Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Newbie asking for help
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
 
Simon Brooke  
View profile  
 More options Jun 27 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Simon Brooke <si...@jasmine.org.uk>
Date: 2000/06/27
Subject: Re: Newbie asking for help
"Steven M. Haflich" <hafl...@pacbell.net> writes:

> Indeed, the "free" use of a variable is orthogonal to the "undeclared"
> use of a variable, but that does in itself not mean anything.  A Usenet
> posting may be factually incorrect, and it may be stupid.  But it may
> be stupid without being incorrect, and it may be incorrect without
> being stupid, and it may be both stupid and incorrect.  These two
> properties are orthogonal.  I know this because I have both read and
> writen many Usenet postings over the past 17 years.

Indeed, and anyone who has been using Usenet for that length of time
and claims (s)he hasn't made posts of both kinds is a liar.

> Similarly, a reference to a variable may be either or both of "undeclared"
> and "free".  Rather than muck around in the meaning of these terms, I'd
> ask Erik the following focussed question:

> Assume a freshly-booted ANS-compliant CL implementation.  What behavior,
> if any, is guaranteed by execution of the following form?

>  (print (progn (setq pie 22/7) pie))

From the point of view of the argument here, aren't both the print
form and the progn forms redundent? Doesn't

* (setq pie 22/7)
==> 22/7
* pie
==> 22/7

illustrate your point just as well?

> I want to know whether this behavior (modulo toplevel interaction,
> prompting, and newlinification) is defined by the ANS.  If you claim that
> it is, please cite the ANS section references.  I claim that the behavior
> is either "is an error" or "is undefined".

> Do you disagree?

OK, I'll play

<URL:http://www.cs.cmu.edu/Groups/AI/html/hyperspec/HyperSpec/Body/sec_3-1...>

    If a form is a symbol that is not a symbol macro, then it is the
    name of a variable, and the value of that variable is
    returned. There are three kinds of variables: lexical variables,
    dynamic variables, and constant variables. A variable can store
    one object. The main operations on a variable are to read[1] and
    to write[1] its value.

    An error of type unbound-variable should be signaled if an unbound
    variable is referenced.

SETQ is defined to bind variables to forms. A variable is just any
name in the 'variable' namespace (Yeuch! LISP2! **Nasty**).
<URL:http://www.cs.cmu.edu/Groups/AI/html/hyperspec/HyperSpec/Body/spefor_...>

So, in your example, setq binds the name 'pie' in the current dynamic
environment, by assigning a value to that name in the namespace (all
possible names exist (in a platonic sense) in the namespace, it's just
that the overwhelming majority of them are never instantiated by being
bound). The environment happens to be top-level. The following
evaluation of the name pie retrieves the value from the namespace.

Therefore the behaviour you describe is mandated by the hyperspec. I
don't have the text of the ANSI specification to hand, but have
sufficient trust in the hyperspec editors to believe that if it's
mandated by the one, it's mandated by the other.

--
si...@jasmine.org.uk (Simon Brooke) http://www.jasmine.org.uk/~simon/

        There are no messages. The above is just a random stream of
        bytes. Any opinion or meaning you find in it is your own creation.


 
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.