Re: @array = %hash

2002-09-02 Thread Piers Cawley
Uri Guttman <[EMAIL PROTECTED]> writes: >> "SC" == Simon Cozens <[EMAIL PROTECTED]> writes: > > SC> [EMAIL PROTECTED] (Damian Conway) writes: > >> > hashes can now take objects as keys and won't just stringify them. > >> > >> Correct. But I believe that's only if the hash has a prope

Re: Hypothetical variables and scope

2002-09-02 Thread Aaron Sherman
On Mon, 2002-09-02 at 23:50, Trey Harris wrote: > No. $0{x} would be set to "grass". $x would stay as 2. $x is in a > different scope from the hypothetical, so it doesn't get touched. Ok, it's just taking some time for me to get my head around just what C and C are, but I'm getting there. Thi

Re: Hypothetical variables and scope

2002-09-02 Thread Trey Harris
In a message dated 2 Sep 2002, Aaron Sherman writes: > I'm working on a library of rules and subroutines for dealing with UNIX > system files. This is really just a mental exercise to help me grasp the > new pattern stuff from A5. > > I've hit a snag, though, on hypothetical variables. How would

Hypothetical variables and scope

2002-09-02 Thread Aaron Sherman
I'm working on a library of rules and subroutines for dealing with UNIX system files. This is really just a mental exercise to help me grasp the new pattern stuff from A5. I've hit a snag, though, on hypothetical variables. How would this code work? { my $x = 2; my $y = "Th

Re: auto deserialization

2002-09-02 Thread David Wheeler
On Monday, September 2, 2002, at 10:00 AM, Damian Conway wrote: > No, I never said (nor intended to imply) that. Note that I carefully > avoided the > word "alias" in my description of this technique. ;-) That was my doing. Sorry folks. David -- David Wheeler

Re: auto deserialization

2002-09-02 Thread David Wheeler
On Monday, September 2, 2002, at 03:44 AM, Damian Conway wrote: >> my Date $date .= new('Jun 25, 20002'); > > H. That's a very interesting idea. > I like it. Hallelujah! I like it, too! It's only one character more than my original suggestion! Regards, David -- David Wheeler

Re: Request for default rule modifiers in a grammar

