develooper Front page | perl.perl6.users | Postings from March 2019

valid values?

Thread Next
ToddAndMargo via perl6-users
March 3, 2019 10:09
valid values?
Message ID:
Hi All,

I want to pass an integer to a sub.  The only
valid values of the integer are 1, 2, 4, 8, and 16.

Other than using "if" to test their values, is
there a way to state that an integer can only
have certain predefined values?

Many thanks,

Having been erased,
The document you're seeking
Must now be retyped.

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About