{"action":"opened","issue":{"url":"https://api.github.com/repos/gkz/LiveScript/issues/805","labels_url":"https://api.github.com/repos/gkz/LiveScript/issues/805/labels{/name}","comments_url":"https://api.github.com/repos/gkz/LiveScript/issues/805/comments","events_url":"https://api.github.com/repos/gkz/LiveScript/issues/805/events","html_url":"https://github.com/gkz/LiveScript/issues/805","id":125273344,"number":805,"title":"Operators as Functions vs. `this`","user":{"login":"summivox","id":1770521,"avatar_url":"https://avatars.githubusercontent.com/u/1770521?v=3","gravatar_id":"","url":"https://api.github.com/users/summivox","html_url":"https://github.com/summivox","followers_url":"https://api.github.com/users/summivox/followers","following_url":"https://api.github.com/users/summivox/following{/other_user}","gists_url":"https://api.github.com/users/summivox/gists{/gist_id}","starred_url":"https://api.github.com/users/summivox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/summivox/subscriptions","organizations_url":"https://api.github.com/users/summivox/orgs","repos_url":"https://api.github.com/users/summivox/repos","events_url":"https://api.github.com/users/summivox/events{/privacy}","received_events_url":"https://api.github.com/users/summivox/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-06T22:02:26Z","updated_at":"2016-01-06T22:02:26Z","closed_at":null,"body":"```livescript\r\no = a: 1, b: 2, f: -> <[a b]> .map (@.)\r\no.f!\r\n```\r\ncurrently compiles to:\r\n```javascript\r\nvar o;\r\no = {a: 1,b: 2, f: function(){\r\n  return ['a', 'b'].map(function(it){\r\n    return this[it];\r\n  });\r\n}};\r\no.f();\r\n```\r\n\r\nI believe a more useful semantics would be to implicitly bind `this`, as if I wrote:\r\n```livescript\r\no = a: 1, b: 2, f: -> <[a b]> .map ~> @[it]\r\no.f!\r\n```\r\nwhich compiles to:\r\n```javascript\r\nvar o;\r\no = {a: 1,b: 2, f: function(){\r\n  var this$ = this;\r\n  return ['a', 'b'].map(function(it){\r\n    return this$[it];\r\n  });\r\n}};\r\no.f();\r\n```\r\n\r\nIIRC there are other situations where some expression has this implicit `this` binding semantics -- it felt so natural I forgot which ;)"}}