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

[REBOL] Re: A hard question

From: g:santilli:tiscalinet:it at: 4-Feb-2001 14:01

Hello Ladislav! On 04-Feb-01, you wrote: LM> Due to the "second class nature" of Rebol errors, HARD cannot LM> pass both tests IMO. (You can have a look at: LM> http://www.sweb.cz/LMecir/rep.html)
>> arg1: func [[throw] x] [return x] >> arg2: [1]
== [1]
>> test2: does [hard :arg1 arg2 2] >> hard: func [[throw] x y] [return x first y] >> test2
== 1
>> arg2: ["some error"]
== ["some error"]
>> arg1: func [x] [return make error! x] >> print mold disarm hard :arg1 arg2
** Throw Error: Return or exit not in function. ** Where: return x first y
>> test3: does [print mold disarm hard :arg1 arg2] >> test3
** User Error: some error. ** Where: return make error! x
>> test4: does [hard :arg1 arg2] >> print mold disarm test4
make object! [ code: 800 type: 'user id: 'message arg1: "some error" arg2: none arg3: none near: [return make error! x] where: none ] If you want it to [throw], it will always [throw], so you need to wrap it inside another function when you don't what it too. Let me know what you think... Regards, Gabriele. -- Gabriele Santilli <[giesse--writeme--com]> - Amigan - REBOL programmer Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/