Returning from Rules

2004-04-19 Thread Luke Palmer
I notice that when I write a grammar, I end up doing this an awful lot (in P::RD notation): list: term ',' list { make_node(@item[0,1,3]) } | term { $item[1] } With attention on the actions, and assuming is on. In Perl 6, aside from the fact that there's a clearly better wa

A12: Mutating Methods and hyperoperators

2004-04-19 Thread Matthew Walton
I know these were discussed to death not that long ago, but reading Apocalypse 12 I had a query I couldn't remember if it had been covered before or not, and I certainly don't recall seeing it in the Apocalypse, although I've not read the entire thing with as much attention as I might like yet

Re: A12: Mutating Methods and hyperoperators

2004-04-19 Thread Luke Palmer
Matthew Walton writes: > I know these were discussed to death not that long ago, but reading > Apocalypse 12 I had a query I couldn't remember if it had been covered > before or not, and I certainly don't recall seeing it in the Apocalypse, > although I've not read the entire thing with as much

Re: Apocalypse 12

2004-04-19 Thread Mark A. Biggar
Brent 'Dax' Royal-Gordon wrote: chromatic wrote: Perl.com has just made A12 available: I started reading it last night, and ended up going to bed before I was finished. But I just wanted to say that this: With this dispatcher you can continue by saying "next METHOD". is the sort of geni

Re: A12 Q: Pointer-to-member-function behavior?

2004-04-19 Thread Larry Wall
On Sat, Apr 17, 2004 at 11:52:19AM -0400, Austin Hastings wrote: : Is it permissible to use variable dispatch for private methods? Don't see why not, as long as the overhead of switching isn't imposed on every method call. : class Cerebellum { : method :think() {...} : method :ponder() {...}

A12 undef method calls

2004-04-19 Thread Luke Palmer
A12 mentions that C<$foo.bar> should return undef if C<$foo> is undef. While I like the idea a lot, I don't think it should happen without distinction. In fact, that's what I would most expect C<.?> to do, not "call a method if there is one," though that seems useful, too. I'm just shooting in th

Re: A12: Mutating Methods and hyperoperators

2004-04-19 Thread Matthew Walton
Luke Palmer wrote: Matthew Walton writes: But can I do @things».=method(); Of course. Excellent. Thankyou. Not this time :-) Next time then, probably.

placeholder attachment?

2004-04-19 Thread Trey Harris
Can anyone explain the rules of placeholder attachment? i.e., in the example in Perl6::Placeholder's manpage, grep { $data{$^value} } 1..10; C<$^value> is clearly intended to attach to the outer closure C<{ $data{$^value} }>, not the inner closure C<{$^value}>. But how does the compiler know?

Testing job

2004-04-19 Thread Mark Jason Dominus
I'm writing automated tests for the example code in my book, which will go into production early next month. I have the harness and test apparatus all set up; I wrote a complete set of tests for chapter 6, and I think I know how I want it done. But I need help writing the tests themselves, becau

Re: Apocalypse 12

2004-04-19 Thread Mark A. Biggar
Brent 'Dax' Royal-Gordon wrote: chromatic wrote: Perl.com has just made A12 available: I started reading it last night, and ended up going to bed before I was finished. But I just wanted to say that this: With this dispatcher you can continue by saying "next METHOD". is the sort of geni

Re: placeholder attachment?

2004-04-19 Thread Luke Palmer
Trey Harris writes: > Can anyone explain the rules of placeholder attachment? i.e., in the > example in Perl6::Placeholder's manpage, > > grep { $data{$^value} } 1..10; > > C<$^value> is clearly intended to attach to the outer closure C<{ > $data{$^value} }>, not the inner closure C<{$^value}>

Re: Constant strings - again

2004-04-19 Thread Jeff Clites
On Apr 18, 2004, at 8:06 AM, Leopold Toetsch wrote: Leopold Toetsch <[EMAIL PROTECTED]> wrote: [ initial proposal ] I've now checked in a working version. * c2str.pl generates a .str header from a .c file * c2str.pl --all generates $(INC)/string_private_cstring.h * this us used in string_init()

Re: Basic Library Paths (was Re: ICU data file location issues)

2004-04-19 Thread Gordon Henriksen
Dan Sugalski wrote: Brent 'Dax' Royal-Gordon wrote: Dan Sugalski wrote: 3) Parrot itself (the main executable) has a static, global 1K buffer in it that starts and ends with some recognizable string (like, say, "***+++***START|" and "|END***+++***") so we can find it and overwrite the content

Re: Constant strings - again

