From: Dmitry A. Soshnikov on 26 Apr 2010 11:06 On Apr 26, 6:28 pm, John G Harris <j...(a)nospam.demon.co.uk> wrote: > On Sun, 25 Apr 2010 at 11:25:31, in comp.lang.javascript, Dmitry A. > > Soshnikov wrote: > > <snip>>I repeat, regardless that reference-concept is just a > >sugar for the pointer in C++, > > <snip> > > That isn't true. In C++ a reference is a synonym. The compiler doesn't > have to use a pointer. If it's possible and if it wants to it can treat > it like a macro instead. (See 'frog', use 'jump'). > It doesn't matter. Moreover, I don't see any sense (and I object) to make a big irrelevant discussion. It doesn't matter what exactly does *any version* of C/C++. Because we talk about theoretical evaluation strategies. I myself use concept of an *alias* (i.e. synonym) when described by-reference strategy. The case that in C by-reference is just a sugar -- it is more abstractly to show that the same we can do with dereferencing a pointer. Meanwhile, I do not know what exactly is going on at preprocessing and compiling stages of *some* C/C++- implementation. The reference at assignment in C++ behaves like a dereferenced pointer. That exactly I meant when said that it's kind of syntactic sugar. Although, I don't know -- maybe it is even so at implementation stage, I didn't read C++ specification. But repeat, it is irrelevant. Nevertheless, John, if you know C++ spec deeply, let me know is it so or not, it will be useful to know for future discussions. Dmitry.
From: Dmitry A. Soshnikov on 26 Apr 2010 11:24 On Apr 26, 6:15 pm, "Dmitry A. Soshnikov" <dmitry.soshni...(a)gmail.com> wrote: > On Apr 26, 2:40 pm, Ry Nohryb <jo...(a)jorgechamorro.com> wrote: > > <snip> > > > In computer science (...) evaluation strategy defines when > > *and*in*what*order*the arguments to a function are evaluated > > Yes, OK, maybe I'll add this sentence in the article; will be useful. > Ok, I added this sentence: "Also the order in which arguments are being evaluated is important in ECMAScript it is left-to-right. In other languages and their implementations the reverse evaluation order (i.e. right-to-left) can be used." Please, correct wording mistakes if there are. Dmitry.
From: John G Harris on 26 Apr 2010 15:42 On Mon, 26 Apr 2010 at 08:06:32, in comp.lang.javascript, Dmitry A. Soshnikov wrote: >On Apr 26, 6:28�pm, John G Harris <j...(a)nospam.demon.co.uk> wrote: >> On Sun, 25 Apr 2010 at 11:25:31, in comp.lang.javascript, Dmitry A. >> >> Soshnikov wrote: >> >> � <snip>>I repeat, regardless that reference-concept is just a >> >sugar for the pointer in C++, >> >> � <snip> >> >> That isn't true. In C++ a reference is a synonym. The compiler doesn't >> have to use a pointer. If it's possible and if it wants to it can treat >> it like a macro instead. (See 'frog', use 'jump'). >> > >It doesn't matter. <snip> Spreading misinformation always matters. >The reference at assignment in C++ behaves like a dereferenced >pointer. That exactly I meant when said that it's kind of syntactic >sugar. <snip> Funnily enough, so does assignment to a variable. Some languages expect programs to dereference a pointer every time they access a variable, but not C++. John -- John Harris
From: Dmitry A. Soshnikov on 26 Apr 2010 16:13 On Apr 26, 9:36 pm, Ry Nohryb <jo...(a)jorgechamorro.com> wrote: <snip> > you can't stand being corrected, and 2nd that you're a young > programmer (time will cure that) OK, I "appreciate" it. Nice try, but unfortunately for you, I have immunity for such weak trolling ;) So, let's omit it. > I've got somewhere a couple or 3 notes I've taken about your CH4 > article "Scope chain". There's an important mistake in it (that I > wonder why nobody has told you yet). Do you want to know ? Or just > don't want any further constructive criticisms ? Yes, you may, I'm opened for any good addition/correction. So you can post it here or anywhere else. Dmitry.
From: Dmitry A. Soshnikov on 26 Apr 2010 16:26
On Apr 26, 11:42 pm, John G Harris <j...(a)nospam.demon.co.uk> wrote: > >The reference at assignment in C++ behaves like a dereferenced > >pointer. That exactly I meant when said that it's kind of syntactic > >sugar. > > <snip> > > Funnily enough, so does assignment to a variable. Some languages expect > programs to dereference a pointer every time they access a variable, but > not C++. > I have no any idea what the goal of your addition? Why do we talk about C/C++? How you guys here like to talk about some nit-picking irrelevant stuff on 10 pages. I'm sorry, I can't help you with that. I told, that C/C++ is a good language to show in action some strategy. That's it. No more, no less. I didn't talk about implementations or sort of. Moreover, I told, it doesn't matter for me will it be C or C+ +. Also I said that I know that in both cases (having as argument a reference or a pointer) we have concept of a "reference". But all this doesn't matter. By the way, in early first version of this article there was no section with comparing with C/C++ pointers, I added it later. And think that is needed. I'm not interested at the moment in nit-picking. So, what are you trying to say to me? What's the main objective of your words? Dmitry. |