Opened 6 years ago

Closed 4 years ago

#167 closed defect (wontfix)

Add constructor for error objects

Reported by: cowan Owned by: alexshinn
Priority: major Milestone:
Component: WG1 - Core Keywords:
Cc:

Description

(Email from Vincent Manis)

Problem: Raising arbitrary objects as exceptions has been found to be nasty in some other languages (Python and C++ in particular).

This one is a tad speculative, but I'm reluctant to encourage people to write things like (raise 4), because of course it doesn't respect any module boundaries. I think the intent with the descriptions of raise and raise-continuable was to allow exception hierarchies to be added in WG2 without constraining them here. I would suggest adding a new procedure:

(make-error-object message obj ...)

to creates the implementation-defined object error is supposed to create, and adding a sentence to the raise and raise-continuable entries that says "The effect of applying this procedure to an object not created via make-error-object is implementation-defined." This allows WG2 to do what it wants regarding exception objects, and to limit the types of exception objects allowed, without breaking anything in WG1. Error can be defined as:

 (define (error message . objs)
   (apply make-error-object message objs))

Change History (3)

comment:1 Changed 6 years ago by alexshinn

  • Resolution set to fixed
  • Status changed from new to closed

We voted no.

comment:2 Changed 4 years ago by cowan

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:3 Changed 4 years ago by cowan

  • Resolution set to wontfix
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.