Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Semantics of vector operations
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Larry Wall  
View profile  
 More options Jan 23 2004, 11:48 pm
Newsgroups: perl.perl6.language
From: la...@wall.org (Larry Wall)
Date: Fri, 23 Jan 2004 20:09:48 -0800
Local: Fri, Jan 23 2004 11:09 pm
Subject: Re: Semantics of vector operations
On Fri, Jan 23, 2004 at 07:53:49PM -0800, Jonathan Lang wrote:
: Dave Whipp wrote:

: > But, presumably, you could write a macro that has a whitespace-eater
: > encoded
: > somehow. That is,
: >
: > macro leach() { chomp_trailing_whitespace; return "?" }
: > macro reach () { chomp_leading_whitespace; return "?" }
: >
: > then the macro magic would expand "leach eq reach" as "?eq?" (which,
: > hopefully, it then re-parses as a single token^Woperator). This doesn't
: > solve the generalized problem of disambiguating, though I could see a
: > "_" operator defined as a macro that eats all its surrounding
: > whitespace.
:
: ...making it a "nospace" character (or is that a "no_space" character?
: Same thing?)
:
: You wouldn't be able to say "chomp_trailing_whitespace" if you did this,
: though.  

I doubt a _ macro would fire off in the middle of an identifier
like that.  Once a grammar rule has snarfed a construct such as an
identifier, it generally rules out other interpretations of the
construct.  There are all sorts of such context sensitivities in
Perl's grammar.  A bareword is not a bareword if there's a "sub"
in front of it, or a "$", "@", etc.

Now, if we get into token-gluing scenarios, these sorts of things
come into play.  But I think the _ proposal was for whitespace eating
without token gluing.

Larry


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.