Values and objects

Rustom Mody rustompmody at gmail.com
Sun May 11 04:48:07 EDT 2014


On Sunday, May 11, 2014 1:56:41 PM UTC+5:30, Jussi Piitulainen wrote:
> Marko Rauhamaa writes:
> > Rustom Mody:
> > 
> > > On Saturday, May 10, 2014 2:39:31 PM UTC+5:30, Steven D'Aprano wrote:
> > >> 
> > >> Personally, I don't imagine that there ever could be a language
> > >> where variables were first class values *exactly* the same as
> > >> ints, strings, floats etc.
> 
> > >
> 
> > > [...]
> 
> > >
> 
> > > What you mean by *exactly* the same mean, I am not sure...
> 
> > 
> 
> > Lisp variables (symbols) are on an equal footing with other objects.
> 
> > IOW, lisp variables are objects in the heap.
> 
> 
> Only some, or only in quite old or special members of the family. But
> yes, I suppose when Lisp was still LISP, it was the kind of language
> that Steven fails to imagine in the quotation above. Variables really
> were symbols, which still are objects that can be passed around and
> stored in data structures. Or maybe not - wasn't the essential binding
> component (originally an "association list", later a more abstract
> "environment", called "namespace" in Python culture) separate from the
> symbol even then? Global bindings aside.
> 

A symbol is a first-class data structure in any lisp (that I know)
http://en.wikipedia.org/wiki/Homoiconicity is a defining characteristic of lisp

Environments are first class in many schemes:
http://sicp.ai.mit.edu/Fall-2004/manuals/scheme-7.5.5/doc/scheme_14.html
(The '+'es there indicate its an MIT scheme extension; but its quite common)

In my understanding a symbol can be called a variable only wrt some environment

IOW there is no meaning to the word 'variable' without some notion of scope.

I am not sure what your references to old and new lisps and static vs dynamic
scope has to do with this.

Or are you saying that in the 1960s lisps, a symbol was the string (name)
along with its (dynamic binding) stack??

Python to qualify for this not only would the namespacing of
locals have to be systematic with globals, the nesting structure of environments
would have to be introspectively available as in the scheme example.

Note the functions: environment-parent and environment-bound-names



More information about the Python-list mailing list