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

[no subject]



cc: GLS at MIT-AI, BUG-LISPM at MIT-MC

    Date: 15 February 1980 05:45-EST
    From: Alan Bawden <ALAN at MIT-MC>

        Date: 14 FEB 1980 0820-EST
        From: GLS at MIT-AI (Guy L. Steele, Jr.)

        In system 25.0, with microcode 612, on LISP Machine Two:
        	(SOME '(a b 1 c) #'numberp #'cddr)
        will claim that (FUNCTION CDDR) has an invalid function definition.
        Bazola!?

    This is because SOME and EVERY are not actually functions, they are special
    forms.  What you wanted to say was: (SOME '(a b 1 c) #'numberp cddr) which
    would expand into:

    	(DO ((SI:*L* '(a b 1 c) (cddr SI:*L*)))
    	    ((NULL SI:*L*) T)
    	  (AND (FUNCALL #'numberp (CAR SI:*L*))
    	       (RETURN SI:*L*)))

    (has its little problems doesn't it!)

    Now the 64k question is: is this what we really want?  I seem to remember
    that these are Interlisp compatibility crocks, is this the way they work in
    Interlisp?  Anybody out there actually know?

All this was my subtle way of pointing out that people still
are not dealing with functional arguments in a consistent way
on the LISP Machine.  If you don't believe in general evaluation
of some kind in the function position (which would make (#'CAR X)
behave correctly, i.e. the same as (CAR X)), then at least people
who write macros and things should take care to use FUNCALL or
something.  It's not exactly clear what INTERLISP does.  However,
SOME and EVERY aren't just crocks; they are useful.  I suggest
adopting them for the LISP Machine, but they should have their
syntax changed to resemble the MAPCAR series, so that multiple-
argument predicates can be used.  For example:

				;points are lists of numbers representing n-vectors
	(DEFUN POINT-WITHIN-HYPERCUBE-P (UPPER-LEFT-FRONT-ETC LOWER-RIGHT-BACK-ETC POINT)
	       (EVERY #'LESSP UPPER-LEFT-FRONT-ETC POINT LOWER-RIGHT-BACK-ETC))