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

Re: small Q



Boris Schaefer <boris@uncommon-sense.net> writes:

> Bruce Hoult <bruce@hoult.org> writes:
> 
> | The debate over what is essential and what is mere convenience is 
> | impossible to decide.  When it comes down to it, you don't *need* 
> | anything more than raw lambda and applicative order evaluation.  You 
> | don't *need* objects, you don't *need* numbers, you don't even *need* 
> | "if".
> 
> How do you branch without "if"?
> In case you mean that you don't need "if" as a special form, I agree.

It can be done using lambda.  I'm not going to explain this, but
suffice to say that the lambda calculus uses a combinator
  K = (lambda (x y) x)
which will work perfectly well for an `if'.

To confuse you further, both #t and #f are also combinators:
  T = (lambda (x y) x)
  F = (lambda (x y) y)
but you shouldn't focus on this very closely until you understand more
about lambda calculus.

If you're suddenly curious about this peculiar branch of mathematics,
or want to learn how to read the semantics in the back of the R5RS, or
want to learn how to write better Scheme programs, I recommend the
books below.

This is an excellent introduction from the perspective of a computer
scientist or other similar person with only rudimentary training in
formal logic, ie someone who hasn't read the Principia Mathematica
from cover to cover.

@Book{hankin:94,
  author =       {Chris Hankin},
  title =        {Lambda Calculi: A guide for Computer Scientists},
  publisher =    {Oxford University Press},
  year =         {1994},
  volume =       {3},
  series =       {Graduate Texts In Computer Science},
  note =         {paperback: ISBN 0-19-853840-40, hardback: ISBN 0-19-853841},
}

This could conceivably be used as an introduction but that would be
insane.  This is *the* reference book on lambda calculus, and with the
advent of the paperback edition everyone who has anything to do with
the subject can now afford a personal copy.

@Book{barendregt:84,
  author =       {Hendrik Pieter Barendregt},
  title =        {The Lambda Calculus: Its Syntax and Semantics},
  publisher =    {Elsevier Science B.V.},
  year =         {1984},
  volume =       {103},
  series =       {Studies in logic and the foundation of mathematics},
  edition =      {Revised},
  note =         {paperback: ISBN 0-444-86748-5, hardback: ISBN 0-444-87508-5},
}

HTH
'james



References: