Message from discussion
Recreational Common Lisp :)
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!sjc70.webusenet.com!news.webusenet.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!not-for-mail
Subject: Re: Recreational Common Lisp :)
From: Mark Conrad <nos...@iam.invalid>
Newsgroups: comp.lang.lisp
Message-ID: <070520032019245631%nospam@iam.invalid>
References: <060520030623188998%nospam@iam.invalid> <060520031307021934%nospam@iam.invalid> <8ytjddkd.fsf@ccs.neu.edu> <070520031534541968%nospam@iam.invalid> <87el3apd5y.fsf@darkstar.cartan>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-transfer-encoding: 8bit
Mail-Copies-To: nobody
User-Agent: Thoth/1.5.5 (Carbon/OS X)
Lines: 79
Date: Thu, 08 May 2003 03:17:08 GMT
NNTP-Posting-Host: 216.119.16.39
X-Complaints-To: abuse@earthlink.net
X-Trace: newsread1.prod.itd.earthlink.net 1052363828 216.119.16.39 (Wed, 07 May 2003 20:17:08 PDT)
NNTP-Posting-Date: Wed, 07 May 2003 20:17:08 PDT
Organization: EarthLink Inc. -- http://www.EarthLink.net
In article <87el3apd5y....@darkstar.cartan>, Nils Goesche
<n...@cartan.de> wrote:
> ...lotsa interesting stuff...
I could not locate the example I was looking for about
define-symbol-macro breaking, so I whiped up another example quickly.
It is not as good an example because I get a compiler 'warning' in this
case, but it will get across the idea.
Example #1 with eval-when
*********************************************
Welcome to the demo version of Macintosh Common Lisp Version 4.3!
? (define-symbol-macro %cont% #'identity)
%CONT%
? (eval-when (:load-toplevel :execute)
(setf (symbol-value '%cont%)
(lambda (&rest args)
(if (cdr args)
args
(car args)))))
#<Anonymous Function #x1EFB84DE>
? (define-symbol-macro k 'meow)
K
? (let ((r %cont%))
(defun test () (print(funcall %cont% 'woof)) (setq r 'bow-wow) r
) )
;Compiler warnings :
; Undeclared free variable %CONT%, in an anonymous lambda form.
TEST
? (test)
WOOF
BOW-WOW
? (funcall %cont% k)
MEOW
?
*******************************************
Example #2 without eval-when
#################################
Welcome to the demo version of Macintosh Common Lisp Version 4.3!
? (define-symbol-macro %cont% #'identity)
%CONT%
? (define-symbol-macro k 'meow)
K
? (let ((r %cont%))
(defun test () (print(funcall %cont% 'woof)) (setq r 'bow-wow) r
) )
;Compiler warnings :
; Undeclared free variable %CONT%, in an anonymous lambda form.
> Error: Unbound variable: %CONT%
> While executing: #<Anonymous Function #x1EF2B69E>
> Type Command-/ to continue, Command-. to abort.
> If continued: Retry getting the value of %CONT%.
See the Restarts menu item for further choices.
1 >
#################################
Mark-