Re: Variable attributes (was Re: RFC 355 (v1) Leave $[ alone.)

2000-10-03 Thread David L. Nicol
Dan Sugalski wrote: > > At 04:39 PM 10/1/00 -0700, Peter Scott wrote: > > What are the chances of the internals supporting user-defined > >attributes? What would the API look like? > > Well, yeah, it'll sort of have to if we allow user-defined types. If you do: > >my Dog $spot : male; > >

Re: Variable attributes (was Re: RFC 355 (v1) Leave $[ alone.)

2000-10-02 Thread John Porter
Peter Scott wrote: > > Maybe I'm just being dense, but why shouldn't arrays and hashes inherit > attributes from UNIVERSAL? I think, rather, they should inherit from some other root class, since UNIVERSAL is for blessed things. > Hmm, am I saying that I should be able to > write @array->met

Re: Variable attributes (was Re: RFC 355 (v1) Leave $[ alone.)

2000-10-02 Thread John Porter
Nathan Wiger wrote: > I pushed a lot of these issues in RFC 319 and 337, which would let you > say something like: > >my Pet @pets :mean; # integrated implicit tie >@pets->attributes('mean') # "true", like 'can' Blech. exists @pets:mean # true -- John Porter

Re: Variable attributes (was Re: RFC 355 (v1) Leave $[ alone.)

2000-10-02 Thread Nathan Wiger
> I may be raining on your RFC 337 parade here (sorry I didn't get to it > earlier - travel), but I think it entirely reasonable to want to specify a > type for an array different from the type of thing it contains. But what > syntax will you use? If I make one up for the sake of illustration: >

Re: Variable attributes (was Re: RFC 355 (v1) Leave $[ alone.)

2000-10-02 Thread Peter Scott
At 03:55 PM 10/2/00 -0700, Nathan Wiger wrote: > > Or are we talking apples and oranges and the above declaration is intended > > to declare that any *member* of @a is of SomeType, never mind the array > > itself? > >Yes, I think that second sentence hits the point. Currently, there's >ambiguity a

Re: Variable attributes (was Re: RFC 355 (v1) Leave $[ alone.)

2000-10-02 Thread Nathan Wiger
> >However, making it a UNIVERSAL method also dictates that this: > > > >my SomeType @a :someattr; > > > >*must* be either: > > > >1. a builtin type > >2. tied > > > >To get its attributes back out. I'm not sure this is going to always be > >true. > > It must be my sinuses. I don't g

Re: Variable attributes (was Re: RFC 355 (v1) Leave $[ alone.)

2000-10-01 Thread Peter Scott
At 04:53 PM 10/1/00 -0400, Dan Sugalski wrote: >At 11:33 AM 10/1/00 -0700, Peter Scott wrote: >>But, setting aside my visceral reaction to changing array bases, you have >>precisely the same problem here that has scuppered my intent to file an >>RFC for hashes with fixed keys; how do you apply t

Re: Variable attributes (was Re: RFC 355 (v1) Leave $[ alone.)

2000-10-01 Thread John Porter
Jeremy Howard wrote: > > I haven't got around to RFCing the more generic version (that all attributes > are inherited inside nested data types), but that would certainly be a nice > approach. Not to confuse, let's call it cascading instead of inheritance. -- John Porter

Variable attributes (was Re: RFC 355 (v1) Leave $[ alone.)

2000-10-01 Thread John Porter
Bart Lateur wrote: > > You don't declare Perl arrays. They just exist. Well... except for my'ed > arrays. > > My idea is that if anybody sets $[ to 1 in a script, all accesses to > array in that script would use 1 as the index of the very first item: > $ary[1]. But if you pass this array (for ex

Re: RFC 355 (v1) Leave $[ alone.

2000-09-30 Thread Bart Lateur
I should have said: file-scoped lexical. On Sat, 30 Sep 2000 21:56:43 +0100, Nicholas Clark wrote: >If it's lexically scoped, would it be for arrays declared in that scope, or >for arrays accessed in that scope? >I'm not sure. I think I see potential breakage both ways. You don't declare Perl a

Re: RFC 355 (v1) Leave $[ alone.

2000-09-30 Thread Glenn Linderman
Bart Lateur wrote: > On 30 Sep 2000 20:13:55 -, Perl6 RFC Librarian wrote: > > >But setting $[ = 1 is the mathematically correct method for > >array addressing and makes it easier for ordinary mortals to do > >basic tasks with C, array addressing and the like. > > I sure don't want the fact t

Re: RFC 355 (v1) Leave $[ alone.

2000-09-30 Thread Nicholas Clark
On Sat, Sep 30, 2000 at 09:56:43PM +0100, Nicholas Clark wrote: > Similarly modules' formatting breaks if you set $/; $\; D'oh > How many of the punctuation variables would be better with less-than-global > scope? Nicholas Clark

Re: RFC 355 (v1) Leave $[ alone.

2000-09-30 Thread Nicholas Clark
On Sat, Sep 30, 2000 at 10:34:40PM +0200, Bart Lateur wrote: > On 30 Sep 2000 20:13:55 -, Perl6 RFC Librarian wrote: > > >But setting $[ = 1 is the mathematically correct method for > >array addressing and makes it easier for ordinary mortals to do > >basic tasks with C, array addressing and