2004-04-19 Thread Jarkko Hietaniemi
> C-constant region of memory? For instance, if we could tell their > memory address is < stack base, and use that to identify them as > constant? I don't think there is much chance of getting anything like this working portably. > static_strings[7], or something. Then the check is just whether

Re: [perl #28916] gmake

2004-04-19 Thread Jeff Clites
On Apr 17, 2004, at 1:47 PM, Nicholas Clark (via RT) wrote: # New Ticket Created by Nicholas Clark # Please include the string: [perl #28916] # in the subject line of all future correspondence about this issue. # http://rt.perl.org:80/rt3/Ticket/Display.html?id=28916 > You must use /usr/bin/

Re: Basic Library Paths (was Re: ICU data file location issues)

2004-04-19 Thread Jeff Clites
On Apr 17, 2004, at 6:18 PM, Gordon Henriksen wrote: Dan Sugalski wrote: Brent 'Dax' Royal-Gordon wrote: Dan Sugalski wrote: 3) Parrot itself (the main executable) has a static, global 1K buffer in it that starts and ends with some recognizable string (like, say, "***+++***START|" and "|END**

Re: c2str.pl

2004-04-19 Thread Jarkko Hietaniemi
FWIW, the usually picky Tru64 compiler is happy with the code generated with the newest c2str.pl. P.S. Why is the /*const*/ commented out? I would think it would be a good idea.

[perl #28915] parrotbug can only send mail

2004-04-19 Thread via RT
# New Ticket Created by Nicholas Clark # Please include the string: [perl #28915] # in the subject line of all future correspondence about this issue. # http://rt.perl.org:80/rt3/Ticket/Display.html?id=28915 > parrotbug can only send mail. This isn't that useful on systems where mail is accep

[perl #28920] [BUG & Test PATCH imcc/t/syn.t] IMCC .param directives cannot be interrupted

2004-04-19 Thread via RT
# New Ticket Created by chromatic # Please include the string: [perl #28920] # in the subject line of all future correspondence about this issue. # http://rt.perl.org:80/rt3/Ticket/Display.html?id=28920 > The attached patch to the IMCC test suite demonstrates that .param directives must appea

Re: Basic Library Paths (was Re: ICU data file location issues)

2004-04-19 Thread Gordon Henriksen
On Saturday, April 17, 2004, at 10:35 , Gordon Henriksen wrote: Which suggests to me a linked list of resource resolvers. First one in the chain to return a file handle to the data or PBC wins. The head of parrot's own "system" chain would be available to be appended to any other chains that wa

Re: Basic Library Paths (was Re: ICU data file location issues)

2004-04-19 Thread Gordon Henriksen
On Thursday, April 15, 2004, at 01:48 , Dan Sugalski wrote: At this point I can say I don't honestly care all that much, and most of my worries are based on vague feelings that there are platforms out there where finding the actual executable name is somewhere between hard and impossible. I wil

[perl #28916] gmake

2004-04-19 Thread via RT
# New Ticket Created by Nicholas Clark # Please include the string: [perl #28916] # in the subject line of all future correspondence about this issue. # http://rt.perl.org:80/rt3/Ticket/Display.html?id=28916 > You must use /usr/bin/gmake to build ICU. (parrot build fails) gmake was neve

Re: ICU data file location issues

2004-04-19 Thread Gordon Henriksen
On Saturday, April 17, 2004, at 02:17 , Gordon Henriksen wrote: On Thursday, April 15, 2004, at 02:25 , Jeff Clites wrote: For Unix platforms at least, you should be able to do this: executablePath = isAbsolute($0) ? dirname($0) : cwd().dirname($0) That absolutely does not work, as already poin

Re: ICU data file location issues

2004-04-19 Thread Gordon Henriksen
On Thursday, April 15, 2004, at 02:25 , Jeff Clites wrote: For Unix platforms at least, you should be able to do this: executablePath = isAbsolute($0) ? dirname($0) : cwd().dirname($0) That absolutely does not work, as already pointed out. Ths looks like a reasonable reference implementation (L

Re: Constant strings - again

2004-04-19 Thread Leopold Toetsch
Jeff Clites <[EMAIL PROTECTED]> wrote: > To handle multiple files, we'll probably need to generate a .c to hold > the C strings (instead of the .h), and have an extern declaration in > the .h (since it will be included in multiple files). That's assuming > they'll all be aggregated into a single f

Re: [perl #28916] gmake

2004-04-19 Thread Peter Sinnott
On Mon, Apr 19, 2004 at 02:46:20AM -0700, Jeff Clites wrote: > On Apr 17, 2004, at 1:47 PM, Nicholas Clark (via RT) wrote: > > ># New Ticket Created by Nicholas Clark > ># Please include the string: [perl #28916] > ># in the subject line of all future correspondence about this issue. > ># http:/

Re: c2str.pl

2004-04-19 Thread Leopold Toetsch
Jarkko Hietaniemi <[EMAIL PROTECTED]> wrote: > FWIW, the usually picky Tru64 compiler is happy with the code generated > with the newest c2str.pl. > P.S. Why is the /*const*/ commented out? I would think it would be a > good idea. Isn't used anymore (it produced warnings during initialization).

Re: [perl #28920] [BUG & Test PATCH imcc/t/syn.t] IMCC .param directives cannot be interrupted

2004-04-19 Thread Leopold Toetsch
Chromatic <[EMAIL PROTECTED]> wrote: > The attached patch to the IMCC test suite demonstrates that .param > directives must appear in one contiguous block, else an 'No entries on > UserStack!' error will appear. > This may be intentional -- however, it surprised me. $ perldoc imcc/docs/calling_c

Re: Constant strings - again

2004-04-19 Thread Leopold Toetsch
Jeff Clites <[EMAIL PROTECTED]> wrote: > Here is a related patch, to cause us to cache the hash values of all > strings (on demand). The important part is that the cached value is > cleared out in unmake_COW, which is called any time we might mutate the > string (and thus, invalidate the cached va

A note WRT c2str.pl

2004-04-19 Thread Leopold Toetsch
I've now changed interpreter.c to use CONST_STRING() too. It's basically working but there is a problem: The macros use the current line number for identifying a string. When the line is: f (some, CONST_STRING("foo"), some_more); then c2str.pl and the C compiler have different line numbers

Re: set_string_native

2004-04-19 Thread Dan Sugalski
At 5:35 PM +0200 4/16/04, Leopold Toetsch wrote: This vtable currently copies the string. Yeah, and we've the same issue with set_pmc -- some of the versions make a copy and some just use the passed in PMC. (the get_[string|pmc] vtable methods have a similar issue--should they return the real th

Re: OO benches

2004-04-19 Thread Dan Sugalski
At 11:19 AM +0100 4/17/04, Piers Cawley wrote: Leopold Toetsch <[EMAIL PROTECTED]> writes: Aaron Sherman <[EMAIL PROTECTED]> wrote: On Fri, 2004-04-16 at 18:18, Leopold Toetsch wrote: Sorry, I gave the wrong impression. I meant it looks suspiciously like Python is doing a lazy construction on

Re: [perl #28916] gmake

2004-04-19 Thread Dan Sugalski
At 1:47 PM -0700 4/17/04, Nicholas Clark (via RT) wrote: # New Ticket Created by Nicholas Clark # Please include the string: [perl #28916] # in the subject line of all future correspondence about this issue. # http://rt.perl.org:80/rt3/Ticket/Display.html?id=28916 > You must use /usr/bin/gmak

Re: Basic Library Paths (was Re: ICU data file location issues)

2004-04-19 Thread Dan Sugalski
At 9:18 PM -0400 4/17/04, Gordon Henriksen wrote: Dan Sugalski wrote: Brent 'Dax' Royal-Gordon wrote: Dan Sugalski wrote: 3) Parrot itself (the main executable) has a static, global 1K buffer in it that starts and ends with some recognizable string (like, say, "***+++***START|" and "|END***+++

RE: A12 undef method calls

2004-04-19 Thread Austin Hastings
> -Original Message- > From: Luke Palmer [mailto:[EMAIL PROTECTED] > Sent: Monday, 19 April, 2004 06:00 AM > To: Language List > Subject: A12 undef method calls > > > A12 mentions that C<$foo.bar> should return undef if C<$foo> is undef. > While I like the idea a lot, I don't think it s

RE: Apocalypse 12

2004-04-19 Thread Austin Hastings
> -Original Message- > From: Mark A. Biggar [mailto:[EMAIL PROTECTED] > > Brent 'Dax' Royal-Gordon wrote: > > > chromatic wrote: > > > >> Perl.com has just made A12 available: > > > > > > I started reading it last night, and ended up going to bed before I was > > finished. But I just wan

Re: Apo 12: Space in method calls

2004-04-19 Thread Larry Wall
On Sat, Apr 17, 2004 at 01:07:44PM -0500, Abhijit A. Mahabal wrote: : I do not understand one of the examples in the Use of methods/the dot : notation section: : : $obj.method ($x + $y) + $z : : >From the earlier examples (like $obj.method +1), I got the impression that : you look ahead until you

Re: Apo 12

2004-04-19 Thread Larry Wall
On Sat, Apr 17, 2004 at 01:12:58PM -0400, Austin Hastings wrote: : If it's not totally obvious to everyone, you should download a copy of A12 : (I like the "printer-friendly" all-in-one-page version) as a hedge against : the almost-inevitable slashdotting. Or not... Perhaps slashdot has decided t

Re: placeholder attachment?

2004-04-19 Thread Larry Wall
On Mon, Apr 19, 2004 at 04:48:05AM -0600, Luke Palmer wrote: : Trey Harris writes: : > Can anyone explain the rules of placeholder attachment? i.e., in the : > example in Perl6::Placeholder's manpage, : > : > grep { $data{$^value} } 1..10; : > : > C<$^value> is clearly intended to attach to th

Re: Apo 12: Space in method calls

2004-04-19 Thread Abhijit A. Mahabal
On Mon, 19 Apr 2004, Larry Wall wrote: > On Sat, Apr 17, 2004 at 01:07:44PM -0500, Abhijit A. Mahabal wrote: > : $obj.method ($x + $y) + $z > : > : >From the earlier examples (like $obj.method +1), I got the impression that > : you look ahead until you find a term or an operator. In the example a

Re: Apo 12

2004-04-19 Thread Dan Sugalski
At 8:11 AM -0700 4/19/04, Larry Wall wrote: On Sat, Apr 17, 2004 at 01:12:58PM -0400, Austin Hastings wrote: : If it's not totally obvious to everyone, you should download a copy of A12 : (I like the "printer-friendly" all-in-one-page version) as a hedge against : the almost-inevitable slashdotting

Re: Apo 12: Space in method calls

2004-04-19 Thread Larry Wall
On Mon, Apr 19, 2004 at 10:37:57AM -0500, Abhijit A. Mahabal wrote: : > $obj.meth, -> obviously not arguments : > $obj.meth $foo,$bar -> obviously arguments : > : : $obj.meth() + $bat -> obviosly not arguments : $obj.meth () + $bat

Re: placeholder attachment?

2004-04-19 Thread Trey Harris
In a message dated Mon, 19 Apr 2004, Larry Wall writes: > On Mon, Apr 19, 2004 at 04:48:05AM -0600, Luke Palmer wrote: > : Trey Harris writes: > : > Can anyone explain the rules of placeholder attachment? i.e., in the > : > example in Perl6::Placeholder's manpage, > : > > : > grep { $data{$^valu

Is Dog|undef a legal type?

2004-04-19 Thread Abhijit A. Mahabal
If we have a method that returns Dog if it returns anything at all, can we say: method foo returns Dog|undef {...} In a similar vein, if the function reurns a dog or a refernce to an array , can we use Dog|Array? And is this legal: given ($obj){ when Dog: ... when Array: ...

Re: Apo 12: Space in method calls

2004-04-19 Thread Abhijit A. Mahabal
> No, obviously arguments. Okay, I see the problem. What you're missing > is that in an earlier Apocalypse, we said that postfix subscripts > and argument lists may not have an intervening space. Oh, I see. Yes, I had missed that. Thanks for clearing that up. --Abhijit

Re: set_string_native

2004-04-19 Thread Leopold Toetsch
Dan Sugalski <[EMAIL PROTECTED]> wrote: > At 5:35 PM +0200 4/16/04, Leopold Toetsch wrote: >>This vtable currently copies the string. > Yeah, and we've the same issue with set_pmc -- some of the versions > make a copy and some just use the passed in PMC. (the > get_[string|pmc] vtable methods have

OSCON discount slots

2004-04-19 Thread Dan Sugalski
The folks at O'Reilly have handed me 20 discount slots for OSCON this year for "Parrot core contributors", whatever that's supposed to mean. These are 15% off the registration cost, and can be used with other discounts. (There's an early-bird 20% discount if you register before June 18th, so pr

Re: Apo 12

2004-04-19 Thread Larry Wall
On Mon, Apr 19, 2004 at 11:44:24AM -0400, Dan Sugalski wrote: : For that they leave it to lambda.weblogs.com to heap *educated* scorn : and derision on things. :) Hmm, well, in all their educatedness, they don't seem to have figured out that the prototyping behavior they're looking for is actuall

Re: Constant strings - again

2004-04-19 Thread Jeff Clites
On Apr 19, 2004, at 2:25 AM, Leopold Toetsch wrote: We still can precalculate for these constant strings and save some extra cylces (the precalculated value isn't used yet, but ...) And we can precalculate hash values for the string constants in the constant table during compilation (and write it

Re: Is Dog|undef a legal type?

2004-04-19 Thread Larry Wall
On Mon, Apr 19, 2004 at 11:00:33AM -0500, Abhijit A. Mahabal wrote: : If we have a method that returns Dog if it returns anything at all, can we : say: : : method foo returns Dog|undef {...} Yes, but... You'd say that only if you wanted to allow a return type that can be simultaneously Dog and u

Re: [perl #28915] parrotbug can only send mail

2004-04-19 Thread Jerome Quelin
Nicholas Clark (via RT) wrote: > parrotbug can only send mail. > This isn't that useful on systems where mail is accepted by sendmail, > but will never get delivered. > perlbug is able to save the bug report to a file, which can then be > copied over to a system that can send mail. > > Would it be

Re: placeholder attachment?

2004-04-19 Thread Dave Whipp
"Trey Harris" <[EMAIL PROTECTED]> wrote i > It's easy to just say "don't nest placeholder-using closures," but that > doesn't seem workable in practice since every block is a closure, unless > placeholders are forbidden from all but the most trivial cases. Absurdly > trivial, it seems. How about

Re: Is Dog|undef a legal type?

2004-04-19 Thread Juerd
Abhijit A. Mahabal skribis 2004-04-19 11:00 (-0500): > when Dog: ... > when Array: ... Shouldn't that be: when Dog { ... } when Array { ... } Or is there some .when that I have not yet heard of? Juerd

Re: placeholder attachment?

2004-04-19 Thread Larry Wall
On Mon, Apr 19, 2004 at 08:57:47AM -0700, Trey Harris wrote: : > : > It's easy to just say "don't nest placeholder-using closures," but that : > : > doesn't seem workable in practice since every block is a closure, unless : > : > placeholders are forbidden from all but the most trivial cases. Absu

Re: Is Dog|undef a legal type?

2004-04-19 Thread Abhijit A. Mahabal
> Abhijit A. Mahabal skribis 2004-04-19 11:00 (-0500): > > when Dog: ... > > when Array: ... > > Shouldn't that be: > > when Dog { ... } > when Array { ... } > > Or is there some .when that I have not yet heard of? Guilty as charged. My Perl6 is getting rusty... --Abhijit

Re: Is Dog|undef a legal type?

2004-04-19 Thread Larry Wall
On Mon, Apr 19, 2004 at 07:01:34PM +0200, Juerd wrote: : Abhijit A. Mahabal skribis 2004-04-19 11:00 (-0500): : > when Dog: ... : > when Array: ... : : Shouldn't that be: : : when Dog { ... } : when Array { ... } Yes, that's how it should be written. : Or is there some .when tha

A12: Required Named Parameters Strike Back!

2004-04-19 Thread John Siracusa
Those with encyclopedic knowledge of the perl6-language list will recall my impassioned, but ultimately futile plea for required named parameters--that is, required arguments to a function that must be supplied as "pairs" rather than positionally. Here's a post from the middle of that old thread:

Re: Apo 12

2004-04-19 Thread John Siracusa
On 4/19/04 11:11 AM, Larry Wall wrote: > On Sat, Apr 17, 2004 at 01:12:58PM -0400, Austin Hastings wrote: > : If it's not totally obvious to everyone, you should download a copy of A12 > : (I like the "printer-friendly" all-in-one-page version) as a hedge against > : the almost-inevitable slashdott

Re: placeholder attachment?

2004-04-19 Thread Larry Wall
On Mon, Apr 19, 2004 at 09:42:14AM -0700, Dave Whipp wrote: : "Trey Harris" <[EMAIL PROTECTED]> wrote i : > It's easy to just say "don't nest placeholder-using closures," but that : > doesn't seem workable in practice since every block is a closure, unless : > placeholders are forbidden from all bu

Re: Apo 12

2004-04-19 Thread Larry Wall
On Mon, Apr 19, 2004 at 01:19:36PM -0400, John Siracusa wrote: : On 4/19/04 11:11 AM, Larry Wall wrote: : > On Sat, Apr 17, 2004 at 01:12:58PM -0400, Austin Hastings wrote: : > : If it's not totally obvious to everyone, you should download a copy of A12 : > : (I like the "printer-friendly" all-in-o

Re: A12: Required Named Parameters Strike Back!

2004-04-19 Thread Larry Wall
On Mon, Apr 19, 2004 at 01:14:57PM -0400, John Siracusa wrote: : I know we are running out of special characters, but I really, really think : that required named parameters are a natural fit for many common APIs. A12 : has reinforced that belief. Save me, Dami-Wan Wallnobi, you're my only : hope

Re: A12: Required Named Parameters Strike Back!

2004-04-19 Thread Dan Sugalski
At 1:14 PM -0400 4/19/04, John Siracusa wrote: I know we are running out of special characters, but I really, really think that required named parameters are a natural fit for many common APIs. Well... maybe, but ponder a likely common case--automatically redelegated initialization methods with cl

Re: set_string_native

2004-04-19 Thread Dan Sugalski
At 6:04 PM +0200 4/19/04, Leopold Toetsch wrote: Dan Sugalski <[EMAIL PROTECTED]> wrote: At 5:35 PM +0200 4/16/04, Leopold Toetsch wrote: This vtable currently copies the string. Yeah, and we've the same issue with set_pmc -- some of the versions make a copy and some just use the passed in PMC.

Re: A12: Required Named Parameters Strike Back!

2004-04-19 Thread John Siracusa
On 4/19/04 1:30 PM, Larry Wall wrote: > On Mon, Apr 19, 2004 at 01:14:57PM -0400, John Siracusa wrote: > : I know we are running out of special characters, but I really, really think > : that required named parameters are a natural fit for many common APIs. A12 > : has reinforced that belief. Sav

Re: A12: Required Named Parameters Strike Back!

2004-04-19 Thread Jonathan Scott Duff
On Mon, Apr 19, 2004 at 10:30:18AM -0700, Larry Wall wrote: > On Mon, Apr 19, 2004 at 01:14:57PM -0400, John Siracusa wrote: > : I know we are running out of special characters, but I really, really think > : that required named parameters are a natural fit for many common APIs. A12 > : has reinfo

Re: A12: Required Named Parameters Strike Back!

2004-04-19 Thread John Siracusa
On 4/19/04 1:41 PM, Dan Sugalski wrote: > At 1:14 PM -0400 4/19/04, John Siracusa wrote: >> I know we are running out of special characters, but I really, really think >> that required named parameters are a natural fit for many common APIs. > > Well... maybe, but ponder a likely common case--auto

Minor confusion

2004-04-19 Thread Jonathan Scott Duff
Quoting A12... > Note that an attribute declaration of the form > > has Tail $wagger .= new(...) > > might not do what you want done when you want it done, if what you > want done is to create a new Dog object each time an object is built. > For that you'd have to say: > > has Tail $wagg

A12: Naming Police - "P6opaque"

2004-04-19 Thread John Siracusa
>From page 7: > In any event, strings are reserved for other object layouts. We could > conceivably have things like: > >return $class.bless("Cstruct", *%_); > > So as it happens, 0 is short for the layout "P6opaque". I feel like "we" have pretty well staked out the letters p-e-r-l, but anyth

Re: A12: Required Named Parameters Strike Back!

2004-04-19 Thread Dan Sugalski
At 1:50 PM -0400 4/19/04, John Siracusa wrote: On 4/19/04 1:41 PM, Dan Sugalski wrote: At 1:14 PM -0400 4/19/04, John Siracusa wrote: I know we are running out of special characters, but I really, really think that required named parameters are a natural fit for many common APIs. Well... maybe,

A12: default accessors and encapsulation

2004-04-19 Thread John Siracusa
Let's say I have a class with some attributes: class Dog; has $.name is rw; has $.age is rw; has $.gender is rw; I initially decide to accept the default accessors. $dog.name = 'Ralph'; print $dog.age; This works well for a while, but then I decide to update Dog so that

Re: A12: default accessors and encapsulation

2004-04-19 Thread Juerd
John Siracusa skribis 2004-04-19 14:20 (-0400): > has $.gender is rw; > (...) > This works well for a while, but then I decide to update Dog so that setting > the name also sets the gender. > $dog.name = 'Susie'; # also sets $dog.gender to 'female' > How do I write such a name() method? Do

Re: PMC constants

2004-04-19 Thread Dan Sugalski
At 4:39 PM +0200 4/16/04, Leopold Toetsch wrote: While trying to speed up hash lookups [1] I came (again) to the problem that we are missing true PMC constants. We just have a special Sub PMC for storing subroutine entries but no general way to represent a constant PMC item. E.g.: .const pmc

Re: set_string_native

2004-04-19 Thread Leopold Toetsch
Dan Sugalski <[EMAIL PROTECTED]> wrote: > At 6:04 PM +0200 4/19/04, Leopold Toetsch wrote: >> >>I'm not sure if we need the two different get vtable methods though. At >>least there isn't any usage for these ;) > Well, think of aggregates (where it's most likely to be used) That was the next ques

Re: Minor confusion

2004-04-19 Thread Larry Wall
On Mon, Apr 19, 2004 at 01:02:36PM -0500, Jonathan Scott Duff wrote: : Quoting A12... : > Note that an attribute declaration of the form : > : > has Tail $wagger .= new(...) : > : > might not do what you want done when you want it done, if what you : > want done is to create a new Dog object

Re: A12: Naming Police - "P6opaque"

2004-04-19 Thread Larry Wall
On Mon, Apr 19, 2004 at 02:04:55PM -0400, John Siracusa wrote: : >From page 7: : : > In any event, strings are reserved for other object layouts. We could : > conceivably have things like: : > : >return $class.bless("Cstruct", *%_); : > : > So as it happens, 0 is short for the layout "P6opaque

Re: A12: Naming Police - "P6opaque"

2004-04-19 Thread John Siracusa
On 4/19/04 3:36 PM, Larry Wall wrote: > On Mon, Apr 19, 2004 at 02:04:55PM -0400, John Siracusa wrote: > : So, how about "Perl6opaque" (or "Perl6Opaque"), just to be safe :) > > How 'bout just "Opaque", meaning Parrot's native object type, or whatever > the native opaque type is for the platform i

RE: A12: default accessors and encapsulation

2004-04-19 Thread Austin Hastings
> -Original Message- > From: John Siracusa [mailto:[EMAIL PROTECTED] > Sent: Monday, 19 April, 2004 02:21 PM > To: Perl 6 Language > Subject: A12: default accessors and encapsulation > > > Let's say I have a class with some attributes: > > class Dog; > > has $.name is rw; > ha

Re: A12: default accessors and encapsulation

2004-04-19 Thread John Siracusa
On 4/19/04 3:58 PM, Austin Hastings wrote: >> I initially decide to accept the default accessors. >> >> $dog.name = 'Ralph'; >> print $dog.age; >> >> This works well for a while, but then I decide to update Dog so that setting >> the name also sets the gender. >> >> $dog.name = 'Susi

Re: backticks (or slash, maybe)

2004-04-19 Thread Angel Faus
Miércoles 14 Abril 2004 14:18, Juerd wrote: > I propose to use ` as a simple hash subscriptor, as an alternative > to {} and <<>>. It would only be useable for \w+ keys or perhaps > -?\w+. As with methods, a simple "atomic" (term exists only in > perlreftut, afaix, but I don't know another word to

Re: backticks (or slash, maybe)

2004-04-19 Thread Juerd
Angel Faus skribis 2004-04-19 22:43 (+0200): > If we really need a ultra-huffman encoding for hash subscriptors, I > have always dreamt of being able to do: > %hash/key > $hashref/foo/bar/baz/quux > ... I'd hate to give up dividing slash. It's one of the few operators that I sometimes type

Re: backticks (or slash, maybe)

2004-04-19 Thread Sean O'Rourke
[EMAIL PROTECTED] (Juerd) writes: > Angel Faus skribis 2004-04-19 22:43 (+0200): >> If we really need a ultra-huffman encoding for hash subscriptors, I >> have always dreamt of being able to do: >> %hash/key >> $hashref/foo/bar/baz/quux >> ... > > I'd hate to give up dividing slash. It's on

Re: backticks (or slash, maybe)

2004-04-19 Thread Juerd
Sean O'Rourke skribis 2004-04-19 15:11 (-0700): > > I'd hate to give up dividing slash. It's one of the few operators that I > > sometimes type without whitespace. Simple because 1/10 is good enough > > and 1 / 10 is very wide. > You can have both, though. But not in a way that makes $foo/$bar div

Re: backticks (or slash, maybe)

2004-04-19 Thread Sean O'Rourke
[EMAIL PROTECTED] (Juerd) writes: > Sean O'Rourke skribis 2004-04-19 15:11 (-0700): >> > I'd hate to give up dividing slash. It's one of the few operators that I >> > sometimes type without whitespace. Simple because 1/10 is good enough >> > and 1 / 10 is very wide. >> You can have both, though. >

Re: backticks (or slash, maybe)

2004-04-19 Thread Matthijs van Duin
On Mon, Apr 19, 2004 at 03:34:13PM -0700, Sean O'Rourke wrote: in a '/' is a regex, anything otherwise is a hash slice. I don't understand. Could you give some examples? Is this in the context of bare /path/to/foo, even? /foo/ # trailing slash -- so it's a regexp (m/foo/) /foo\/bar/ #

Re: backticks (or slash, maybe)

2004-04-19 Thread Juerd
Sean O'Rourke skribis 2004-04-19 15:34 (-0700): > I'm saying "division" is now defined such that when the numerator is > a hash(-ref), the result is the set of values associated with the > denominator. I've never tried to divide a hash or hashref by > something without it being a bug. I understan

Re: A12: default accessors and encapsulation

2004-04-19 Thread John Siracusa
On 4/19/04 4:47 PM, [EMAIL PROTECTED] wrote: >> On 4/19/04 3:58 PM, Austin Hastings wrote: >> One work-around might be an alternate kind of default accessor that doesn't >> allow assignment: >> >> $dog.name # get >> $dog.name('foo') # set >> $dog.name = 'foo' # compile-time er

ICU Win32 Issues

2004-04-19 Thread Marcus Thiesen
Hi, most of you might have recognized it by now but M$ released it's compiler to the public yesterday (I know it has been there before, but everybody sells it as real news). As I'm currently at my fathers place I had the time and resources to do some cygwin and native win32 testing. I can't ge

Duplicated code

2004-04-19 Thread Ovid
As part of our refactoring project, we'd like to find duplicated code. Our hand-rolled scripts do a decent job, but could use a lot of work. Rather than do a lot of work, I'm curious to know if anyone knows of any tools already out there for that. Any suggestions? I'd be rather curious to hea

Re: Duplicated code

2004-04-19 Thread Adrian Howard
On 19 Apr 2004, at 21:03, Ovid wrote: As part of our refactoring project, we'd like to find duplicated code. Our hand-rolled scripts do a decent job, but could use a lot of work. Rather than do a lot of work, I'm curious to know if anyone knows of any tools already out there for that. Any su

Re: A12: default accessors and encapsulation

2004-04-19 Thread Luke Palmer
John Siracusa writes: > On 4/19/04 3:58 PM, Austin Hastings wrote: > >> I initially decide to accept the default accessors. > >> > >> $dog.name = 'Ralph'; > >> print $dog.age; > >> > >> This works well for a while, but then I decide to update Dog so that setting > >> the name also sets th

Re: A12: default accessors and encapsulation

2004-04-19 Thread Damian Conway
John Siracusa wrote: > I'd either like a way to more cleanly extend the default accessor's > assignment behavior down the road (i.e. by just writing a new name() method, > not by hacking away at STORE traits and adding private worker subs) or a way > to auto-generate the slightly more "boring" def

Re: backticks (or slash, maybe)

2004-04-19 Thread Damian Conway
Sean O'Rourke wrote: > I'm saying "division" is now defined such that when the numerator is > a hash(-ref), the result is the set of values associated with the > denominator. I've never tried to divide a hash or hashref by > something without it being a bug. Right...in Perl 5. In Perl 6, a hash

Re: A12: Required Named Parameters Strike Back!

2004-04-19 Thread Larry Wall
On Mon, Apr 19, 2004 at 01:44:53PM -0400, John Siracusa wrote: : On 4/19/04 1:30 PM, Larry Wall wrote: : > On Mon, Apr 19, 2004 at 01:14:57PM -0400, John Siracusa wrote: : > : I know we are running out of special characters, but I really, really think : > : that required named parameters are a natu

Re: A12: Required Named Parameters Strike Back!

2004-04-19 Thread Damian Conway
John Siracusa asked: Well, actually, we saved you last summer when we decided to make + mean that the parameter must be named. ...named and required, or named and optional? Named and optional, by default. IOW, is this all true? sub foo(+$a, +$b) { ... } foo(); # compile-time e

Re: A12: default accessors and encapsulation

2004-04-19 Thread Larry Wall
On Mon, Apr 19, 2004 at 06:53:29PM -0400, John Siracusa wrote: : Yeah, that's exactly what I don't want to type over and over :) I really don't understand what you're getting at here. First you complain that you'd rather write an ordinary method, and then you complain that you have to. Have I me

A12 - Protected Attributes and Methods

2004-04-19 Thread Joe Gottman
Apocalypse 12 was very clear about the difference between private and public class members, but it didn't say anything about protected ones? How can you define a protected member? Do you have to do the following? has $.foo is protected; method bar() is protected; Maybe we could ha

[perl #28981] [PATCH src/exec_start.c] Fix Compilation Error

2004-04-19 Thread via RT
# New Ticket Created by chromatic # Please include the string: [perl #28981] # in the subject line of all future correspondence about this issue. # http://rt.perl.org:80/rt3/Ticket/Display.html?id=28981 > I played with making executables today (to no avail; it's having trouble with load_bytec

SDL Parrot Status

2004-04-19 Thread chromatic
Since Piers needs fodder to summarize regularly I've created a small webpage with the current status and downloadable snapshots for SDL Parrot: http://wgz.org/chromatic/parrot/sdl/ You'll probably see a link to my PDX.pm talk from earlier this month. It's not ground-breakingly new,

Re: ICU Win32 Issues

2004-04-19 Thread George R
Your concerns are valid for versions of ICU before 3.0. ICU 3.0 will allow you to build with Cygwin with gcc or MSVC's cl compiler. The toolutil library is located in icu/source/tools/toolutil. If you used the --disabled-shared configure option as Parrot's README states (not ICU's readme), yo