javascript (was Re: Java > Scala -> new thread: GUI for D)

2011-12-04 Thread Adam D. Ruppe
Jacob Carlborg Wrote: > I hide JavaScript behind CoffeeScript, makes it a bit more usable. If you like the idea there, but want something a lot more conservative, in my html.d (in here: https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff ) there's now a Javascript

Re: javascript (was Re: Java > Scala -> new thread: GUI for D)

2011-12-04 Thread Jacob Carlborg
On 2011-12-04 21:17, Adam D. Ruppe wrote: Jacob Carlborg Wrote: I hide JavaScript behind CoffeeScript, makes it a bit more usable. If you like the idea there, but want something a lot more conservative, in my html.d (in here: https://github.com/adamdruppe/misc-stuff-including-D-programming-la

Re: javascript (was Re: Java > Scala -> new thread: GUI for D)

2011-12-04 Thread Adam D. Ruppe
Jacob Carlborg Wrote: > Maybe you should take a look at SASS, it has if-statements, for-loops, Yea, I've looked at it before (and like some of the ideas - their lighten, darken, etc. functions are nice and I intend to implement them myself as I find the time - see color.d in that github page.)

Re: javascript (was Re: Java > Scala -> new thread: GUI for D)

2011-12-04 Thread Nick Sabalausky
"Jacob Carlborg" wrote in message news:jbglgs$2no2$1...@digitalmars.com... > > I think CoffeeScript works really well, it's been around a while and it's > the default way to handle JavaScript in Rails 3.1 and later versions (SASS > is the default way of handling CSS). That seems slightly stran

Re: javascript (was Re: Java > Scala -> new thread: GUI for D)

2011-12-04 Thread Jacob Carlborg
On 2011-12-04 21:40, Adam D. Ruppe wrote: Jacob Carlborg Wrote: Maybe you should take a look at SASS, it has if-statements, for-loops, Yea, I've looked at it before (and like some of the ideas - their lighten, darken, etc. functions are nice and I intend to implement them myself as I find th

Re: javascript (was Re: Java > Scala -> new thread: GUI for D)

2011-12-05 Thread Jacob Carlborg
On 2011-12-05 07:59, Nick Sabalausky wrote: "Jacob Carlborg" wrote in message news:jbglgs$2no2$1...@digitalmars.com... I think CoffeeScript works really well, it's been around a while and it's the default way to handle JavaScript in Rails 3.1 and later versions (SASS is the default way of hand

Re: javascript (was Re: Java > Scala -> new thread: GUI for D)

2011-12-05 Thread bearophile
Jacob Carlborg: > I think they're good languages, regardless of the indent-syntax or not. > CoffeeScript and Ruby share a couple of language features that I'm not > sure if Python does: > > * Instance variables start with @ (shortcut for "this." in CS) > > * Functions can be called without par

Re: javascript (was Re: Java > Scala -> new thread: GUI for D)

2011-12-05 Thread Marco Leise
Am 04.12.2011, 21:17 Uhr, schrieb Adam D. Ruppe : Jacob Carlborg Wrote: If you like the idea there, but want something a lot more conservative, in my html.d (in here: https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff ) there's now a JavascriptMacroExpander

Re: javascript (was Re: Java > Scala -> new thread: GUI for D)

2011-12-05 Thread Jacob Carlborg
On 2011-12-05 10:10, Marco Leise wrote: Am 04.12.2011, 21:17 Uhr, schrieb Adam D. Ruppe : Jacob Carlborg Wrote: If you like the idea there, but want something a lot more conservative, in my html.d (in here: https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff ) th

Re: javascript (was Re: Java > Scala -> new thread: GUI for D)

2011-12-05 Thread Adam Ruppe
Jacob Carlborg Wrote: > for e in arr > # do something with the element "e" Heh, I used to think that would work in regular Javascript, since it does have a for(blah in something) form... But in regular javascript, that only works on objects!

Re: javascript (was Re: Java > Scala -> new thread: GUI for D)

2011-12-05 Thread Adam Ruppe
Marco Leise Wrote: > This is really one of the largest shortcomings of the language that can > not be explained with a simple design choice. Aye. One of the newer versions adds a forEach member to the array prototype, that works like this: [1, 2, 3].forEach(function(element) { use element here;

Re: javascript (was Re: Java > Scala -> new thread: GUI for D)

2011-12-05 Thread Jacob Carlborg
On 2011-12-05 16:47, Adam Ruppe wrote: Jacob Carlborg Wrote: for e in arr # do something with the element "e" Heh, I used to think that would work in regular Javascript, since it does have a for(blah in something) form... But in regular javascript, that only works on objects! Yeah, it

Re: javascript (was Re: Java > Scala -> new thread: GUI for D)

2011-12-05 Thread Jacob Carlborg
On 2011-12-05 16:53, Adam Ruppe wrote: Marco Leise Wrote: This is really one of the largest shortcomings of the language that can not be explained with a simple design choice. Aye. One of the newer versions adds a forEach member to the array prototype, that works like this: [1, 2, 3].forEach(