{"issue":{"state":"open","pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"milestone":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/88299e4a8e125373865856ed7c7c8b11?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"88299e4a8e125373865856ed7c7c8b11","url":"https://api.github.com/users/JulianBirch","login":"JulianBirch","id":84115},"updated_at":"2011-10-30T20:11:17Z","labels":[],"assignee":null,"comments":28,"closed_at":null,"url":"https://api.github.com/repos/jashkenas/coffee-script/issues/1495","body":"Since chaining is a pretty common feature of Javascript libraries, how about a dedicated syntax for it?\r\n\r\ne.g.\r\n\r\n    $(\"p.neat\").addClass(\"ohmy\").show(\"slow\");\r\n\r\ncould be written\r\n\r\n    $(\"p.neat\")..       # Note the \"dot dot\"\r\n      addClass \"ohmy\"\r\n      show \"slow\"\r\n\r\nAlternatively, you could go with something insanely LISPy\r\n\r\n    ->>\r\n      $ \"p.neat\"\r\n      addClass \"ohmy\"\r\n      show \"slow\"\r\n\r\nNB, the semantics I'm proposing would be equivalent to\r\n\r\n    a = $ \"p.neat\"\r\n    b = a.addClass \"ohmy\"\r\n    c = b.show \"slow\"","html_url":"https://github.com/jashkenas/coffee-script/issues/1495","title":"Improve chaining syntax","number":1495,"id":1192118,"created_at":"2011-07-08T19:40:11Z"},"action":"created","comment":{"user":{"avatar_url":"https://secure.gravatar.com/avatar/028ba5b41575252757fa149296ef6842?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"028ba5b41575252757fa149296ef6842","url":"https://api.github.com/users/timcameronryan","login":"timcameronryan","id":80639},"updated_at":"2011-10-30T20:11:17Z","url":"https://api.github.com/repos/jashkenas/coffee-script/issues/comments/2571261","body":"@raganwald +1. This seems like an intuitive, semantic distinction between chaining vs continuation of previous lines.\r\n\r\nIt would also justifies being able to cleanly omit parentheses for multi-line chaining. Right now, CoffeeScript is less ambiguous in one case because it converts\r\n\r\n    brush\r\n        .startPath 'red'\r\n        .moveTo 10, 10\r\n\r\ninto\r\n\r\n    brush.startPath 'red'.moveTo 10, 10\r\n\r\nBut because it doesn't require the change in indentation level, it is *still* ambiguous because you can nest method calls for different objects in the same indentation level (here `startPath` vs `moveTo`). This goes against the rest of the language,  where indentation (nesting level) is significant.\r\n\r\nThis perhaps should generate a compiler error (mismatched indentation), or more usefully, enable a simple multi-line chaining syntax that makes jQuery readable ;)","id":2571261,"created_at":"2011-10-30T20:11:17Z"}}