From: Bob Alexander Date: 2002-03-22T00:53:54+09:00 Subject: Thought on "abort with message" RCR This is a multi-part message in MIME format. ------=_NextPart_000_0130_01C1D0AD.DC0ACEE0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable The RCR: http://www.rubygarden.org/article.php?sid=3D193. There is an implementation suggestion in the comments for this RCR, but = I'd like to repeat it here to make sure it is considered should the RCR = become reality. It seems that the proper implementation would be that an optional = message argument for abort should NOT be printed by the abort method. = Rather, it should be the "message" of the SystemExit exception that = abort raises. The default handler for SystemExit should be modified to = print the exception's message (if any) to $stderr before exiting. This would give programs the ability to "rescue" SystemExits and do = something different with the message if desired. Naturally, the same = would go for "exit" if it also should get an optional message parameter. BTW, while looking into this, I noticed that the exit status is in the = SystemExit object as a non-exposed instance variable -- seems that it = would be better if it were a public "reader" method(?) Bob ------=_NextPart_000_0130_01C1D0AD.DC0ACEE0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
The RCR: http://www.rubyg= arden.org/article.php?sid=3D193.
 
There is an implementation = suggestion in the=20 comments for this RCR, but I'd like to repeat it here to make sure it is = considered should the RCR become reality.
 
It seems that the proper implementation = would be=20 that an optional message argument for abort should NOT be printed = by the=20 abort method. Rather, it should be the "message" of the SystemExit=20 exception that abort raises. The default handler for SystemExit should = be=20 modified to print the exception's message (if any) to $stderr before=20 exiting.
 
This would give programs the ability to = "rescue"=20 SystemExits and do something different with the message if desired. = Naturally,=20 the same would go for "exit" if it also should get an optional message=20 parameter.
 
BTW, while looking into this, I noticed = that the=20 exit status is in the SystemExit object as a non-exposed instance = variable --=20 seems that it would be better if it were a public "reader"=20 method(?)
 
 
Bob
 
 
------=_NextPart_000_0130_01C1D0AD.DC0ACEE0--