bzs@bu-cs.BU.EDU (Barry Shein) (07/18/89)
In Common Lisp, given: (setf (get 'foo 'bar) 'goo) what should: (prog (foo) (get 'foo 'bar)) return (prog could be (lambda (foo)..) or (let (foo)...), I assume the answer should be basically the same)? One implementation I tried returned 'goo and the other NIL. I couldn't find any definition in CLTL but if I missed it and you know the page number that would be the perfect answer. -- -Barry Shein Software Tool & Die, Purveyors to the Trade 1330 Beacon Street, Brookline, MA 02146, (617) 739-0202 Internet: bzs@skuld.std.com UUCP: encore!xylogics!skuld!bzs or uunet!skuld!bzs
mt@mit-amt.MEDIA.MIT.EDU (Michael Travers) (07/18/89)
In article <34825@bu-cs.BU.EDU> bzs@bu-cs.BU.EDU (Barry Shein) writes: > >In Common Lisp, given: > > (setf (get 'foo 'bar) 'goo) > >what should: > > (prog (foo) (get 'foo 'bar)) > >return (prog could be (lambda (foo)..) or (let (foo)...), I assume the >answer should be basically the same)? I would have thought so too, but it turns out the prog is not like progn in that it doesn't return the value of its last form. Prog is defined in terms of tagbody (see ClTL p. 133) and tagbody returns nil by default (p. 130). Binding a variable never affects its property list, so that's irrelevant. >One implementation I tried returned 'goo and the other NIL. The first one is apparently in error. -- Michael Travers / MIT Media Lab / mt@media-lab.media.mit.edu
mt@mit-amt.MEDIA.MIT.EDU (Michael Travers) (07/20/89)
Refere.rpi <34825@bu-cs.BU.EDU> Reply-Po: mt@media-lab.media.mit.edu (Michael Travers) Organieation: MIT Media Lab, Cambridge MA Lines: 27 21 icle <34825@bu-cs.BU.Er Xi bzs@bu-cs.BU.EDU (Barry Shein) writes: > > n Common Lisp, give Sunw > > (setf (get 'foo 'bar) 'goo) > >lleret should: > > (prog (foo) (get 'foo 'bar)) > >return (prog could be >answer should be basically the same)? I would have thought so too, but it turns out the prog is not like progn in tdefined in terms of tagbody (see ClTL p. 133) and tagbody returns nil by default (p. 130). Binding a variable never affects its property list, so that's irrelevant. >One implementation I tried returned 'goo and the other NIL. The first one is apparently in error. -- Michael Travers / MIT Media Lab / mt@media-lab.media.mit