do
{a, b} = hello
{{a}, b, {c}} = hello
{ :hello, :world } = value
do
{ yes: no, thing } = world
{:a,:b,:c,:d} = yeah
{a} = one, two
{b}, c = one
{d}, e = one, two
x, {y} = one, two
xx, yy = 1, 2
{yy, xx} = {xx, yy}
{a, :b, c, :d, e, :f, g} = tbl
do :a, :b, c = tbl
do a, :b, :c = tbl, _
do :a, b, :c = tbl, _, _
---
do
futurists =
sculptor: "Umberto Boccioni"
painter: "Vladimir Burliuk"
poet:
name: "F.T. Marinetti"
address: {
"Via Roma 42R"
"Bellagio, Italy 22021"
}
do {poet: {:name, address: {street, city}}} = futurists
do {
:sculptor
:painter
poet:
:name
address:
* street
* city
} = futurists
do
a:
b: c
d: e = tb
do
a:
* b: c
* d: e
* f = tb
--
do
{ @world } = x
{ a.b, c.y, func!.z } = x
{ world: @world } = x
--
do
thing = {{1,2}, {3,4}}
for {x,y} in *thing
print x,y
--
do
with {a,b} = thing
print a, b
--
do
thing = nil
if {a} = thing
print a
else
print "nothing"
thang = {1,2}
if {a,b} = thang
print a,b
if {a,b} = thing
print a,b
elseif {c,d} = thang
print c,d
else
print "NO"
--
do
z = "yeah"
{a,b,c} = z
do
{a,b,c} = z
_ = (z) ->
{a,b,c} = z
do
z = "oo"
_ = (k) ->
{a,b,c} = z
do
{function:{end:endVar}} = thing
do
{if:{a,b,c}} = thing
do
{:a, :b} = {a: "Hello", b: "World"} if true
{days, hours, mins, secs} = [tonumber a for a in *{
string.match "1 2 3 4", "(.+)%s(.+)%s(.+)%s(.+)"
}]
{:one, :two, :three} = {w,true for w in foo\gmatch("%S+")}
{:a},b = a\if(123) + t, 123
do
{:name = "nameless", :job = "jobless"} = person
request = (url, options = {}) ->
{
:method = "GET"
:headers = {}
:parameters = {}
:payload = ""
:ok
:err
:final
} = options
res = makeRequest(url, method, parameters, payload, ok, err, final)
return res
{key1: {key2: value1 = 123}, :key3 = "abc"} = tb
{#: mt = {__index: {abc: 123}}, #: {:call# = (-> {}), :add#}} = tb
{x: {#: mtx = {}}, :y, z: zItem, :index# = -> nil} = tb
{#: {func: a.b(-> 123).c = item?.defVal}} = tb
do
{#: mt = {}, sub#: subFunc} = tb.x
do
{x: {#: mt = {}, sub#: subFunc}} = tb
do
{a = 1, b = 2, c: {d.e = 3}} = tb
for {left = "null", right = false} in *tuples
print left, right
do
{_, a, _, b} = tb -- list placeholder
do
{x: a.b = 1, y: a.c = 2} = x.x.x