Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion More Scope...
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Erann Gat  
View profile  
 More options Feb 25 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: g...@jpl.nasa.gov (Erann Gat)
Date: 2000/02/25
Subject: Re: More Scope...

In article <3160482077049...@naggum.no>, Erik Naggum <e...@naggum.no> wrote:
> (1) common-lisp-user
> ;; In Lisp Listener #2
> (2) common-lisp-user
> (defun foobar (x)
>   (values x (symbol-value 'x)))
> => foobar
> (3) common-lisp-user
> (setq x 666)
> => 666
> (4) common-lisp-user
> (foobar 4711)
> => 4711
> => 666
> (5) common-lisp-user
> (defvar x 69)
> => x
> (6) common-lisp-user
> (foobar 4711)
> => 4711
> => 4711

It takes a pretty smart implementation of Common Lisp to actually
produce this result as presented.  In most systems you'll have to
recompile FOOBAR after DEFVARing X to see the result:

? (defun foo (x) (values x (symbol-value 'x)))
FOO
? (setf x 666)
666
? (foo 4711)
4711
666
? (defvar x 69)
X
? (foo 4711)
4711
69
? (defun foo (x) (values x (symbol-value 'x)))
FOO
? (foo 4711)
4711
4711
?

This was MCL 4.3.

Erann Gat
g...@jpl.nasa.gov


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google