`~!` as `.call(this)`
vendethiel opened this issue · 7 comments
vendethiel 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.)
satyr commented
Desugaring to what, a.b.~()
? Doesn't look right as we don't allow a.b.()
.
vendethiel 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)
satyr commented
Note that a.b.~(c)
is already taken.
vendethiel commented
Ah, indeed, a.(b)
is taken. My bad, I didn't even thought about that. Not sure what then.
vendethiel commented
related : gkz/LiveScript#249, proposing postfix @
redexp commented
how about this?
a..(1) # a.call(this, 1)
redexp commented
and extend a...
with params
a...([a, b]) # a.apply(this, [a, b])
a...(b) # a.apply(this, b)