[REBOL] Re: Parse introduction tutorial thingy
From: arolls::idatam::com::au at: 8-Nov-2001 16:38
It looks quite good Brett.
I reckon the use of Find-result in the following
code is a bit confusing:
If Find-result: Find/match input "fox" [ Input: find-result ]
I suggest rename 'Find-result to 'position, or 'pos.
If position: Find/match input "fox" [ Input: position ]
Find-result sounds too much like a function,
but I might be nit-picking.
You might want to explain what find/match is doing
at this point.
In defending "ordinary scripting", I just noticed that
you are also setting 'input, which is a built-in value.
(I don't think it's bad, maybe it's better to point it out,
My defence follows:-)
>> input: "dog"
>> parse input ["dog" | "cat" | "bird"]
foreach animal ["dog" "cat" "bird"][
if found? p: find/match input animal [input: p break]
Damn, parse is too powerful for me.
That was interesting though. I wonder if there is
a more concise way (without using parse, that is:).
Let's say you only want to check that you input contains
should be -> "your input contains"
should be -> "let's" short for "lettuce", ah silly me, of course
I mean "tomato"...
Sometime we really couldn't care less what lies
should be -> "Sometimes"
What are message?
should be -> "messages"
Now parse can this directly as a pattern matching instruction
No it can't... :) "can do"?
Overall I think it is a very good document.
It is structured well with clear sections.