[comp.lang.scheme] Keywords do not apply

Alan@lcs.mit.EDU (Alan Bawden) (05/02/91)

   Date: Tue, 30 Apr 91 12:36 GMT
   From: STCS8004%IRUCCVAX.UCC.IE@mitvma.mit.edu
   ...
   However if one uses the eta-conversion (lambda (x y) (f x y)) = f then
   'apply' works as expected:

	(apply (lambda (x y) (and x y)) '(#f #t)) --> #f.
   ...

If you use eta-conversion to argue that 

  (LAMBDA (X Y) (AND X Y))

should be equivalent to just

  AND

then nothing stops me from using eta-conversion to argue that

  (LAMBDA (X Y) (LAMBDA X Y))

should be equivalent to just 

  LAMBDA

STCS8004%IRUCCVAX.UCC.IE@mitvma.mit.EDU (05/02/91)

In reply to:

>  "Alan@lcs.mit.EDU"  "Alan Bawden"  2-MAY-1991 02:00:47.52
>   ...

> If you use eta-conversion to argue that

>  (LAMBDA (X Y) (AND X Y))

> should be equivalent to just

>  AND

> then nothing stops me from using eta-conversion to argue that

>  (LAMBDA (X Y) (LAMBDA X Y))

> should be equivalent to just

>  LAMBDA

Oh, yes there is!  Eta-conversion is valid ONLY for FUNCTIONS!  Thus
whilst (in lambda calculus) it is valid to have

    (lambda (x) (sqrt x)) =  sqrt

it is NOT valid to claim

    (lambda (x) (3 x))  = 3.

If  you want  to argue  that AND  is not  a function,  then I  disagree.

G. Oulsnam                                 stcs8004@iruccvax.ucc.hea.ie

barmar@think.com (Barry Margolin) (05/03/91)

In article <9105021642.aa12771@mc.lcs.mit.edu> STCS8004%IRUCCVAX.UCC.IE@mitvma.mit.EDU writes:
>If  you want  to argue  that AND  is not  a function,  then I  disagree.

According to R3RS, AND is a syntactic keyword, not a variable naming a
procedure (i.e. function).
--
Barry Margolin, Thinking Machines Corp.

barmar@think.com
{uunet,harvard}!think!barmar

alan@ai.mit.edu (Alan Bawden) (05/03/91)

In article <9105021642.aa12771@mc.lcs.mit.edu>
STCS8004%IRUCCVAX.UCC.IE@mitvma.mit.EDU writes:

   If  you want  to argue  that AND  is not  a function,  then I  disagree.

Well, as the language is currently defined, AND is -not- a function.  It is
a keyword just like LAMBDA (hence my example).  You really can't disagree
with that, it's just a fact.  You -can- argue that AND was not a good name
for that keyword.  You -can- argue that the Boolean function that computes
the conjunction of its arguments should be provided as a primitive.

tmb@ai.mit.edu (Thomas M. Breuel) (05/04/91)

      If  you want  to argue  that AND  is not  a function,  then I  disagree.

   Well, as the language is currently defined, AND is -not- a function.  It is
   a keyword just like LAMBDA (hence my example).  You really can't disagree
   with that, it's just a fact.  You -can- argue that AND was not a good name
   for that keyword.  You -can- argue that the Boolean function that computes
   the conjunction of its arguments should be provided as a primitive.

Other functional languages call these keywords ANDALSO and ORELSE.
It might be worth considering changing the names of the AND and OR
keywords in Scheme as well to eliminate this constant source of
confusion and arguments.