Re: [perl #59542] null hash keys give segfault

2008-10-02 Thread NotFound
> maybe a duplicate of #43485 > > PIR code to reproduce: > > ..sub 'foo' :main > $S0 = null > $P0 = new 'Hash' > # no crash without next line > $P0['yum'] = 5 > $P1 = $P0[$S0] > ..end Fixed in r31566, together with a test adapted from this code. Don't know if is related to #43

[perl #59542] null hash keys give segfault

2008-10-02 Thread via RT
# New Ticket Created by I Sop # Please include the string: [perl #59542] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59542 > maybe a duplicate of #43485 PIR code to reproduce: ..sub 'foo' :main     $S0 = null     $P0 =

[perl #54236] [TODO] Allow Parrot Hashes to have PMC keys

2008-05-15 Thread via RT
ave only string keys, that trying to pull the keys out as PMCs (presumably Strings) fails. Aside from the ugly failure, this design seems broken in the face of languages like Perl6 that expect to be able to use non-string hash keys. Both for direct use by Perl6 internals, and for interoperability w

[perl #53464] [TODO] pge - trim whitespace around #= keys

2008-04-28 Thread via RT
# New Ticket Created by Patrick R. Michaud # Please include the string: [perl #53464] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=53464 > Modify PGE to trim extra whitespace around #= keys (which really shouldn&#

[perl #47930] [RFC] Remove comma separated keys [a,b]

2008-03-25 Thread Will Coleda via RT
On Wed Nov 28 12:18:50 2007, kjs wrote: > hi, > > IMCC allows for writing > > $P0 = $P1[10, 20] > > Looking into the yacc file, it seems there's something going on with > slicing, just as the ".." syntax does (which is deprecated). > > I'm wondering what exactly is going on, what it is supposed

[perl #47930] [RFC] Remove comma separated keys [a,b]

2007-11-28 Thread via RT
# New Ticket Created by Klaas-Jan Stol # Please include the string: [perl #47930] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=47930 > hi, IMCC allows for writing $P0 = $P1[10, 20] Looking into the yacc file, it seems

Re: [perl #46391] [TODO] Return None PMC for nonexisting keys in gdbmhash

2007-10-16 Thread Allison Randal
n null for nonexisting keys". And even arrays will be changing to return a null PMC when we roll the pdd15oo branch back in. So, agreed on preferring the null PMC. Allison

Re: [perl #46391] [TODO] Return None PMC for nonexisting keys in gdbmhash

2007-10-15 Thread Patrick R. Michaud
bject line of all future correspondence about this issue. ># http://rt.perl.org/rt3/Ticket/Display.html?id=46391 > > >In src/dynpmc/gdbmhash.c there is the todo item: > >TODO: return None PMC for nonexisting keys. > >This is relevant when fetching keys, and ne

[perl #46391] [TODO] Return None PMC for nonexisting keys in gdbmhash

2007-10-12 Thread Bob Rogers
Ticket/Display.html?id=46391 > In src/dynpmc/gdbmhash.c there is the todo item: TODO: return None PMC for nonexisting keys. This is relevant when fetching keys, and needs to be implemented. Maybe not; see "None Must Die" [perl #40178] . . .

[perl #46391] [TODO] Return None PMC for nonexisting keys in gdbmhash

2007-10-12 Thread via RT
for nonexisting keys. This is relevant when fetching keys, and needs to be implemented.

[perl #44893] [PATCH] struct update in pdd08 (keys)

2007-08-23 Thread via RT
# New Ticket Created by Christoph Otto # Please include the string: [perl #44893] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=44893 > This is just copy/paste from key.h to get this pdd back in sync. Christoph --- docs/pd

Re: [perl #44663] [PATCH] [CAGE] Change Test::* Namespaces to Use Keys

2007-08-16 Thread chromatic
On Friday 17 August 2007 04:24:10 Badai Aqrandista wrote: > Changed [ 'Test::More' ] to [ 'Test'; 'More' ] Thanks, applied as r20648. By the way, the justification for this is that PDD 15 says (or at least should) that the proper approach to namespace nesting

Re: [perl #44663] [PATCH] [CAGE] Change Test::* Namespaces to Use Keys

2007-08-16 Thread chromatic
On Thursday 16 August 2007 15:50:25 Badai Aqrandista via RT wrote: > Sorry I just read the docs/submissions.pod and realized I shouldn't > have submit the patch here. I'll resubmit it in proper way to > parrotbug. It's fine here; don't worry. -- c

Re: [perl #44663] [PATCH] [CAGE] Change Test::* Namespaces to Use Keys

2007-08-16 Thread Badai Aqrandista
Hi, Sorry I just read the docs/submissions.pod and realized I shouldn't have submit the patch here. I'll resubmit it in proper way to parrotbug. -- Thanks, Badai Aqrandista (cheepy)

Re: [perl #44663] [PATCH] [CAGE] Change Test::* Namespaces to Use Keys

2007-08-16 Thread Badai Aqrandista
== --- runtime/parrot/include/test_more.pir(revision 20643) +++ runtime/parrot/include/test_more.pir(patch rt44663-cage-test-more-namespace-to-keys level 1) @@ -12,7 +12,7 @@ # get the testing functions .local

Re: [perl #44663] [CAGE] Change Test::* Namespaces to Use Keys

2007-08-15 Thread Badai Aqrandista
Hi chromatic, Thanks for your prompt reply. > The main change is to change all instances of [ 'Test::More' ] and the like to > [ 'Test'; 'More' ]. Can you point to a document or a thread that explains about why this change needs to happen? I'm at work now. I'll work on it tonight. -- Thanks,

Re: [perl #44663] [CAGE] Change Test::* Namespaces to Use Keys

2007-08-15 Thread chromatic
On Wednesday 15 August 2007 13:42:39 Badai Aqrandista wrote: Hi Badai, > I'm new to the list. I'm a Perl Programmer doing web development in my > day job and I'd like to help. I'll try to commit an hour or two per > day to parrot project. Welcome! > Can you let me know what I should do to get t

Re: [perl #44663] [CAGE] Change Test::* Namespaces to Use Keys

2007-08-15 Thread Badai Aqrandista
Hi, I'm new to the list. I'm a Perl Programmer doing web development in my day job and I'd like to help. I'll try to commit an hour or two per day to parrot project. Can you let me know what I should do to get this done? I mean, do you mean I need to change 'lib/Test/More.pm' or '/runtime/parrot/

[perl #44663] [CAGE] Change Test::* Namespaces to Use Keys

2007-08-15 Thread via RT
# New Ticket Created by chromatic # Please include the string: [perl #44663] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=44663 > The Test::More namespace uses 'Test::More' instead of [ 'Test'; 'More' ]. I prefer the la

Creating Keys in PIR

2006-12-24 Thread Bob Rogers
From: chromatic <[EMAIL PROTECTED]> Date: Sun, 24 Dec 2006 10:56:42 -0800 I'm writing tests for namespaces now (and fixing code), and testing the keyed variants is a real pain, mostly because creating nested Key PMCs in PIR is so face-stabbingly awful, if it's even possible. It

Creating Keys in PIR

2006-12-24 Thread chromatic
I'm writing tests for namespaces now (and fixing code), and testing the keyed variants is a real pain, mostly because creating nested Key PMCs in PIR is so face-stabbingly awful, if it's even possible. Without hard-coding the names, I'd love to see working PIR for creating a key which can refer

Re: HLL root globals and empty keys (was Re: test of get_namespace opcode)

2006-07-10 Thread Chip Salzenberg
On Mon, Jul 10, 2006 at 07:22:21PM -0700, Allison Randal wrote: > Chip Salzenberg wrote: > > I think that "hll" is the best I can think of, and given the existing > > ".HLL" directive, its meaning is immediately clear: > > I like that. Great! > > Seems to me that we should have get_namespace pat

Re: Re: HLL root globals and empty keys (was Re: test of get_namespace opcode)

2006-07-10 Thread Chip Salzenberg
On Mon, Jul 10, 2006 at 06:57:06PM -0700, Matt Diephouse wrote: > Patrick R. Michaud <[EMAIL PROTECTED]> wrote: > >I really like both of these suggestions. We also noted on #parrot that > >get_hll_global would really simplify things for the Tcl folks, which > >currently go through a macro to achie

Re: HLL root globals and empty keys (was Re: test of get_namespace opcode)

2006-07-10 Thread Allison Randal
Chip Salzenberg wrote: > > Hrm. Relative is the usual apposite to absolute, but we have a three-way > logic here, so appositives don't really work. I think that "hll" is the > best I can think of, and given the existing ".HLL" directive, its meaning > is immediately clear: I like that. > Seems

Re: Re: HLL root globals and empty keys (was Re: test of get_namespace opcode)

2006-07-10 Thread Matt Diephouse
Patrick R. Michaud <[EMAIL PROTECTED]> wrote: On Mon, Jul 10, 2006 at 02:53:15PM -0700, Chip Salzenberg wrote: > On Mon, Jul 10, 2006 at 03:23:56PM -0500, Patrick R. Michaud wrote: > > On Sat, Jul 08, 2006 at 01:57:58PM -0700, Chip Salzenberg wrote: > > > Relative is the usual apposite to absolut

Re: HLL root globals and empty keys (was Re: test of get_namespace opcode)

2006-07-10 Thread Patrick R. Michaud
On Mon, Jul 10, 2006 at 02:53:15PM -0700, Chip Salzenberg wrote: > On Mon, Jul 10, 2006 at 03:23:56PM -0500, Patrick R. Michaud wrote: > > On Sat, Jul 08, 2006 at 01:57:58PM -0700, Chip Salzenberg wrote: > > > Relative is the usual apposite to absolute, but we have a three-way > > > logic here, so

Re: HLL root globals and empty keys (was Re: test of get_namespace opcode)

2006-07-10 Thread Chip Salzenberg
On Mon, Jul 10, 2006 at 03:23:56PM -0500, Patrick R. Michaud wrote: > On Sat, Jul 08, 2006 at 01:57:58PM -0700, Chip Salzenberg wrote: > > Relative is the usual apposite to absolute, but we have a three-way > > logic here, so appositives don't really work. I think that "hll" is the > > best I can

Re: HLL root globals and empty keys (was Re: test of get_namespace opcode)

2006-07-10 Thread Patrick R. Michaud
On Sat, Jul 08, 2006 at 01:57:58PM -0700, Chip Salzenberg wrote: > Relative is the usual apposite to absolute, but we have a three-way > logic here, so appositives don't really work. I think that "hll" is the > best I can think of, and given the existing ".HLL" directive, its meaning > is immediat

Re: Re: HLL root globals and empty keys (was Re: test of get_namespace opcode)

2006-07-08 Thread Matt Diephouse
Chip Salzenberg <[EMAIL PROTECTED]> wrote: { Language implementors, please know I'm going to do everything I can to make every commit break nothing. I did pretty well when I made namespace [''] stop being [] -- I fixed all the HLLs in the selfsame patch, except two bits of code generation

Re: HLL root globals and empty keys (was Re: test of get_namespace opcode)

2006-07-08 Thread Chip Salzenberg
{ Language implementors, please know I'm going to do everything I can to make every commit break nothing. I did pretty well when I made namespace [''] stop being [] -- I fixed all the HLLs in the selfsame patch, except two bits of code generation in TGE and PGE, which I fixed when they were

Re: HLL root globals and empty keys (was Re: test of get_namespace opcode)

2006-07-08 Thread Chip Salzenberg
On Thu, Jul 06, 2006 at 05:39:45PM -0700, jerry gay wrote: > am i silly to think that if i'm looking for globals from the current > namespace, they're just as likely to be found closer to the namespace > root, than further away? perhaps something like > >.namespace [ 'Foo'; 'Bar' ] >$P0 =

Re: HLL root globals and empty keys (was Re: test of get_namespace opcode)

2006-07-07 Thread Allison Randal
es the need for creating and passing in an empty array, because 'no argument' always means the same thing as 'empty array' or 'no key' would mean. That's a really elegant piece of consistency. And I think it's a worthy goal to make compiler writer's l

Re: HLL root globals and empty keys (was Re: test of get_namespace opcode)

2006-07-07 Thread Allison Randal
Chip Salzenberg wrote: Well, I see a lot to like about this, but (and you knew there was a "but" ("but" that's my job now :-))), in descending order of difficulty: And you do it so well. Thank you. :) * The division into two categories ("global" and "symbol") leaves the third category (c

Re: Re: HLL root globals and empty keys (was Re: test of get_namespace opcode)

2006-07-06 Thread Matt Diephouse
en prove > useful for real keys. And this makes keys even more compatible with the > Array interface, which I think they might need to implement someday anyway. > > Allison, what do you think of zero-length keys, i.e. having [] construct a > Key PMC describing no dimensions of lookup?

Re: HLL root globals and empty keys (was Re: test of get_namespace opcode)

2006-07-06 Thread jerry gay
On 7/6/06, Chip Salzenberg <[EMAIL PROTECTED]> wrote: So here's an illustrative suggestion, which I think is a variant on one of your also-rans, albeit one that leaves the common HLL case unmarked: .HLL 'perl5', perl5_group .namespace ['Foo'] $P0 = get_cur_global 'x'

Re: HLL root globals and empty keys (was Re: test of get_namespace opcode)

2006-07-06 Thread Chip Salzenberg
{ All you HLL implementors and other PIR users out there, please be assured that I'll be providing as easy a transition as possible when/if these global opcodes are adjusted. } On Thu, Jul 06, 2006 at 11:53:59AM -0700, Allison Randal wrote: > I ran through a number of possibilities, but so far

Re: HLL root globals and empty keys (was Re: test of get_namespace opcode)

2006-07-06 Thread Chip Salzenberg
On Thu, Jul 06, 2006 at 12:11:47PM -0700, Allison Randal wrote: > It's essentially the linguistic problem of being able to refer to > something both by its full name and by the pronoun "it". (Otherwise known > as "topic".) Only, currently "it" isn't represented by a word. Well, we have three disti

Re: HLL root globals and empty keys (was Re: test of get_namespace opcode)

2006-07-06 Thread Allison Randal
b with enough information to disambiguate. And when that gets unclear, they throw in the full name again. ...I was hoping you'd say something like, "Oh yeah, we're gonna need zero-length keys anyway for Perl 6". What is the parameter to operator:postcircumfix [] when a user

Re: HLL root globals and empty keys (was Re: test of get_namespace opcode)

2006-07-06 Thread Allison Randal
Allison Randal wrote: I had a much longer reply, but I'm going to let it steep overnight and see what percolates. I ran through a number of possibilities, but so far my favorite is: find_global and store_global are truly 'global', that is, they always require a fully specified namespace, in

Re: HLL root globals and empty keys (was Re: test of get_namespace opcode)

2006-07-06 Thread Chip Salzenberg
voiding explicit re-coding of a known bit of environmental information, as in "the first floor of this building" rather than "the first floor of 123 main street". > Chip Salzenberg wrote: > >Allison, what do you think of zero-length keys, i.e. having [] construct a >

Re: HLL root globals and empty keys (was Re: test of get_namespace opcode)

2006-07-06 Thread Allison Randal
Chip Salzenberg wrote: --- PART 2, IN WHICH AN ELEGANT SOLUTION IS PROPOSED -- On the other hand, we could extend the key PMC to represent emptiness, i.e. zero dimensions. This seems useful for namespaces and could even prove useful for real keys. And this makes keys even more compatible

HLL root globals and empty keys (was Re: test of get_namespace opcode)

2006-07-05 Thread Chip Salzenberg
ce [] > so that we could also have the > matching C< find_global [], 'foo' >. Otherwise find_global becomes a > two step operation for finding globals in the root HLL namespace. Well, that's a bit problematic. The [] syntax is inherited from the key syntax, and keys c

Re: Q: Keys can be strings/ints only?

2006-01-21 Thread Leopold Toetsch
On Jan 20, 2006, at 21:34, Klaas-Jan Stol wrote: Hi, I tried to index aggregates using several types of keys (that is, several types of values), and it seems only string and integer values can be used as keys. A quick look at the source in compilers/imcc/symreg.c confirms this, there is no

Q: Keys can be strings/ints only?

2006-01-20 Thread Amos Robinson
I think I remember reading one of the comments in the IMCC compiler something to the effect of "if someone needs N keys they can just convert to strings." Sorry I can't find the exact wording right now, but it might point you somewhere useful. Amos Robinson On 1/21/06, Klaas-J

Re: Q: Keys can be strings/ints only?

2006-01-20 Thread Klaas-Jan Stol
Matt Fowles wrote: Klaas-Jan~ On 1/20/06, Klaas-Jan Stol <[EMAIL PROTECTED]> wrote: Hi, I tried to index aggregates using several types of keys (that is, several types of values), and it seems only string and integer values can be used as keys. A quick look at the source in compiler

Re: Q: Keys can be strings/ints only?

2006-01-20 Thread Matt Fowles
Klaas-Jan~ On 1/20/06, Klaas-Jan Stol <[EMAIL PROTECTED]> wrote: > Hi, > > I tried to index aggregates using several types of keys (that is, > several types of values), and it seems only string and integer values > can be used as keys. A quick look at the source in >

Q: Keys can be strings/ints only?

2006-01-20 Thread Klaas-Jan Stol
Hi, I tried to index aggregates using several types of keys (that is, several types of values), and it seems only string and integer values can be used as keys. A quick look at the source in compilers/imcc/symreg.c confirms this, there is no case for 'N' values (and a test makes

Re: Accessing Hash with strings/keys

2005-08-02 Thread Klaas-Jan Stol
Leopold Toetsch wrote: Klaas-Jan Stol wrote: Leopold Toetsch wrote: By far the simplest thing is either look at the opcode in ops/core_ops.c or use a debugger and set a breakpoint at the appropriate opcode, e.g. So, apparently, it seems to me the get_pmc_keyed method is called. Y

Re: Accessing Hash with strings/keys

2005-07-31 Thread Leopold Toetsch
Klaas-Jan Stol wrote: Leopold Toetsch wrote: By far the simplest thing is either look at the opcode in ops/core_ops.c or use a debugger and set a breakpoint at the appropriate opcode, e.g. So, apparently, it seems to me the get_pmc_keyed method is called. Yep .. I tried to run the Par

Re: Accessing Hash with strings/keys

2005-07-31 Thread Klaas-Jan Stol
Leopold Toetsch wrote: On Jul 29, 2005, at 10:38, Klaas-Jan Stol wrote: Anybody an idea what I'm doing wrong here? By far the simplest thing is either look at the opcode in ops/core_ops.c or use a debugger and set a breakpoint at the appropriate opcode, e.g. Parrot_set_p_p_kc (or _ki

Re: Accessing Hash with strings/keys

2005-07-29 Thread Leopold Toetsch
On Jul 29, 2005, at 10:38, Klaas-Jan Stol wrote: Anybody an idea what I'm doing wrong here? By far the simplest thing is either look at the opcode in ops/core_ops.c or use a debugger and set a breakpoint at the appropriate opcode, e.g. Parrot_set_p_p_kc (or _kic) and step on from there

Accessing Hash with strings/keys

2005-07-29 Thread Klaas-Jan Stol
Hi, I'm trying to extend the standard Hash PMC, if it returns "None", because there was no value at the specified key, then I want to override this behaviour by returning something else. In order to do that, I should know what methods are called. That's where I'm running into trouble. I can j

Re: Keys

2005-06-01 Thread Chip Salzenberg
[1], you need a proxy object to hold on to [ [EMAIL PROTECTED], 0 ] until the [1] comes in. Having all the keys collected together before the first lookup avoids that hackery. -- Chip Salzenberg <[EMAIL PROTECTED]>

re: Keys

2005-06-01 Thread Dan Sugalski
At 7:10 PM -0700 5/31/05, TOGoS wrote: > The 'used as' type indicates whether this key is to be used to do a by-integer-index (array) access or by-string-index (hash) access. Why not extend this to properties, too? Because properties (and attributes) are metadata. At the moment properti

Re: Keys

2005-06-01 Thread TOGoS
explanation: > > Perl has keyed access on hashes and arrays: > > $v = @a[$k] and $v = %a{$k} > > Both would translate to Parrot's: > > v = a[k] > > and the meaning "indexed" vs "hashed" access would > be lost. To get that > in

Re: Keys

2005-06-01 Thread Leopold Toetsch
ctually answer > your question at all. ??? Anyway - and to run the risk of stating again something you already know - here is a more verbose explanation: Perl has keyed access on hashes and arrays: $v = @a[$k] and $v = %a{$k} Both would translate to Parrot's: v = a[k] and t

Re: Keys

2005-06-01 Thread TOGoS
perl6-internals: the place to go to have people tell you things you already know and not actually answer your question at all. --- Leopold Toetsch <[EMAIL PROTECTED]> wrote: > TOGoS wrote: > > > Why not extend this to properties, too? > > > foo.hello becomes > > > > 'hello' > > stri

Re: Keys

2005-06-01 Thread Leopold Toetsch
TOGoS wrote: Why not extend this to properties, too? foo.hello becomes 'hello' string as-property Because that's an attribute access: $P0 = getattribute foo, "hello" leo

re: Keys

2005-05-31 Thread TOGoS
> The 'used as' type indicates whether this key > is to be used to do a by-integer-index (array) > access or by-string-index (hash) access. Why not extend this to properties, too? foo['hello'] becomes 'hello' string as-offset foo{'hello'} becomes 'hello' string

Keys

2005-05-31 Thread Dan Sugalski
and $a{$b} generates $b PMC as-hash and $a{3} generates 3 integer as-hash *If* a PMC supports it, it may complain if the basic type is incorrect (that is, you pass in a string for array access) but generally that's a bad thing -- the PMC should just convert. (Al

Re: [perl #34660] [TODO] Unicode hash keys

2005-04-04 Thread Leopold Toetsch
Will Coleda <[EMAIL PROTECTED]> wrote: > .sub main @MAIN > $P0 = new Integer > store_global "Foo", unicode:"Bar", $P0 > print "ok 1\n" > .end > It generates the error: > unimplemented unicode Yep. charset/unicode.c:compute_hash() *was* unimplemented. leo

[perl #34660] [TODO] Unicode hash keys

2005-04-03 Thread via RT
# New Ticket Created by Will Coleda # Please include the string: [perl #34660] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/rt3/Ticket/Display.html?id=34660 > In my test bed, I've switched tcl over to using unicode for most of its strings, so tha

Re: [perl #33641] Deleting keys from an OrderedHash

2005-01-02 Thread Leopold Toetsch
Simon Glover <[EMAIL PROTECTED]> wrote: > ... In both cases, I would expect to get '00', since the hash > should be empty. Is this a bug in the code, or is an OrderedHash supposed > to work this way (in which case a note to this effect in the > documentation might be a good idea)? Mixing keye

[perl #33641] Deleting keys from an OrderedHash

2005-01-02 Thread via RT
# New Ticket Created by Simon Glover # Please include the string: [perl #33641] # in the subject line of all future correspondence about this issue. # http://rt.perl.org:80/rt3/Ticket/Display.html?id=33641 > This code: new P0, .OrderedHash set P0["foo"], "Foo" delete P0["

Re: Bug in method calling with nonconst keys

2004-11-22 Thread Leopold Toetsch
Luke Palmer <[EMAIL PROTECTED]> wrote: > There's a pretty bad problem with calling the vtable proxy methods with > keys that aren't constant. Best illustrated by example: Fixed. Thanks for reporting leo

Re: Bug in method calling with nonconst keys

2004-11-22 Thread Leopold Toetsch
Luke Palmer <[EMAIL PROTECTED]> wrote: > There's a pretty bad problem with calling the vtable proxy methods with > keys that aren't constant. Best illustrated by example: > .sub _main > newclass $P0, "Foo" > > find_type $I0, "Foo"

Bug in method calling with nonconst keys

2004-11-22 Thread Luke Palmer
There's a pretty bad problem with calling the vtable proxy methods with keys that aren't constant. Best illustrated by example: .sub _main newclass $P0, "Foo" find_type $I0, "Foo" new $P1, $I0 $I1 = $P1["foo"] $S0 = "foo&

[perl #30894] [PATCH] sort config_lib.pasm keys

2004-07-31 Thread via RT
+++ config/gen/config_pm.pl 2004-07-31 12:35:15.219763800 +0300 @@ -54,7 +54,7 @@ while() { if(/<>/) { my $k; - for $k(Configure::Data->keys) { + for $k(sort { lc $a cmp lc $b || $a cmp $b } Configure::Data->keys) { my $v=Configure::Data->get($k); if(defined $v) { $v =~ s/(["\\])/\\$1/g;

Re: PerlHash using PMCs for keys?

2004-06-07 Thread Piers Cawley
. > >> new P3, .Key >> set P2, P1 > ^^ > typo? Yes, and should be an assign. >> Perl 6 supports using full on objects as keys in its hashes. It seems >> that having parrot do the same would be a Good Thing. > > The main problem here is, what doe

Re: PerlHash using PMCs for keys?

2004-06-04 Thread TOGoS
--- Piers Cawley <[EMAIL PROTECTED]> wrote: > new P10, .PerlHash > new P1, .PerlString > set P1, "Bar" > new P2, .Key > set P2, P1 Oops! should be assign! This is one of the reasons I think code like $P0 = new PerlString $P0 = "foo" should be illegal. If people were forc

Re: PerlHash using PMCs for keys?

2004-06-04 Thread Leopold Toetsch
r" > new P2, .Key > set P2, P1 ^^^ C aliases the two PMCs, both are pointing to the same PMC then. You'd like to use C here. > new P3, .Key > set P2, P1 ^^ typo? > Perl 6 supports using full on objects as keys in its hashes. It seems > that

Re: PerlHash using PMCs for keys?

2004-06-03 Thread Piers Cawley
Leopold Toetsch <[EMAIL PROTECTED]> writes: > Togos <[EMAIL PROTECTED]> wrote: >> Should aggregate PMCs (like PerlHash) be able to take >> PMCs as keys? I mean so that: > >> $P0 = $P1[$P2] > > Just use a Key PMC for $P2. > > $P2 = new Key &g

Re: PerlHash using PMCs for keys?

2004-05-24 Thread Leopold Toetsch
Togos <[EMAIL PROTECTED]> wrote: > Should aggregate PMCs (like PerlHash) be able to take > PMCs as keys? I mean so that: > $P0 = $P1[$P2] Just use a Key PMC for $P2. $P2 = new Key $P2 = "key_string" ... leo

Re: PerlHash using PMCs for keys?

2004-05-21 Thread Stéphane Payrard
Le Thu, May 20, 2004 at 12:03:52PM -0700, le valeureux mongueur TOGoS a dit: > Should aggregate PMCs (like PerlHash) be able to take > PMCs as keys? I mean so that: > > $P0 = $P1[$P2] > > where $P1 is a PerlHash, would work. The way it works > now is that it complains tha

PerlHash using PMCs for keys?

2004-05-20 Thread TOGoS
Should aggregate PMCs (like PerlHash) be able to take PMCs as keys? I mean so that: $P0 = $P1[$P2] where $P1 is a PerlHash, would work. The way it works now is that it complains that you can't use a PMC as a key. So my compiler has to spit out about 20 lines of code for every sub-el

Re: [perl #28151] [PATCH] Compound keys for PerlHash

2004-04-02 Thread Leopold Toetsch
Bernhard Schmalhofer <[EMAIL PROTECTED]> wrote: > I noticed that I couldn't use compound keys for setting values in a > PerlHash. > Retrieving values seems to work OK. Thanks, applied. leo

[perl #28151] [PATCH] Compound keys for PerlHash

2004-04-01 Thread via RT
# New Ticket Created by Bernhard Schmalhofer # Please include the string: [perl #28151] # in the subject line of all future correspondence about this issue. # http://rt.perl.org:80/rt3/Ticket/Display.html?id=28151 > Hi, I noticed that I couldn't use compound keys for setting val

Re: [PATCH] to support mere pmcs as keys

2004-02-10 Thread Stéphane Payrard
for compilers. Perl6 has > %P0[$key} and @P0[$key]. This syntax imposes some type restriction (or > coercion) on the key and defines the operation. I am not sure that Perl6 syntax imposes any type restriction on keys. If so, it would probably invalidate my example of two-way hash accessed

Re: [PATCH] to support mere pmcs as keys

2004-02-09 Thread Leopold Toetsch
Hi Stef, Stéphane Payrard <[EMAIL PROTECTED]> wrote: > Le Mon, Feb 09, 2004 at 09:52:28PM +0100, le valeureux mongueur > Leopold Toetsch a dit: Trop long d'introduction. Pas de valeur. [ precise summary snipped ] >P3 = PO[P1]# regular keyed access without flag ># set a flag in P1

Re: [PATCH] to support mere pmcs as keys

2004-02-09 Thread Stéphane Payrard
Le Mon, Feb 09, 2004 at 09:52:28PM +0100, le valeureux mongueur Leopold Toetsch a dit: > Stéphane Payrard <[EMAIL PROTECTED]> wrote: > > > The implementation of the methods key_* in keys.c imposed > > to the PMCs to be of type Key. I don't' see the interest >

Re: [PATCH] to support mere pmcs as keys

2004-02-09 Thread Leopold Toetsch
Stéphane Payrard <[EMAIL PROTECTED]> wrote: > The implementation of the methods key_* in keys.c imposed > to the PMCs to be of type Key. I don't' see the interest > for atomic keys that could be mere PMCs. > This concretely means that one can write the followi

[PATCH] to support mere pmcs as keys

2004-02-09 Thread Stéphane Payrard
The implementation of the methods key_* in keys.c imposed to the PMCs to be of type Key. I don't' see the interest for atomic keys that could be mere PMCs. This concretely means that one can write the following and save a intermediate register: P3 = PO[P1] instead of: P3 = ne

Re: PerlHash keys

2003-06-16 Thread Leopold Toetsch
Clinton A. Pierce <[EMAIL PROTECTED]> wrote: > Any thought on when PerlHashes will be able to allow us to iterate over the > keys? Possibly do things like: Please have a look at iterator.pmc, iter.t, and array.pmc. Its currently implemented partially for arrays only. I'm

PerlHash keys

2003-06-15 Thread Clinton A. Pierce
Any thought on when PerlHashes will be able to allow us to iterate over the keys? Possibly do things like: new P0, .PerlHash set P0["skeleton"], value set P0["master"], value set P0["Odin'sBro"], value set P0["USPO

Re: [PASM] PerlHash and keys

2003-01-03 Thread Leopold Toetsch
Aldo Calpini wrote: I was the proposer. I have written an Iterator PMC back in the ol' 0.0.8 days, but then I was distracted and never finished my work. I will try to reimplement my addition to 0.0.9 and submit a patch ASAP (probably after 07 jan ;-). Thanks, great. cheers, Aldo leo

Re: [PASM] PerlHash and keys

2003-01-03 Thread Aldo Calpini
Leopold Toetsch wrote: > There is a nextkey_keyed mentioned in pdd02_vtables.pod, which would > almost be all to implement aggregate iterators. Missing is IMHO how to > reset (start) an iteration. > Also not too long ago, there was some proposal WRT an iterator class. I was the proposer. I have

Re: [PASM] PerlHash and keys

2003-01-02 Thread Leopold Toetsch
Jerome Quelin wrote: Hi there, How can one retrieve the keys of a PerlHash in Parrot assembly? Is there a way to traverse a hash? Not yet. There is a nextkey_keyed mentioned in pdd02_vtables.pod, which would almost be all to implement aggregate iterators. Missing is IMHO how to reset

[PASM] PerlHash and keys

2003-01-02 Thread Jerome Quelin
Hi there, How can one retrieve the keys of a PerlHash in Parrot assembly? Is there a way to traverse a hash? Jerome -- [EMAIL PROTECTED]

Re: [perl #17573] [PATCH] imcc: stack bug, keys, semicolons, BRANCH

2002-09-24 Thread Leopold Toetsch
Steve Fink (via RT) wrote: > - In imcc.y:main(), the stacktop was being set to an uninitialized > value, making stackwalking sometimes *really* slow, sometimes crash, > and sometimes work perfectly fine. Yes, already fixed > - My bison does not accept actions that do not end in a semicol

[perl #17573] [PATCH] imcc: stack bug, keys, semicolons, BRANCH

2002-09-24 Thread via RT
diff -p -u -r1.22 imcc.y --- imcc.y 22 Sep 2002 17:38:47 - 1.22 +++ imcc.y 25 Sep 2002 03:07:55 - @@ -35,10 +35,14 @@ int expect_pasm; static SymReg *regs[IMCC_MAX_REGS]; +/* Bit vector saying whether argument i is a key */ +static int keyvec = 0; static i

Re: [RFC] How are compound keys with a PerlHash intended to work?

2002-09-18 Thread Dan Sugalski
index by strings ? ie > > my @array is indexed('a'..'z'); > >So if parrot wants to provide a method for compound keys, then the >HL should be able to specify what type it is expecting each level >to be. > >But the question also exists how this flag s

Re: [RFC] How are compound keys with a PerlHash intended to work?

2002-09-18 Thread Graham Barr
So if parrot wants to provide a method for compound keys, then the HL should be able to specify what type it is expecting each level to be. But the question also exists how this flag should be used/checked. For example, does the op use it to test the PMC type before calling the method to fetch th

Re: [RFC] How are compound keys with a PerlHash intended to work?

2002-09-18 Thread Leopold Toetsch
Dan Sugalski wrote: > At 9:03 AM +0200 9/16/02, Leopold Toetsch wrote: >> In PASM they look the same. But as Dan stated, and as tried to show in >> my answer to Graham, the lookup succeeds only if the nested PMCs are >> all of the correct type. This works now because an array doesn't >> suppo

Re: [RFC] How are compound keys with a PerlHash intended to work?

2002-09-18 Thread Dan Sugalski
At 9:03 AM +0200 9/16/02, Leopold Toetsch wrote: >Ken Fox wrote: > >>Dan Sugalski wrote: > >>>On lookup. The aggregate being queried by key is responsible for >>>complaining if the key its passed is something that it doesn't >>>like. >> >> >>If %h{"a"}[0][1] is a PASM P2["a";0;1], then what is %

Re: [RFC] How are compound keys with a PerlHash intended to work?

2002-09-13 Thread Leopold Toetsch
Dan Sugalski wrote: > At 9:51 AM +0200 9/13/02, Leopold Toetsch wrote: > >> and is a perl6 %h{"a"}[0][1] a PASM P2["a";0;1]? > > Yes. Fine, thought so too, thanks for your quick answer. I have already a patch for it, I'll make an entry in t/pmc/perlhash.t too. _But_: What about all these bo

Re: [RFC] How are compound keys with a PerlHash intended to work?

2002-09-13 Thread Dan Sugalski
At 9:51 AM +0200 9/13/02, Leopold Toetsch wrote: >The same system with a PerlHash doesn't: [Snip] >So the question arises to the syntax gurus, should it work like this? Yes. >and is a perl6 %h{"a"}[0][1] a PASM P2["a";0;1]? Yes. -- Dan --

[RFC] How are compound keys with a PerlHash intended to work?

2002-09-13 Thread Leopold Toetsch
ey_next, gives the final result, which is @a[0][1] in perl6 - DWIM. This is functional with variables as keys too. set I0, 1 set I1, 1 set I2, P1[I0;I1] print I2 => 2 The same system with a PerlHash doesn't: new P2, .PerlHash set P2["a"], P1 #

Re: [perl #17193] [PATCH] Re: Howto packout _SC / _NC KEYs

2002-09-12 Thread Leopold Toetsch
> Here is a patch, that is selfcontained in packfile.c, s/packfile/packout/ of course, sorry leo

[perl #17193] [PATCH] Re: Howto packout _SC / _NC KEYs

2002-09-12 Thread via RT
inter but some structure >data -> { int idx, PMC *next } and store the constant index there. > > 3) > The easierst solution (for me): provide the possibility to call a > callback, that fills the packed structure with the required data. > Actually I have also this packed data, b

Howto packout _SC / _NC KEYs

2002-09-10 Thread Leopold Toetsch
} and store the constant index there. 3) The easierst solution (for me): provide the possibility to call a callback, that fills the packed structure with the required data. Actually I have also this packed data, because on building the keys I assemble this packed data, which on PackFile_Constan

  1   2   >