Trey Harris wrote:
sub repeat is multi ($desc is valued(1), body) {
body(1);
}
sub repeat is multi ($desc is valued(0), body) {
}
sub repeat is multi ($desc is valued(['A'..'F']), body) {
die Can't repeat hexadecimally;
This is very nice.
Larry wrote:
sub while (test is rx/expr/, body);
or some such. That probably isn't sufficient to pick expr out of Perl's
grammar rather than the current lexical scope.
I love the idea, but the property name needs to be more expressive
(and Huffmanly longer). Maybe:
sub
Larry Wall wrote:
: In summary: assuming Perl 6 allows user-defined while-ish structures, how
: would it be done?
I think the secret is to allow easy attachment of regex rules to sub
and parameter declarations. There's little point in re-inventing
regex syntax using declarations. The
In a message dated Thu, 29 Aug 2002, Damian Conway writes:
And, of course, the Cis valued property would smart-match its value
against the corrresponding argument, so one could also code optimized
variants like:
sub repeat is multi ($desc is valued(1), body) {
body(1);
On Thu, 29 Aug 2002, Thomas A. Boyer wrote:
: Am I getting this straight?
As straight as any of us are getting it thus far. :-)
The process is intended to be convergent. That doesn't guarantee it
will converge, but that's the intention.
When I'm playing golf, I always expect to knock the
Sean O'Rourke wrote:
I hope this is wrong, because if not, it breaks this:
if 1 { do something }
foo $x;
in weird ways. Namely, it gets parsed as:
if(1, sub { do something }, foo($x));
which comes out as wrong number of arguments to `if', which is just
strange.
Any
Damian Conway wrote:
Any subroutine/function like Cif that has a signature (parameter list)
that ends in a Csub argument can be parsed without the trailing
semicolon. So Cif's signature is:
sub if (bool $condition, block);
So what does the signature for Cwhile look like? I've been
Thom Boyer [mailto:[EMAIL PROTECTED]] wrote:
sub while (bool $test, body);
sub while (test, body);
But neither of these really works.
The first would imply that the test is evaluated only once
(and that once is
before 'sub while' is even called). That'd be useless.
It
On Wed, 28 Aug 2002, Thom Boyer wrote:
: Damian Conway wrote:
: Any subroutine/function like Cif that has a signature (parameter list)
: that ends in a Csub argument can be parsed without the trailing
: semicolon. So Cif's signature is:
:
: sub if (bool $condition, block);
:
: So
On Wed, 28 Aug 2002, Damian Conway wrote:
Any subroutine/function like Cif that has a signature (parameter list)
that ends in a Csub argument can be parsed without the trailing
semicolon. So Cif's signature is:
sub if (bool $condition, block);
So the trailing semicolon isn't
Second, is there a prototype-way to specify the arguments to for
(specifically, the first un-parentesized multidimensional array argument)?
In other words, is that kind of signature expected to be used often enough
to justify not forcing people to explicitly extend the grammar?
If you're
On Wed, 28 Aug 2002, Luke Palmer wrote:
Second, is there a prototype-way to specify the arguments to for
(specifically, the first un-parentesized multidimensional array argument)?
In other words, is that kind of signature expected to be used often enough
to justify not forcing people to
On Wed, 28 Aug 2002, Sean O'Rourke wrote:
: Being able to specify fixed arguments after a splat looks illegal, or at
: least immoral. It opens the door to backtracking in argument parsing,
: e.g.:
:
: sub foo (*@args, func, *@more_args, $arg, func) { ... }
:
: Saying specifically a list
On 27 Aug 2002, Piers Cawley wrote:
Damian Conway [EMAIL PROTECTED] writes:
Debbie Pickett asked:
(Offtopic: can I say:
$c = - $xyz { mumble }
Yes. Though you need a semicolon at the end unless its the last
statement in a block.
Um... when did that rule come in? I thought a
On Tue, 27 Aug 2002, Luke Palmer wrote:
On 27 Aug 2002, Piers Cawley wrote:
Damian Conway [EMAIL PROTECTED] writes:
Debbie Pickett asked:
(Offtopic: can I say:
$c = - $xyz { mumble }
Yes. Though you need a semicolon at the end unless its the last
statement in a block.
On Tue, 27 Aug 2002, Sean O'Rourke wrote:
On Tue, 27 Aug 2002, Luke Palmer wrote:
On 27 Aug 2002, Piers Cawley wrote:
Damian Conway [EMAIL PROTECTED] writes:
Debbie Pickett asked:
(Offtopic: can I say:
$c = - $xyz { mumble }
Yes. Though you need a semicolon at the
In a message dated Tue, 27 Aug 2002, Luke Palmer writes:
No, it's right. But it doesn't break that. In the grammar, C-like
languages include (something like):
statement: expression ';'
statement: if expression block
So an if _statement_ terminates itself. The } on a line of
Debbie Pickett wrote:
So . . correct me if I'm wrong . . .
Crule allows us to define both named and anonymous rules,
Yes.
depending on context.
Depending on whether or not you provide a name.
Crx allows us to define only anonymous rules.
Yes. And they can't take parameter lists.
The only extra piece of syntactic sugar that Crx is giving us over
Crule[*] is the ability to have arbitrary delimiters.
Not quite arbitrary. Alphanumerics aren't allowed, nor are colon or
parens.
Of course. I didn't want to poison my entire sentence with footnotes
for the obvious
Not quite arbitrary. Alphanumerics aren't allowed, nor are colon or
parens.
Of course. I didn't want to poison my entire sentence with footnotes
for the obvious exceptions.
Yes. It wasn't directed at you particularly, but at those for whom the
exception isn't obvious. The problem being, of
The only extra piece of syntactic sugar that Crx is giving us over
Crule[*] is the ability to have arbitrary delimiters.
Not quite arbitrary. Alphanumerics aren't allowed, nor are colon or
parens.
Aww, no alphanumerics anymore. That's too bad; it was so nice in poetry
to be able to
Luke Palmer wrote:
Hang on... I thought parens weren't allowed as delimiters. Or does that
not apply to rx()?
Well, yes, we *did* say that in A5 and E5.
But we were thinking of m// and s/// in particular and of patterns with
modifiers (which might take argument lists) in general.
For an
Glenn Linderman asked:
So one thing that bothers me in the whole discussion of rule vs rx
differences and similarities, is that there was a previous discussion
that said regular expression and regex should be deprecated terms
because the rules and patterns are no longer regular, but if rx
On Mon, 26 Aug 2002, Glenn Linderman wrote:
because the rules and patterns are no longer regular, but if rx isn't a
short form of regex, what is it a short form of?
It's a short form of r$x for some value of $x ;).
/s
On Mon, 26 Aug 2002, Glenn Linderman wrote:
: Damian Conway wrote:
: For an Crx without modifiers, (...) are certainly unambiguous as delimiters.
: So I think they should be allowed. Of course, it's Larry's call and he may
: well prefer the simplicity of a blanket prohibition.
:
: So one
Damian wrote:
Debbie Pickett asked:
So my question is: why two words for regular expressions, but only one
for subroutines? Are rule and rx just alternate spellings, much as
Perl5's for and foreach are? If so, why the two keywords?
If not, why not?
They are not quite synonyms. Crule
DAP == Deborah Ariel Pickett [EMAIL PROTECTED] writes:
DAP Crule allows us to define both named and anonymous rules, depending on
DAP context. Crx allows us to define only anonymous rules. Crule is
DAP the more general one, and you can use it exclusively if that's what you
DAP feel
Note! Some of the following is hypothetical, not strictly based on Apocalypses
and such. Now that your brain is in the right mode:
Uri wrote:
DAP == Deborah Ariel Pickett [EMAIL PROTECTED] writes:
DAP Crule allows us to define both named and anonymous rules, depending on
DAP context.
Deborah Ariel Pickett wrote:
I'm imagining a table something like this:
Subroutine Pattern matching
Default { code } / pattern /
delimiter
Declare named
Funny you should mention that. This brings up something that I was
afraid to mention before, lest it be regarded as too weird. There isn't
any strong syntactic reason for subs to be delimited with just braces either.[*]
Sure, there's a historical Perl precedent, and I'd probably be forced
On Sun, 25 Aug 2002, Glenn Linderman wrote:
Deborah Ariel Pickett wrote:
I'm imagining a table something like this:
Subroutine Pattern matching
Default { code }
31 matches
Mail list logo