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]
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
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
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
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
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,
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 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
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
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,
$.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
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
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
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 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
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 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
(?=...) 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
# =~ $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.
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 { ...
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
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 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
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
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
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
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
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 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
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?
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
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
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
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
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
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
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
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
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
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 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
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
..., 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();
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
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
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 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.
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) {
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 }
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
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, 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
This is really the wrong place to be sending this. This is Perl 5 (or
maybe even Perl 4, which I don't know) code, and this is a list for
discussing the design of Perl 6. A good place to send this would
probably be [EMAIL PROTECTED]
Good Luck,
Luke
On Wed, 28 Aug 2002, frank crowley
On Thu, 29 Aug 2002, Steffen Mueller wrote:
Nicholas Clark wrote:
On Thu, Aug 29, 2002 at 12:00:55AM +0300, Markus Laire wrote:
And I'm definitely going to try any future PerlGolf challenges also
in perl6.
Is it considered better if perl6 use more characters than perl5? (ie
implying
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
The ° character doesn't have any special meaning,
that's why I choosed it in the above example.
However, it also symbolizes a little capturing
and as it isn't filled,
it could really symbolize an uncapturing.
Interesting idea. I'm not sure if I agree with it yet. However, I don't
agree
Hmm... I think I'd rather see
my $foo is Bag = array.as('Bag');
The idea being that one could treat hashes and arrays as syntactic
vitamins meaning 'Dictionary' (to use the Smalltalk term) and
'OrderedCollection', but all Collections would implement an Cas
method allowing conversion
On Tue, 3 Sep 2002, Brent Dax wrote:
Damian Conway:
# Neither. You need:
#
# $roundor7 = rx /roundascii+[17]/
#
# That is: the union of the two character classes.
How can you be sure that roundascii is implemented as a character
class, as opposed to (say) an alternation?
Aaron Sherman wrote:
So, for example here are some translations of existing operators:
+ ={.count 0}
* ={1}
*?={1}?
8 ={.count == 8}# No optimization possible!
Could it be done this way?:
c:=(.)* ( c == 8 )
Surely inefficient, but it works
On 5 Sep 2002, Aaron Sherman wrote:
On Thu, 2002-09-05 at 01:47, Brent Dax wrote:
Aaron Sherman:
The one thing I notice all over the place is:
sub abs($num is int){ return $num=0 ?? $num :: -$num }
Another thing I'm not sure on... how do you force numeric, but not
integer
Answering to the best of my knowledge.
On Sat, 7 Sep 2002, Jonathan Scott Duff wrote:
Question #2:
Why are we storing the hypothetical's sigil in the match object?
I think it's to differentiate the different namespaces (scalar, array,
hash) within the match object's hash. Personally, I
On Fri, 6 Sep 2002, Mr. Nobody wrote:
While Apocolypse 5 raises some good points about problems with the old regex
syntax, its new syntax is actually worse than in perl 5. Most regexes, such
as this one to match a C float
/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/
would actually
Going back to patterns, this gives us an added bonus. It not only
explains the behavior of hypotheticals, but also of subexpression
placeholders, which are created when the pattern returns:
$self but lexicals(0=$self, 1= $self.{1}, 2= $self.{2}, etc...)
That yields the side
On Mon, 9 Sep 2002, Andrew Wilson wrote:
On Mon, Sep 09, 2002 at 02:14:25PM -0500, Me wrote:
Hence the introduction of let:
m/ { let $date := date } /
which makes (a symbol table like entry for) $date available
somewhere via the match object.
Somewhere? where it appears in
This is for everyone: EOA4
In Perl, this problem comes up most often when people say Why do I
have to put a semicolon after do {} or eval {} when it looks like a
complete statement?
Well, in Perl 6, you don't, if the final curly is on a line by itself.
That is, if you
Luke Palmer wrote:
[quote from A4]
To me, this looks like it has answers to all these questions.
Up to a point. Look at the discussion of given/when in the same
Apocalypse. Here's some example code from A4:
given $! {
when Error::Overflow { ... }
when Error
On Thu, 12 Sep 2002, Ken Fox wrote:
Luke Palmer wrote:
This requires infinite lookahead to parse. Nobody likes infinite
lookahead grammars.
Perl already needs infinite lookahead. Anyways, most people
don't care whether a grammar is ambiguous or not -- if we did,
natural human
BTW, there are some parser generators that handle
ambiguous grammars -- they either support backtracking,
infinite lookahead, or simultaneously parse all possible
derivations. In the case of the simultaneous parse, they
can actually return multiple parse trees and let the
code generator
On Wed, 18 Sep 2002, Josh Jore wrote:
On Wed, 18 Sep 2002, Damian Conway wrote:
Would it be correct for this to print 0? Would it be correct for this
to print 2?
my $n = 0;
aargh =~ /a* { $n++ } aargh/;
print $n;
Yes. ;-)
Wouldn't that print 2 if $n is lexical
I was just thinking that $((1,2,3)) is also the same as [1,2,3],
and shorter than scalar(1,2,3).
I wonder if you can't just use $(1, 2, 3) to the same effect.
I think you can. I was under the impression that the C comma was dying,
so that would have to make a list or err.
Also, I
On Fri, 20 Sep 2002, Chip Salzenberg wrote:
According to Luke Palmer:
I think to get Perl5 behavioueaur :), you do this:
my flatL = ( *(1a, 2a), *(1b, 2b) );
Geez, I hope not, because that would imply that in
my v = ( func() );
that func is called in a scalar context
On 21 Sep 2002, Smylers wrote:
Larry Wall wrote:
On 20 Sep 2002, Aaron Sherman wrote:
: Does that mean that I can't
:
: for $x - $_ {
: for $y - $z {
: print $_, $z\n;
: }
: }
:
: And expect to get different
On 21 Sep 2002, Smylers wrote:
Luke Palmer wrote:
my v = $( func() );
Would provide scalar context. But then assign it to a list...
In the course of reading that I developed a concern about memory usage
when trying to find the size of arrays. As I understand it the Perl 5
On Sun, 22 Sep 2002, Markus Laire wrote:
On Sat, Sep 21, 2002 at 11:36:49AM -0600, John Williams wrote:
On Sat, 21 Sep 2002, Jonathan Scott Duff wrote:
Anyway, (7) or (3+4) should yield a number, not a list, because
otherwise every math expression will break.
Why can't perl
1 - 100 of 974 matches
Mail list logo