Perl 6 summary for the week ending 23rd June 2002

2002-06-24 Thread Piers Cawley
=head1 This week on Perl 6 (17-23 June 2002) by Piers Cawley, 020020624 =head2 Notes It's been a while since the last Perl 6 digest and summarizing everything that's happened since then would take, ooh, a while. So I've punted on that, and just pretended that the last one was

Re: Apoc 5 questions/comments

2002-06-11 Thread Piers Cawley
Andy Wardley <[EMAIL PROTECTED]> writes: > On Sat, Jun 08, 2002 at 06:51:19AM +1000, Damian Conway wrote: >> I have no doubt that, once Perl 6 is available, we'll see a rash of >> modules released in the Grammar:: namespace. Including >> Grammar::HTML and Grammar::XML. > > I have no doubt that, o

Re: A5: a few simple questions

2002-06-06 Thread Piers Cawley
Allison Randal <[EMAIL PROTECTED]> writes: > On Thu, Jun 06, 2002 at 10:38:39AM -0400, John Siracusa wrote: >> On 6/6/02 2:43 AM, Damian Conway wrote: >> > rule wordlist { (\w+) [ , (\w+) ]* } >> >> No semicolon at the end of that line? I've already forgotten the "new >> rules" for that type

Re: Idea

2002-05-24 Thread Piers Cawley
Luke Palmer <[EMAIL PROTECTED]> writes: >> >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? By only optimizing in the prese

Re: Loop controls

2002-05-10 Thread Piers Cawley
"Miko O'Sullivan" <[EMAIL PROTECTED]> writes: > From: "Damian Conway" <[EMAIL PROTECTED]> >> while (my $res = $search->getnext) { ...} >> >> has a valid meaning in Perl 6. In fact, it's meaning in Perl 6 is far more >> reasonable than in Perl 5. > > I don't think the new meaning makes sense at al

Re: Accessor methods ?

2002-05-10 Thread Piers Cawley
Damian Conway <[EMAIL PROTECTED]> writes: > Aaron Sherman wrote: > >> > What if I want my methods to be called C<.get_bar()> and C<.set_bar()>, >> > since a certain Perl OO specialist suggests this approach is best for >> > avoiding ambiguity in one's API? >> >> Then you can declare them as such

Re: What does this do?

2002-05-07 Thread Piers Cawley
Larry Wall <[EMAIL PROTECTED]> writes: > Piers Cawley writes: > : Consider the following. > : > :sub foo {...} > : > :foo *@ary; > :foo * @ary; > : > : Is this another place where whitespace will have meaning? Or should I > : add parentheses t

What does this do?

2002-05-03 Thread Piers Cawley
Consider the following. sub foo {...} foo *@ary; foo * @ary; Is this another place where whitespace will have meaning? Or should I add parentheses to disambiguate? Enquiring minds want to know. -- Piers "It is a truth universally acknowledged that a language in possession of

Re: Loop controls

2002-05-01 Thread Piers Cawley
Luke Palmer <[EMAIL PROTECTED]> writes: > On Tue, 30 Apr 2002, Miko O'Sullivan wrote: > >> > Damian, now having terrible visions of someone suggesting C ;-) >> >> Then may I also give you nightmares on: elsdo, elsdont, elsgrep, elstry ... > > Ooh! Why don't we have a dont command! With several

Re: Regex and Matched Delimiters

2002-04-23 Thread Piers Cawley
"Brent Dax" <[EMAIL PROTECTED]> writes: > Larry Wall: > That's...odd. Is $$ (the variable) going away? > > # /./s// or /<.>/ ??? > > I think that . is too common a metacharacter to be relegated to > this. I think you failed to notice that '/s' on the regex. In general . w

Re: Regex and Matched Delimiters

2002-04-23 Thread Piers Cawley
Larry Wall <[EMAIL PROTECTED]> writes: > /^pat$/m /^^pat$$/ $$ is no longer the current PID? Or will we have to call that '${$}' in a regex? -- Piers "It is a truth universally acknowledged that a language in possession of a rich syntax must be in need of a rewrite."

Re: Hashes, Stringification, Hashing and Strings

2002-04-16 Thread Piers Cawley
David Wheeler <[EMAIL PROTECTED]> writes: > On 4/16/02 11:57 AM, "Piers Cawley" <[EMAIL PROTECTED]> claimed: > >> Personally I'd like the default hash to return some immutable, unique >> and probably opaque object id (something the like >> 

Re: Hashes, Stringification, Hashing and Strings

