[Grace-core] Short-circuiting elseif

James Noble kjx at ecs.vuw.ac.nz
Mon Mar 19 03:26:13 PDT 2012


Hi Bart! 

good to have your comment.

On 19/03/2012, at 21:26 PM, Bart Jacobs wrote:

> Here are two more options:
> 
> A. Suck it up and have the ugly-but-logical syntax:
> 
> if (C1) then { B1 } elseif {C2} then { B2 } else { B3 }
> 
> Ugliness is a matter of getting used to, and furthermore these little quirks can make the language more attractive to the fans. It's like wearing a thinkgeek t-shirt :-)

you know, I find that... strangely attractive. 
It *could* be on a T-shirt. 

> B. This may be too convoluted (esp. for a CS1 language), but here goes:

> This is similar to the dollar sign in the Haskell standard library:

so it seems that m $ e  is basically the same as m(e) - is that right? 

Newspeak 0.06 has something similar listed as Unimplemented
(but explicitly as similar to Haskell's $)

> e :| μ. It is equivalent to (e) μ.

> label: ”foo” :| color: Color red :| font: #Courier

but then Newspeak kept Smalltalk cascades, while Self dumped 'em.
I'd rather follow Self here.  I wonder if AmbientTalk had anything like this?

James


More information about the Grace-core mailing list