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 }
Well, I'm still hopeful Larry will approve superpositions. In which case,
since types in Perl 6 are first-class, you would be able to write
the same thing something like:
class Foo {
attr any(str,int) $bar;
method SETUP(any(str,int) $newBar) {
On Thu, 15 Aug 2002, Deven T. Corzine wrote:
On Thu, 15 Aug 2002, Larry Wall wrote:
On Thu, 15 Aug 2002, Deven T. Corzine wrote:
: I've got another idea. How about using a copy-restore technique?
I suspect that would make Perl 6's sub calls even slower than Perl 5's.
Yes and no.
From: Larry Wall [EMAIL PROTECTED]
The default is pass-by-reference, but non-modifiable. If
there's a pass-by-value, it'll have to be specially requested
somehow.
This is a minimal difference from Perl 5, in which everything
was pass-by-reference, but modifiable. To get pass-by-value,
On 25 Jul 2002 [EMAIL PROTECTED] wrote:
Personally I don't like the C is Hashed::ByValues because it smacks
of spooky action at a distance; I much prefer my notion of C %h{*@x}
= 1. And in Perl 6 I have the horrible feeling that C %h = (*@x =
1) would expand to C %h = (1,2,3 = 1) ,
On 25 Jul 2002 [EMAIL PROTECTED] wrote:
Luke Palmer [EMAIL PROTECTED] writes:
On 25 Jul 2002 [EMAIL PROTECTED] wrote:
Personally I don't like the C is Hashed::ByValues because it smacks
of spooky action at a distance; I much prefer my notion of C %h{*@x}
= 1. And in Perl 6 I
On Tue, 16 Jul 2002, Brent Dax wrote:
I was reading through the Monastery, and I noticed a node (about the
line between what's considered Perl discussion and what's off-topic)
that had this regex in it:
m:iw/how [do[es]?|can] [I|one] tasks in non_perl_languages/
(Yes, people are
..., and someone pointed out that it had a problem
with code like { some_function_returning_a_hash() }. Should it give a
closure? Or a hash ref? ...
Oh, well now that it's stated this way... (something went wrong in my
brain when I read the actual message) It returns a closure
On Mon, 15 Jul 2002, Karl Glazebrook wrote:
In Apocalypse 2 Larry Wall wrote:
RFC 082: Arrays: Apply operators element-wise in a list context
APL, here we come... :-)
This is by far the most difficult of these RFCs to decide, so I'm going
to be doing a lot of thinking out loud
On Tue, 16 Jul 2002, Deborah Ariel Pickett wrote:
I still have my vote on %() as a hash constructor in addition to {}. :)
The problem I see with that is that % as a prefix implies a
*dereferencing*, though years of Perl5 conditioning like this:
%{ $mumble } = return_a_hash();
For anyone interested,
http://fibonaci.babylonia.flatirons.org/perl6.vim
contains a fairly complete (yet buggy, I'm sure) vim highlighting file for
Perl 6. I sure hope I didn't already post this :(... if so, sorry.
And definitely tell me where there's bugs or when I'm missing
On Sun, 7 Jul 2002, Bill Atkins wrote:
1. Perl6 should include a has and have keyword to set properties
more clearly:
Already been over this. Answer was no for some reason.
my $var has Found;
See, then you need a direct object. IWhat is it that C$var has found? :)
(sortof) Seriously, we
case2 - hyperoperator :
my $result = 0;
for ($a,$b,$c) {
if ($x == $_) { $result =1; last}
}
Not correct. The second case is the same as:
($x == $a, $x == $b, $x == $c)
which reduces in effect to:
$x == $c
Hold on---something's awry here. I thought C
On Tue, 2 Jul 2002, Michael G Schwern wrote:
On Fri, Jun 28, 2002 at 01:21:50PM -0700, Erik Steven Harrison wrote:
Over on Perlmonks someone was asking about Perl 6's ability to have named
argument passing. He also asked about the Jensen Machine and Ruby iterators.
Now, just being on this
On 15 Jun 2002, Alberto Manuel Brandão Simões wrote:
If spaces delimit tokens,
/abc* def/ means in perl5
/abc*def/
or /(?:abc)*def/ ?
Thanks
Alberto
The former.
Now, could you just do
rule leftop ($leftop, $op) {
$leftop [$op $leftop]*
}
rule leftop ($leftop, $op, $rightop) {
$leftop [$op $rightop]*
}
I should hope that rules can take multiple arguments. Here's something
that made me wonder, though: the
On Sun, 16 Jun 2002, Michael G Schwern wrote:
On Sat, Jun 15, 2002 at 10:35:48PM -0400, John Siracusa wrote:
Once nice thing about Java is the class naming convention that lets
individual companies (or even individuals, I guess) do custom development
that they can safely integrate with
I'm still unclear as to how you implement lex-like longest token rule with
P6 regexes. If the | operator grabs the first one it matches, how do I
match bacamus out of this?:
bacamus =~ / b.*a | b.*s /
Luke
I figured that (I actually did it, in a less-pretty form, in my early
Perl days when I wrote a syntax highlighter for my website). So there's
no elegant way the new regexes support it? That's a shame.
But I see now how state objects are a very cool idea.
Oh, and I'd just thought I'd let
I came across this problem when writing the vim syntax file:
How can we tell the difference between these?:
m:option(pattern)
m:option(argument)/pattern/
Luke
Dave Storrs wrote:
Can we please have a 'reverse x' modifier that means treat whitespace as
literals? Yes, we are living in a Unicode world now and your data could
/FATAL ERROR\:Process (\d+) received signal\: (\d+)/
I don't see how this example is nearly as flexible as
Note: My answers are non-authoritative. Don't trust me.
Can we please have a 'reverse x' modifier that means treat whitespace as
literals? Yes, we are living in a Unicode world now and your data could
theoretically be coming in from a different character set than expected.
But there are
The most serious objection to this was 'well, use modules for matching *ml -
which simply points out that the current incarnation of perl6 regex doesn'
t handle a very large class of matching problems very well.
The modules use regexes. They just spend more time on them and make them
better
On Fri, 7 Jun 2002, John Siracusa wrote:
On 6/7/02 4:48 PM, Luke Palmer wrote:
rule tag($name) {:w \ $name %opts:=[ (\S+)=(\S+) ]* \ }
Then, you can match an img tag with:
/ tag 'img' /
See, isn't that great?
Don't you mean, see, isn't that massively over-simplified
I just read through A5 (wow, that's long), and I agree with most of it.
Some of it's really cool. Here's what makes me uneasy: The fact that a
grammar rule auto-captures into a variable of its name.
Is this efficient? If I'm writing a syntax-directed translator, I usually
don't need to
Hmm... I like it. It took me a good 6 months before I learned how to use
CPAN. I don't see how your proposal is that different from:
alias cpan='perl -MCPAN -e shell'
But I get the idea. Someone (well, you've inspired me now, so I) could
write a perl5 equivilent, because command line is
On Tue, 28 May 2002, Glenn Linderman wrote:
with reads very nicely, but we already have a perl6 precedent,
perhaps... how about reusing when as the method name for currying?
This may not curry favor with Damian, but I suggest
my half = div.when(y = 2);
would declare the subroutine
I hate to solicit, but I have a favor to ask someone who is willing. I
would very much enjoy attending the O'reilly Open Source convention,
particularly the Perl conference; however, I am less that wealthy (seeing
as how I'm only 17). Would someone extremely generous be willing to donate
any
The rest of this message assumes that the answer to A is run time error.
I'm not sure that's correct. Might just be a runtime warning,
I would assume not. How can we optimize if we just make it a warning?
On Wed, 22 May 2002, Chris Angell wrote:
Everyone,
Please correct me if I am emailing the wrong address/list. Thanks.
Well, in general, you are mailing the wrong list; however, we do know a
lot of perl 5, so you'll get your question answered :) (This is the Perl
6 list, used for
I'm sort of side-tracking from the trend of discussions, but I was just
thinking that I always found it annoying how you had to double backslashes
in single-quoted strings. I like the bash's behavior with regard to this
much better... I mean, the whole idea behind single-quoted strings is
On 16 May 2002, Aaron Sherman wrote:
On Thu, 2002-05-16 at 16:13, David Whipp wrote:
Aaron Sherman [mailto:[EMAIL PROTECTED]] wrote:
You might not be able to REASONABLY get a length, so you return
undef. In your documentation, you advise users not to take the length,
but just dive
It seems something messed up while I tried to send this earlier. If this
is essentially a duplicate, ignore it.
I've always liked how VB allowed you to do instance methods. They allow
for more elegant callbacks, and more structure if callbacks are
complicated. Will Perl6 allow this? (Perl5
Oh. Sorry. I suppose there was no discussion because there were no
objections. I support it strongly. But everyone's already heard my
opinion, and my opinion, and my opinion about it, so I'll be quiet now.
Luke
On 6 May 2002, Aaron Sherman wrote:
It's odd, folks are still talking about the
On Thu, 2 May 2002, Jim Cromie wrote:
with p5, Ive often written
eval {} or carp $ blah;
it seems to work, and it reads nicer (to my eye) than
eval {}; if ($) {}
but I surmise that it works cuz the return-value from the block is non-zero,
for successful eval, and 0 or undef when
On Tue, 30 Apr 2002, Miko O'Sullivan wrote:
Damian, now having terrible visions of someone suggesting Celswhen ;-)
Then may I also give you nightmares on: elsdo, elsdont, elsgrep, elstry ...
Ooh! Why don't we have a dont command! With several variants:
dont FILE
dont BLOCK
On Tue, 30 Apr 2002, Trey Harris wrote:
Why not allow Celse if while still allowing Celsif as a synonym,
preserving backwards compatibility while still allowing all these weird
and varied constructs people seem to have use for?
Backwards compatability is pretty much a lost cause for Perl 6.
On Tue, 30 Apr 2002, Jim Cromie wrote:
so, assuming we have;
print 'you gave me: wordlist = ';# single quote - no interpolation
for words - $it {
print;
FIRST { print '(' }# provisionally
NEXT { print ',' }
LAST {print ');' }
}
# and maybe
else {
print
See above.
Two issues spring to mind:
1) Do we have a reality check on why this syntax is needed? I agree it's
cool idea, but can anyone name a real-world scenario where it would be
useful? Can we do things just bcause they're cool? That approach didn't
work too well for me as
So, the answer to your question is: yes, I do propose that there should
be an elsif, elsloop and elsfor. That's it. Three words, not an
expansive list of ever-more-complex words.
Oh! I have an idea! Why don't we make the lexer just realize a prefix
els on any operator. Then you could do Cif
On Fri, 26 Apr 2002, Allison Randal wrote:
Besides, I would expect an Celsfor to actually be a loop of it's own,
on the principle of elsif = else + if so elsfor = else + for.
So, you're suggesting we add Celsunless then? Just because it's
possible doesn't mean it's necessary.
Luke
foreach my $var (arr) { ... }
You mean
foreach arr - $var {...}
before { ... } # run before first iteration, only if there is at
least one iteration
after { ... } # run after last iteration, only if there is at least
one iteration
noloop { ...
# =~ $re =~ /$re/ ouch?
I don't see the win.
Naturally =~ $re is a bit cleaner, but we can't do that because =~ is
smart match, not regex match.
# (?=...) before: ...
# (?!...) !before: ...
# (?=...)after: ...
# (?!...)
On Wed, 24 Apr 2002, Iain Truskett wrote:
* Larry Wall ([EMAIL PROTECTED]) [23 Apr 2002 11:56]:
[...]
* Parens always capture.
Maybe I missed something in the rest of the details, but is anything
going to replace non-capturing parens? It's just that I do find them
quite useful.
(?=...) before: ...
(?!...) !before: ...
(?=...) after: ...
(?!...) !after: ...
(?...) grab: ...
Yummy :)
I'd say this is about perfect. The look(ahead|behind)s, er,
look:ahead|behinds are used seldom enough that this is
On Fri, 19 Apr 2002, Daniel S. Wilkerson wrote:
Please don't use 'but' to associate runtime properties to things.
Please call it 'has'.
How about both?
Luke
On Sat, 20 Apr 2002, Daniel S. Wilkerson wrote:
Everyone I've ever talked to about it agrees that defining things to be a
negative is just a bad idea. Consider:
if (gronk) do_this();
else do_that();
versus
if (not_gronk) do_that();
else do_this();
But look how well Cunless reads
Now, I love that the for loop can do both of these things, but the subtlety
of the difference in syntax is likely, IMO, to lead to very difficult-
to-find bugs. It's very easy to miss that I've used a comma when I meant to
use a semicolon, and vice versa. And what's the mnemonic again?
Well,
On Mon, 15 Apr 2002, Damian Conway wrote:
More interestingly, it may also be that, by default, the Coperator:{} (i.e.
hash-look-up) method of a class invokes the accessor of the same name as the
key, so that:
I'm a tad bit confused on the grounds of classes. Are we allowed to:
%fred = new
There'd be an interaction between is topic_preserving, default parameter
values, and explicit parameter values which should be clarified. Now I
understand why someone suggested using //= $_ instead of is
topic_preserving, somewhere along the line. Clearly if the user
supplies the
On Fri, 12 Apr 2002, Trey Harris wrote:
I think I've missed something, even after poring over the archives for
some hours looking for the answer. How does one write defaulting
subroutines a la builtins like print() and chomp()? Assume the code:
for {
printRec;
}
printRec
On Fri, Apr 12, 2002 at 04:42:07PM +0100, Piers Cawley wrote:
[EMAIL PROTECTED] writes:
Why isn't
if %foo {key} {print Hello 1}
equivalent with the perl5 syntax:
if (%foo) {key} {print Hello 1}
Which keyword is it expecting?
Keyword /els(e|if)/, or end of line, or
On Fri, 12 Apr 2002, Miko O'Sullivan wrote:
SUMMARY
A way to declare public names for params irrelevant to the internal variable
names:
sub load_data (-filename $filename_tainted ; 'version' 'ver'
$version_input / /= 1) {...}
I like it. It's clean (doesn't introduce any wierd
class myobj {
...
int a,b,c;
myobj(int aa, int bb, int cc) :
a(aa), b(bb), c(cc) const {}
...
};
Ummm no. Straight from Bjarne: You can't have a const constructor. You
just do what you did without
$.foo
It's already defined as an instance variable.
I don't think I like that. Instance variables are far more common that
class variables, so why not just $foo, and you could use a compile-time
property for class variables. Like Cis private as discussed. That or
Cis static. I
Ah, but I think the mnemonic value of the '.' more than earns its keep
here. Cour $foo is private is doing a slightly different job
anyway. And instance variables are *not* the same as 'normal'
variables, they hang off a different symbol table (or syte, to use
Damian's oh so clever term from
On Thu, 11 Apr 2002, Piers Cawley wrote:
Miko O'Sullivan [EMAIL PROTECTED] writes:
The current plans indicate that a subroutine's params should be defaulted
like this:
sub load_data ($filename ; $version / /= 1) {...}
(The space between / and / is on purpose, my emailer has
If the new, spiffy features of Perl6 are out of my reach that 60-80% of
the time, and I have to use perl5compat -nle ..., then the usefulness
of this new language will be largely lost on me.
I'm not sure I follow. What hypothetical features are you talking about
here? From what I've seen,
As to the inspring issue about using [] for hashes, I say go for it if
(and only if) it is a signifigant improvement for the parser.
I would imagine it's not. The braces are one of the things that make Perl
feel like Perl. My original post that inspired this gigantic discussion
was simply
On 4 Apr 2002, Aaron Sherman wrote:
On Thu, 2002-04-04 at 11:09, Luke Palmer wrote:
On Thu, 4 Apr 2002, James Ryley wrote:
How 'bout:
$foo = 'def';
$bar = 'ghi';
$y = 'abc$foo$bar';
$z = eval qq{$y};
Of course, for security and correctness reasons, you'd probably want
Just some thoughts in case you assumed people would only us Perl for
good.
$_='opcpez/xsjuft/qzax/,kvtu/gps/hppe!'
;szaxfsmyb-z,/!a-y !-print;
By ultimate control, I meant that if you have an interpolate command,
you can then do whatever you want at each stage. You could do:
$z = interpolate interpolate $y;
Good point. Well, we were brainstorming macros for a reason ;). But an
efficient version would be nice, I suppose.
You can do anything you like if you mess with the parser. Changing
the rules for recognizing an identifier would be trivial.
Does this refer to messing with the parser... compile time (that is, when
Perl compiles, not when Perl is compiled)? Or are you actually talking
about screwing with
On Fri, 5 Apr 2002 [EMAIL PROTECTED] wrote:
Does one of these items not belong?
From Exegesis 4:
This new turbo-charged 'smart match' operator will also work on arrays, hashes and
lists:
if @array =~ $elem {...}# true if @array contains $elem
if $key =~ %hash
On Thu, 4 Apr 2002, James Ryley wrote:
Hi,
I was wondering if anything ever became of the comments at
http:[EMAIL PROTECTED]/msg00318.html?
I have an application that would benefit from double interpolation. Of
course I can work around it, but double interpolation would be so much
On Wed, Apr 03, 2002 at 12:41:13PM -0500, John Siracusa wrote:
Reading EX4 and seeing those place-holder variables made me wonder what
Where is EX4? It's not at perl.org... so... ??
Larry has said very clearly that in Perl 6 there are no magical lexical scopes.
That is, variables declared in a Cloop control aren't magically in the
following block.
However, I don't agree with him. It may be more intuitive to newcomers,
but it is a common programming idiom that is used a
{
my subs;
loop (my $x = 0; $x 10; $x++) {
push subs, { $^a + $x };
}
$x--;
# ...
}
This certainly does *not* DWIM in the current thought. And the silence
would be much more confusing than a simple syntax error the traditional
way with
So, does the new =~ commute now, except for regexps; i.e.
$a =~ $b
is the same as
$b =~ $a
unless one or both are regexps?
Additionally, can you chain statement modifiers?
do_this() if $a unless $b;
print for mylist if $debug;
or less efficiently,
print if $debug for mylist;
print $x,
If my proposal has a hidden agenda, it's that I want to show that
you can get a lot of the power we want without actually having to
embed arbitrary code.
In general, however, I think that embedding code in regexes is a *very*
good idea. Sure you can get a lot of power without it, but it is
Too late. I'm going there... :)
Good for you. I was hoping transformations could make it :)
Here's something I was wondering. Say you wanted to write a pow() macro
(from a previous example) that would forward to C's pow() unless the
exponent was an integer, in which case it would optimize to
How about we implement some way to peer into coderefs? Maybe just on the
top level, with attributes, or maybe a syntax tree (probably not).
Because here, what both arguments (in the discussion) are missing, is the
ability to look at their arguments' (the uh, ones you pass in) internal
On Mon, 18 Mar 2002, Jim Cromie wrote:
Rich Morin wrote:
At 11:24 PM -0500 3/6/02, Uri Guttman wrote:
qn would be just like qq but not allow any
direct hash interpolations (%foo or %foo{bar}). you can always get those
with $() if needed. this solves the common case with a
operators seem to be a contrived attempt at
being revolutionary, without providing much practicality.
Not to bash them or anything :-P
Luke Palmer,
[EMAIL PROTECTED]
901 - 974 of 974 matches
Mail list logo