Re: tokenizer hints, supporting delimited identifiers or symbols

2006-02-07 Thread Larry Wall
On Tue, Feb 07, 2006 at 03:54:07PM -0800, Larry Wall wrote:
: On Tue, Feb 07, 2006 at 03:28:05PM -0800, Larry Wall wrote:
: : say $::;
: 
: Or you can use a symbolic ref with a constant string:
: 
: $::('x y');
: 
: The compiler knows it's a constant.  And it's even implemented in Pugs.

Hmm, except you can't yet use the $::('') form in a "my", of course.
Presumably we'll have to tell "my" to accept one or another of these
quoting forms to avoid people scattering BEGIN blocks all over just so
they can introduce funny symbols into their MY tables.  Arguably you
ought to be able to say things like

my $::('foo') = 1;
my $:: = 2;

when the name can be resolved at compile time.

Anyway, however it works out, my point is that we don't need to recruit
a new quoting delimiter for it.  I think ` can still be reserved for
user-defined quoting.

Larry


Re: tokenizer hints, supporting delimited identifiers or symbols

2006-02-07 Thread Larry Wall
On Wed, Feb 08, 2006 at 12:26:52AM +, Luke Palmer wrote:
: On 2/7/06, Larry Wall <[EMAIL PROTECTED]> wrote:
: > $MY::{'x y'}
: > $MY::  # same thing
: > MY::<$x y>  # same thing
: 
: Er, aren't we obscuring the meaning of <> a little bit here?   I would
: think that the following two things would be equivalent:
: 
: $My::
: $My::{'x','y'}

Er, yeah.  My bad.

Larry


Re: tokenizer hints, supporting delimited identifiers or symbols

2006-02-07 Thread Luke Palmer
On 2/7/06, Larry Wall <[EMAIL PROTECTED]> wrote:
> $MY::{'x y'}
> $MY::  # same thing
> MY::<$x y>  # same thing

Er, aren't we obscuring the meaning of <> a little bit here?   I would
think that the following two things would be equivalent:

$My::
$My::{'x','y'}

Luke


Re: tokenizer hints, supporting delimited identifiers or symbols

2006-02-07 Thread Larry Wall
On Tue, Feb 07, 2006 at 03:49:36PM -0800, Darren Duncan wrote:
: At 3:28 PM -0800 2/7/06, Larry Wall wrote:
: >say $::;
: >Larry
: 
: My mistake.  When I read Synopsis 2 I had interpreted the text more 
: narrowly than what I was looking for.  So for now I retract my 
: request.

Well, it's not like any of the Synopses are the height of clarity.
But that's okay--we're applying XP to the design process in the hopes
that just roughing it in and patching things up as we go along is
faster than trying to specify it all in advance.  We're not trying
to design another Ada here...

But yes, there is a mechanism specified for doing hash lookups on
particular symbol tables, and the intent whenever hash subscripting
pops up is that it be orthogonal to whether you use .{'x y'} or ..

Larry


Re: tokenizer hints, supporting delimited identifiers or symbols

2006-02-07 Thread Larry Wall
On Tue, Feb 07, 2006 at 03:28:05PM -0800, Larry Wall wrote:
: say $::;

Or you can use a symbolic ref with a constant string:

$::('x y');

The compiler knows it's a constant.  And it's even implemented in Pugs.

But my thinking on the ::<> form is that it derives from the symbol
table as hash forms:

$MY::{'x y'}
$MY::  # same thing
MY::<$x y>  # same thing

$GLOBAL::{'x y'}
$GLOBAL::  # same thing
GLOBAL::<$x y>  # same thing

but I was assuming some particular symbol table would be supplied if you
just specified a null symbol table, MY maybe.  If not, then you'd have
to say

$MY::

or use the symblic ref form.

Or I suppose the null symbol table could mean to search each symbol
table in the same order you would for a bare $foo.  In other words,
there would be no difference between $foo and $:: and ::<$foo>
(except you can't interpolate the last one in a string directly).

Larry


Re: tokenizer hints, supporting delimited identifiers or symbols

2006-02-07 Thread Darren Duncan

At 3:28 PM -0800 2/7/06, Larry Wall wrote:

say $::;
Larry


My mistake.  When I read Synopsis 2 I had interpreted the text more 
narrowly than what I was looking for.  So for now I retract my 
request.


Pugs still doesn't implement what you indicated though, from my 
testing, so I think I'll have to check that a test for the feature 
exists, and add one if not.


-- Darren Duncan


Re: tokenizer hints, supporting delimited identifiers or symbols

2006-02-07 Thread Larry Wall
say $::;

Larry