I would think that the following Rebol 3 code:
x: [newline 1 2]
y: [
1 2]
print x
print new-line? x
print y
print new-line? y
should output:
<empty line>
1 2
true
<empty line>
1 2
true
but what is output is:
<empty line>
1 2
false
1 2
true
Both blocks, when reduced, should yield a newline character followed by '1' and '2' and so, IMO, should print identically. Less clear is whether new-line? on the two blocks should also give the same result since the newline keyword should be equivalent to the literal newline for this kind of test.
The flag which is checked by new-line?
and set by new-line
is used only by LOAD and MOLD. For all other semantic purposes in the program, it might as well not be there.
Therefore your x
and y
are completely different. Note that:
x: [newline 1 2]
y: [
1 2]
3 = length? x
2 = length? y
It's a quirk of Rebol that it singles out this one bit of whitespace information to stow in a hidden place. But arguably the choice to break a line represents something that is often significant in source, that if you reflect it back out into text you'd like to preserve more than the rest of the whitespace.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With