2002-04-16 Thread Piers Cawley
Aaron Sherman <[EMAIL PROTECTED]> writes: > On Tue, 2002-04-16 at 14:00, Mike Lambert wrote: >> Speaking of which, how do we ensure the immutability of keys being put >> into the hash? I think Perl copied the string, so that: >> >> $b = "aa"; >> $a{$b} = 1; >> chop $b; >> print $a{"aa"}; >> >>

Scary things

2002-04-16 Thread Piers Cawley
Also known as constructs you wish you hadn't discovered. So, I'm reading through Finkel and I came across the following, which computes the greatest common divisor of a and b (recast into perl6ish syntax) while { when $a < $b { $b -= $a } when $b < $a { $a -= $b } } The idea is that

Re: Unary dot

2002-04-16 Thread Piers Cawley
Andy Wardley <[EMAIL PROTECTED]> writes: > On Mon, Apr 15, 2002 at 07:24:13PM -0700, Larry Wall wrote: >> So the main reason that objects can function as hashes is so that the >> user can poke an object into an interface expecting a hash and have it >> "make sense", to the extent that the object i

Re: Subroutine variables are like underwear

2002-04-15 Thread Piers Cawley
Damian Conway <[EMAIL PROTECTED]> writes: > Yes, subroutine variables *are* like underwear. > But parameter names *aren't* like underwear. > Because they're not (primarily) subroutine variables. > > So they're like the labels on the knobs, dials, and buttons of your > favourite elctronic device.

Re: Fisher-Yates shuffle

2002-04-12 Thread Piers Cawley
[EMAIL PROTECTED] writes: > 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

Re: Fisher-Yates shuffle

2002-04-12 Thread Piers Cawley
[EMAIL PROTECTED] writes: > On Fri, Apr 12, 2002 at 04:00:37PM +0100, Piers Cawley wrote: >> >> [EMAIL PROTECTED] writes: >> > As for "cleanness", this is my interpretation of how perl6 is going >> > to work: >> > >>

Re: Fisher-Yates shuffle

2002-04-12 Thread Piers Cawley
[EMAIL PROTECTED] writes: > As for "cleanness", this is my interpretation of how perl6 is going > to work: > > %foo = (); > if %foo {"key"} {print "Hello 1"} > > %foo = (); > if %foo{"key"} {print "Hello 2"} > > %foo = (); > if %foo{"key"}{print "Hello 3"

Re: How to default? (was Unary dot)

2002-04-12 Thread Piers Cawley
Trey Harris <[EMAIL PROTECTED]> writes: > 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; > } > pri

Re: Defaulting params

2002-04-11 Thread Piers Cawley
Aaron Sherman <[EMAIL PROTECTED]> writes: > On Thu, 2002-04-11 at 00:47, Damian Conway wrote: > >> sub load_data ($filename) { load_data($filename, 1) } >> >> sub load_data ($filename, $version) {...} > > Interesting. This brings goto to mind. Above, I could just assume > that inlining

Re: Defaulting params

2002-04-10 Thread Piers Cawley
Damian Conway <[EMAIL PROTECTED]> writes: > Piers wrote: > >> one could always handle the first case >> more explicitly by doing: >> >>sub load_data ($filename; $version) { >> $version = 1 if @_.length < 2; >> ... >>} > > Err...no. If you specify named parameters, you don't g

Re: Defaulting params

2002-04-10 Thread Piers Cawley
"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 problems if > they are together.) If that's

Re: Unary dot

2002-04-10 Thread Piers Cawley
Luke Palmer <[EMAIL PROTECTED]> writes: >> > $.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. Lik

Re: Unary dot

2002-04-10 Thread Piers Cawley
Damian Conway <[EMAIL PROTECTED]> writes: [...] > Reflecting on this, it seems that it would be useful if methods > implicitly did their default topicalization-of-invocant like so: > > -> $self > > rather than just: > > -> $_ > > That is, that as well as aliasing the invocant to $_,

Re: Unary dot

2002-04-10 Thread Piers Cawley
"David Whipp" <[EMAIL PROTECTED]> writes: > Piers Cawley >> > This may be a case of keep up at the back, but if that is a >> method call, >> > how do I call a subroutine from within a method ? >> >> [...] >> >> Yes, I know

Re: Unary dot

2002-04-10 Thread Piers Cawley
"Mark J. Reed" <[EMAIL PROTECTED]> writes: > On Wed, Apr 10, 2002 at 07:57:01PM +0100, Piers Cawley wrote: >> > ::m2; # calls global subroutine main::m2 >> > main::m2; # calls global subroutine main::m2 >> >> This is looking more and more

Re: none

