From: teleny
Subject: Teaching self....question?
Date: 
Message-ID: <3754C02B.CD4B5905@connix.com>
I am learning LISP through several books. One of them is "Metamagical
Themas" by Douglas Hofstaeder (OK, it's just a pop intro, but you gotta
start somewhere.)
In his introduction to defining functions he gives me

(def rac (lambda (lyst) (car (reverse lyst))))

which gives me:

error: unbound function - def
if continued: try evaluating symbol again

if I try :

(defun rac (lambda (lyst) (car (reverse lyst))))

from another book,  I get:

error: bad formal argument list.

What am I doing wrong????
 Teleny, friend of cats.

From: Arthur Lemmens
Subject: Re: Teaching self....question?
Date: 
Message-ID: <3754DEAC.45A70B3@simplex.nl>
> In his introduction to defining functions he gives me
> 
> (def rac (lambda (lyst) (car (reverse lyst))))
> which gives me:
> 
> error: unbound function - def

In Common Lisp, you would write this as:
(defun rac (lyst) (car (reverse lyst)))

In Scheme you could use:
(define rac (lambda (lyst) (car (reverse lyst))))
or:
(define (rac lyst) (car (reverse lyst)))

Arthur Lemmens
From: teleny
Subject: Re: Teaching self....question?
Date: 
Message-ID: <37551C29.8519115A@connix.com>
Arthur Lemmens wrote:

> > In his introduction to defining functions he gives me
> >
> > (def rac (lambda (lyst) (car (reverse lyst))))
> > which gives me:
> >
> > error: unbound function - def
>
> In Common Lisp, you would write this as:
> (defun rac (lyst) (car (reverse lyst)))
>
> In Scheme you could use:
> (define rac (lambda (lyst) (car (reverse lyst))))
> or:
> (define (rac lyst) (car (reverse lyst)))

Perhaps I should have made it clear that "lyst" is being used as a dummy
variable...

teleny, friend of cats.
From: Barry Margolin
Subject: Re: Teaching self....question?
Date: 
Message-ID: <2Gb53.201$KM3.88533@burlma1-snr2>
In article <·················@connix.com>, teleny  <······@connix.com> wrote:
>
>
>Arthur Lemmens wrote:
>
>> > In his introduction to defining functions he gives me
>> >
>> > (def rac (lambda (lyst) (car (reverse lyst))))
>> > which gives me:
>> >
>> > error: unbound function - def
>>
>> In Common Lisp, you would write this as:
>> (defun rac (lyst) (car (reverse lyst)))
>>
>> In Scheme you could use:
>> (define rac (lambda (lyst) (car (reverse lyst))))
>> or:
>> (define (rac lyst) (car (reverse lyst)))
>
>Perhaps I should have made it clear that "lyst" is being used as a dummy
>variable...

Why?  It's already clear from the code you posted, and irrelevant to the
error you were asking about (which had to do with "def", not "lyst").

-- 
Barry Margolin, ······@bbnplanet.com
GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.