Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new function template #90

Closed
wants to merge 2 commits into from
Closed

new function template #90

wants to merge 2 commits into from

Conversation

sartiran
Copy link

@sartiran sartiran commented Oct 7, 2015

Hi,

as it was needed for some grid storage configuration, I wrote a function comparing versions numbers (a simple string comparison does not do the jobs). I guess this may be a function of general interest so it would be nice to have in under some standard path. I'm not sure this (quattor/functions) is the correct location where to put the template, so, please let me know which is the best way to proceed.

Cheers,
a.

@hpcugentbot
Copy link

Automatic reply from Jenkins: Can I test this?

@jrha jrha added this to the 15.10 milestone Oct 7, 2015
@stdweird
Copy link
Member

stdweird commented Oct 7, 2015

test this please

@jrha
Copy link
Member

jrha commented Nov 30, 2015

test this please

@@ -0,0 +1,29 @@
declaration template quattor/functions/strings;

include { 'pan/functions' };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the { }

@jrha
Copy link
Member

jrha commented Nov 30, 2015

This looks good, it could do with some documentation to explain how it "compares" versions.
Add documentation comments as pan annotations.

Also: four space indentation please.

};
};

return(0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can leave out the return() here and just assert 0

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in fact you must leave out the return()... Having an explicit return() is handled internally as an exception adn breaks the parallelism into the compiler... return must be used only when it is required to break the normal execution flow... (in fact there are quite a lot of useless return in the template library coming from the ancient times...)

@jrha
Copy link
Member

jrha commented Dec 7, 2015

No longer required.

@sartiran sartiran deleted the compare_versions branch March 9, 2016 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants