REBOL3 tracker
  0.9.12 beta
Ticket #0000889 User: anonymous

Project:



rss
TypeWish Statustested Date5-Jun-2009 14:20
Versionalpha 55 Categoryn/a Submitted bymeijeru
PlatformAll Severityminor Prioritynormal

Summary conversion of error value to object still useful
Description disarm was deprecated in alpha 55, and with reason because the new approach to errors makes its original (REBOL 2) purpose superfluous

however, the ability to convert an error value to the equivalent object value was useful; it is true that this conversion can be achieved by finding the binding (e.g. obj: bind? in err 'id) but since the opposite is allowed (to-error obj) why not allow its counterpart also (to-object err)

the same reasoning can be held for ports, by the way
Example code
to object! make error! "example"

Assigned ton/a Fixed inalpha 64 Last Update29-Jun-2009 17:17


Comments
(0001101)
Carl
29-Jun-2009 03:38

This will be a bit problematic. Errors aren't really objects (they are more like wrappers around objects, but also include a minimal form that has no object.)

It may be possible to extract an object from an error (as you've shown in the bind example), but there are a few cases where no such object exists.
(0001104)
Carl
29-Jun-2009 04:31

Here's how it now works:

>> to object! make error! "example"
== make object! [
code: 800
type: 'User
id: 'message
arg1: "example"
arg2: none
arg3: none
near: none
where: none
]

>> to object! throw 1
** Script error: invalid argument: make error! 2

Date User Field Action Change
29-Jun-2009 17:17 BrianH Status Modified built => tested
29-Jun-2009 04:31 carl Fixedin Modified => alpha 64
29-Jun-2009 04:31 carl Status Modified reviewed => built
29-Jun-2009 04:31 carl Comment : 0001104 Added -
29-Jun-2009 03:38 carl Comment : 0001101 Added -
29-Jun-2009 03:24 carl Code Modified -
5-Jun-2009 15:10 BrianH Status Modified submitted => reviewed
5-Jun-2009 15:10 BrianH Description Modified -
5-Jun-2009 14:20 meijeru Ticket Added -