Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!hookup!swrinde!pipex!uknet!festival!edcogsci!jeff
From: jeff@aiai.ed.ac.uk (Jeff Dalton)
Subject: Re: Explicit struct (,vectors, etc.) in function definitions
Message-ID: <Cyx2y0.83C@cogsci.ed.ac.uk>
Sender: usenet@cogsci.ed.ac.uk (C News Software)
Nntp-Posting-Host: bute-alter.aiai.ed.ac.uk
Organization: AIAI, University of Edinburgh, Scotland
References: <DUDEYP.94Nov4150618@darwin.cs.orst.edu> <39gqpj$gnd@tools.near.net>
Date: Mon, 7 Nov 1994 21:41:59 GMT
Lines: 25

In article <39gqpj$gnd@tools.near.net> barmar@nic.near.net (Barry Margolin) writes:
>In article <DUDEYP.94Nov4150618@darwin.cs.orst.edu> dudeyp@darwin.cs.orst.edu (Peter Dudey Drake) writes:
>>> (defstruct thing)
>>THING
>>> (setq foo `(lambda (x) (eq x ,(make-thing))))
>>(LAMBDA (X) (EQ X #S(THING)))
>>> (funcall foo 23)
>>*** - EVAL: illegal form #S(THING)
>
>CLtL1 only defined how to evaluate numbers, strings, symbols, and lists;
>other data types are undefined.  In ANSI CL all the others will be
>self-evaluating, but since CLISP is only CLtL1-conforming, it doesn't
>follow this rule.
>
>>Does anybody know a way to do this without dumping the data in the
>>struct into a list or somesuch?
>
>Quote it:
>
>(setq foo `(lambda (x) (eq x ',(make-thing))))

Barry -- after our long discussions of this point how can you
not mention that quoting makes it not modifiable?

-- Jeff
