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

[REBOL] Re: REBOL/View 1.3 - invalid word datatype

From: rebol-list2:seznam:cz at: 16-Dec-2003 18:14

Hello Carl, Tuesday, December 16, 2003, 8:45:56 AM, you wrote: CR> On 16-Dec-03, rebOldes wrote:
>> Hello Carl, >> As you are preparing new build of Rebol, I would like to ask you, If >> it would be possible to change somehow handling of "invalid >> datatypes" >> As I'm working on a probably the largest known dialect using Rebol - >> the Rebol/Flash dialect ( ), I >> still feel very limited because of impossibility to use some words. >> For example I would like to have in my dialect code words like this >> one: >>>> objects/1._x >> ** Syntax Error: Invalid decimal -- 1._x >> ** Near: (line 1) objects/1._x >> As you can see, it's recognized as an invalid decimal. So here comes >> the question. Would it be possible to change this behavior to >> something which we could use? There were already some discussions on >> mailing list about this issue months ago, but I still don't know >> your opinion. >> I think the best way would be to handle these 'invalid' words as a >> special word which would not be able to hold some values but I would >> be able to parse this word as a normal string. >> If it will be a problem maybe it would help to use some refinement >> in the 'load function not to throw these "invalid datatype" errors >> and convert these "invalid datatypes". >> If you would make this change, I would be able to make for example >> functions as are known in other languages for example: >> myFunc(a, 2, a + b) >> because loading such a dialect would not throw error like: >>>> load [myFunc(a, 2, a + b)] >> ** Syntax Error: Invalid word -- a, >> ** Near: (line 1) load [myFunc(a, 2, a + b)]
CR> The problem would be that real errors wouldn't be caught. Maybe we CR> need a special type of block that would allow this? (Which would CR> require a new datatype - well, two new datatypes - the special block CR> and an unknown! datatype.) CR> Which is non-trivial I suspect. unknown! is a good name. For me it would be enough if such a datatype would be recognized during 'load function - so it seems not to be such a problem to me. Now we have a name as well:) CR> For your Flash dialect Oldes, have you thought about a two-pass CR> approach? The first pass would parse the file as a string, CR> converting your myFunc(a, 2, a + b)s and so on to strings (or what CR> datatypes or group of datatypes best suit them), with the second pass CR> performing the main parse. It's not a solution for something like objects/:i._x which I would like to parse as _x possition of object i from array of objects. Something what's not possible even in Rebol, but something, what could be parsed in dialect easily if I would be able to load such a code. Now I need to write: tmp: objects/:i tmp._x CR> -- CR> Carl Read -- Best regards, rebOldes -----------------[ ]