From: Ry Nohryb on 27 Apr 2010 05:37 On Apr 27, 12:10 am, Stefan Weiss <krewech...(a)gmail.com> wrote: > On 26/04/10 23:58, Ry Nohryb wrote: > > > Nah, here's his most truly enlightening talk : > >http://artlung.com/smorgasborg/Invention_of_Cplusplus.shtml > > ...and after reading that truly enlightening interview, it may be a good > idea to read this: <http://www2.research.att.com/~bs/bs_faq.html#IEEE> Nah, soon after the interview he realized he had gone too far, and that "of course not" is just a lame attempt at retracting his earlier statements. :-) -- Jorge.
From: John G Harris on 27 Apr 2010 15:17 On Mon, 26 Apr 2010 at 13:26:55, in comp.lang.javascript, Dmitry A. Soshnikov wrote: <snip> >Why do we talk >about C/C++? You're the one who started talking about C++ and syntactic sugar. <snip> >I told, that C/C++ is a good language to show in action some strategy. >That's it. No more, no less. There's nothing wrong with saying a pointer is a way of supplying a reference variable in a function call. What's wrong is saying that C++ references always work that way. They aren't required to and in some optimising compilers in suitable circumstance they don't. <snip> >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. Will that really help readers who know no C++ ? <snip> >So, what are you trying to say to me? What's the main objective of >your words? I object to even more misinformation polluting the internet. There's too much already. John -- John Harris
From: John G Harris on 27 Apr 2010 15:51 On Tue, 27 Apr 2010 at 02:10:01, in comp.lang.javascript, Dmitry A. Soshnikov wrote: >On Apr 26, 7:06�pm, "Dmitry A. Soshnikov" <dmitry.soshni...(a)gmail.com> >wrote: > >> Although, I don't know -- maybe it is even so at implementation >> stage, I didn't read C++ specification. > >I checked in MS 2005 compiler. It is so, C++ reference concept *is >just a syntactic sugar* for a pointer. I can statement it now >precisely. You've proved that in one circumstance a reference parameter can be implemented using a pointer. Nobody has said it can't be. It doesn't prove that there is no other way. >Example to check: <URL: http://gist.github.com/380515> > >1 C++ source: >2 >3 void call_by_reference(int& x) >4 { >5 x = 20; >6 } Note that the y declared in main is not in scope here. >8 void call_by_pointer(int* x) >9 { >10 *x = 20; >11 } >12 >13 void by_value(int x) >14 { >15 x = 20; >16 } >17 >18 int _tmain(int argc, _TCHAR* argv[]) >19 { >20 int y = 0; >21 >22 call_by_reference(y); y is not in the scope of the body of call_by_reference so the caller must supply its address because the function body cannot find the variable in any other way. >23 call_by_pointer(&y); >24 by_value(y); >25 >26 return 0; >27 } >28 >29 Disassembly: >30 >31 The most important lines are 50-51 (by-reference) and 55-56 (by- >pointer) >32 as we see, the same -- load effective address and push to stack. >33 >34 int _tmain(int argc, _TCHAR* argv[]) >35 { <snip 'machine' code> >67 } >P.S.: Also, C++ creator Straustrup also notice that at implementation >level, a reference is just a sugar for the pointer. And this pointer >is dereferenced every time when we deal with a reference operation. What Stroustrup says in the 3rd edition of his book is this : "A reference is an alternative name for an object." and "In some cases, the compiler can optimize away a reference so that there is no object representing that reference at run-time." John -- John Harris
From: Dmitry A. Soshnikov on 27 Apr 2010 16:48 On Apr 27, 11:17 pm, John G Harris <j...(a)nospam.demon.co.uk> wrote: > > >So, what are you trying to say to me? What's the main objective of > >your words? > > I object to even more misinformation polluting the internet. There's too > much already. > I didn't expect anything else then such cheeky demagogy. And I object to useless discussions on 10 pages with *irrelevant* nit-picking. You should learn to talk about the main goal, it is more essential. Thank you, the talk is over. Dmitry.
From: John G Harris on 28 Apr 2010 06:12
On Tue, 27 Apr 2010 at 13:48:41, in comp.lang.javascript, Dmitry A. Soshnikov wrote: >On Apr 27, 11:17�pm, John G Harris <j...(a)nospam.demon.co.uk> wrote: > >> >> >So, what are you trying to say to me? What's the main objective of >> >your words? >> >> I object to even more misinformation polluting the internet. There's too >> much already. >> > >I didn't expect anything else then such cheeky demagogy. And I object >to useless discussions on 10 pages with *irrelevant* nit-picking. You >should learn to talk about the main goal, it is more essential. > >Thank you, the talk is over. As I suspected, you aren't interested in getting anything right. John -- John Harris |