Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Re: Re: Re: Re: Re: NO PERL 6

by theorbtwo (Prior)
on Dec 10, 2002 at 06:18 UTC ( #218740=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: Re: Re: Re: NO PERL 6
in thread NO PERL 6

Larry recently addressed both these points. +, he thinks, would be a bad choice for concatination. I note even VB, which does use + as it's concat operator most of the time, has an & operator, for where it's unclear if you want to add, or simply concatinate two strings that happen to be numeric. Larry s Post

As far as using abjunctation as the concat operator (IE the no-operator operator), that "can never happen in perl", since there are quite a number of things that have different meaning if perl is expecting a TERM or an OP, and will only be more in perl6. I can't seem to find Larry's post on this, but for example, << as here-doc (term) vs. shift-left (op).


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).


Comment on Re: Re: Re: Re: Re: Re: NO PERL 6
Re: Re: Re: Re: Re: Re: Re: NO PERL 6
by BrowserUk (Pope) on Dec 10, 2002 at 13:56 UTC

    Of course you (and LW) are right. I can see the ambiguity in $ip = '192' + '.10' + '.10' + '.1'; for example.

    The problem with abuttment is less clear to me. With a here-doc, doesn't the '<<' need to be preceded by '=' and followed by ';' which distinguishes

    $var =<<"here"; from $var <<= 2;?

    I did spend quite a while trying to find syntactic problems with abuttment of vars and/or string for catenation, and failed. The only place where I saw a particular problem was with print STDERR "string" ; versus print "string" "string"; where the (to me) strange syntactic choice of not just not requiring a comma after the HANDLE, but actually requiring it NOT to be there, causes a problem.

    I guess I should read some more stuff by those that have been looking at the problem for a while rather than trying to logic it out for myself.


    Okay you lot, get your wings on the left, halos on the right. It's one size fits all, and "No!", you can't have a different color.
    Pick up your cloud down the end and "Yes" if you get allocated a grey one they are a bit damp under foot, but someone has to get them.
    Get used to the wings fast cos its an 8 hour day...unless the Govenor calls for a cyclone or hurricane, in which case 16 hour shifts are mandatory.
    Just be grateful that you arrived just as the tornado season finished. Them buggers are real work.

      One example that comes to mind: "nosehair" << 10;
      Will that be a left shift or a concatenation of a string with a here doc?

      Makeshifts last the longest.

        Catenation with a here-doc obviously:^) (since left-shifting a string isn't legal?);

        "10" << 10; this is the stuff 10

        Would be ambiguous, were it not that then you have a constant in a void context, which is rarely ever useful.

        Once you remove the void context as in

        my $var = "10" <<10; this is the stuff 10

        it would be ambiguous, but I think that being able to use a number as a here-doc delimiter is as bad as the long deprecated (and now illegal) practice of using a space for that purpose. I always assumed (without ever having had cause to actually check until now) that here-doc delimiters followed the same naming rules as labels. I now see that is untrue, but I can't think of a good reason why it shouldn't be made so. That would remove that ambiguity.

        At the end of the day, personally, I'll probably be quite happy to accept '_' or '~' (or any other syntax the powers that be decide upon) for catenation, but 'simple' abuttment seems almost logical (to me), and I was exploring the idea to see what effect it might have on the rest of the current perl syntax. I don't yet see anything that would be a problem that I wouldn't be happy to change to accomodate it, but I don't use most of the more esoteric constructs that it might conflict with, and have relatively little history with the language which means that I am open to possible changes that those with ingrained habits would rail against.

        I have no expectation that any of my meanderings are going to influence anything one way or the other, but when I see something that raises a queston in my mind that I can't resolve by a little playing around or research, I am of the habit of asking the question of those with better experience than I. That's my prefered way to assimilate new knowledge. It seems a shame that in some quarters at least, this practice is seen as bad. Not you I might add.


        Okay you lot, get your wings on the left, halos on the right. It's one size fits all, and "No!", you can't have a different color.
        Pick up your cloud down the end and "Yes" if you get allocated a grey one they are a bit damp under foot, but someone has to get them.
        Get used to the wings fast cos its an 8 hour day...unless the Govenor calls for a cyclone or hurricane, in which case 16 hour shifts are mandatory.
        Just be grateful that you arrived just as the tornado season finished. Them buggers are real work.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2014-08-28 09:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (259 votes), past polls