This sounds like a job for Design by Contract. :)

As far as I know the only thing you can do in rebol is check for those
inputs and throw an error if the argument doesn't match one of them.

Keith

P.S. I wonder if Carl's ever looked at Eiffel and such for ideas for Rebol.
I know he's dealt with a lot of languages, but I'm interested to find out if
he's ever had any dealings with Eiffel and Design by Contract stuff...
Sather has it also, although I haven't looked at it too much at all.

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, September 05, 2000 10:39 AM
Subject: [REBOL] Enumerated type creation


> I want to constrain the input values for a string field to be either the
words "cancel" or "nocancel".
>
> REBOL has excellent support for forcing a function argument to be date!,
time!, string!, but I want to increase the restrictions for a particular
field and have it throw an error on spurious input.
>
> Must I homebrew something or did I overlook the built-in support for this?
>
> ---
>
> ; run this in your
> ; <a href=http://www.rebol.com>REBOL</a> Interpreter!
> terrence-brannon: [ [EMAIL PROTECTED] perl-refugee myth-gamer ]
> perl-refugee: [ 'loved href perl discovery: (metaperl = rebol) 'hates href
perl ]
> myth-gamer: http://www.bungie.net/bin/stats.pl?player=princepawn
>
> ; angles makes this a href instead of code! use ur imagination!
> href: func [U T] [ rejoin [ "a href=" U ">" T "/a" ] ]
> perl: href http://www.perl.com "Perl"
>
>
>
> Get your FREE Email and Voicemail at Lycos Communications at
> http://comm.lycos.com

Reply via email to