Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Outdented calls use the last value in the column to their left. So:

      first
    .second
Never means `first.second`, either `.second` is an error, or it is applied to something above this, such as:

    someValue
      .methodName ->
        first
      .second
...which becomes:

    someValue.methodName(-> first)
    someValue.second
      
If such a value can't be found, it's an error. Of interest is the meaning of `.propertyName` in the leftmost column, as in:

    object
    .property
I suggest it's an error. As long as you can write:

    object.property # or...
    object
      .property
I don't see the value in

    object
    .property
This:

    object.property
      .value
Means `object.property.value`.


> I suggest it's an error.

So we'd have to give up:

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


IMHO, Smalltalk got this right using ; rather than whitespace. And it's easier to read.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: