[REBOL] Re: Explain please
From: joel:neely:fedex at: 17-Aug-2002 14:15
Hi, Dick,
You've managed to fake out the REBOL lexical scanner!!!
[reffy--ulrich--net] wrote:
> Hi List,
>
> >> .a:10
> == .a:10
> >> .a
> ** Script Error: .a has no value
> ** Where: halt-view
> ** Near: .a
>
> no error occurred on the "assignment"
> yet there is no value for .a
>
I knew right off that there was no "assignment" becuase you
didn't write a set-word followed by a value (there's no space
after the colon, therefore there's no set-word value), and
because the result of SET-WORD: EXPRESSION is the value of
the expression, not an echo of the entire line. I assume you
had meant to write
.a: 10
instead, but still wondered why there was no complaint. So I
asked REBOL what was going on...
>> type? .a:10
== url!
Apparently the scheme component of a potential URL! value
doesn't have to be valid (or at least known to the system) for
the lexical scanner to distinguish between real urls and bogus
input...
>> type? garbage:goes-here
== url!
What's even more interesting is the following:
>> type? garbage:"trash"
== string!
>> foo: garbage:"trash"
== "trash"
>> foo
== "trash"
Does anybody besides me think that this should be reported as
a bug?
-jn-
--
; Joel Neely joeldotneelyatfedexdotcom
REBOL [] do [ do func [s] [ foreach [a b] s [prin b] ] sort/skip
do function [s] [t] [ t: "" foreach [a b] s [repend t [b a]] t ] {
| e s m!zauafBpcvekexEohthjJakwLrngohOqrlryRnsctdtiub} 2 ]