Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: We don't need a cat

by dingus (Friar)
on Dec 17, 2002 at 09:59 UTC ( #220482=note: print w/replies, xml ) Need Help??

in reply to We don't need a cat

We may not need a cat but we really do need an append (i.e the p6 equivalent of $string .= $appended_text) and if you have no cat operator then you can't have a nice append operator related to it. I suppose that if you rule that interpolation ("") is the way to go then you could go for "= but I think that would break many colouring editors not to mention cause a lot of people to get very confused.

Of course if you define cat as join('', list) then it might be reasonable to create an append($target, list) function but that does rather add to the verbiage AND change the way you look at the operation. To me, at least, opeators are cheap and quick functions are generally slower and more expensive. concatenate and append should IMO be looked on as cheap and quick because they are.

Another possibility that I just thought of while writing this is that append could be written using print $target list but that opens a whole can of mainainability worms as $target could either be a filehandle or a string and I see no easy way to make it clear which it is in a particular context.

PS For those who understand pantomime, does this thread sound a little familiar?


Enter any 47-digit prime number to continue.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://220482]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2023-03-28 17:44 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (68 votes). Check out past polls.