On 2019-12-04 01:44, William Michels via perl6-users wrote:
Hi Todd,

Chapter 9 (Associatives) of "Learning Perl 6" by brian d foy has a
section on Maps, "the immutable mapping of zero or more keys to
values". In that section there are subsections entitled 'Checking
Keys', 'Creating from a Positional' and 'Checking Allowed Values.'

HTH, Bill.

On Wed, Dec 4, 2019 at 12:41 AM ToddAndMargo via perl6-users
<perl6-us...@perl.org> wrote:

Hi All,

I am cooking up something where I want top pass a value to a sub, but I
want to restrict what those values are.

For instance, things like

     AbortRetryIgnore
     CancelRetryContinue
     Help
     YesNo
     Maybe

And so on and so forth.

If the wrong value is passed, I want the checker to crash
the sub.

What is the best way of going about this?

Many thanks,
-T

Hi Bill,

I can't have books in my house.  It is along story.

But, based on what you said, I found this;

https://docs.perl6.org/type/Map.html

The docs are really poorly written for beginners, but
it is a good start

Thank you!
-T

Reply via email to