Re: Discuss changing the behaviour of append()

new topic     » goto parent     » topic index » view thread      » older message » newer message

Derek,

What I was getting at is this (and we agree this is not about a processing error).

An argument could be made that:

  append(1,{})  -- {1,{}}  
  prepend(1,{}) -- {{},1}  

ought to be identical as {} is empty. (We assume the return value is a sequence).

i.e. it should not matter if you prepend or append an empty sequence you have added nothing.

Mathmatically this means: {} is the identify under append. which would mean:

{} append A   ==   A append {}  -- == equivalence 

I certainly could understand people reading things this way.

I know it doesn't fit with the mechanics of Eu.

Appending an empty slice might appear as an error.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu