Better HN
topnewbestaskshowjobs
Log inSign up

satyr

15 karma · joined Dec 25, 2010 (15y ago) · 7 submissions

Submissions

comment 14y ago · link · parent

Try:

    switch a
      when b
         , c
         , d
        e()

comment 14y ago · link · parent

And when do you ever want to leak local variables to an outer scope? Never.

Not to mention that loop counters are no different than other `var`iables in JS.

comment 14y ago · link · parent

The inconsistency doesn't stop there; `for` variables are specialcased:

    bar = ->
      alert "Holy crap cheese is awesome!"

    foo = ->
      for bar of bars
        console.log bar
      return
↓

    var bar, foo;

    bar = function() {
      return alert("Holy crap cheese is awesome!");
    };

    foo = function() {
      var bar;
      for (bar in bars) {
        console.log(bar);
      }
    };

comment 14y ago · link · parent

> I suggest it's an error.

So we'd have to give up:

    array
    .map (x) ->
      f x
    .reduce (a, b) ->
      g a, b

comment 14y ago · link · parent

There's no outdented continued call in current CoffeeScript; an outdented line always makes OUTDENT.

(Or are you suggesting to allow such code? I personally see no value in it.)

comment 15y ago · link · parent

I believe you mean:

    foo
      bar;
      bash: something;
      thenBlitz.
http://www.inf.ufsc.br/poo/smalltalk/ibm/tutorial/chap3.html...

comment 15y ago · link · parent

  # Fix things CS goofs.
  # Add things CS lacks.