A question on modification of a list via a function invocation

Rustom Mody rustompmody at gmail.com
Tue Sep 5 13:26:16 EDT 2017


On Tuesday, September 5, 2017 at 10:45:45 PM UTC+5:30, Ned Batchelder wrote:
> On 9/5/17 1:02 PM, Steve D'Aprano wrote:
> > On Tue, 5 Sep 2017 11:37 pm, Gregory Ewing wrote:
> >
> >> Dennis Lee Bieber wrote:
> >>> Pascal, probably Modula-2, Visual BASIC are closer to the C++ reference
> >>> semantics, in that the definition of a function declares how the
> >>> argument(s) are passed.
> >> Well, sort of. In Pascal and Modula, and also VB I think,
> >> parameters are the only things that can be declared as having
> >> reference semantics, whereas references in C++ are first-class
> >> things that can be stored in any variable.
> > No, they aren't first-class. 
> 
> Did you mis-read Gregory's claim? He said, "references *in C++* are
> first-class things".  You seem to be talking below about Python things.

I think its mostly true of C++
And Steven did say:

(I don't know enough about C++ to distinguish between the last two opinions, but
I'm strongly leaning towards "not values at all".) 

So he seems to be talking of C++ (as analogous to python??)

But I dont see that any of it is relevant

Whether references are 
- first-class (Algol-68, pointers-in-C) or are simply
- second class (C++)
- invisible (python, lisp, ruby, javascript)

has little to do with what we are talking

The question is whether we need the *idea* of references
(modulo humpty-dumpty-fication)
to talk *about* the language; ie it needs to be there in the human/informal
ontology, even if the docs play word-games and try to avoid trigger-words
in honour of PC.

In my view its almost the defining quality of imperative languages that
the semantics of the language is not properly/fully comprehensive without
(something like) references.

[Replace "imperative language" with "assignment and mutation" if you like]



More information about the Python-list mailing list