[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Revised straw proposal for heuristic info



   Date: Mon, 13 May 1996 15:38:34 +0000
   From: William D Clinger <will@ccs.neu.edu>

   Two people (one privately) have pointed out an oversight in
   my description of PROCEDURE-ARITY: the integers in a list
   should not be required to be exact.  Here is a correction:

Our discussion of procedure-arity is more contentious than I think it
deserves.  Knowing the arity of a procedure gives no assurance that
the procedure will not signal an error when called.  Let me suggest
that we instead replace it with the more informative:

(procedure-formals _proc_)

  Returns a formal arguments list suitable as formals in a lambda
  expression.  If the result is #F, then no information is available.

  The returned formals list should be compatible with the intended
  invocation of the procedure _proc_; ie. `procedure-formals' of the
  built-in procedure `car' would not be `(real_1 real_2 . real_3)'.
  It is an error to modify a objects returned by `procedure_formals'.

  (procedure-formals car)   ==> (list)

  (procedure-formals write) ==> (object . optional-port)

			       -=-=-=-
Features:

* Procedure-formals (just returning #f) is compatible with R4RS.

* Returning a formals list (instead of numbers) conveys nearly as much
  arity information as the proposed arity functions.

* The variable names in the formals list can succinctly convey
  information about arguments to the procedure; This information need
  not then be replicated in the procedure-documentation.

* The formals list can be used in the construction of trace
  procedures and environment inspectors.

* The formals list together with the procedure-name comprise a large
  part of the customary information in error and warning messages.