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: 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

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: 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

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: 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

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: >> 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

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: >> > 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

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: > 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-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: $^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. &

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: 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

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: 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: $^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: $^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

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: 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

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: 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: 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: 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
"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: 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-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: 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: 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

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

<    1   2   3