Syntax of &-operator

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

-P873@KI

Hi Derek,

DP>I'm not sure what the issue is here?

As I said, I don't like the behaviour of "&". This seems strange to me:

> a & b = append({a}, b)

> a & b = append(a, b)

being valid at the same time!

> It could be coded like this:
>
> {a} & {b} & {c} & {d}

DP>or like this ...
DP>  {a,b,c,d}

Nope! That would eliminate the option of "&=".

DP>the "old" way? What is the "new" way then? How have things changed?

Replace "old" with "current". Then replace "new" with "an alternative", and 
you've got it! Things haven't changed, and they won't ever with so many 
programs and libraries up and running.

DP>Are you advocating that a new function be included in Euphoria called 
DP>'concat' and that it should work the same as '&' operation?

Not the same, of course (nothing would be gained by that!), and its name 
doesn't matter. In fact, it should be a single character like "@". Nobody 
*has* to use it but it would be faster by assuming operands to be *always* 
sequences. And debugging would be easier in many cases where "&" ignores 
the difference between atoms and sequences...

Lutz.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu