Re: Discuss changing the behaviour of append()

new topic     » goto parent     » topic index » view thread      » older message » newer message
ArthurCrump said...
ryanj said...

Why not just use & then? What's the advantage of append(), anyway? I don't think i ever use it.

a = {1,2} & {3,4} 
-- and 
b = append({1,2},{3,4}) 

give different results:

a is {1,2,3,4}

b is {1,2,{3,4}}

Arthur

But you can easily simulate the behavior of append like this:

a = {1,2} & {{3,4}} 
-- and 
b = append({1,2},{3,4}) 

It's a good way to make up for the lack of an append= operator:

a &= {{3,4}} 
-- and 
b = append(b,{3,4}) 
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu