[RfD] parrot run loops

2003-01-30 Thread Leopold Toetsch
or our runloops are wrong or deep core stuff All run loops get a pointer to the parrot byte code for execution. This has several impacts on the runloop itself and on branching and jumping between instructions. As parrot PASM jumps are expressed by means of opcodes (absolute or relative) all ru

Re: [RFC] multiple code segments and the interpreter

2003-01-30 Thread Leopold Toetsch
Nicholas Clark wrote: On Wed, Jan 29, 2003 at 02:12:01PM +0100, Leopold Toetsch wrote: The variable layout of interpreter->code (actually the packfile) doesn't fit very good for multiple code segments. There is only one ->byte_code pointer, the byte_code_size is in bytes and converted zig tim

Re: Arrays: Default Values

2003-01-30 Thread Leopold Toetsch
Jonathan Scott Duff wrote: The solution I advocate is to allow even "primitive" types to hold undef. Why do you then use a primitive type in the first place? IMHO: 1) primitive types are what they are - no undef, no attributes, just e.g. plain integers (or shorts or bits ...) 2) if you w

Re: Arrays: Default Values

2003-01-30 Thread Spider Boardman
On 29 Jan 2003 14:29:52 -0500, Aaron Sherman wrote (in part): ajs> As for the argument that testing for true non-existentness is a ajs> burden, check out the way Perl5 does this. Hint: there's a central ajs> sv_undef, and that's not what array buckets are initialized to Either you're dead wr

Re: arrays, hashes unified indexing syntax impact on future varia tion s on other collection types

2003-01-30 Thread gregor
AAron -- I think the point is that C<$x{$foo}> says "Hey C<$x>, y'know that unordered mess of stuff you've been keeping track of? Get me the one tagged $foo, woudja?" while C<$x[$n]> says "yo C<$x>! Grab me the C<$n>-th thingee in line over there, hey!". And, nothing prevents you wanting to use a

Sabbatical from the list

2003-01-30 Thread Damian Conway
This is just to let everybody know that I will be unsubscribing from p6-lang for the foreseeable future, effective immediately. I deeply regret that I simply no longer have the time to cope with the volume of messages being generated here. Unfortunately, the exigencies of finding paying work in t

Re: Arrays: Default Values

2003-01-30 Thread Austin Hastings
--- Michael Lazzaro <[EMAIL PROTECTED]> wrote: > Right, we just can't do the 'undef' thing. OK, so let me see if this > is right yet: > > my Int @a is default(2); > @a[5] = 5; > > @a[4]; # 2 (autofilled) > @a[5]; # 5 > @a[6]; # 2 (out-of-bounds) > >

Re: Sabbatical from the list

2003-01-30 Thread Aaron Sherman
On Thu, 2003-01-30 at 15:38, Damian Conway wrote: > This is just to let everybody know that I will be unsubscribing from > p6-lang for the foreseeable future, effective immediately. I too will be leaving this list, as I'm concerned that my recent enthusiasm has at least contributed to Damian's wit

Re: Arrays: Default Values

2003-01-30 Thread Michael Lazzaro
On Thursday, January 30, 2003, at 12:49 PM, Austin Hastings wrote: undef @a[5]; # undefining the element sets it to the default @a[5]; # 2 @a[5] = undef; # same as above @a[5]; # 2 undef!! @a is an array of Int (not int) and can store undef, so no error occurs

RE: Sabbatical from the list

2003-01-30 Thread Brent Dax
Damian Conway: # This is just to let everybody know that I will be # unsubscribing from p6-lang for the foreseeable future, # effective immediately. I, and I'm sure the rest of the list, am sorry to see you go. Best of luck with the job hunt and the serious design work. (I swear, this is the l

Re: Arrays: is computed

2003-01-30 Thread Nicholas Clark
(Sorry, deleted Michael's original message, hence this messy quoting interaction) On Thu, Jan 30, 2003 at 03:11:34PM -0500, [EMAIL PROTECTED] wrote: > Shouldn't access to 'is computed' arrays be read-only? > > If you want to be able to consume the elements by shifting, > you can always create a t

Re: Arrays: Default Values

2003-01-30 Thread Nicholas Clark
On Thu, Jan 30, 2003 at 11:41:04AM -0500, Aaron Sherman wrote: > On Wed, 2003-01-29 at 16:41, Nicholas Clark wrote: > > > And the demonstration was as expected? > > Yes, of course. If you modify a hash, or look at another hash, you > should not expect the same results. Why would you? More importa

Re: Arrays: Default Values

2003-01-30 Thread Aaron Sherman
On Wed, 2003-01-29 at 16:41, Nicholas Clark wrote: > And the demonstration was as expected? Yes, of course. If you modify a hash, or look at another hash, you should not expect the same results. Why would you? More importantly, why would the conversation threat up until now lead to such an exampl

Re: Arrays: Default Values

2003-01-30 Thread Aaron Sherman
On Wed, 2003-01-29 at 17:12, Dan Sugalski wrote: > At 12:40 PM -0500 1/29/03, Aaron Sherman wrote: > >Elements of a has ARE ordered, just not the way you may expect. > > Just to nip this one in the bud... The bud was back that-a-way about 3 days > If people start assuming that there's *any*

Re: Arrays: Default Values

2003-01-30 Thread Aaron Sherman
On Wed, 2003-01-29 at 17:50, Spider Boardman wrote: > On 29 Jan 2003 14:29:52 -0500, Aaron Sherman wrote (in part): > > ajs> As for the argument that testing for true non-existentness is a > ajs> burden, check out the way Perl5 does this. Hint: there's a central > ajs> sv_undef, and that's not wh

arrays, hashes unified indexing syntax impact on future variation s on other collection types

2003-01-30 Thread Garrett Goebel
Joseph F. Ryan wrote: > Stéphane Payrard wrote: > > > >I think that arrays and associative tables are very > >different entities for two reasons: > > -type of keys. array keys are integers > > -cost of insertion and deletion operations: O(n) and > > lower for associative table ( O(1) if you do

Re: Arrays: Default Values

2003-01-30 Thread Dan Sugalski
At 11:41 AM -0500 1/30/03, Aaron Sherman wrote: On Wed, 2003-01-29 at 17:12, Dan Sugalski wrote: At 12:40 PM -0500 1/29/03, Aaron Sherman wrote: >Elements of a has ARE ordered, just not the way you may expect. Just to nip this one in the bud... The bud was back that-a-way about 3 days

Re: arrays, hashes unified indexing syntax impact on future variation s on other collection types

2003-01-30 Thread Damian Conway
What was the reason again which Larry rejected unifying the syntax for array and hash indexing? Because some things have both, and do different things with each. And because some built-in redundancy is useful for error checking, especially on complex nested data structures. As Piers said, we k

Re: arrays, hashes unified indexing syntax impact on future variation s on other collection types

2003-01-30 Thread Piers Cawley
Garrett Goebel <[EMAIL PROTECTED]> writes: > Joseph F. Ryan wrote: >> Stéphane Payrard wrote: >> > >> >I think that arrays and associative tables are very >> >different entities for two reasons: >> > -type of keys. array keys are integers >> > -cost of insertion and deletion operations: O(n) an

Re: Arrays: Default Values

2003-01-30 Thread Michael Lazzaro
On Thursday, January 30, 2003, at 12:03 AM, Leopold Toetsch wrote: Why do you then use a primitive type in the first place? IMHO: 1) primitive types are what they are - no undef, no attributes, just e.g. plain integers (or shorts or bits ...) 2) if you want to store additional information us

Re: Arrays: Default Values

2003-01-30 Thread Dan Sugalski
At 9:53 AM -0800 1/30/03, Michael Lazzaro wrote: This is leading me to the conclusion that primitive-typed arrays should not be allowed to have defaults, period, and that attempting to place one should be a compile-time error. If you want a default, use C instead of an C, and it will work fine

RE: arrays, hashes unified indexing syntax impact on future varia tion s on other collection types

2003-01-30 Thread Garrett Goebel
Apologies in advance for beating this dead horse... Damian Conway wrote: > Garrett Goebel wrote: > > > What was the reason again which Larry rejected unifying the > > syntax for array > > and hash indexing? > > Because some things have both, and do different things with each. Ok $0 is special.

RE: arrays, hashes unified indexing syntax impact on futurevariat ion s on other collection types [x-bayes]

2003-01-30 Thread Garrett Goebel
Piers Cawley wrote: > Garrett Goebel <[EMAIL PROTECTED]> writes: > > > > What was the reason again which Larry rejected unifying the > > syntax for array and hash indexing? As Piers said, we know > > whether $a is an array or hash reference when we do: > > > > print $a->{foo}; > > But as someone

Re: arrays, hashes unified indexing syntax impact on futurevariat ion s on other collection types [x-bayes]

2003-01-30 Thread Piers Cawley
Garrett Goebel <[EMAIL PROTECTED]> writes: > Piers Cawley wrote: >> Garrett Goebel <[EMAIL PROTECTED]> writes: >> > >> > What was the reason again which Larry rejected unifying the >> > syntax for array and hash indexing? As Piers said, we know >> > whether $a is an array or hash reference when w

Re: Arrays: Default Values

2003-01-30 Thread Michael Lazzaro
On Thursday, January 30, 2003, at 09:55 AM, Dan Sugalski wrote: At 9:53 AM -0800 1/30/03, Michael Lazzaro wrote: This is leading me to the conclusion that primitive-typed arrays should not be allowed to have defaults, period, and that attempting to place one should be a compile-time error.

RE: arrays, hashes unified indexing syntax impact on futurevariat ion s on other collection types [x-bayes]

2003-01-30 Thread Garrett Goebel
From: Piers Cawley [mailto:[EMAIL PROTECTED]] > Garrett Goebel <[EMAIL PROTECTED]> writes: > > > > And what's to prevent that collection object from handling: > > > > my $queue = SomeQueue.new; > > > > $queue.push('foo'); > > $queue.push('bar'); > > $queue.push('baz'); > > > >

Re: Arrays: Default Values

2003-01-30 Thread Austin Hastings
--- Michael Lazzaro <[EMAIL PROTECTED]> wrote: > > On Thursday, January 30, 2003, at 12:03 AM, Leopold Toetsch wrote: > > Why do you then use a primitive type in the first place? > > > > IMHO: > > > > 1) primitive types are what they are - no undef, no attributes, > just > > e.g. plain integers

Re: Arrays: Default Values

2003-01-30 Thread Mark Biggar
Austin Hastings wrote: There is no reason why primitive-typed arrays can't have a default. It is the confusion of "default" with "undef" that is causing this problem. If I have: my int @a; print @a[4]; What comes out? Notice, there's no "is default(woo-woo)" in there. Just a plain old primit

Re: Arrays: Default Values

2003-01-30 Thread Michael Lazzaro
On Thursday, January 30, 2003, at 10:56 AM, Austin Hastings wrote: There is no reason why primitive-typed arrays can't have a default. It is the confusion of "default" with "undef" that is causing this problem. Yes, I misspoke. You can have a default, which it will use for autofill & out-of-

Re: Arrays: Default Values

2003-01-30 Thread Dan Sugalski
At 10:54 AM -0800 1/30/03, Mark Biggar wrote: and if we define a prop "is no_default" then you get what ever junk happens to be in memory. (this for even more speed) That's not going to happen. It's too unsafe, and too open to corruption attacks. -- Dan

Re: arrays, hashes unified indexing syntax impact on future varia tion s on other collection types

2003-01-30 Thread Damian Conway
Garrett Goebel wrote: Ok $0 is special. But isn't it _the_ special case? Nope. Pretty much any built-in that returns more than a single piece of information (e.g. C, C, C, etc.) will do the same kind of thing. And strictly speaking, its an ordered associative array right? It doesn't really n

Arrays: is computed

2003-01-30 Thread Michael Lazzaro
For C arrays, things get more complicated. Since there are no true 'holes' in a primitive-typed array, the correct behavior there would seem to be to autofill the array using the computed values. For example, an empty array: my int @a is computed { $^index ** 2 } @a[2]; # 4 (doesn

Re: arrays, hashes unified indexing syntax impact on future variation s on other collection types

2003-01-30 Thread Stéphane Payrard
On Thu, Jan 30, 2003 at 09:11:10AM -0800, Damian Conway wrote: > >What was the reason again which Larry rejected unifying the syntax for > >array > >and hash indexing? > > Because some things have both, and do different things with each. > And because some built-in redundancy is useful for error

RE: arrays, hashes unified indexing syntax impact on future varia tion s on other collection types

2003-01-30 Thread Aaron Sherman
On Thu, 2003-01-30 at 13:13, Garrett Goebel wrote: > Hmm... $0[$!] > > However isn't that something the collection object should have to deal with? > It seems like such nice thing to unify collection syntax. Actually, that's a great example, and there are certainly others. According to Larry, t

Re: arrays, hashes unified indexing syntax impact on future variation s on other collection types

2003-01-30 Thread Austin Hastings
--- Damian Conway <[EMAIL PROTECTED]> wrote: > > What was the reason again which Larry rejected unifying the syntax > for array > > and hash indexing? > > Because some things have both, and do different things with each. > And because some built-in redundancy is useful for error checking, > espec

Re: arrays, hashes unified indexing syntax impact on future varia tion s on other collection types

2003-01-30 Thread Luke Palmer
> X-Original-To: [EMAIL PROTECTED] > Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm > From: Garrett Goebel <[EMAIL PROTECTED]> > Date: Thu, 30 Jan 2003 12:13:22 -0600 > X-SMTPD: qpsmtpd/0.20, http://develooper.com/code/qpsmtpd/ > > --_=_NextPart_001_01C2C88B.468ED3D0 > Content-Type: tex

Fun with unified collections [was: Re: arrays, hashes unified indexing syntax impact on future varia tion s on other collection types]

2003-01-30 Thread gregor
A little blue-sky, here... > > And strictly > > speaking, its an ordered associative array right? It doesn't really need > > the full range of expression offered by $0{...} and $0[...]. All it > > needs is $0[1] for ordered lookups and $0["1"] for named lookups. > > Nope. The array aspect retu

Re: arrays, hashes unified indexing syntax impact on future varia tion s on other collection types

2003-01-30 Thread Aaron Sherman
On Thu, 2003-01-30 at 14:21, Damian Conway wrote: > People, the whole argument that $a[key] should be a homonym for both > array-like and hash-like look-ups is ... a really bad argument to have, and I would not presume. When Perl has tried to unify syntax in that way, it has ultimately failed (a

Re: Arrays: is computed

2003-01-30 Thread gregor
Shouldn't access to 'is computed' arrays be read-only? If you want to be able to consume the elements by shifting, you can always create a tied object that kees a cursor and a reference to the underlying array and gives you that access (and it could die for splicing, etc.)... Regards, -- Gregor

Re: Arrays: Default Values

2003-01-30 Thread Andrew Rodland
On Wednesday 29 January 2003 09:52 pm, Rick Delaney wrote: > On Wed, Jan 29, 2003 at 01:54:10PM -0800, Michael Lazzaro wrote: > > On Wednesday, January 29, 2003, at 12:38 PM, Smylers wrote: > > > That would make the rule very simple indeed: > > > > > > Assigning C to an array element causes that

Re: Arrays: Default Values

2003-01-30 Thread Andrew Rodland
On Thursday 30 January 2003 06:49 pm, Andrew Rodland wrote: > On Wednesday 29 January 2003 09:52 pm, Rick Delaney wrote: > > On Wed, Jan 29, 2003 at 01:54:10PM -0800, Michael Lazzaro wrote: > > > On Wednesday, January 29, 2003, at 12:38 PM, Smylers wrote: > > I'd also like to point out that ruby h

Re: Arrays: is computed

2003-01-30 Thread Michael Lazzaro
[EMAIL PROTECTED] wrote: Shouldn't access to 'is computed' arrays be read-only? In general, I would hope that 90% of them would be, but it's been stated that it won't be a requirement. But hey -- note that, for starters, this would mean that you could easily use an array for caching things

Re: arrays, hashes unified indexing syntax impact on futurevariat ion s on other collection types [x-bayes]

2003-01-30 Thread Piers Cawley
Garrett Goebel <[EMAIL PROTECTED]> writes: > From: Piers Cawley [mailto:[EMAIL PROTECTED]] >> Garrett Goebel <[EMAIL PROTECTED]> writes: >> > >> > And what's to prevent that collection object from handling: >> > >> > my $queue = SomeQueue.new; >> > >> > $queue.push('foo'); >> > $que

Re: Arrays: is computed

2003-01-30 Thread Leopold Toetsch
Michael Lazzaro wrote: [EMAIL PROTECTED] wrote: Shouldn't access to 'is computed' arrays be read-only? In general, I would hope that 90% of them would be, but it's been stated that it won't be a requirement. If you want such 'is computed' thingy, then tie it or wrap it in your own -

Re: [perl #20597] [PATCH] packfile #6

2003-01-30 Thread Leopold Toetsch
Leopold Toetsch wrote: static void cvt_num12_num8(unsigned char *dest, unsigned char *src) [...] I have committed the changes to packfile.c. As the tinderboxen seem to be the ultimate testers, they'll tell if it works :) And please: read the comment in t/native_pbc/number.t TIA leo