Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Explain please

 [1/9] from: reffy:ulrich at: 17-Aug-2002 13:44


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 Dick

 [2/9] from: gscottjones:mchsi at: 17-Aug-2002 14:06


From: Dick
> >> .a:10 > == .a:10
<<quoted lines omitted: 4>>
> no error occurred on the "assignment" > yet there is no value for .a
Hi, Dick, Missing a space between the ':' and the integer.
>> .a: 10
== 10
>> .a
== 10 As far as why there was no error, near as I can figure, the interpreter parser thought it looked close enough to a url:
>> type? .a:10
== url! --Scott Jones

 [3/9] from: info:id-net:ch at: 17-Aug-2002 21:07


It's maybe because when you thought it was an assignment, it was actually not. You has to insert a space between the ":" and the value.
>> .a: 20
== 20

 [4/9] from: tim::johnsons-web::com at: 17-Aug-2002 11:24


* [reffy--ulrich--net] <[reffy--ulrich--net]> [020817 11:04]:
> Hi List, > >> .a:10
<<quoted lines omitted: 5>>
> no error occurred on the "assignment" > yet there is no value for .a
Hi there! There was no assignment. You just created an unset 'word. (.a:10). You need some whitespace
>> a.: 10 ; note the space between the colon and the literal number 10
== 10
>> a.
== 10 ; the little gotcha gave me fits when I was trying to learn ; rebol and unlearn "C" HTH -tj-
> Dick > > Download NeoPlanet at http://www.neoplanet.com > > -- > To unsubscribe from this list, please send an email to > [rebol-request--rebol--com] with "unsubscribe" in the > subject, without the quotes.
-- Tim Johnson <[tim--johnsons-web--com]> http://www.alaska-internet-solutions.com http://www.johnsons-web.com

 [5/9] 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
<<quoted lines omitted: 5>>
> 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 ]

 [6/9] from: g:santilli:tiscalinet:it at: 17-Aug-2002 21:39


Hi reffy, On Saturday, August 17, 2002, 11:44:50 PM, you wrote: run> no error occurred on the "assignment" run> yet there is no value for .a Almost everyone of us has fallen into this at least once, when learning REBOL. (You'll find the same question asked on the ml archive too, probably.) I think that this simple line will be enough to shed some light on what is happening.
>> type? .a:10
== url! Adding some white space will help:
>> .a: 10
== 10
>> .a
== 10 HTH, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r

 [7/9] from: g:santilli:tiscalinet:it at: 18-Aug-2002 11:46


Hi Joel, On Saturday, August 17, 2002, 9:15:48 PM, you wrote: JN> What's even more interesting is the following: JN> >> type? garbage:"trash" JN> == string! It probably looks like a bug, but actually is just that REBOL does not (currently) require white space before ", {, [ and (. (I could be forgetting other cases.)
>> a:"String"
== "String"
>> a
== "String"
>> a:[block]
== [block]
>> a
== [block]
>> print"string"
string
>> print[a]
block Regards, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r

 [8/9] from: joel:neely:fedex at: 18-Aug-2002 7:29


Hi, Gabriele, Gabriele Santilli wrote:
> Hi Joel, > On Saturday, August 17, 2002, 9:15:48 PM, you wrote:
<<quoted lines omitted: 4>>
> not (currently) require white space before ", {, [ and (. (I could > be forgetting other cases.)
Right! I realized that this morning after having enough coffee, but I'm glad you caught my goof! I actually used that fact in a "code obfuscator" I fiddled with a while back. So much time, so little syntax... ;-) -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 ]

 [9/9] from: al:bri:xtra at: 19-Aug-2002 16:47


Gabriele wrote:
> It probably looks like a bug, but actually is just that REBOL does not
(currently) require white space before ", {, [ and (. (I could be forgetting other cases.) You're right in that respect (I had forgotten about that), but I feel that a set-word should require at least one whitespace after the colon. Otherwise there's this problem:
>> x:"Hello!"
== "Hello!" Works OK with string! values, now try a integer! value:
>> x:123
== x:123
>> x
== "Hello!" Hmmmm...
>> type? x:123
== url!
>> type? x:"Hello!"
== string! Andrew Martin ICQ: 26227169 http://valley.150m.com/

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted