Return-Path: <tvashwin@cs.bu.edu> Received: from csa.bu.edu (csa [128.197.12.3]) by cs3.bu.edu (8.12.11/8.12.11) with ESMTP id i8NIBmHN001533 for <kfoury@cs.bu.edu>; Thu, 23 Sep 2004 14:11:48 -0400 Received: from localhost (tvashwin@localhost) by csa.bu.edu (8.10.1/8.10.1) with ESMTP id i8NIBmv15932 for <kfoury@cs.bu.edu>; Thu, 23 Sep 2004 14:11:48 -0400 (EDT) X-Authentication-Warning: csa.bu.edu: tvashwin owned process doing -bs Date: Thu, 23 Sep 2004 14:11:48 -0400 (EDT) From: ashwin thangali <tvashwin@cs.bu.edu> X-Sender: tvashwin@csa.bu.edu To: "Assaf J. Kfoury" <kfoury@cs.bu.edu> Subject: Re: question regarding head and tail of empty list In-Reply-To: <41530D6F.6BC0033D@cs.bu.edu> Message-ID: <Pine.SOL.4.20.0409231409390.13319-100000@csa.bu.edu> Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-HitLevel: X-Spam-DCC: meer: cs3.bu.edu 1086; Body=1 Fuz1=1 Fuz2=1 X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on cs3.bu.edu X-Spam-Level: X-Spam-Status: No, hits=0.0 required=10.0 tests=none autolearn=ham version=2.64 X-Spam-Pyzor: Reported 0 times. Status: X-Mozilla-Status: 8013 X-Mozilla-Status2: 00000000 X-UIDL: 411f69ec00000b74
my question was with respect to exercise 5.2.8 which asks for an
implementation of head and tail in lamda calculus. so it ok if we dont
handle empty lists?
Ashwin V. Thangali
111 Cummington Street,MCS 263,
Computer Science Dept,
Boston University,
Boston, MA 02215
Office: 617 358 1139
Home: 617 734 6209
Homepage: http://cs-people.bu.edu/tvashwin
On Thu, 23 Sep 2004, Assaf J. Kfoury wrote:
> Here is a list of 6 integers in the style of programming
> language Scheme:
>
> (4 5 1 2 30 40)
>
> Call it L. Then head(L) = 4 which is an integer, and
> tail(L) = (5 1 2 30 40) which is a list of integers.
>
> A special case is the empty list ( ). Call it nil. It is a
> design decision what to do with head(nil) and tail(nil).
> The most common is to make head(nil) and tail(nil)
> cause a run-time error.
>
> I hope this helps.
>
> Assaf
>
> ashwin thangali wrote:
>
> > asaf,
> >
> > is the result of head (or tail) of a list an element or a list? if its
> > an element, what does head or tail return for an empty list?
> >
> > ashwin
> >
> > Ashwin V. Thangali
> > 111 Cummington Street,MCS 263,
> > Computer Science Dept,
> > Boston University,
> > Boston, MA 02215
> > Office: 617 358 1139
> > Home: 617 734 6209
> > Homepage: http://cs-people.bu.edu/tvashwin
>
This archive was generated by hypermail 2b29 : Fri Nov 19 2004 - 17:00:43 EST