[REBOL] R: Re: R: Re: This is a strange thing
From: rotenca:telvia:it at: 4-Jul-2001 14:52
Hello,
can some (gentle) man explain me this behaviour?
The script which follow can be copied and executed to see the problem.
Given a block, it generates rules for parsing block like this:
[set string!]
It fails with decimal! (and something else), not with decimal!, word!,
string!...
Where is my error?
Another thing: why doesn't exist the function:
to-datatype
ciao (excuse my bad english)
romano paolo tenca
---------------------
REBOL[]
inb: [34]
rules: copy []
bn: 0
foreach tok inb [
mytype: type? tok
bn: bn + 1
append rules 'set
append rules to-word join form mytype bn
append rules mytype
]
print ["*** Block is:^/" mold inb]
print ["*** Rules are:^/" mold rules]
print ["*** Rules application give:^/" parse inb rules]
print "^/^/Now with decimal..."
inb: [34.1]
rules: copy []
bn: 0
foreach tok inb [
mytype: type? tok
bn: bn + 1
append rules 'set
append rules to-word join form mytype bn
append rules mytype
]
print ["*** Block is:^/" mold inb]
print ["*** Rules are:^/" mold rules]
print ["*** Rules application give:^/" parse inb rules]
halt