class P
constructor: ( @x, @y )->
p = new P 1, 2
args = [ 1, 2 ]
a = 1
b = 2
###call function immediately
do ( a, b )->123
# equivalent to
(( a, b )->123)(a, b)
# works with complex variables or constants as well
do ( a = args[0], b = 5 )->123
# eq
(( a, b )->123)(args[0], 5)
###apply arguments
a.b args...
# eq
a.b.apply a,args
# especially useful with object creation
a = new A args...
# alternative is either manually unrolling array
a = new A args.a, args.b
# or writting long piece of complicated code
a = do ( A, args, ctor=-> )->
ctor:: = A::
child = new ctor
result = A.apply child, args
if Object(result) is result then result else child