Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-26 Thread Antoon Pardon
On 2008-11-20, greg [EMAIL PROTECTED] wrote: Antoon Pardon wrote: You are changing your argument. In a follow up you made the point that call by value should be as it was intended by the writers of the algol 60 report. No, I was countering the argument that call by value is short for call

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-23 Thread Arnaud Delobelle
Aaron Brady [EMAIL PROTECTED] writes: Truth and clarity are not tired of this thread. This is such a marvellously economic way of putting it, it's poetic! -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-23 Thread Derek Martin
On Tue, Nov 18, 2008 at 09:23:30AM +, Steven D'Aprano wrote: How I can answer the question, are the objects a and b the same or different? I can look at every aspect of each object, looking for something that is different. Well, sure, if you care *that much* about potentially trivial

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-23 Thread Steve Holden
Derek Martin wrote: [some stuff, followed by about 32k of unnecessarily quoted crap] It would be helpful if you'd take the time to trim your replies appropriately. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ --

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-23 Thread Steven D'Aprano
On Sun, 23 Nov 2008 09:24:05 -0600, Derek Martin wrote: On Tue, Nov 18, 2008 at 09:23:30AM +, Steven D'Aprano wrote: How I can answer the question, are the objects a and b the same or different? I can look at every aspect of each object, looking for something that is different.

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-22 Thread Aaron Brady
On Nov 21, 8:53 pm, greg [EMAIL PROTECTED] wrote: Aaron Brady wrote: Call-by-value has other characteristics that Python does not meet. The designers of most other dynamic languages don't seem to share that opinion, since they use the term call-by-value just as though it *does* mean call-

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-22 Thread Joe Strout
On Nov 22, 2008, at 4:08 AM, Aaron Brady wrote: Furthermore, to apply c-b-v to Python, you have to introduce the concept of pointers, which is ostensibly non-native for human programmers. Not necessarily pointers per se -- any type of object references will do, and yes, Python has those in

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-22 Thread Aaron Brady
On Nov 22, 8:40 am, Joe Strout [EMAIL PROTECTED] wrote: On Nov 22, 2008, at 4:08 AM, Aaron Brady wrote: Furthermore, to apply c-b-v to Python, you have to introduce the concept of pointers, which is ostensibly non-native for human programmers. Not necessarily pointers per se -- any type

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-21 Thread Duncan Booth
Steven D'Aprano [EMAIL PROTECTED] wrote: On Fri, 21 Nov 2008 03:32:25 +, Steven D'Aprano wrote: Rather it seems to me that the essence of the idea they had in mind is that call-by-value is equivalent to assignment. You've just *assumed* that assignment in Algol 60 doesn't involving

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-21 Thread Aaron Brady
On Nov 21, 3:11 am, Duncan Booth [EMAIL PROTECTED] wrote: Steven D'Aprano [EMAIL PROTECTED] wrote: On Fri, 21 Nov 2008 03:32:25 +, Steven D'Aprano wrote: Rather it seems to me that the essence of the idea they had in mind is that call-by-value is equivalent to assignment. You've

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-21 Thread Duncan Booth
Aaron Brady [EMAIL PROTECTED] wrote: a[:] = [1, 2, 3] No, that's not assignment, it's syntactic sugar for a __setslice__ call. No copies here. Oh dear, perhaps you had better get the Python developers to update the grammar that Python uses as that seems to think it's an assignment:

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-21 Thread Aaron Brady
On Nov 21, 4:33 am, Duncan Booth [EMAIL PROTECTED] wrote: Aaron Brady [EMAIL PROTECTED] wrote: a[:] = [1, 2, 3] No, that's not assignment, it's syntactic sugar for a __setslice__ call.  No copies here. Oh dear, perhaps you had better get the Python developers to update the grammar that

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-21 Thread greg
Aaron Brady wrote: But wait, is that true assignment? It's assignment, but it's not really copying an object. No new objects are being created -- rather, some of the items within the lhs object are being rebound to already-existing objects. It would be possible for the lhs object's

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-21 Thread greg
Aaron Brady wrote: Tell me, what happens during a call to the following C++ function? void f( std::vector int x ); The same thing as would happen if you wrote std::vectorint x = actual_parameter_expression; what happens during a call to the following Python function? def f( x ): ...

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-21 Thread greg
Steven D'Aprano wrote: You've just *assumed* that assignment in Algol 60 doesn't involving copying. I've done no such thing. I've *refrained* from assuming that the assignment in the definition always has to refer to Algol 60 assignment. You're the one insisting on tying everything to Algol.

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-21 Thread Aaron Brady
On Nov 21, 7:06 pm, greg [EMAIL PROTECTED] wrote: Aaron Brady wrote: Tell me, what happens during a call to the following C++ function? void f( std::vector int x ); The same thing as would happen if you wrote    std::vectorint x = actual_parameter_expression; what happens during a

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-21 Thread greg
Aaron Brady wrote: Call-by-value has other characteristics that Python does not meet. The designers of most other dynamic languages don't seem to share that opinion, since they use the term call-by-value just as though it *does* mean call- by-assignment and nothing more. -- Greg --

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-20 Thread Aaron Brady
On Nov 19, 7:22 pm, greg [EMAIL PROTECTED] wrote: Antoon Pardon wrote: You are changing your argument. In a follow up you made the point that call by value should be as it was intended by the writers of the algol 60 report. No, I was countering the argument that call by value is short

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-20 Thread Steven D'Aprano
On Thu, 20 Nov 2008 14:22:50 +1300, greg wrote: Antoon Pardon wrote: You are changing your argument. In a follow up you made the point that call by value should be as it was intended by the writers of the algol 60 report. No, I was countering the argument that call by value is short for

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-20 Thread Steven D'Aprano
On Wed, 19 Nov 2008 11:20:05 -0500, Terry Reedy wrote: It is useful and convenient to have null values like None, but it isn't useful to say that None is not a value. I never said that. But you've been defending the views of somebody who did. If you're going to play Devil's Advocate for

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-20 Thread John Nagle
Steven D'Aprano wrote: On Thu, 20 Nov 2008 14:22:50 +1300, greg wrote: Antoon Pardon wrote: You are changing your argument. In a follow up you made the point that call by value should be as it was intended by the writers of the algol 60 report. No, I was countering the argument that call by

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-20 Thread Steven D'Aprano
On Fri, 21 Nov 2008 03:32:25 +, Steven D'Aprano wrote: Rather it seems to me that the essence of the idea they had in mind is that call-by-value is equivalent to assignment. You've just *assumed* that assignment in Algol 60 doesn't involving copying. Based on the very little I know

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-19 Thread Antoon Pardon
On 2008-11-19, greg [EMAIL PROTECTED] wrote: Antoon Pardon wrote: Call by value is officially defined in terms of assignment in a context where assignments means copying and in a definition of a specifix language. You can't lift this part out of the definition of algol 60 and say it

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-19 Thread Terry Reedy
Steven D'Aprano wrote: On Tue, 18 Nov 2008 15:55:10 -0500, Terry Reedy wrote: To me, that distortion of his (and my) point is silly. 0 partipipates in numerous integer operations, whereas None participates in no NoneType operations. (Neither has attributes.) And that is the difference he

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-19 Thread Steve Holden
[EMAIL PROTECTED] wrote: On Nov 18, 10:22 am, Steve Holden [EMAIL PROTECTED] wrote in thread Python-URL! weekly Python news and links (Nov 17): [EMAIL PROTECTED] wrote: [...] One of the reasons I would like to formulate a good model of an object's value and type is so that I could try to

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-19 Thread greg
Antoon Pardon wrote: You are changing your argument. In a follow up you made the point that call by value should be as it was intended by the writers of the algol 60 report. No, I was countering the argument that call by value is short for call by copying the value. I was pointing out that

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-18 Thread Antoon Pardon
On 2008-11-12, greg [EMAIL PROTECTED] wrote: Here is the definition of call-by-value from the Revised Report on the Algorithmic Language Algol 60 http://www.masswerk.at/algol60/report.htm: 4.7.3.1. Value assignment (call by value). All formal parameters quoted in the value part of the

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-18 Thread Aaron Brady
On Nov 18, 2:21 am, Antoon Pardon [EMAIL PROTECTED] wrote: On 2008-11-12, greg [EMAIL PROTECTED] wrote: Here is the definition of call-by-value from the Revised Report on the Algorithmic Language Algol 60 http://www.masswerk.at/algol60/report.htm: 4.7.3.1. Value assignment (call by

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-18 Thread Steven D'Aprano
On Sun, 16 Nov 2008 15:46:54 -0800, rurpy wrote: Since many responses to my definition of value raised similar points, I will try and respond generally here. In hindsight, I should not have used the word value; it is far too overloaded with preexisting semantics for me to have attempted to

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-18 Thread Antoon Pardon
On 2008-11-12, greg [EMAIL PROTECTED] wrote: Steven D'Aprano wrote: Why should anyone take the Revised Report on the Algorithmic Language Algol 60 as the official (only?) definition of call-by-value for all languages everywhere? Since the term was more or less invented by the people who

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-18 Thread Steve Holden
Steven D'Aprano wrote: On Mon, 17 Nov 2008 18:35:04 -0800, Craig Allen wrote: * Do all objects have values? (Ignore the Python docs if necessary.) If one allows null values, I am current thinking yes. I don't see a difference between a null value and not having a value. I think the

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-18 Thread rurpy
On Nov 17, 7:35 pm, Craig Allen [EMAIL PROTECTED] wrote: * Do all objects have values? (Ignore the Python docs if necessary.) If one allows null values, I am current thinking yes. I don't see a difference between a null value and not having a value. I think the difference is

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-18 Thread Terry Reedy
Steven D'Aprano wrote: On Sun, 16 Nov 2008 15:46:54 -0800, rurpy wrote: For example, consider the two electrons around a helium nucleus. They have the same mass, the same speed, the same spin, the same electric charge, the same magnetic moment, they even have the same location in space

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-18 Thread Aaron Brady
On Nov 18, 2:55 pm, Terry Reedy [EMAIL PROTECTED] wrote: Steven D'Aprano wrote: On Sun, 16 Nov 2008 15:46:54 -0800, rurpy wrote: For example, consider the two electrons around a helium nucleus. They have the same mass, the same speed, the same spin, the same electric charge, the same

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-18 Thread Robert Kern
Terry Reedy wrote: Steven D'Aprano wrote: On Sun, 16 Nov 2008 15:46:54 -0800, rurpy wrote: For example, consider the two electrons around a helium nucleus. They have the same mass, the same speed, the same spin, the same electric charge, the same magnetic moment, they even have the same

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-18 Thread greg
Antoon Pardon wrote: Call by value is officially defined in terms of assignment in a context where assignments means copying and in a definition of a specifix language. You can't lift this part out of the definition of algol 60 and say it applies equally well in languages with different

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-18 Thread rurpy
On Nov 18, 10:22 am, Steve Holden [EMAIL PROTECTED] wrote in thread Python-URL! weekly Python news and links (Nov 17): [EMAIL PROTECTED] wrote: [...] One of the reasons I would like to formulate a good model of an object's value and type is so that I could try to offer something better.

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-18 Thread Steven D'Aprano
On Tue, 18 Nov 2008 15:55:10 -0500, Terry Reedy wrote: Steven D'Aprano wrote: On Sun, 16 Nov 2008 15:46:54 -0800, rurpy wrote: For example, consider the two electrons around a helium nucleus. They have the same mass, the same speed, the same spin, the same electric charge, the same

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-18 Thread Gabriel Genellina
En Wed, 19 Nov 2008 01:14:28 -0200, [EMAIL PROTECTED] escribió: On Nov 18, 10:22 am, Steve Holden [EMAIL PROTECTED] wrote in thread Python-URL! weekly Python news and links (Nov 17): [EMAIL PROTECTED] wrote: [...] One of the reasons I would like to formulate a good model of an object's value

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-17 Thread Craig Allen
* Do all objects have values? (Ignore the Python docs if necessary.) If one allows null values, I am current thinking yes. I don't see a difference between a null value and not having a value. I think the difference is concrete... an uninitialized variable in C has no value, I'd say,

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-17 Thread Aaron Brady
On Nov 17, 8:35 pm, Craig Allen [EMAIL PROTECTED] wrote: * Do all objects have values? (Ignore the Python  docs if necessary.) If one allows null values, I am current thinking yes. I don't see a difference between a null value and not having a value. I think the difference is

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-17 Thread Steven D'Aprano
On Sun, 16 Nov 2008 23:34:58 -0500, Terry Reedy wrote: Steven D'Aprano wrote: class EqualsAll(object): ... def __eq__(self, other): ... return True ... 5 == EqualsAll() True The methods of 5 don't even get called. Why do you say that? As I read the manual,

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-17 Thread Steven D'Aprano
On Mon, 17 Nov 2008 18:35:04 -0800, Craig Allen wrote: * Do all objects have values? (Ignore the Python docs if necessary.) If one allows null values, I am current thinking yes. I don't see a difference between a null value and not having a value. I think the difference is

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-16 Thread Derek Martin
On Thu, Nov 13, 2008 at 11:58:18AM -0800, [EMAIL PROTECTED] wrote: I have yet to see any reasonable definition of a Python value in the Python docs or elsewhere, despite the fact that a value is one of the three defining characteristics of an object, a central concept in Python. Why does it

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-16 Thread Steven D'Aprano
On Sat, 15 Nov 2008 19:41:20 -0800, rurpy wrote: I prefer another definition of object: an object *is* a value, rather than *has* a value. That value consists of identity, type (or class), and everything else of interest which is sometimes also called value. Since identity is usually

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-16 Thread Derek Martin
On Sun, Nov 16, 2008 at 06:06:20AM +, Steven D'Aprano wrote: * Do all objects have values? (Ignore the Python docs if necessary.) If one allows null values, I am current thinking yes. I don't see a difference between a null value and not having a value. [...] It wasn't until

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-16 Thread Derek Martin
On Sun, Nov 16, 2008 at 08:38:25AM +, Steven D'Aprano wrote: I believe that the language reference says that objects have an identity, a type and state, but I'm too lazy too look it up. I'd be happy with that definition. They do indeed say value, not state. As I said in a different

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-16 Thread Arnaud Delobelle
Derek Martin [EMAIL PROTECTED] writes: On Thu, Nov 13, 2008 at 11:58:18AM -0800, [EMAIL PROTECTED] wrote: I have yet to see any reasonable definition of a Python value in the Python docs or elsewhere, despite the fact that a value is one of the three defining characteristics of an object, a

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-16 Thread Derek Martin
On Sun, Nov 16, 2008 at 09:30:45AM +, Arnaud Delobelle wrote: [...] If you like, you could think of the value of an object as the set of all possible values to which the object may evaluate in every possible context, given a particular state of the object. This definition looks a bit

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-16 Thread Arnaud Delobelle
Derek Martin [EMAIL PROTECTED] writes: I think he meant None... Or at least, I personally see a distinction between zero and None (and so do the Python docs). Zero is a value, whereas None is specifically intended to denote the lack of any value. None is an 'value' which is intended to

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-16 Thread Steven D'Aprano
On Sat, 15 Nov 2008 19:42:33 -0800, rurpy wrote: You are saying there is no objective definition of value. I disagree. I think one can define value in a useful way that is precise, objective, and useful. No, I'm not saying that there is no objective definition of value. I'm saying that the

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-16 Thread Steven D'Aprano
On Sun, 16 Nov 2008 04:12:53 -0500, Derek Martin wrote: On Sun, Nov 16, 2008 at 06:06:20AM +, Steven D'Aprano wrote: * Do all objects have values? (Ignore the Python docs if necessary.) If one allows null values, I am current thinking yes. I don't see a difference between a

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-16 Thread Steve Holden
Steven D'Aprano wrote: On Sat, 15 Nov 2008 19:42:33 -0800, rurpy wrote: [...] But I propose that one can define value in a precise way that captures what most people think of as value, and avoids confusing objects (or references to them) and the value of objects. Good luck. I think you're

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-16 Thread Steve Holden
Steven D'Aprano wrote: On Sat, 15 Nov 2008 11:17:07 -0800, rurpy wrote: [...] * How can I find an object's value (if I don't believe .str(), .repr(), etc)? Use gdb. :-) I would say the object's value is the value, so if you have the object, you have its value. [...] There's also the

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-16 Thread rurpy
Since many responses to my definition of value raised similar points, I will try and respond generally here. In hindsight, I should not have used the word value; it is far too overloaded with preexisting semantics for me to have attempted to redefine it, even if it is the word used (but not

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-16 Thread Steve Holden
[EMAIL PROTECTED] wrote: Since many responses to my definition of value raised similar points, I will try and respond generally here. In hindsight, I should not have used the word value; it is far too overloaded with preexisting semantics for me to have attempted to redefine it, even if

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-16 Thread Terry Reedy
Steven D'Aprano wrote: Because of Python's interpreted nature, names can't be compiled away as in C, they need a concrete runtime existence, but does the language definition need to assume that? Of course. It wouldn't be Python if they didn't. However, remember that objects don't have names.

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-16 Thread rurpy
On Nov 16, 5:12 pm, Steve Holden [EMAIL PROTECTED] wrote: The Python Reference Manual states that an object consists of identity, type, and value. Identity seems to be non-controversial. Let's take type as meaning the attributes an object inherits from it's class. value is then what is

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-16 Thread Terry Reedy
[EMAIL PROTECTED] wrote: Or one could adopt what Terry Reedy called a 4-aspect view: an object is identity, class, value (or local-state or something) and intrinsic-value. What I specifically said is id, class, instance attributes, and private data. So objects have only one, some only the

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-15 Thread Aaron Brady
On Nov 15, 12:51 am, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Fri, 14 Nov 2008 22:56:52 -0500, Terry Reedy wrote: snip I would say that the answer to this is, Would you like to include behaviour in value?. Let me give you an example: class String(string):     def

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-15 Thread Arnaud Delobelle
[EMAIL PROTECTED] writes: I have yet to see any reasonable definition of a Python value in the Python docs or elsewhere, despite the fact that a value is one of the three defining characteristics of an object, a central concept in Python. I don't remember how the expression 'object value' is

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-15 Thread rurpy
On Nov 14, 8:56 pm, Terry Reedy [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: On Nov 13, 4:53 pm, Terry Reedy wrote: [EMAIL PROTECTED] wrote: I have yet to see any reasonable definition of a Python value in the Python docs or elsewhere, despite the fact that a value is one of the three

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-15 Thread Terry Reedy
[EMAIL PROTECTED] wrote: On Nov 14, 8:56 pm, Terry Reedy [EMAIL PROTECTED] wrote: First of all, thanks. Thanks to your answers I have finally been able to formulate a concept of Python values. Now we'll see if it is valid/usable... :-) Good questions help refine a concept. * Can I create

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-15 Thread rurpy
On Nov 15, 4:12 pm, Terry Reedy [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: On Nov 14, 8:56 pm, Terry Reedy [EMAIL PROTECTED] wrote: ...snip... * Does an object's behavior (methods) affect its value? My first answer is No. Instance methods are attributes of a class and, in most

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-15 Thread rurpy
[Tried multiple times to post this but Google errors out so will try posting in two parts... this is part 1] On Nov 14, 11:51 pm, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Fri, 14 Nov 2008 22:56:52 -0500, Terry Reedy wrote: [EMAIL PROTECTED] wrote: On Nov 13, 4:53 pm,

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-15 Thread rurpy
[Tried multiple times to post this but Google errors out so will try posting in two parts... this is part 2] On Nov 14, 11:51 pm, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Fri, 14 Nov 2008 22:56:52 -0500, Terry Reedy wrote: [EMAIL PROTECTED] wrote: On Nov 13, 4:53 pm, Terry

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-15 Thread Steven D'Aprano
On Sat, 15 Nov 2008 11:17:07 -0800, rurpy wrote: * Can I create an object that has a value that is the same as int(3) without somehow using an int(3) object in its construction? [...] Yes: mpz(3) where mpz is multi-precision int class with same set of possible values as Python ints. The

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-14 Thread rurpy
On Nov 13, 4:53 pm, Terry Reedy wrote: [EMAIL PROTECTED] wrote: I have yet to see any reasonable definition of a Python value in the Python docs or elsewhere, despite the fact that a value is one of the three defining characteristics of an object, a central concept in Python. I noticed

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-14 Thread Terry Reedy
[EMAIL PROTECTED] wrote: On Nov 13, 4:53 pm, Terry Reedy wrote: [EMAIL PROTECTED] wrote: I have yet to see any reasonable definition of a Python value in the Python docs or elsewhere, despite the fact that a value is one of the three defining characteristics of an object, a central concept in

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-14 Thread Steven D'Aprano
On Fri, 14 Nov 2008 22:56:52 -0500, Terry Reedy wrote: [EMAIL PROTECTED] wrote: On Nov 13, 4:53 pm, Terry Reedy wrote: [EMAIL PROTECTED] wrote: I have yet to see any reasonable definition of a Python value in the Python docs or elsewhere, despite the fact that a value is one of the three

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-13 Thread greg
Steve Holden wrote: greg wrote: Do you agree that it makes sense to talk about assigning that value to something? No. Why do you think that we are (mostly) careful to talk about binding names and values instead? That's an odd position to take, considering that the Python docs use the word

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-13 Thread greg
Grant Edwards wrote: I stopped paying much attention to this thread a while ago, but you've got to admire the persistence of somebody who soldiers on even though Aahz, Fredrik Lund, and Steve Holden are all on the other side of the argument... Those people clearly know a great deal about

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-13 Thread Aaron Brady
On Nov 13, 3:44 am, greg [EMAIL PROTECTED] wrote: Grant Edwards wrote: I stopped paying much attention to this thread a while ago, but you've got to admire the persistence of somebody who soldiers on even though Aahz, Fredrik Lund, and Steve Holden are all on the other side of the

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-13 Thread greg
Fredrik Lundh wrote: Python's definition of the word value can be found in the language reference: http://docs.python.org/reference/datamodel.html#objects-values-and-types That whole passage is talking almost exclusively about the value of an *object*: Every object has an identity, a

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-13 Thread Fredrik Lundh
greg wrote: If you're going to indulge in argument by authority, you need to pick authorities that can be considered, er, authoritative in the field concerned... Like Barbara Liskov, who's won tons of awards for her work on computer science and programming languages, and who was among the

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-13 Thread rurpy
On Nov 12, 2:05 pm, Fredrik Lundh [EMAIL PROTECTED] wrote: Python's definition of the word value can be found in the language reference: http://docs.python.org/reference/datamodel.html#objects-values-and-types Using that definition, a Python expression yields an object, not an object value.

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-13 Thread Grant Edwards
On 2008-11-13, greg [EMAIL PROTECTED] wrote: Grant Edwards wrote: I stopped paying much attention to this thread a while ago, but you've got to admire the persistence of somebody who soldiers on even though Aahz, Fredrik Lund, and Steve Holden are all on the other side of the argument...

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-13 Thread Terry Reedy
Fredrik Lundh wrote: greg wrote: If you're going to indulge in argument by authority, you need to pick authorities that can be considered, er, authoritative in the field concerned... Like Barbara Liskov, who's won tons of awards for her work on computer science and programming languages,

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-13 Thread rurpy
On Nov 12, 7:09 pm, George Sakkis [EMAIL PROTECTED] wrote: On Nov 12, 4:05 pm, Fredrik Lundh [EMAIL PROTECTED] wrote: greg wrote: It's not only misleading, it's also a seriously flawed reading of the original text - the Algol 60 report explicitly talks about assignment of *values*. Do

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-13 Thread Terry Reedy
[EMAIL PROTECTED] wrote: I have yet to see any reasonable definition of a Python value in the Python docs or elsewhere, despite the fact that a value is one of the three defining characteristics of an object, a central concept in Python. I noticed too. My try: The value of an object is the

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-12 Thread Steve Holden
greg wrote: Fredrik Lundh wrote: It's not only misleading, it's also a seriously flawed reading of the original text - the Algol 60 report explicitly talks about assignment of *values*. Do you agree that an expression in Python has a value? Most expressions have values. The ones whose

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-12 Thread Grant Edwards
On 2008-11-12, Steve Holden [EMAIL PROTECTED] wrote: greg wrote: I stopped paying much attention to this thread a while ago, but you've got to admire the persistence of somebody who soldiers on even though Aahz, Fredrik Lund, and Steve Holden are all on the other side of the argument... --

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-12 Thread greg
Fredrik Lundh wrote: It's not only misleading, it's also a seriously flawed reading of the original text - the Algol 60 report explicitly talks about assignment of *values*. Do you agree that an expression in Python has a value? Do you agree that it makes sense to talk about assigning that

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-12 Thread greg
Steven D'Aprano wrote: Why should anyone take the Revised Report on the Algorithmic Language Algol 60 as the official (only?) definition of call-by-value for all languages everywhere? Since the term was more or less invented by the people who designed Algol, I thought it would be a good idea

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-12 Thread Fredrik Lundh
Aahz wrote: There you have it -- call by value is offially defined in terms of assignment. There is no mention in there of copying. So it's perfectly correct to use it in relation to Python. Except, of course, for the fact that it is generally misleading. It's not only misleading, it's

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-12 Thread greg
Steven D'Aprano wrote: If you insist that Python is call by value, the only way that can work is by defining values to be references, which is nothing like Algol. No, that's not the only way. You can also make it work by accepting the original definition of call-by-value at face value -- i.e.

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-12 Thread Francesco Guerrieri
On Wed, Nov 12, 2008 at 2:01 PM, Steve Holden [EMAIL PROTECTED] wrote: Now, can we get on to something substantive like how many angels can dance on the head of a pin? Oh, come on, that's too easy! 42. I thought that by now everybody knew that. Francesco --

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-12 Thread Fredrik Lundh
greg wrote: It's not only misleading, it's also a seriously flawed reading of the original text - the Algol 60 report explicitly talks about assignment of *values*. Do you agree that an expression in Python has a value? Do you agree that it makes sense to talk about assigning that value

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-12 Thread Aahz
In article [EMAIL PROTECTED], Grant Edwards [EMAIL PROTECTED] wrote: On 2008-11-12, Steve Holden [EMAIL PROTECTED] wrote: greg wrote: I stopped paying much attention to this thread a while ago, but you've got to admire the persistence of somebody who soldiers on even though Aahz, Fredrik Lund,

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-12 Thread George Sakkis
On Nov 12, 4:05 pm, Fredrik Lundh [EMAIL PROTECTED] wrote: greg wrote: It's not only misleading, it's also a seriously flawed reading of the original text - the Algol 60 report explicitly talks about assignment of *values*. Do you agree that an expression in Python has a value? Do

Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-11 Thread greg
Here is the definition of call-by-value from the Revised Report on the Algorithmic Language Algol 60 http://www.masswerk.at/algol60/report.htm: 4.7.3.1. Value assignment (call by value). All formal parameters quoted in the value part of the procedure declaration heading are assigned the values

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-11 Thread Aahz
In article [EMAIL PROTECTED], greg [EMAIL PROTECTED] wrote: Here is the definition of call-by-value from the Revised Report on the Algorithmic Language Algol 60 http://www.masswerk.at/algol60/report.htm: 4.7.3.1. Value assignment (call by value). All formal parameters quoted in the value part

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-11 Thread Steven D'Aprano
On Wed, 12 Nov 2008 13:10:10 +1300, greg wrote: Here is the definition of call-by-value from the Revised Report on the Algorithmic Language Algol 60 http://www.masswerk.at/algol60/report.htm: Why should anyone take the Revised Report on the Algorithmic Language Algol 60 as the official

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-11 Thread Steven D'Aprano
On Wed, 12 Nov 2008 02:44:42 +, Steven D'Aprano wrote: But one thing is clear: values aren't references. Given the assignment x=1, the value of x is not a reference to 1 but 1 itself. So the one thing we can unambiguously say is that Algol's assignment model is not the same as Python's

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-11 Thread Arnaud Delobelle
Steven D'Aprano [EMAIL PROTECTED] writes: I am very happy to say that x=1 implies that the value of x is the object 1 itself, in fact I would insist on such a definition of value. If you insist that Python is call by value, the only way that can work is by defining values to be references