我不确定下面的代码片段到底发生了什么。
>> a, b = ["ho", "hey"]
=> ["ho", "hey"]
>> a
=> "ho"
>> b
=> "hey"
>> c, d = "foo", "bar"
=> ["foo", "bar"]
>> c
=> "foo"
>> d
=> "bar"
>> a, b = ["blerg"], ["baz"]
=> [["blerg"], ["baz"]]
>> a
=> ["blerg"]
>> b
=> ["baz"]
为什么第 1 行不返回a => ["ho"]
?
a, b = ["ho", "hey"]
那么在幕后,这三个赋值( , c, d = "foo", "bar"
, a, b = ["blerg"], ["baz"]
)有什么区别呢?