update rules (?)
[1/3] from: jthomas:apollo:evo:it at: 3-Nov-2000 16:40
Hello [jeff--rebol--net]
On 02-Nov-00, [jeff--rebol--net] wrote:
>j
>j
<<quoted lines omitted: 3>>
>j dirty approach that does something like that:
>j
... my goal was something like the following:
(your help has been VERY useful, thanx :D )
Regards
--
Joachim Thomas - [jthomas--mail--evo--it] - ICQ 18088459
Amiga1260+Amiga4060PPC604
Member of ATO (italian Division) http://bilbo.di.unipi.it/~ato-it & Phoenix Consortium
Concerti - Gruppi Musicali & Locali http://concertitalia.supereva.it
Virtual PHOTO Gallery http://www.terzomercato.com/free/jt_home
Retarded: "When i grow up I'll work for MicroSoft..."
-- Lorens Johansson
-- Attached file included as plaintext by Listar --
-- File: TOJEFF.R
REBOL [
title: "to Jeff"
]
wordlist: ['gosh 'gulp 'sigh]
endprg: false
rules: [
'halt (endprg: true) |
set wordsel wordlist (print ["word selected!" wordsel]) |
'add set new-word word! (
append wordlist reduce [
'| to-lit-word new-word
]
probe wordlist
)
]
while [endprg = false] [
parse compose [(load ask "?? ")] [some rules]
]
[2/3] from: jeff:rebol at: 2-Nov-2000 11:53
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
[3/3] from: jthomas::apollo::evo::it at: 2-Nov-2000 21:02
Hello,
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?
--
Joachim Thomas - [jthomas--mail--evo--it] - ICQ 18088459
Amiga1260+Amiga4060PPC604
Member of ATO (italian Division) http://bilbo.di.unipi.it/~ato-it & Phoenix Consortium
Concerti - Gruppi Musicali & Locali http://concertitalia.supereva.it
Virtual PHOTO Gallery http://www.terzomercato.com/free/jt_home
Error in operator: add beer
-- Terrance Richard Boyes
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted