Re: "Magic" features of programming languages

2011-05-23 Thread Richard O'Keefe
On 22/05/2011, at 11:17 PM, Frank Wales wrote: > Blimey, are we top-posting or bottom-posting in this discussion? Anyway... > > The original question was about whether there were studies on > the effect of 'magic' features, but we seem to have devolved into > a show-and-tell of them instead. >

Re: "Magic" features of programming languages

2011-05-22 Thread Frank Wales
Blimey, are we top-posting or bottom-posting in this discussion? Anyway... The original question was about whether there were studies on the effect of 'magic' features, but we seem to have devolved into a show-and-tell of them instead. I wonder whether one person's 'magic' is another person's f

Re: "Magic" features of programming languages

2011-05-22 Thread Lindsay Marshall
PDP-8 had auto-increment locations down in low memory in similar style. I suppose the device addressing through memory on lots of machines counts as magic too, L. Sent from my iPad On 22 May 2011, at 06:39, "Thomas Green" wrote: > > Kevlin Henney wrote: >> To really demonstrate autoboxing y

Re: "Magic" features of programming languages

2011-05-21 Thread Thomas Green
Kevlin Henney wrote: To really demonstrate autoboxing you need to allow the compiler to convert from int to Integer: Integer x = 1000; Integer y = 1000; However, if you are after interesting counterintuitive corner cases, change the constant to 100: Integer x = 100; Integer y =

Re: "Magic" features of programming languages

2011-05-21 Thread Peter Gutmann
Kevlin Henney writes: >In other words, your corner case has a corner case. And they let children play with this stuff? Peter. -- The Open University is incorporated by Royal Charter (RC 000391), an exempt charity in England & Wales and a charity registered in Scotland (SC 038302).

Re: "Magic" features of programming languages

2011-05-21 Thread Frank Wales
Kevlin Henney wrote: To really demonstrate autoboxing you need to allow the compiler to convert from int to Integer: Integer x = 1000; Integer y = 1000; However, if you are after interesting counterintuitive corner cases, change the constant to 100: Integer x = 100; Integer

Re: "Magic" features of programming languages

2011-05-21 Thread Kevlin Henney
Best, Martin Original Message Subject: Re: "Magic" features of programming languages Date: Fri, 20 May 2011 12:31:53 -0400 From: John Daughtry To: Martin C.Martin I don't have a reference, but a more general example... A great well-known example

Re: "Magic" features of programming languages

2011-05-20 Thread Martin C.Martin
bjects: false Best, Martin Original Message Subject: Re: "Magic" features of programming languages Date: Fri, 20 May 2011 12:31:53 -0400 From: John Daughtry To: Martin C.Martin I don't have a reference, but a more general example... A great well-

"Magic" features of programming languages

2011-05-20 Thread Martin C.Martin
Hi all, When a construct is ambiguous, sometimes language designers will provide a default which (they hope) does the right thing in the common case. An example is XPath. When = is called on two sets, the semantics are that there is at least one pair of elements (one from each set) that comp