On 10/07/2010 05:42 PM, Sorrell, Al wrote:
>
>> -----Original Message-----
> <snip>
>> At this point, it seems quite likely that the new syntax will be
>> identical to Perl named match variables $+{name} (if I am not mistaken,
>> Perl supports them since version 5.10).
>
> Would this require Perl 5.10 to run SEC or are you just using the same syntax
> convention?
No, definitely not. I intend to keep SEC fully workable over as many
platforms as possible. The problem is that many conservative UNIX
distributions are still using Perl 5.8, so having in SEC code something
which is present in Perl 5.10 only would become a huge issue.
What I had in mind is to use the same syntax convention -- but in the
case you have Perl 5.10, you would also be able to use its features. For
example, if you write '(?<NAME>pattern)' in Perl 5.10, it is like
writing '(pattern)' in an earlier version of Perl, but apart from
setting the $1 variable, Perl 5.10 also sets the variable $+{NAME} (an
element in the %+ hash, to be entirely precise).
Suppose that you have a construct like this in SEC:
pattern=(.+)
map=$1->mystring
which would take the $1 variable and assign its content to the variable
$+{mystring}, so that you can use both $1 and $+{mystring} in other
parts of the rule (like action list definitions).
However, if you have Perl 5.10 by coincidence, you could also write
pattern=(?<mystring>.+)
without setting 'mystring' with a separate statement, since this version
of Perl supports named match variables.
That's roughly the idea I have :)
kind regards,
risto
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Simple-evcorr-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users