2002-09-02 Thread Ken Fox
Damian Conway wrote: > One possibility is that a modifier is > implemented via a special class: > > my class Decomment is RULE::Modifier >is invoked(:decomment) { > method SETUP ($data, $rule) { > ... > } > # etc. >

Re: @array = %hash

2002-09-02 Thread Damian Conway
Uri Guttman wrote: > but what about mixing pairs and scalars which was the core of this > thread? Then you get whatever behaviour you defined the hash to give. > by default it seems assigning such a list to a hash would use > the pairs as 2 elements It's not the right way to think about wha

Re: auto deserialization

2002-09-02 Thread Damian Conway
Mike Lambert wrote: > class Date is Really::Long::Package::Name::Ugh; > > class DateManipulator; > our Date $date2manip; > ...date manip methods here... > > An external class is thus unable to do: > $DateManipulator::date2manip = new Really::Long::Package::Name::Ugh() > > Is that correct? Ye

Re: auto deserialization

2002-09-02 Thread Mike Lambert
Damian Conway wrote: > Trey Harris wrote: > > > An alias? Isn't > > > > class Date is Really::Long::Package::Name::Ugh; > > > > a new class declaration, declaring 'Date' as a subclass of > > Really::Long::Package::Name::Ugh? > > Yes. It's not an alias. class Date is Really::Long::Package::Nam

Re: auto deserialization

2002-09-02 Thread Dan Sugalski
At 4:01 PM +0100 8/29/02, Nicholas Clark wrote: >On Thu, Aug 29, 2002 at 07:52:42AM -0700, Steve Canfield wrote: >> From: Dan Sugalski [EMAIL PROTECTED] >> >I actually had something a bit more subversive >> >in mind, where the assignment operator for the >> >Date class did some magic the same

Re: atomicness and \n

2002-09-02 Thread Dan Sugalski
At 9:24 PM -0400 8/31/02, Ken Fox wrote: >Damian Conway wrote: >>No. It will be equivalent to: >> >> <[\x0a\x0d...]> > >I don't think \n can be a character class because it >is a two character sequence on some systems. Apoc 5 >said \n will be the same everywhere, so won't it be >something li

Re: @array = %hash

2002-09-02 Thread Uri Guttman
> "DC" == Damian Conway <[EMAIL PROTECTED]> writes: DC> Uri Guttman wrote: >> so what that attribute does is force the hash to keep all pairs as >> single objects. but what about run time control of it? sometimes you >> might want a list of pairs to be handled like pairs and other tim

Re: auto deserialization

2002-09-02 Thread Damian Conway
Nicholas Clark wrote: > So, based on what I remember about variables, would > > class Date := Really::Long::Package::Name::Ugh; > > express aliasing of classes? By analogy to: my $date := $really::long::variable::name::ugh; yes. If Larry allows aliasing of classnames at all, that

Re: auto deserialization

2002-09-02 Thread Damian Conway
Trey Harris wrote: > An alias? Isn't > > class Date is Really::Long::Package::Name::Ugh; > > a new class declaration, declaring 'Date' as a subclass of > Really::Long::Package::Name::Ugh? Yes. It's not an alias. > it will have a similar effect to aliasing Really::Long::Package::Name::Ugh

Re: auto deserialization

2002-09-02 Thread Damian Conway
Graham Barr wrote: > I would say it is not always redundant to specify the type on both > sides > > my Dog $dog = Greyhound.new('black'); Sure. But it's the redundant case we were trying to simplify. >>And, furthermore, that you could easily define special semantics >>for void-context con

Re: auto deserialization

2002-09-02 Thread Damian Conway
Adam D. Lopresto wrote: > That's pretty close to what I was thinking of, but I don't think the > constructors actually have to be special. What if "my Date $date;" lets the > compiler know that $date belongs to the Date class, even if it's undef? If > that's the case you could call static funct

Re: @array = %hash

2002-09-02 Thread Damian Conway
Uri Guttman wrote: > so what that attribute does is force the hash to keep all pairs as > single objects. but what about run time control of it? sometimes you > might want a list of pairs to be handled like pairs and other times you > want pairs to be scalars in a hash assignment. is there any wa

Re: Request for default rule modifiers in a grammar

2002-09-02 Thread Damian Conway
Ken Fox wrote: > The thing I'd like to do right now is turn on :w > for all rules. A Fortran grammar might want to turn > on :i for all rules. > > Maybe add modifiers to the grammar declaration? > > grammar Fortran :i { ... } Maybe. Or a property: grammar Fortran is modified(:i) { ...

Re: auto deserialization

2002-09-02 Thread Nicholas Clark
On Mon, Sep 02, 2002 at 04:40:14AM -0400, Trey Harris wrote: > An alias? Isn't > > class Date is Really::Long::Package::Name::Ugh; > > a new class declaration, declaring 'Date' as a subclass of > Really::Long::Package::Name::Ugh? Because the class body is empty, i.e. > this line is equivale

Re: auto deserialization

2002-09-02 Thread Trey Harris
In a message dated 1 Sep 2002, Uri Guttman writes: > > "DW" == David Wheeler <[EMAIL PROTECTED]> writes: > > DW> On Sunday, September 1, 2002, at 05:30 AM, Damian Conway wrote: > >> Sure. But the right solution is to permanently eliminate the > >> sesquipedalian > >> name (so you don

Re: auto deserialization

2002-09-02 Thread Graham Barr
On Sat, Aug 31, 2002 at 01:52:18PM +, Damian Conway wrote: > I'd suggest that redundancy in syntax is often a good thing and > that there's nothing actually wrong with: > > my Date $date = Date.new('June 25, 2002'); I would say it is not always redundant to specify the type on both sid