satyr / coco

Unfancy CoffeeScript

Home Page:http://satyr.github.com/coco/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`~!` as `.call(this)`

vendethiel opened this issue · comments

commented

Pretty minor. Here ? (I'd like to avoid creating mess then "will get my hands dirty" 'cause what I did was pure crap)

a.b~! => a.b.call(this)

(since we already have ~ as bound access.)

Desugaring to what, a.b.~()? Doesn't look right as we don't allow a.b.().

commented

Even if it doesn't really make sense for a simple call (.()), that could go beyond !.
I don't really mind the syntax - I just chose that because that was composed of bound access and bang call.

a~(1) # a.call(this, 1)
a~! # a.call(this)
# but it doesn't look alike this :
a ... # a.apply(this, arguments)

Note that a.b.~(c) is already taken.

commented

Ah, indeed, a.(b) is taken. My bad, I didn't even thought about that. Not sure what then.

commented

related : gkz/LiveScript#249, proposing postfix @

how about this?

a..(1) # a.call(this, 1)

and extend a... with params

a...([a, b]) # a.apply(this, [a, b])
a...(b) # a.apply(this, b)