rebol's code evaluation... [was: MySQL protocol bug]
[1/3] from: maximo::meteorstudios::com at: 19-Feb-2004 14:41
> -----Original Message-----
> From: Hallvard Ystad [mailto:[hallvard--ystad--oops-as--no]]
<<quoted lines omitted: 9>>
> Correction: the string is not ignored. It is evaluated (to
> itself!). Isn't it so?
yess... I had written it that way first (in my own words) then decided it would be a
little confusing for beginners. but your words make it so clear!
Thanks for bringing that to light.
The way I see it is that any value which does not evaluate into an action simply returns
a clean version if itself. It is possible that some values get reduced or "corrected"
as part of their evaluation, but I do not know how to call this behavior.
example:
>> 2001-3-4
== 4-Mar-2001
Both are valid and equivalent dates, but the evaluated one is what will be molded and
is the expected format.
This is another feature of rebol I like. Because the interpreter expects to evaluate
items as it encouters them, it can loosen up syntax of many things.
-MAx
[2/3] from: hallvard:ystad:oops-as:no at: 19-Feb-2004 22:29
Dixit Maxim Olivier-Adlhoch (20.41 19.02.2004):
>The way I see it is that any value which does not evaluate into an action simply returns
a clean version if itself. It is possible that some values get reduced or "corrected"
as part of their evaluation, but I do not know how to call this behavior.
>
>example:
>>> 2001-3-4
>== 4-Mar-2001
Same behaviour e.g. for URLs:
>> http://www.uio.no/f/%26tr/y
== http://www.uio.no/f/&tr/y
I think RT calls this "passing the value through the parser". But your words, (reduction,
correction) are as good, I suppose. Don't know about any "official", "correct" way to
call this. Or maybe someone at RT reads this and can tell us?
HY
[3/3] from: rotenca:telvia:it at: 19-Feb-2004 23:25
Hi, all
> >The way I see it is that any value which does not evaluate into an action
simply returns a clean version if itself. It is possible that some values get
reduced or "corrected" as part of their evaluation, but I do not know how to
call this behavior.
> >
> >example:
> >>> 2001-3-4
> >== 4-Mar-2001
the fact is that the Rebol loader "understands" many date formats, so you can
pass to the loader the equivalent strings:
2001-3-4
2001-Mar-4
2001/Mar/4
and many others, the loader transform this strings in the (undocumented)
internal representation of a Rebol date datatype.
But when you mold it, like implicitly happens in your console example, Rebol
must select one serialized format among the others, and the format selected is
always:
dd-mmm-yyyy
I should like to select diffrent serialized formats for many Rebol values,
like already happens for binary.
x: #{0A}
system/options/binary-base; == 16
x ;== #{0A}
system/options/binary-base: 2
x ; == 2#{00001010}
system/options/binary-base: 64
x ; == 64#{Cg==}
For example i should like to do:
system/options/decimals: "00,00"
and then
>> 1.0
01,00
the same for dates, time, and so on.
---
Ciao
Romano
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted