Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Re: New String Concatenation In Perl 6?

by stefp (Vicar)
on Dec 04, 2002 at 08:49 UTC ( #217434=note: print w/replies, xml ) Need Help??

in reply to Re: New String Concatenation In Perl 6?
in thread New String Concatenation In Perl 6?

~ is the unary operator to force string context.
- is the binary operator to concatenate strings.

-- stefp

  • Comment on Re: Re: New String Concatenation In Perl 6?

Replies are listed 'Best First'.
Re: Re: Re: New String Concatenation In Perl 6?
by theorbtwo (Prior) on Dec 04, 2002 at 20:42 UTC

    ~ is both the unary string context forcing operator and the concatenate operator; - is still subtraction.

    Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).

      Sorry, I really meant underscore. Anyway, tilda is indeed discussed as a possible concatenation operator. It makes indeed sense to use the same sign for the unary conversion to string and the binary concatenation. Also the underscore was less than ideal because it is used for identifiers. So that meant that it had to be surrounded by space.

      There are very long threads in p6l about operators in general and concatenation in particular. Indeed, the status of underscore as concatenation character is contested and tilda seems the main contendant but that does not seem a done thing.

      -- stef

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2021-02-27 16:49 GMT
Find Nodes?
    Voting Booth?

    No recent polls found