Date: Thu, 12 Dec 2002 02:19:18 -0500
From: Dan Sugalski [EMAIL PROTECTED]
Since that may be either:
$foo = bar($x, $y), foo()
in which case it's in scalar context, or
$foo = bar($x, $y, foo())
in which case it's in list context (sort of)
The fun thing is that, potentially,
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Date: Wed, 11 Dec 2002 17:24:54 -0800
From: Dave Storrs [EMAIL PROTECTED]
Mail-Followup-To: [EMAIL PROTECTED] [EMAIL PROTECTED]
Content-Disposition: inline
X-SMTPD: qpsmtpd/0.20, http://develooper.com/code/qpsmtpd/
On Thu, Dec 12, 2002
Date: Thu, 12 Dec 2002 10:11:00 -0800
From: Michael Lazzaro [EMAIL PROTECTED]
On Wednesday, December 11, 2002, at 06:56 PM, Simon Cozens wrote:
[EMAIL PROTECTED] (Michael Lazzaro) writes:
Wel... yes and no. You can make the same argument for operators
upon scalars, for example,
Date: Wed, 11 Dec 2002 19:15:53 +1100
From: Damian Conway [EMAIL PROTECTED]
I suspect Cstates may be a method only, so that would be either:
my @foos = states $foos:;
or:
my @foos = $foos.states;
Though, I suppose we might argue that Cstates is as fundamental to Perl
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Date: Wed, 11 Dec 2002 19:21:35 -0500
From: John Siracusa [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
X-SMTPD: qpsmtpd/0.20, http://develooper.com/code/qpsmtpd/
On 12/11/02 6:16 PM, Damian Conway wrote:
There's no need for special
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
From: Dave Whipp [EMAIL PROTECTED]
Date: Wed, 11 Dec 2002 14:54:18 -0800
Organization: Fast-Chip inc.
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4920.2300
X-MimeOLE: Produced By Microsoft
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Date: Tue, 10 Dec 2002 21:07:34 -0500
From: Adam Turoff [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Content-Disposition: inline
X-SMTPD: qpsmtpd/0.20, http://develooper.com/code/qpsmtpd/
On Tue, Dec 10, 2002 at 03:38:58PM -0800, Rich Morin
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Date: Tue, 10 Dec 2002 15:38:58 -0800
From: Rich Morin [EMAIL PROTECTED]
X-SMTPD: qpsmtpd/0.20, http://develooper.com/code/qpsmtpd/
On occasion, I have found it useful to cobble up a little language
that allows me to generate a list of
Date: Sun, 8 Dec 2002 21:52:33 -0800
From: Dave Storrs [EMAIL PROTECTED]
On Sat, Dec 07, 2002 at 01:28:41PM +1100, Damian Conway wrote:
Dave Whipp wrote:
I notice everyone still want Int context for eval of the block:
Pease don't forget about hashes. Is there such a thing as
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Date: Mon, 9 Dec 2002 23:43:44 +
Cc: [EMAIL PROTECTED] [EMAIL PROTECTED]
Content-Disposition: inline
From: Nicholas Clark [EMAIL PROTECTED]
X-SMTPD: qpsmtpd/0.20, http://develooper.com/code/qpsmtpd/
On Sun, Dec 08, 2002 at
Date: Sun, 08 Dec 2002 19:10:30 +1100
From: Damian Conway [EMAIL PROTECTED]
There are actually four types of junction:
conjunction: all(@elements)
disjunction: any(@elements)
abjunction:one(@elements)
injunction: none(@elements)
Oh yeah...
represent
Date: Mon, 9 Dec 2002 06:00:40 +0100
From: =?iso-8859-1?Q?St=E9phane?= Payrard [EMAIL PROTECTED]
Damian:
so it's easy to build up more complex right-to-left pipelines, like:
(@foo, @bar) :=
part [/foo/, /bar/],
sort { $^b = $^a }
Note: this is back on-list.
From: Me [EMAIL PROTECTED]
Date: Mon, 9 Dec 2002 01:27:55 -0600
[regarding - as a left-to-right pipe-like operator]
Please do. As in, please point out on list that
'-' is already established as a left-to-right
flow/assignment operator so why not consider
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Sender: [EMAIL PROTECTED]
From: Simon Cozens [EMAIL PROTECTED]
Date: 06 Dec 2002 14:54:43 +
Organization: Bethnal Green is PEOPLE!
X-Posted-By: 217.204.174.162
Is it clear how attributes accessors on objects are going to work
Date: Fri, 06 Dec 2002 11:15:20 -0800
From: Larry Wall [EMAIL PROTECTED]
As for constructor syntax, I suppose we might make use of the $. notation
like this:
method new($.name, $.age) {
return $class.bless;
}
Come to think of it, new is a class method, not an object
Date: Fri, 6 Dec 2002 10:16:20 -0700 (MST)
From: John Williams [EMAIL PROTECTED]
2) requiring balanced delimiters to be escaped,
PRO: it's consistent with non-balanced delimiter requirements
CON: you already can; don't force it those who don't want it
I'll say no, agreeing with the
=head1 Perl 6 and Set Theory
This document will introduce a new way of thinking about some Perl 6
constructs. In addition, it proposes some minor changes that would
help this way of thinking be more consistent. These changes may make
Perl 6 a better language in general, as a side effect.
Even
From: Brent Dax [EMAIL PROTECTED]
Date: Thu, 5 Dec 2002 00:28:52 -0800
Michael G Schwern:
# You can do it with a map without much trouble:
#
# my @indexes = map { /condition/ ? $i++ : () } @stuff;
Unless I'm mistaken, that won't work, since $i only gets incremented on
matches. I
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Date: Thu, 5 Dec 2002 02:45:39 -0800
From: Michael G Schwern [EMAIL PROTECTED]
Content-Disposition: inline
Sender: Michael G Schwern [EMAIL PROTECTED]
X-SMTPD: qpsmtpd/0.12, http://develooper.com/code/qpsmtpd/
I'm going to ask something
Date: Tue, 03 Dec 2002 18:39:27 -0500
From: James Mastros [EMAIL PROTECTED]
Huh? In that case, somebody should tell Angel Faus; Numeric literals,
take 3 says 0c777, and nobody disented. IIRC, in fact, nobody's
descented to 0c777 since it was first suggested.
Well, except Larry. I
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Date: Wed, 4 Dec 2002 18:26:17 -0800
From: Michael G Schwern [EMAIL PROTECTED]
Content-Disposition: inline
Sender: Michael G Schwern [EMAIL PROTECTED]
X-SMTPD: qpsmtpd/0.12, http://develooper.com/code/qpsmtpd/
(The post about 'purge'
Date: Wed, 4 Dec 2002 19:21:27 -0800
From: Michael G Schwern [EMAIL PROTECTED]
On Wed, Dec 04, 2002 at 08:08:48PM -0700, Luke Palmer wrote:
About your idea, though, I'm rather indifferent. However, a friend of
mine once asked me if Perl had search or find operation, returning
the Iindex
From: Ph. Marek [EMAIL PROTECTED]
Date: Wed, 27 Nov 2002 09:10:19 +0100
So an usage could be
@a = @b =+ @b;
@a = @b =+ @b;
@a = @b += @b;
where the 2nd form would be the most intuitive (from reading this source).
Hmm, that would leave us with
@a =+= @b;
which
Date: Wed, 20 Nov 2002 12:11:52 -0800 (PST)
From: Austin Hastings [EMAIL PROTECTED]
--- Larry Wall [EMAIL PROTECTED] wrote:
...
This might work now, presuming
sub foo (;$_ = $=)
(or whatever) is really a binding, and not an assignment. (That's
another reason why //=
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Date: Mon, 18 Nov 2002 18:59:58 -0500
From: matt diephouse [EMAIL PROTECTED]
X-SMTPD: qpsmtpd/0.12, http://develooper.com/code/qpsmtpd/
Damian Conway wrote:
matt diephouse wrote:
$junction = $x | $y | $z;
foo($junction);
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
X-Sent: 19 Nov 2002 02:51:54 GMT
Date: Tue, 19 Nov 2002 13:51:56 +1100
From: Damian Conway [EMAIL PROTECTED]
X-Accept-Language: en, en-us
Cc: [EMAIL PROTECTED] [EMAIL PROTECTED]
X-SMTPD: qpsmtpd/0.12, http://develooper.com/code/qpsmtpd/
Date: Tue, 19 Nov 2002 14:29:46 +1100
From: Damian Conway [EMAIL PROTECTED]
Ken Fox lamented:
Or the circumfix ... operator. Which is the problem here.
This is like playing poker with God.
I hear God prefers dice.
What does the circumfix ... operator do?
It's the ASCII
Date: Mon, 18 Nov 2002 07:39:55 +1100
From: Damian Conway [EMAIL PROTECTED]
It would be *vastly* better thought integrate junctive calls with
the standard threading behaviour.
Of course, there will be a pragma or something to instruct it to
operate serially, yes?
Luke
Date: Mon, 18 Nov 2002 09:28:59 +1100
From: Damian Conway [EMAIL PROTECTED]
I've a couple of questions here:
we still have implicit iteration:
for fibs() {
print Now $_ rabbits\n;
}
Really? What if fibs() is a coroutine that returns lists (Fibonacci
lists, no less),
From: david nicol [EMAIL PROTECTED]
Date: 15 Nov 2002 18:56:35 -0600
I don't know if you haven't been paying attention, or you're
summarizing what's happened. I'll assume the former. Forgive me if
I've misunderstood you.
1: string cat is an old and reliable horsehide drum. I've been
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Date: Fri, 15 Nov 2002 07:05:26 +1100 (EST)
From: Timothy S. Nelson [EMAIL PROTECTED]
Sender: [EMAIL PROTECTED]
X-SMTPD: qpsmtpd/0.12, http://develooper.com/code/qpsmtpd/
Hi all. I missed out on the original RFC process; it was
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Date: Fri, 15 Nov 2002 07:46:21 +1100 (EST)
From: Timothy S. Nelson [EMAIL PROTECTED]
Sender: [EMAIL PROTECTED]
X-SMTPD: qpsmtpd/0.12, http://develooper.com/code/qpsmtpd/
These are mostly not my ideas (except activate); hopefully
When junctions collapse, is that reflected back in the original
junction, as it should be (QM-wise)?
$foo = 1 | 2 | 4
print $foo;
# Foo is now just one of (1, 2, 4); i.e. not a junction
If so, what is perl going to do about the computationally expensive
entanglement thingy?
$x =
Date: Wed, 13 Nov 2002 20:34:49 +
From: Nicholas Clark [EMAIL PROTECTED]
If a subroutine explicitly needs access to its invocant's topic, what is so
wrong with having an explicit read-write parameter in the argument list that
the caller of the subroutine is expected to put $_ in?
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
From: Deborah Ariel Pickett [EMAIL PROTECTED]
Date: Thu, 14 Nov 2002 09:05:16 +1100 (EST)
Cc: [EMAIL PROTECTED]
X-SMTPD: qpsmtpd/0.12, http://develooper.com/code/qpsmtpd/
Luke wrote:
When junctions collapse, is that reflected back in
Date: Fri, 8 Nov 2002 15:04:16 +
From: Nicholas Clark [EMAIL PROTECTED]
And to people in the perl5 know, Memoize is the module that implements this,
hence why people who know of how and what Memoize can do favour that name.
Except that it's not necessarily obvious to everyone else?
Date: Thu, 07 Nov 2002 20:48:50 +1100
From: Damian Conway [EMAIL PROTECTED]
we could make it lazy thus:
sub a_pure_func(Num $n) is lazy returns Num {
return $n ** $n
}
which would cause any invocation of Ca_pure_func to cache
its arguments (probably in a closure)
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
From: Luke Palmer [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Date: Thu, 7 Nov 2002 13:49:14 -0700 (MST)
X-SMTPD: qpsmtpd/0.12, http://develooper.com/code/qpsmtpd/
Date: Thu, 07 Nov 2002 20:48:50 +1100
From: Damian Conway [EMAIL
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Date: Thu, 7 Nov 2002 17:19:28 -0500
From: Mark J. Reed [EMAIL PROTECTED]
Content-Disposition: inline
X-Julian-Day: 2452586.42675
X-SMTPD: qpsmtpd/0.12, http://develooper.com/code/qpsmtpd/
[Recipients list trimmed back to just the list
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
From: Piers Cawley [EMAIL PROTECTED]
Date: Wed, 06 Nov 2002 12:44:39 +
X-SMTPD: qpsmtpd/0.12, http://develooper.com/code/qpsmtpd/
So, I was, thinking about the way Common Lisp handles keyword
arguments. It's possible to declare a
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Date: Wed, 6 Nov 2002 14:53:37 -0800
From: Michael Lazzaro [EMAIL PROTECTED]
X-SMTPD: qpsmtpd/0.12, http://develooper.com/code/qpsmtpd/
If anyone knows the answer to these two questions, I'd appreciate it.
1) What do these do?
I just need a little clarification about yield().
consider this sub:
sub iterate(foo) {
yield for foo;
undef;
}
(Where yield defaults to the topic) Presumably.
a = (1, 2, 3, 4, 5);
while($_ = iterate a) {
print
}
Will print 12345. Or is that:
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Date: Mon, 4 Nov 2002 12:09:12 -0800 (PST)
From: Austin Hastings [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
X-SMTPD: qpsmtpd/0.12, http://develooper.com/code/qpsmtpd/
Something from [EMAIL PROTECTED] about the relative frequency made
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Date: Sat, 2 Nov 2002 01:15:05 +0200
From: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
X-SMTPD: qpsmtpd/0.12, http://develooper.com/code/qpsmtpd/
Michael Lazzaro writes:
magical whitespace modifier:
_ - When used at the
From: Markus Laire [EMAIL PROTECTED]
Date: Sat, 02 Nov 2002 14:44:39 +0200
On 2 Nov 2002 at 0:06, Simon Cozens wrote:
More and more conversations like this, (and how many have we seen here
already?) about characters sets, encodings, mail quoting issues, in
fact, anything other than Perl,
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Date: Thu, 31 Oct 2002 10:11:00 -0800
From: Michael Lazzaro [EMAIL PROTECTED]
X-SMTPD: qpsmtpd/0.12, http://develooper.com/code/qpsmtpd/
And if you really want to drool at all the neat glyphs that the
wonderful, magical world of math
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Date: Thu, 31 Oct 2002 14:45:16 -0800
From: Erik Steven Harrison [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
X-Sent-Mail: off
Reply-To: [EMAIL PROTECTED]
X-Sender-Ip: 152.18.50.63
Organization: Angelfire
Oops. About that op thing, I was wrong. Though there is a case
that does it:
sub bar();
sub postfix:bar($x) returns IO::Handle;
$x = length bar;
If it's possible to have a distinct sub and an operator with the same
name. If not, I believe the distinction is precisely the same as
Date: Thu, 31 Oct 2002 15:16:17 -0800 (PST)
From: Austin Hastings [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED], [EMAIL PROTECTED]
--- Luke Palmer [EMAIL PROTECTED] wrote:
--- Damian Conway [EMAIL PROTECTED] wrote:
Austin Hastings wrote:
traits = any
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Date: Fri, 1 Nov 2002 03:08:37 +
From: Andrew Wilson [EMAIL PROTECTED]
Mail-Followup-To: [EMAIL PROTECTED] [EMAIL PROTECTED]
Content-Disposition: inline
X-SMTPD: qpsmtpd/0.12, http://develooper.com/code/qpsmtpd/
On Fri, Nov 01,
Larry wrote:
I don't much care whether they short-circuit or not. I could argue it
either way. I think it'd be okay if they short-circuit. Anybody who
uses an operator like ? expecting it to force a side effect on the
second expression is nuts. And there's something (though not much)
to
Date: Tue, 29 Oct 2002 15:57:56 -0800 (PST)
From: Larry Wall [EMAIL PROTECTED]
That's not a problem with builtins, but what about
sub foo ();
sub prefix:foo ($x);
@a = [foo][1,2,3,4,5];
So how is this interpreted? Such syntactic ambiguity isn't nice.
Should we go with the
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Cc: [EMAIL PROTECTED] [EMAIL PROTECTED]
From: Piers Cawley [EMAIL PROTECTED]
Date: Wed, 30 Oct 2002 18:59:15 +
X-SMTPD: qpsmtpd/0.12, http://develooper.com/code/qpsmtpd/
Dave Storrs [EMAIL PROTECTED] writes:
In the Re:
Date: Thu, 31 Oct 2002 13:02:44 +1300 (NZDT)
From: Martin D Kealey [EMAIL PROTECTED]
We don't in general have a let on the front of assignment statements; why
should this type of assignment be any different? (Do we want a let keyword?
Personally I don't think so, but what do others think?)
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
From: Piers Cawley [EMAIL PROTECTED]
Date: Tue, 29 Oct 2002 05:45:01 +
X-SMTPD: qpsmtpd/0.12, http://develooper.com/code/qpsmtpd/
Whilst I don't wish to get Medieval on your collective donkey I must
say that I'm really not sure of
Cc: [EMAIL PROTECTED]
From: Piers Cawley [EMAIL PROTECTED]
Date: Tue, 29 Oct 2002 09:36:12 +
Luke Palmer [EMAIL PROTECTED] writes:
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
From: Piers Cawley [EMAIL PROTECTED]
Date: Tue, 29 Oct 2002 05:45:01 +
X-SMTPD: qpsmtpd
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Date: Tue, 29 Oct 2002 21:37:32 +
From: Aaron Crane [EMAIL PROTECTED]
Content-Disposition: inline
X-SMTPD: qpsmtpd/0.12, http://develooper.com/code/qpsmtpd/
Damian Conway writes:
My personal favorite solution is to use square
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Date: Sat, 26 Oct 2002 23:01:31 -0700
From: Michael Lazzaro [EMAIL PROTECTED]
X-Accept-Language: en,pdf
Cc: Damian Conway [EMAIL PROTECTED],
[EMAIL PROTECTED] [EMAIL PROTECTED]
X-SMTPD: qpsmtpd/0.12-dev,
Date: Sat, 26 Oct 2002 09:16:41 -0700 (PDT)
From: Larry Wall [EMAIL PROTECTED]
We're also missing the actual C operators that are guaranteed to return 0 or 1:
$x ? $y # C's $x $y
$x ?| $y # C's $x || $y
$x ?! $y # C's, er, !!$x ^ !!$y
And we need those... why? Wouldn't:
You know, \ and friends as xor is appealing to me.
There's no problem with \\ or \=, so that works. It's got nothing to
do with references, but unary | has nothing to do with anything.
Plus, it's parallel (er, perpendicular) to // as err, being logical
and all.
Just to clarify:
\
From: Angel Faus [EMAIL PROTECTED]
Date: Fri, 25 Oct 2002 00:54:09 +0200
All this ones fit more with the concept of mystical analogy hinted
by =~ than with the plain similarity that one would expect from
like
True. Can't say I like, um, like.
Oh, and =~ looks much more intimidating,
Date: Wed, 23 Oct 2002 11:14:33 -0700 (PDT)
From: Larry Wall [EMAIL PROTECTED]
On top of which, Damian has expressed an interest in ! for a
superpositional xor.
Which would behave how, exactly?
Luke
Date: Wed, 23 Oct 2002 18:43:08 -0300
From: Adriano Nagelschmidt Rodrigues [EMAIL PROTECTED]
Hi,
Perl is my favorite language, and I'm eagerly following Perl 6
development. So I would like to ask this question here. Sorry if I'm
being inconvenient...
Do you think that Lisp macros make
I didn't call the problem unreasonable, I was objecting to its
characterization as an essential feature. It isn't. A useful thing,
definitely, but there are a lot of those. It's hardly essential any
more than, say, a hash that automagically maps to the current
directory's files
From: [EMAIL PROTECTED] [EMAIL PROTECTED]
Date: Tue, 15 Oct 2002 14:33:28 -0400
I like the idea of this. The finer details, like returning what to
do, could be more elegant. But the extensibility idea is golden.
To change how certain exceptions behave, a block simply changes the methods
Put another way, is there a significant difference between:
eval {
$foo = 1/0;
print Bar;
}
if( $ =~ /^Illegal division by zero/ ) {
... oops ...
}
and
try {
$foo = 1/0;
print Bar;
}
catch {
when /^Illegal
Date: Sat, 12 Oct 2002 08:43:46 -0700 (PDT)
From: Larry Wall [EMAIL PROTECTED]
If we use | and as sugar for any() and all(), then their precedence
should probably be the same as || and .
Should they? I had in mind something just above comparisons. That
way:
if $x == 3 || $y ==
Date: Fri, 11 Oct 2002 12:16:00 -0700 (PDT)
From: Larry Wall [EMAIL PROTECTED]
I'm wondering whether the single ones could indicate parallel streams.
We had the difficulty of specifying whether the Cfor loop should
terminate on the shorter or the longer stream. We could say that |
sub f(int $a is constrained($a=1,must be positive),
documented(an integer)) {
...
}
I now realize I'm a little fuzzy on the yada-yada-yada operator. What
exactly is it... or what does it do? Is it a statement, an
expression? Could you say
Do parens still provide list context on the left side of an assignment?
What do these two do:
my $x = ARGS;
my ($y) = ARGS;
Parens just grouping suggests that C$x and C$y should be the same
(which may well be good, as it's a subtle distinction which trips up
many beginners in Perl
[Negative matching]
a generic negative, multi-byte string matching mechanism. Any thoughts?
Am I missing something already present or otherwise obvious?
Maybe I'm misundertanding the question, but I think you want negative
lookahead:
Perl 5: /(.*)(?!union)/
Perl 6: /(.*) !before:
On 23 Sep 2002, Simon Cozens wrote:
[EMAIL PROTECTED] (Luke Palmer) writes:
Since we now have an explicit flattening operator (unary *), there's no
need to differentiate between a real list and a reference to one.
What context does push impute on its operands?
If
push
On Mon, 23 Sep 2002, Jonathan Scott Duff wrote:
On Mon, Sep 23, 2002 at 04:58:55PM -0400, Trey Harris wrote:
for (1,(a,b,c),3 { ... }
and
for 1,(a,b,c),3 { ... }
Now that I've ventured away from DWIMs and more into WIHDTEMs (What In
Hell Does This Expression Mean), is the
On 24 Sep 2002, Simon Cozens wrote:
[EMAIL PROTECTED] (Luke Palmer) writes:
push @a: [1,2,3,4];
pushes an array ref onto @a.
push @a: *[1,2,3,4];
pushes 1, 2, 3, and 4 onto @a (as it would without the * and []).
Remind me which language this is supposed to be, again
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
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 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
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
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
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
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
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 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
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
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?
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
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
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
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
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
801 - 900 of 974 matches
Mail list logo