Howdy, Joachim:
Letsee... if I understand correctly, here's a quick and
dirty approach that does something like that:
rules: [
'foo (do-foo) |
'add set new-word word! set action block! (
append rules reduce [
'| to-lit-word new-word to-paren action
]
)
]
forever [parse compose [(load ask "?? ")] [some rules]]
comment [ ;-- For example:
?? zamo
?? add zamo [print "ZAMO!!"]
?? zamo
ZAMO!!
?? add goof [print "GOOOOFFFF!!!"]
?? goof
GOOOOFFFF!!!
?? add quit [quit]
?? quit
]
;- jeff
> I've been experimenting with rules in the last days and
> encountered this
> problem, without findin a satisfactory solution:
>
>
> 1] I've a block of words to load when the script is
> launched
>
> 2] I'll get some input from the user (ASK)
>
> 3] One first rule should check if the user typed one of the
> words
> (so I can execute an appropriate function/command) and
> eventually parsing for following data
>
> 4] Another rule should test if I typed 'ADD <newword>',
> where 'ADD is a literal
> word and <newword> should be added to the block of words
> parsed in the rules
>
> 5] exit saving updated block
>
>
>
> Anyone has a clue doing this in a clean&simple way?
--
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the
subject, without the quotes.