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

[REBOL] Re: parse and datatype

From: brett:codeconscious at: 5-Jul-2001 11:36

Hi Romano, I've been tracking down the problem you refer to. It appears that you have been a victim of a bug in possibly PARSE. This one has been obviously lurking for some time (I've tested it back as far as Core 2.3). It appears your particular experimentation has pushed it out into the open. I'm impressed :) Here's a demonstration. Each of the following should return true:
>> parse [34] reduce [type? 34]
== true
>> parse [34.1] reduce [type? 34.1]
== false
>> parse [34] reduce [type? 34]
== false
>> parse ["a"] reduce [type? "a"]
== true
>> parse [34] reduce [type? 34]
== true
>> parse [34.1] reduce [type? 34.1]
== false
>> parse [34] reduce [type? 34]
== false As you can see it looks like some state travels between one invocation of parse and the next causing very unpredictable problems. Now these should have looked like the following:
>> parse [34] reduce [integer!]
== true
>> parse [34.1] reduce [decimal!]
== true
>> parse [34] reduce [integer!]
== true
>> parse ["a"] reduce [string!]
== true
>> parse [34] reduce [integer!]
== true
>> parse [34.1] reduce [decimal!]
== true
>> parse [34] reduce [integer!]
== true So there is also some strange interaction between "type? x" and parse... I've sent this information to feedback so that Rebol Technologies can fix it. Regards, Brett.