On Wed 13 Sep, Bart Lateur wrote:
> On Tue, 12 Sep 2000 19:01:35 -0400, Mark-Jason Dominus wrote:
> 
> >I don't know what you mean, but you're mistaken, because it means to
> >interpolate @foo as in a double-quoted string.
> 
> Which is precisely the meaning he wants for it, with $" set to '|'.
> 
> I wonder if we're not trying too hard. What if, inside regexes, $" is
> always localized and set to '|'. What if we change the meaning of
> "\Q@foo" so it only metaquotes the contents of the array, not of the
> separator.
> 
>       @foo = ('a.b', 'a+b', 'a*b');
>       $" = '|';
>       print "\Q@foo";
> -->
>       a\.b\|a\+b\|a\*b
> 
> Hmm... We can't really use this result, can we?
> 

This is getting there, but not quite.  The problem is the order in which
the regex compiler performs the actions.  The expansion of @foo (and $bar)
currently occours BEFORE the regex is examined as a regex and before the
compiler looks at \Q etc.  This construct does not wrap the @foo in 
a set of brackets.

I have no special desire for one type of syntax or another so the
list expanson could be @foo or (?@foo).  What this exposes also is my
idea for idea (in RFC112) for regex asignment.  Both would suffer.

If we want to allow more facilities within regexes, the order of expansion
may need to be enhanced to allow the regex compiler to get in before
the handling of $s and @s.  [This is feasable].

As well as \Quoting an array I also think we should have the complementry
\Quoting of a scalar.

Richard

-- 

[EMAIL PROTECTED]

Reply via email to