Sean O'Dell wrote:

>
> How is Abort different from Exit?  Exit already has an optional parameter,
> why not make another optional parameter for Exit that accepts a message
> string rather than adding a parameter to a function which currently takes no
> parameter, and in my opinion isn't supposed to?
>
> Abort, Exit with status or Raise an exception.
>
> Exit [Number | String] seems more consistent to me than Exit [Number] and
> Abort [String].

"abort" is exactly equivalent to "exit(1)", as far as I can tell. An optional
message argument for exit would be fine, too.

I chose abort simply because

  - "abort" is already a Ruby function.
  - Use of "abort" signals that the intent is an error termination.
  - Error terminations often would have an accompanying error message.


BEGIN RAMBLE

What about this:

abort => no message, exit value 1
abort("hello") => prints message, exit value 1
abort(22, "hello") => prints message, exit value 22

exit => no message exit value 0
exit("hello") => prints message, exit value 1 (since printing of a message
probably means there was an error)
exit(22, "hello") => prints message, exit value 22

In the above, exit and abort are the same except for the exit value when no
parameters.

This is just a brainstorming exercise -- I'm not sure I actually like it --
pretty baroque, but then again, pretty intuitive

Python's solution (to this problem, at least) is elegant and simple

exit() => no message, exit value 0
exit(22) => no message, exit value 22
exit("message") => print message,  exit value 1

END RAMBLE


Bob