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

Re: Error Signalling

    Date: Sun, 29 Jun 86 18:18:21 PDT
    From: franz!fizzy!jkf@kim.Berkeley.EDU

    >> It's *probably* not a portability problem that (safety 1) means something
    >> different in different implementations.  PCLS uses the speed settings to
    >> switch various kinds of optimizations, but we didn't have much intuition
    >> about what the difference between (speed 2) and (speed 3) should be
    >> ...

    We also didn't know what should be done for the various settings of
    speed, size and safety so we put the decision back in the users'
    Our compiler can perform a number of optimizations, some of the
    optimizations involve removing safety checks and for these we felt
    that the user should be aware of what they are and should have control
    over when they are done.
    Therefore each optimization is controlled by a function of safety,
    size and speed.  The user is free to redefine the functions if he
    doesn't like the default function.  Here is an example of the function
    which controls one of the optimizations discussed recently: that of 
    not checking the number of arguments passed to the function:

    (defvar verify-argument-count-switch
       #'(lambda (safety size speed)
	    (declare (ignore size))
	    (or (< speed 3)
		(> safety 0)))
      "bound to a function which given safety, size and speed returns t
       if the compiler should generate code to verify that the correct number
       of arguments were passed to a function.  
       Note: an argument count check is always done if there are optional
       or rest arguments.")

Nit: that isn't in the LISP: or USER: package, I hope, but SYS: or some
other private package.

    -john foderaro
     Franz Inc.