2002-04-10 Thread Piers Cawley
Ashley Winters <[EMAIL PROTECTED]> writes: >> Patches welcome. > > Excellent... > > Forgive any formatting errors, I have mail issues. Thanks, applying. With a few caveats. > @@ -62,6 +62,7 @@ > class SchemePair is SchemeExpr { >my $nil //= class is SchemeExpr { > method is_nil {1} >

Re: Unary dot

2002-04-10 Thread Piers Cawley
Glenn Linderman <[EMAIL PROTECTED]> writes: > Graham Barr wrote: >> >> On Wed, Apr 10, 2002 at 01:35:22PM -0400, Mark J. Reed wrote: >> > On Wed, Apr 10, 2002 at 10:30:25AM -0700, Glenn Linderman wrote: >> > > method m1 >> > > { >> > >m2; # calls method m2 in the same class >> > Yes, but do

Re: Unary dot

2002-04-10 Thread Piers Cawley
Graham Barr <[EMAIL PROTECTED]> writes: > On Wed, Apr 10, 2002 at 01:35:22PM -0400, Mark J. Reed wrote: >> On Wed, Apr 10, 2002 at 10:30:25AM -0700, Glenn Linderman wrote: >> > method m1 >> > { >> >m2; # calls method m2 in the same class >> Yes, but does it call it as an instance method on t

Re: Unary dot

2002-04-10 Thread Piers Cawley
Melvin Smith <[EMAIL PROTECTED]> writes: > At 10:50 AM 4/10/2002 -0700, Glenn Linderman wrote: >>"Mark J. Reed" wrote: >> > >> > On Wed, Apr 10, 2002 at 10:30:25AM -0700, Glenn Linderman wrote: >> > > method m1 >> > > { >> > >m2; # calls method m2 in the same class >> > Yes, but does it call

Re: I'll show you mine...

2002-04-10 Thread Piers Cawley
Melvin Smith <[EMAIL PROTECTED]> writes: > At 09:23 AM 4/10/2002 +0100, Piers Cawley wrote: >>Okay, this is the beginnings of Scheme in Perl6. I'm sure there's >>stuff I'm getting wrong. I've not written the parser yet for instance > > Very nice!

Re: I'll show you mine...

2002-04-10 Thread Piers Cawley
Aaron Sherman <[EMAIL PROTECTED]> writes: > On Wed, 2002-04-10 at 10:03, Piers Cawley wrote: >> In message <[EMAIL PROTECTED]>, I wrote: >> > [ A huge wodge of possible perl 6 code ] >> >> I'm getting that Warnock's Dilemma feeling here...

Re: I'll show you mine...

2002-04-10 Thread Piers Cawley
In message <[EMAIL PROTECTED]>, I wrote: > [ A huge wodge of possible perl 6 code ] I'm getting that Warnock's Dilemma feeling here... Did I stun you all into silence? -- Piers "It is a truth universally acknowledged that a language in possession of a rich syntax must be in need of a re

I'll show you mine...

2002-04-10 Thread Piers Cawley
Okay, this is the beginnings of Scheme in Perl6. I'm sure there's stuff I'm getting wrong. I've not written the parser yet for instance and I'm toying with waiting for A5 before I do. Also, I've not yet implemented such important stuff as proper closures/lambda or the environment chain, but the un

Re: Unary dot

2002-04-09 Thread Piers Cawley
Larry Wall <[EMAIL PROTECTED]> writes: > Me writes: > : > But suppose you want all .foo to refer to self and not > : > to the current topic. > : > : What about > : > : given (self) { } > > That wouldn't have the same effect as what we're talking about--it'd be > overruled by any C with

Re: Bracekets

2002-04-09 Thread Piers Cawley
Simon Cozens <[EMAIL PROTECTED]> writes: > Piers Cawley: >> Well, no. Because Perl 6 is specified as behaving like perl 5 until >> told different. Which means that the first translation you give would >> be a syntax error. > > Ouch. Guess I need to go reread

Re: Bracekets

2002-04-09 Thread Piers Cawley
Jonathan Scott Duff <[EMAIL PROTECTED]> writes: > On Tue, Apr 09, 2002 at 04:17:38PM +0100, Simon Cozens wrote: >> Aaron Sherman: >> >nice du -a | sort -n | tail -300 | tac | perl -nle ' >> >die "Require non-zero disk size!\n" unless $ENV{DF}; >> >if ($. == 1) { >> >

Re: Unary dot

2002-04-09 Thread Piers Cawley
Me <[EMAIL PROTECTED]> writes: >> But suppose you want all .foo to refer to self and not >> to the current topic. > > What about > > given (self) { } > > Also, what about > > use invocant; > > resulting in all method bodies in scope getting an implied > surrounding given (self) { ...

Re: Bracekets

2002-04-08 Thread Piers Cawley
"Mark J. Reed" <[EMAIL PROTECTED]> writes: > On Mon, Apr 08, 2002 at 07:56:11PM +0100, Piers Cawley wrote: >> > Also, just wondering: >> > >> >$_[_][EMAIL PROTECTED] _=_0_-_ >> > >> > does that work the way I expect it to? &

Re: Bracekets

2002-04-08 Thread Piers Cawley
Aaron Sherman <[EMAIL PROTECTED]> writes: > On Mon, 2002-04-08 at 13:01, Jonathan E. Paton wrote: > >> I'm I beating this point to death, or do I have to write >> the RPC: >> >> "Keep the {} and [] notation for hashes and arrays" >> >> or >> >> "Save our array!" > > Let's boil this RFC down to

Re: Bracekets

2002-04-08 Thread Piers Cawley
Dan Sugalski <[EMAIL PROTECTED]> writes: > At 2:33 PM +0100 4/7/02, Piers Cawley wrote: >>"Jonathan E. Paton" <[EMAIL PROTECTED]> writes: >>> but wait, there's more... what does: >>> >>> @multi_dim[$a][$b][$c] >>> >&g

Re: Ex4 smart match question

2002-04-08 Thread Piers Cawley
Damian Conway <[EMAIL PROTECTED]> writes: > Incidentally, the table of C<=~> comparisons (Table 1) at: > > http://dev.perl.org/perl6/apocalypse/4 > > suggests that hash/hash matching is equivalent to: > > match if grep exists $a{$_}, $b.keys > > I hope to convince Larry that it would b

Re: Unary dot

2002-04-07 Thread Piers Cawley
Damian Conway <[EMAIL PROTECTED]> writes: > Piers asked: > >> So, is there any chance that we'll be able to do: >> >> class ical { >> use object_name '$self'; >> >> method ical { >> given $self.ology { >> ... { $self.ish } >> } >> } >> } > > Of course, if you

Re: Bracekets

2002-04-07 Thread Piers Cawley
"Jonathan E. Paton" <[EMAIL PROTECTED]> writes: > but wait, there's more... what does: > > @multi_dim[$a][$b][$c] > > give? Who cares? So long as the intermediate results in @multi_dim.[$a].[$b].[$c] respond to []. -- Piers "It is a truth universally acknowledged that a language in poss

Unary dot

2002-04-06 Thread Piers Cawley
Whilst I've been hacking the perl 6 scheme interpreter I've found myself using code like the following method get_token( $self: ) { given $self.get_char { when !defined { fail IOException: msg=> "EOF" } when /\s/ { $self.get_token } when '(' { $the_left_paren }

Re: $^a, $^b, and friends

2002-04-06 Thread Piers Cawley
Larry Wall <[EMAIL PROTECTED]> writes: > Piers Cawley writes: > : In a use.perl post not far away I sketched out something like the following: > : > : module foo is Mixin { > : > : sub category($category, &block) { > : &block.abst

Re: $^a, $^b, and friends

2002-04-06 Thread Piers Cawley
Larry Wall <[EMAIL PROTECTED]> writes: > Rafael Garcia-Suarez writes: > : Larry Wall wrote in perl.perl6.language : > : > > : > Such a grammar switching routine could operate either over a lexical > : > scope or over the rest of the file. The only restriction is that > : > one module not clobbe

Re: Tail Recursion optimization

2002-04-06 Thread Piers Cawley
Dan Sugalski <[EMAIL PROTECTED]> writes: > At 11:45 PM +0100 4/5/02, Piers Cawley wrote: >>So, here I am working on a Scheme interpreter in Perl 6, and I'm >>trying to write it in a (for want of a better description) >>'Scheme-like' fashion with lots

Re: Tail Recursion optimization

2002-04-06 Thread Piers Cawley
"Jonathan E. Paton" <[EMAIL PROTECTED]> writes: >> : Piers Cawley writes: >> : >> : So, here I am working on a Scheme interpreter in Perl 6, and I'm >> : trying to write it in a (for want of a better description) >> : 'Scheme-like

Re: Questions about private variables

2002-04-05 Thread Piers Cawley
Damian Conway <[EMAIL PROTECTED]> writes: > Joe Gottman wrote: >> For instance, what would happen in the >> following code? >> >> sub func1() { >> our $varname is private \\= 1; >> return $varname; >> } >> >> sub func2() { >> our $varname is private \\= 2; > > Fatal error: "Private v

Tail Recursion optimization

2002-04-05 Thread Piers Cawley
So, here I am working on a Scheme interpreter in Perl 6, and I'm trying to write it in a (for want of a better description) 'Scheme-like' fashion with lots of recursion. The trouble is, unless Perl6 is going to be guaranteed to do optimization of tail calls, this is going to lead to horribly slo

Re: $^a, $^b, and friends

2002-04-05 Thread Piers Cawley
Larry Wall <[EMAIL PROTECTED]> writes: > Piers Cawley writes: > : Larry Wall <[EMAIL PROTECTED]> writes: > : > : > Dan Sugalski writes: > : > : >Strict, but doesn't really matter. Nobody sane will use anything other > : > : >than $^a and $^b. &

Re: $^a, $^b, and friends

2002-04-05 Thread Piers Cawley
Larry Wall <[EMAIL PROTECTED]> writes: > Dan Sugalski writes: > : >Strict, but doesn't really matter. Nobody sane will use anything other > : >than $^a and $^b. > : > : Well Are we allowing non-latin characters in identifiers? There > : may be potential interesting ramifications with those

Re: Exegesis 4

2002-04-03 Thread Piers Cawley
Damian Conway <[EMAIL PROTECTED]> writes: > Larry explained: > >> : Umm. didn't you say bare blocks were going away? >> >> Rule #2 was invoked. >> >> The current thinking is that any bare block will never be interpreted >> as returning a closure. You have to use explicit C or C >> to retur

Re: $^a, $^b, and friends

2002-04-03 Thread Piers Cawley
Jonathan Scott Duff <[EMAIL PROTECTED]> writes: > On Wed, Apr 03, 2002 at 11:27:10AM -0800, Larry Wall wrote: >> They are assumed to be declared in alphabetical order. Whoa! you say, >> that could get confusing. It surely can. But if you're doing >> something complicated enough that alphabetic

Re: Exegesis 4

2002-04-03 Thread Piers Cawley
Damian Conway <[EMAIL PROTECTED]> writes: >> > Eventually, of course, we'll have to go back and make eveything >> > copacetic, but at the moment I think most folks would rather have us >> > working on writing unwritten A's and E's, rather than rewriting >> > written ones. ;-) >> >> Point. Maybe

Nested whens?

2002-04-03 Thread Piers Cawley
Just a thought, I assume that something like the following will be legal: given $msg { when Message::ACK { $msg_store.fetch( $msg.acknowledged_msg ).set_state($msg); } when Message::SMS { when .is_incoming { ... } when .is_outgoin

Re: Exegesis 4

2002-04-03 Thread Piers Cawley
Damian Conway <[EMAIL PROTECTED]> writes: >> Good oh. BTW, (and apologies for repeating the question I asked >> elsewhere) are we going to see an updated Apocalypse 4 incorporating >> all the changes made to get E4 to work? > > Probably not any time soon. Previous Apocalypses haven't been > updat

Apocrypha

2002-04-03 Thread Piers Cawley
So, I've been looking at the stuff in the Apocalypses and Exegeses so far and I think I've reached the point where I can have a crack at using perl 6 to implement another programming language. Coming (possibly) to a mailing list near you, Perl6::Scheme... -- Piers "It is a truth universally

Re: Exegesis 4

2002-04-03 Thread Piers Cawley
Damian Conway <[EMAIL PROTECTED]> writes: > Piers wrote: > >> Over on use.perl, someone spotted what looks like a bug in the example >> program which (if it *is* a bug) is fixed by using unary '*', but >> that's not what I'm writing about here. > > I'll admit I'm not sure whether it is a bug or n

Exegesis 4

2002-04-03 Thread Piers Cawley
Over on use.perl, someone spotted what looks like a bug in the example program which (if it *is* a bug) is fixed by using unary '*', but that's not what I'm writing about here. In the discussion of the yadda yadda yadda operator, Damian says that ... in this example, Err::BadData is *never*

Re: A thought occured to me...

2002-03-28 Thread Piers Cawley
Simon Cozens <[EMAIL PROTECTED]> writes: > Piers Cawley: >> ie, overriding hash lookups, array lookups, whatever. > > Ah, you want C#/Python indexers, you do. So do I. Um... is that what you call 'em. Actually, you can already do 'use overload q|%{}|', to s

A thought occured to me...

2002-03-28 Thread Piers Cawley
Wouldn't it be nice if you could do: class Foo { ... &{intern('{}')} := method ($self: $key) is lvalue { ... } } So, later, you could do: $obj = Foo.new; $obj{something} = $something_else; ie, overriding hash lookups, array lookups, whatever. (I'm using a Lispish 'intern

Re: Metadata

2002-03-19 Thread Piers Cawley
Larry Wall <[EMAIL PROTECTED]> writes: > Charles Bunders writes: > : I came across Simon Cozens email > : (http:[EMAIL PROTECTED]/msg08641.html) again > : tonight and it got me thinking... > : > : In Perl 6 are modules compiled down to pbc (Perl byte code) going to also > : create metadata simil

Re: PMCs, setting, and suchlike things [forward from p6-internals]

2002-02-13 Thread Piers Cawley
"Wizard" <[EMAIL PROTECTED]> writes: > This came up on perl6-internals, and Dan liked the "try" suggestion and > suggested That I post it here for comments. I'm not subscribed to > p6-language, so you'll need to include me in any replies where you want a > response from me. > =

Re: Night of the Living Lexical (sequel to Apoc4: The loop keyword)

2002-01-22 Thread Piers Cawley
Michael G Schwern <[EMAIL PROTECTED]> writes: > On Mon, Jan 21, 2002 at 03:02:06PM -0500, Tzadik Vanderhoof wrote: >> Why all the fuss? Often, you would *want* to access that lexical after the >> loop terminates, for instance to check how it terminated. > > In most cases you don't want that to h

Re: [dha@panix.com: Re: ^=~]

2002-01-22 Thread Piers Cawley
Damian Conway <[EMAIL PROTECTED]> writes: > I suppose this discussion also raises the vexed question whether ??:: > can also be put out to pasture in favour of: > > $val = if $x { 1 } else { 2 } Only if you can also do: if $x { $x } else { $y } = 'foo'; But that looks really scary. -

Re: Apoc4: The loop keyword

2002-01-22 Thread Piers Cawley
Michael G Schwern <[EMAIL PROTECTED]> writes: > On Mon, Jan 21, 2002 at 03:27:29PM -0500, Casey West wrote: >> So you're suggesting that we fake lexical scoping? That sounds more >> icky than sticking to true lexical scoping. A block dictates scope, >> not before and not after. I don't see ick

Re: A question

2002-01-21 Thread Piers Cawley
Piers Cawley <[EMAIL PROTECTED]> writes: > Larry Wall <[EMAIL PROTECTED]> writes: > >> Piers Cawley writes: >> : Yeah, that's sort of where I got to as well. But I just wanted to make >> : sure. I confess I'm somewhat wary of the ';' oper

Re: A question

2002-01-21 Thread Piers Cawley
Larry Wall <[EMAIL PROTECTED]> writes: > Piers Cawley writes: > : Yeah, that's sort of where I got to as well. But I just wanted to make > : sure. I confess I'm somewhat wary of the ';' operator, especially > : where it's 'unguarded' by brac

Re: Apoc4: "When do I put a semicolon after a curly?"

2002-01-19 Thread Piers Cawley
You're treating do, if, foreach as if they were keywords. I'm not entirely sure that that's still the case. And you're also forgetting the possibility of user implemented control type operators/methods. Unless I'm very much mistaken you're suggesting that we special case the parser for 'do' and a

Re: A question

2002-01-18 Thread Piers Cawley
[reformatting response for readability and giving Glenn a stiff talking to] Glenn Linderman <[EMAIL PROTECTED]> writes: > Piers Cawley wrote: > >> Okay boys and girls, what does this print: >> >> my @aaa = qw/1 2 3/; >> my @bbb = @aaa; >> >> try

Re: Does this mean we get Ruby/CLU-style iterators?

2002-01-18 Thread Piers Cawley
Larry Wall <[EMAIL PROTECTED]> writes: > Michael G Schwern writes: > : Reading this in Apoc 4 > : > : sub mywhile ($keyword, &condition, &block) { > : my $l = $keyword.label; > : while (&condition()) { > : &block(); > : CATCH { > : my $

A question

2002-01-18 Thread Piers Cawley
Okay boys and girls, what does this print: my @aaa = qw/1 2 3/; my @bbb = @aaa; try { print "$_\n"; } for @aaa; @bbb -> my $a; my $b { print "$a:$b"; } I'm guessing one of: 1:1 2:2 3:3 or a syntax error, complaining about something near C<@bbb -> my $a ; my $b {> In other words, how

Re: Apo4: PRE, POST

2002-01-18 Thread Piers Cawley
"Me" <[EMAIL PROTECTED]> writes: >> [concerns over conflation of post-processing and post-assertions] > > Having read A4 thoroughly, twice, this was my only real concern > (which contrasted with an overall sense of "wow, this is so cool"). I think that people have sort of got used to the fact th

Re: Does this mean we get Ruby/CLU-style iterators?

2002-01-18 Thread Piers Cawley
Dan Sugalski <[EMAIL PROTECTED]> writes: > At 3:37 PM + 1/18/02, Piers Cawley wrote: >>Michael G Schwern <[EMAIL PROTECTED]> writes: >> >>Hmm... making up some syntax on the fly. I sort of like the idea of >>being able to do >> >> class

Re: Does this mean we get Ruby/CLU-style iterators?

2002-01-18 Thread Piers Cawley
Michael G Schwern <[EMAIL PROTECTED]> writes: > Reading this in Apoc 4 > > sub mywhile ($keyword, &condition, &block) { > my $l = $keyword.label; > while (&condition()) { > &block(); > CATCH { > my $t = $!.tag; > when X::

Re: Apropos of nothing...

2001-12-21 Thread Piers Cawley
Resending due to BT doing bad things to good nameservers. Damian Conway <[EMAIL PROTECTED]> writes: >> >$val = (foo())[0]; >> > >> > List? >> >> Scalar, obviously. > > How do you figure that? (Not a criticism: I'd really like to understand your > thought process her

Re: Apropos of nothing...

2001-12-20 Thread Piers Cawley
Damian Conway <[EMAIL PROTECTED]> writes: >> >$val = (foo())[0]; >> > >> > List? >> >> Scalar, obviously. > > How do you figure that? (Not a criticism: I'd really like to understand your > thought process here so I can assess the relative DWIMity of the two > alternat

Re: Apropos of nothing...

2001-12-20 Thread Piers Cawley
Aaron Sherman <[EMAIL PROTECTED]> writes: > On Sun, Dec 16, 2001 at 03:55:10PM +1100, Damian Conway wrote: > > [...] > >>> And, just for laughs: >>> >>> $ref = [1,2]; >>> @ary[$ref] = foo(); # probably a syntax error > > Ok, as far as I can recall, Larry hinted that arrays a

Re: Apropos of nothing...

2001-12-13 Thread Piers Cawley
"Brent Dax" <[EMAIL PROTECTED]> writes: > Piers Cawley: > # In the following code fragment, what context is foo() in? > # > # @ary[0] = foo() > > The short answer is scalar context. The long answer is below. Note > that the long answer is only

Apropos of nothing...

2001-12-13 Thread Piers Cawley
In the following code fragment, what context is foo() in? @ary[0] = foo() the following code @ary= foo() obviously evaluates @foo in a list context, but in the first I'm no longer sure. -- Piers "It is a truth universally acknowledged that a language in possession of a ri

Re: the handiness of undef becoming NaN (when you want that)

2001-11-09 Thread Piers Cawley
Damian Conway <[EMAIL PROTECTED]> writes: > Of course, that's not to say that the particular C that's returned on > failure-to-numerify mightn't have a property set that indicates the problem > was not-a-numeric in nature. Having more than one 'undef' value sounds like a recipe for internals mad

Re: Static Values and Variable Bindings [was RE: Perl 6 -Cheerleader s?]

2001-11-02 Thread Piers Cawley
"Brent Dax" <[EMAIL PROTECTED]> writes: > Garrett Goebel: > # > my int ($pre, $in, $post) is constant = (0..2); > # > # Means that you are asking for compile time optimizations, and > # agreeing not > # to bless references to, or ascribe run-time properties to > # those scalars. So > # we've alre

Re: Perl 6 - Cheerleaders?

2001-11-01 Thread Piers Cawley
"David M. Lloyd" <[EMAIL PROTECTED]> writes: > On Wed, 31 Oct 2001, David Nesting wrote: > >> On Tue, Oct 30, 2001 at 09:37:39AM -0500, Aaron Sherman wrote: >> : Yep, but in Perl5, this was never very clean or obvious to the >> : casual programmer. Constants have been coming of age in Perl, >> :

Re: Perl 6 - Cheerleaders?

2001-10-28 Thread Piers Cawley
Damian Conway <[EMAIL PROTECTED]> writes: > Brent told us: >> All these Star Trek references are threatening to make my warp core >> breach... :^) > > Too much information. Look, I'm sorry, okay? I only finished up the article with a Trek reference because, whilst I could see Larry as G

Re: Perl 6 - Cheerleaders?

2001-10-26 Thread Piers Cawley
Jonathan Scott Duff <[EMAIL PROTECTED]> writes: > On Fri, Oct 26, 2001 at 01:13:42PM -0400, Aaron Sherman wrote: >> It does make me think, though... Would it make sense to have an >> accessor operator? For example, in Perl5 I would do this: >> >> sub foo { >> my $self = shift;

Re: Perl 6 - Cheerleaders?

2001-10-26 Thread Piers Cawley
Bart Lateur <[EMAIL PROTECTED]> writes: > On Thu, 25 Oct 2001 16:53:46 -0500, Garrett Goebel wrote: > >>Piers Cawley has written a nice article entitled: "Perl 6 : Not Just For >>Damians". > >>http://www.perl.com/pub/a/2001/10/23/damians.html >

Re: Perl 6 - Cheerleaders?

2001-10-26 Thread Piers Cawley
Uri Guttman <[EMAIL PROTECTED]> writes: >>>>>> "GG" == Garrett Goebel <[EMAIL PROTECTED]> writes: > > GG> Piers Cawley has written a nice article entitled: "Perl 6 : Not > GG> Just For Damians". > > GG> If the

Re: AOP

2001-10-24 Thread Piers Cawley
You have seen Aspect.pm haven't you? Aspect Oriented Programming for Perl 5, built on top of Hook::LexWrap and very, very cool. -- Piers "It is a truth universally acknowledged that a language in possession of a rich syntax must be in need of a rewrite." -- Jane Austen?

Re: the handiness of undef becoming NaN (when you want that)

2001-10-22 Thread Piers Cawley
Aaron Sherman <[EMAIL PROTECTED]> writes: > On Mon, Oct 22, 2001 at 11:30:01AM -0700, David Whipp wrote: >> > > More, someone has mentioned the %x{$_}++ feature, which IMHO, MUST >> > > continue to work. >> > >> > What is void plus one? >> >> Can't we utilize the lazy arrays stuff to make all t

Re: the handiness of undef becoming NaN (when you want that)

2001-10-22 Thread Piers Cawley
Aaron Sherman <[EMAIL PROTECTED]> writes: > On Mon, Oct 22, 2001 at 07:39:44PM +0100, Piers Cawley wrote: > >> Yeah, but it's correct. If you extract something and get garbage then >> you're going to screw your average up. Admittedly, in 400,000 lines, >&g

Re: the handiness of undef becoming NaN (when you want that)

2001-10-22 Thread Piers Cawley
Aaron Sherman <[EMAIL PROTECTED]> writes: > On Mon, Oct 22, 2001 at 04:27:24PM +0100, Sam Vilain wrote: >> On Fri, 19 Oct 2001 09:27:50 -0400 >> Aaron Sherman <[EMAIL PROTECTED]> wrote: >> >> > > I am implementing a textbook algo in Perl (the textbook has >> > > it written in C++) and have reali

Operator function names

2001-10-16 Thread Piers Cawley
Okay, I think I understand how we're going to be mapping from an operator to a function name in most cases. But what about the ternary operator? operator:??:: Or something else. I'm assuming something else, because there may be cases in which we want to define our own ternary operators. (Wei

Re: reduce via ^

2001-10-11 Thread Piers Cawley
Damian Conway <[EMAIL PROTECTED]> writes: > Colin exemplifies: > >> $a = 1; >> @a = (1); >> @b = (1, 2, 3); >> @c = (4, 5, 6); >> >> $a = $a ^+ @b; >> @a = @a ^+ @b; >> >> print $a; # 7 > > No. It will (probably) print: 4. Because: > > $a = $a ^

Re: More on operators

2001-10-10 Thread Piers Cawley
HellyerP <[EMAIL PROTECTED]> writes: > > :Alberto Manuel Brandao Simoes <[EMAIL PROTECTED]> writes: > > : > > :> If we are in the mood of changing operators, && can be /\ > > :> and || can be \/. At least, mathematicians will like it! > > : > > :You are, of course, joking. > > > Given Da

Re: More on operators

2001-10-10 Thread Piers Cawley
Alberto Manuel Brandao Simoes <[EMAIL PROTECTED]> writes: > If we are in the mood of changing operators, && can be /\ > and || can be \/. At least, mathematicians will like it! You are, of course, joking. -- Piers

Re: EX3: Adverbs and print()

2001-10-10 Thread Piers Cawley
Bart Lateur <[EMAIL PROTECTED]> writes: > On Sat, 06 Oct 2001 22:20:49 -0400, John Siracusa wrote: > > >So, in the … operator, the filter is the adverb: > > > >$sum = … @costs : {$^_ < 1000}; > > WTF is that operator? All I see is a black block. We're not in ASCII any > more, Toto... I'm g

Re: Just a thought...

2001-10-09 Thread Piers Cawley
Bart Lateur <[EMAIL PROTECTED]> writes: > On 09 Oct 2001 11:22:02 +0100, Piers Cawley wrote: > > >Does the change from ?: to ??:: mean that we can have '?' as a valid > >character in an identifier? > > I'm sure it won't be. The reasoning for r

<    1   2   3   4   5   6   >