Re: Calling Conventions and Pass By Reference

2008-09-02 Thread Yuval Kogman
On Wed, Sep 03, 2008 at 00:35:01 +0300, Yuval Kogman wrote: > Every value is conceptually an infinite stream of values, so e.g. > writing a clock widget amounts to assigning the output of some > formatting function applied to $time, into a GUI widget. The system > will reevaluate on any change. I

Re: Calling Conventions and Pass By Reference

2008-09-02 Thread Yuval Kogman
On Tue, Sep 02, 2008 at 20:13:12 +0100, Simon Wistow wrote: > For the first example, the answer is pretty clearly 14 but for the > second the answer could arguably be either 14 *or* 24. ... > More importantly - if that happened would it even matter? Would old > programmers have a problem with it

Re: Calling Conventions and Pass By Reference

2008-09-02 Thread Simon Wistow
On Tue, Sep 02, 2008 at 09:07:18PM +0100, Raphael Mankin said: > I think that you are confusing call by reference with call by name. With > call by name every parameter is actually a subroutine that evaluates the > parameter when you use it, as in Algol 60 of blessed memory. Sorry, I was being a l

Re: Calling Conventions and Pass By Reference

2008-09-02 Thread Raphael Mankin
On Tue, 2008-09-02 at 20:13 +0100, Simon Wistow wrote: > On Tue, Sep 02, 2008 at 09:43:32PM +0300, Yuval Kogman said: > > but conversly you have: > > > > my $x = 3; > > my $y = $x; > > $x++; > > $y; # 4 > > > > IIRC python works like that. > > There was an interesting paper a wh

Re: Calling Conventions and Pass By Reference

2008-09-02 Thread Randy J. Ray
a=10 b=4 c=a+b a=20 Now what is the value of c? For the first example, the answer is pretty clearly 14 but for the second the answer could arguably be either 14 *or* 24. I think most programmers are going to go with 14 but I wonder if a totally pass by reference language

Re: Calling Conventions and Pass By Reference

2008-09-02 Thread Simon Wistow
On Tue, Sep 02, 2008 at 09:43:32PM +0300, Yuval Kogman said: > but conversly you have: > > my $x = 3; > my $y = $x; > $x++; > $y; # 4 > > IIRC python works like that. There was an interesting paper a while back [goes off to find it ... AHAH] http://www.cs.mdx.ac.uk/rese

Re: Calling Conventions and Pass By Reference

2008-09-02 Thread Yuval Kogman
On Tue, Sep 02, 2008 at 20:29:31 +0200, Philip Newton wrote: > For example, in certain languages, strings and primitive-wrapper > objects are immutable, so if you pass them to someone else, they can't > muck around with them. In perl they are too, a scalar is a container not a value. $x++ create

Re: Calling Conventions and Pass By Reference

2008-09-02 Thread Yuval Kogman
On Tue, Sep 02, 2008 at 19:18:38 +0100, Simon Wistow wrote: > A thought - what would the advantages and disadvantages of having only > references in a language. I'm going to assume you mean low level referencing semantics (value aliasing) > The downside is that, of course, you can spooky actions

Re: Calling Conventions and Pass By Reference

2008-09-02 Thread Randy J. Ray
What other subtleties am I missing? What are the pros and cons from a language and culture perspective? From an underlying implementation and internals perspective? Well, the first thing that occurs to me is that every variable access is now a dereference, which is going to be very wasteful fo

Re: Calling Conventions and Pass By Reference

2008-09-02 Thread Philip Newton
On Tue, Sep 2, 2008 at 20:18, Simon Wistow <[EMAIL PROTECTED]> wrote: > What other subtleties am I missing? What are the pros and cons from a > language and culture perspective? From an underlying implementation and > internals perspective? >From a culture perspective, it also depends on which cla

Calling Conventions and Pass By Reference

2008-09-02 Thread Simon Wistow
A thought - what would the advantages and disadvantages of having only references in a language. Let's take Perl for example. By only having references we'd clean up a lot of syntax confusion - no more $foo{bar} and $foo->{bar}, there is only one way to do it. Related it's much easier to expla