Re: regex objects as hash keys

2020-04-06 Thread Joseph Brenner
> Object hashes currently come with a performance penalty. That's why they are > currently not the default. Thanks, that makes sense. On 4/6/20, Elizabeth Mattijsen wrote: >> On 6 Apr 2020, at 07:19, Joseph Brenner wrote: >>> If you want a Hash which allows any >> kind of object as key, you

Re: regex objects as hash keys

2020-04-06 Thread Elizabeth Mattijsen
> On 6 Apr 2020, at 07:19, Joseph Brenner wrote: >> If you want a Hash which allows any > kind of object as key, you have to declare it such: > >> my $obj = Rutabaga.new; >> my %vegeout{Any}; # <-- see: >> https://docs.raku.org/language/hashmap#Non-string_keys_(object_hash) > > That's an inte

Re: regex objects as hash keys

2020-04-05 Thread Joseph Brenner
gt;> And what's worse is it coerces to an *empty list* which means *every* >> regex is treated as the same key. >> >> If you I follow the advice to use the *.perl, then that works, of course: >> >> %match_locs{ $godzilla_rx.perl } = $loc; >> >> Bu

Re: regex objects as hash keys

2020-04-05 Thread Tobias Boege
essage: > ># Regex object coerced to string (please use .gist or .perl to do that) > > And what's worse is it coerces to an *empty list* which means *every* > regex is treated as the same key. > > If you I follow the advice to use the *.perl, then that works, of cou

regex objects as hash keys

2020-04-05 Thread Joseph Brenner
* regex is treated as the same key. If you I follow the advice to use the *.perl, then that works, of course: %match_locs{ $godzilla_rx.perl } = $loc; But you wouldn't be able to use the keys of the hash as a regex object later, which seems sub-optimal, though not a concern for my present purposes.

[perl #126951] [TESTNEEDED] Interpolating a typed hash into an argument list produces wrong keys

2017-10-06 Thread Sam S. via RT
Test added: https://github.com/perl6/roast/commit/8773139c37 Closing.

[perl #131962] [TESTNEEDED] [REGRESSION] `Pair.kv`/`.keys`/.`values` dies if either the key or the value is `Mu`

2017-09-13 Thread Brian S. Julin via RT
xpected Any but got Mu (Mu) > > > > ➜ say ((Mu) => 4).kv; > > Type check failed in binding to parameter 'val1'; > > expected Any but got Mu (Mu) > > > > ➜ say ((Mu) => Mu).kv; > > Type check failed in binding to parameter 'val1';

[perl #132053] [BUG] Autovivification on element with [] or {} as default causes "secret" keys

2017-09-11 Thread jn...@jnthn.net via RT
On Sat, 09 Sep 2017 19:53:53 -0700, tomentiru...@gmail.com wrote: > > my @h is default([]) > [] > > @h[0].push: 3 > [3] > > @h > [] > > @h[0] > [3] > > > my %h is default({}) > {} > > %h = 3 > 3 > > %h > {} > > %h > {b => 3} > > The array/hash variable's default is an empty array/hash literal. If

[perl #132053] [BUG] Autovivification on element with [] or {} as default causes "secret" keys

2017-09-11 Thread jn...@jnthn.net via RT
On Sat, 09 Sep 2017 19:53:53 -0700, tomentiru...@gmail.com wrote: > > my @h is default([]) > [] > > @h[0].push: 3 > [3] > > @h > [] > > @h[0] > [3] > > > my %h is default({}) > {} > > %h = 3 > 3 > > %h > {} > > %h > {b => 3} > > The array/hash variable's default is an empty array/hash literal. If

[perl #132053] [BUG] Autovivification on element with [] or {} as default causes "secret" keys

2017-09-10 Thread via RT
# New Ticket Created by Andrew Buchanan # Please include the string: [perl #132053] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=132053 > > my @h is default([]) [] > @h[0].push: 3 [3] > @h [] > @h[0] [3] > my %h is default(

[perl #129092] [JVM] Can't get CORE::.keys

2017-09-10 Thread Christian Bartolomaeus via RT
This works now. I've added a simple test to S02-names/pseudo.t with roast commit 7edf26aae4. $ ./perl6-j -e 'say CORE::.keys' (SoftRoutine PF_LOCAL &METAOP_REDUCE_XOR &exit Rat Rational Slang &sqrt buf8 $?COMPILATION-ID &nextcallee &infix:<∘> &kv

[perl #129092] [JVM] Can't get CORE::.keys

2017-09-10 Thread Christian Bartolomaeus via RT
This works now. I've added a simple test to S02-names/pseudo.t with roast commit 7edf26aae4. $ ./perl6-j -e 'say CORE::.keys' (SoftRoutine PF_LOCAL &METAOP_REDUCE_XOR &exit Rat Rational Slang &sqrt buf8 $?COMPILATION-ID &nextcallee &infix:<∘> &kv

[perl #132053] [BUG] Autovivification on element with [] or {} as default causes "secret" keys

2017-09-10 Thread Aleks-Daniel Jakimenko-Aleksejev via RT
Heh. FWIW we had this since forever: https://gist.github.com/Whateverable/78168042a011e01fc768c042b0d91898 On 2017-09-09 19:53:53, tomentiru...@gmail.com wrote: > > my @h is default([]) > [] > > @h[0].push: 3 > [3] > > @h > [] > > @h[0] > [3] > > > my %h is default({}) > {} > > %h = 3 > 3 > > %h

Re: [perl #131962] [REGRESSION] `Pair.kv`/`.keys`/.`values` dies if either the key or the value is `Mu`

2017-08-26 Thread Elizabeth Mattijsen
val1'; > expected Any but got Mu (Mu) > > ➜ say ((Mu) => Mu).kv; > Type check failed in binding to parameter 'val1'; > expected Any but got Mu (Mu) > > `Pair` methods that are affected: > .kv > .keys > .values > > `Pa

Re: [perl #131962] [REGRESSION] `Pair.kv`/`.keys`/.`values` dies if either the key or the value is `Mu`

2017-08-26 Thread Elizabeth Mattijsen via RT
val1'; > expected Any but got Mu (Mu) > > ➜ say ((Mu) => Mu).kv; > Type check failed in binding to parameter 'val1'; > expected Any but got Mu (Mu) > > `Pair` methods that are affected: > .kv > .keys > .values > > `Pa

[perl #131962] [REGRESSION] `Pair.kv`/`.keys`/.`values` dies if either the key or the value is `Mu`

2017-08-26 Thread via RT
Mu (Mu) `Pair` methods that are affected: .kv .keys .values `Pair` methods that NOT are affected: .key .value .pairs .antipairs .Str .gist .perl bisectable finds that this was broken two weeks ago: https://gist.github.com/Whateverable/03a10377df0

Re: [perl #126951] [BUG] Interpolating a typed hash into an argument list produces wrong keys

2017-08-26 Thread Elizabeth Mattijsen
Fixed with 6cec6b7218650aff1780a4dd , tests needed > On 26 Aug 2017, at 10:35, Sam S. via RT wrote: > > Shorter test-case: > >➜ say :{ a => 1, b => 2 }.FLATTENABLE_HASH; >{Str|a => a => 1, Str|b => b => 2} > > Compare to a normal Hash which works fine: > >➜ say { a => 1, b => 2

Re: [perl #126951] [BUG] Interpolating a typed hash into an argument list produces wrong keys

2017-08-26 Thread Elizabeth Mattijsen via RT
Fixed with 6cec6b7218650aff1780a4dd , tests needed > On 26 Aug 2017, at 10:35, Sam S. via RT wrote: > > Shorter test-case: > >➜ say :{ a => 1, b => 2 }.FLATTENABLE_HASH; >{Str|a => a => 1, Str|b => b => 2} > > Compare to a normal Hash which works fine: > >➜ say { a => 1, b => 2

[perl #126951] [BUG] Interpolating a typed hash into an argument list produces wrong keys

2017-08-26 Thread Sam S. via RT
Shorter test-case: ➜ say :{ a => 1, b => 2 }.FLATTENABLE_HASH; {Str|a => a => 1, Str|b => b => 2} Compare to a normal Hash which works fine: ➜ say { a => 1, b => 2 }.FLATTENABLE_HASH; {a => 1, b => 2}

[perl #126951] [BUG] Interpolating a typed hash into an argument list produces wrong keys

2017-08-26 Thread Sam S. via RT
This bug is still present in Rakudo version 2017.08-8-g753c9a5ea built on MoarVM version 2017.08.1-19-g151a2563 implementing Perl 6.c.

[perl #131351] [BUG] List.Capture crashes when List contains Pairs with non-Str keys

2017-05-24 Thread Zoffix Znet via RT
On Tue, 23 May 2017 15:59:43 -0700, c...@zoffix.com wrote: > > The culprit is this line that make an nqp::hash out of Pairs, but I > guess we don't yet have object nqp hashes? > https://github.com/rakudo/rakudo/blob/c82b72a/src/core/List.pm#L886 > > m: (class {} => 42,).Capture > Zoffix___, rak

[perl #131351] [BUG] List.Capture crashes when List contains Pairs with non-Str keys

2017-05-24 Thread Zoffix Znet via RT
On Tue, 23 May 2017 15:59:43 -0700, c...@zoffix.com wrote: > > The culprit is this line that make an nqp::hash out of Pairs, but I > guess we don't yet have object nqp hashes? > https://github.com/rakudo/rakudo/blob/c82b72a/src/core/List.pm#L886 > > m: (class {} => 42,).Capture > Zoffix___, rak

[perl #131351] [BUG] List.Capture crashes when List contains Pairs with non-Str keys

2017-05-23 Thread via RT
# New Ticket Created by Zoffix Znet # Please include the string: [perl #131351] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=131351 > The culprit is this line that make an nqp::hash out of Pairs, but I guess we don't yet h

Re: Associative collection with automatic keys?

2017-04-05 Thread Luca Ferrari
On Tue, Apr 4, 2017 at 11:31 AM, Trey Ethan Harris wrote: > (I can use classify-list to do this ad-hoc, or even just do a simple map as > I might in Perl 5, but I'm thinking of each key's relationship to and > extraction from its value as being a feature of the collection, not of the > way I const

Re: Associative collection with automatic keys?

2017-04-04 Thread The Holy Ghost
On Wed, Apr 05, 2017 at 01:33:58AM +0200, Elizabeth Mattijsen wrote: > > On 4 Apr 2017, at 11:31, Trey Ethan Harris wrote: > > > > I'm thinking of a Hash-like collection where I can add objects using a > > index-less append operation, but then have random access to the elements > > based on a k

Re: Associative collection with automatic keys?

2017-04-04 Thread Elizabeth Mattijsen
> On 4 Apr 2017, at 11:31, Trey Ethan Harris wrote: > > I'm thinking of a Hash-like collection where I can add objects using a > index-less append operation, but then have random access to the elements > based on a key provided by the object. (For instance, imagine a ProcessTable, > where I cr

Associative collection with automatic keys?

2017-04-04 Thread Trey Ethan Harris
I'm thinking of a Hash-like collection where I can add objects using a index-less append operation, but then have random access to the elements based on a key provided by the object. (For instance, imagine a ProcessTable, where I create the collection telling it to index by the .pid method, add eac

[perl #129128] qualified names in enum keys neither produce error nor work

2016-08-29 Thread via RT
# New Ticket Created by Wenzel Peppmeyer # Please include the string: [perl #129128] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=129128 > enum Collision(); my Collision $c; dd $c.WHAT.enums; $c = Coll::Str; # OUTPUT«Map.n

[perl #129092] [JVM] Can't get CORE::.keys

2016-08-26 Thread via RT
# New Ticket Created by awwa...@thelackthereof.org # Please include the string: [perl #129092] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=129092 > perl6-j -e 'say CORE::.keys' ContextRef representation does

[perl #128806] [BUG] .hash on [Bag|Mix][Hash]? types stringifies keys

2016-08-01 Thread via RT
# New Ticket Created by Zoffix Znet # Please include the string: [perl #128806] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=128806 > As reported in RT#127402, Set.hash stringified keys. That problem has since been fi

[perl #128619] Lists as hash keys: an inconsistency between assignment and binding

2016-07-14 Thread via RT
-14#i_12840543 until about https://irclog.perlgeek.de/perl6/2016-07-14#i_12840653 In a hash that accepts arbitrary objects as keys, an assignment using a list-like variable as a key works, but a binding interprets the list nature of the variable as a hash slice and fails: 17:02 < lizmat> m:

[perl #126951] Interpolating a typed hash into an argument list produces wrong keys

2015-12-17 Thread via RT
# New Ticket Created by Sam S. # Please include the string: [perl #126951] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=126951 > Example: sub f (*%args) { say .perl for %args.keys } my %typedhash :=

[perl #125242] .perl method fails on hashes with type-constrained keys

2015-05-26 Thread Carl Mäsak via RT
lizmat (>) > This appears fixed with 869306336fadd85320bfc1 Resolving ticket.

Re: [perl #125242] .perl method fails on hashes with type-constrained keys

2015-05-25 Thread Elizabeth Mattijsen
://rt.perl.org/Ticket/Display.html?id=125242 > > > > Trying to call the .perl method on a Hash object which has an explicit type > constraint for its keys, fails with an exception. > > Example with a newly instantiated, empty Hash[Str,Any] object: > >→ say Hash[Str,An

[perl #125242] .perl method fails on hashes with type-constrained keys

2015-05-25 Thread via RT
for its keys, fails with an exception. Example with a newly instantiated, empty Hash[Str,Any] object: → say Hash[Str,Any].new.perl Cannot call infix:<===>(Str, Mu); none of these signatures match: (Any $?) (Any $a, Any $b) (Int:D \a, Int:D \b) (int $

[perl #124149] [BUG] Declarative and procedural conjunctions in regex don't remember the keys of positional captures

2015-03-22 Thread via RT
# New Ticket Created by Pepe Schwarz # Please include the string: [perl #124149] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=124149 > 19:43 < psch> m: say ("a" ~~ /(.) | ./); say ("a" ~~ /(.) & ./) 19:43 <+camelia> rakudo-m

Re: non-string keys (in a BagHash, for example)

2014-12-01 Thread Carl Mäsak
Yes, the WHICH method controls how the hashing happens. But the more fundamental principle is that the method always return the same value for the same objects. This tends to be implemented by returning either (a representation of) the reference, or the value itself (which must then not be mutable

Re: non-string keys (in a BagHash, for example)

2014-12-01 Thread Theo van den Heuvel
Thanks, Carl, that helps. I just need to add a WHICH method. great. Theo

Re: non-string keys (in a BagHash, for example)

2014-12-01 Thread Carl Mäsak
Theo van den Heuvel (>): > Perl6 considers all entries as new, and the hash has 3 separate entries. Do > I actually have to project my objects to strings to accomplish this? You're putting arrays into a hash. When you put something into a hash, it matters whether the object in question has *refere

non-string keys (in a BagHash, for example)

2014-12-01 Thread Theo van den Heuvel
Hi all, I was hoping to store objects of class Foo in a BagHash in the expectation that objects that are "the same" share their keys. But if I do something like my $b = BagHash.new(); for 1..3 { $b{['foo']}++; } say $b.perl; #(perl6 version 2014.09 built on Mo

[perl #123153] Assigning OUTER::OUTER::.keys() to a constant array generates an error

2014-11-09 Thread Christian Bartolomaeus via RT
This looks very similiar to Ticket #119521: https://rt.perl.org/Ticket/Display.html?id=119521 On Parrot we get a Null PMC access error with the same error message as in #119521: $ perl6-p -e 'constant @SOMETHING = OUTER::OUTER::.keys();' ===SORRY!=== Null PMC access in get_attr_st

[perl #123153] Assigning OUTER::OUTER::.keys() to a constant array generates an error

2014-11-07 Thread via RT
# New Ticket Created by Rob Hoelz # Please include the string: [perl #123153] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=123153 > Example: constant @SOMETHING = OUTER::OUTER::.keys(); Results in the following er

[perl #117915] [BUG] X metaoperator fails with bag keys

2014-10-15 Thread Christian Bartolomaeus via RT
This works now (on Moar, Parrot and JVM): $ perl6 -e 'my Bag $bag .= new: ; for $bag.keys X $bag.keys -> $a, $b { say $a, $b }' foofoo foobar barfoo barbar I added a test to S02-types/bag.t with the following commit: https://github.com/perl6/roast/commit/245c5988e7

[perl #117481] [BUG] duplicate keys in .gist in Match of regex which backtracked in Rakudo

2014-10-10 Thread Christian Bartolomaeus via RT
There is no longer a duplicate key in the .gist output: $ perl6-m -e "say ('/foo/bar/baz/' ~~ m/^ $=(.* '/'+)? $=(<-[\/]>+) '/'* $ /).gist" 「/foo/bar/baz/」 dirname => 「/foo/bar/」 basename => 「baz」 I added a test to S02-names-vars/list_array_perl.t (couldn't find a better place) with the follo

[perl6/specs] 37196f: Fix example: $/.keys list keys start from 0, not 1

2014-05-05 Thread GitHub
-regex.pod Log Message: --- Fix example: $/.keys list keys start from 0, not 1

[perl #118223] [BUG] Non-dwimmy hyper hash addition warns about missing keys in Rakudo

2013-05-28 Thread Carl Mäsak
" => 4).hash␤» I must say I don't need that one often... but when I do, it's *very* nice to have. what's with all the warnings, though? heh, what does >>+<< on hashes mean? do we take in keys too? isBEKaml: do the operation on the values. >>+<< tak

[perl #117915] [BUG] X metaoperator fails with bag keys

2013-05-08 Thread via RT
# New Ticket Created by grond...@yahoo.fr # Please include the string: [perl #117915] # in the subject line of all future correspondence about this issue. # https://rt.perl.org:443/rt3/Ticket/Display.html?id=117915 > This is perl6 version 2013.04-43-g5ad46fd built on parrot 5.2.0 revision R

Re: [perl #117481] [BUG] duplicate keys in .gist in Match of regex which backtracked in Rakudo

2013-04-04 Thread Patrick R. Michaud
. > wut. > I suspect a backtracking-related glitch. > ... > The .gist output is bizarre. There should never be duplicate keys in a > Match. The "gist" method uses ".caps" for the match output, so I suspect the culprit is in "caps", or in Match.gist&#x

[perl #117481] [BUG] duplicate keys in .gist in Match of regex which backtracked in Rakudo

2013-04-04 Thread Carl Mäsak
r/baz/」␤ dirname => 「/foo/bar/」␤ basename => 「baz」␤␤» okay, why do I get two copies of dirname when the match only succeeds once? huuhhnn. wut. I suspect a backtracking-related glitch. * masak submits labster's rakudobug r: say ('/foo/bar/baz/' ~~ m/^ $=(.* '/'+)? $=(

[perl6/specs] 96bd7e: [S09] standard hashes coerce the keys to Str

2012-02-20 Thread GitHub
-data.pod Log Message: --- [S09] standard hashes coerce the keys to Str They don't type check against Str Commit: 208eabfaeee8129aeb43e45a6d7221516367 https://github.com/perl6/specs/commit/208eabfaeee8129aeb43e45a6d7221516367 Author: Moritz Lenz Date: 20

[perl #75850] [BUG] > say %( \( (:a(2)) )).keys # a (:a(2)) should ends up as a positionnal

2012-01-10 Thread Will Coleda via RT
On Fri Jun 18 01:26:55 2010, cognominal wrote: > > say%( \( (:a(2)) )).keys > a > > (:a(2)) should ends up as a positionnal > Update: 20:12 < [Coke]> rakudo: say %( \( (:a(2)) )).WHAT 20:12 <+p6eval> rakudo 38165a: OUTPUT«EnumMap()␤» 20:13 < [Coke]&

[perl #77982] [BUG] Enum keys are spookily cloned from the last named enum to be defined to all other defined enums in Rakudo

2011-10-14 Thread Will Coleda via RT
On Wed Sep 22 04:41:18 2010, moritz wrote: > 12:55 < nymacro> rakudo: enum A <1 2 3>; enum B ; say > A.enums.keys; say B.enums.keys; > 12:55 <+p6eval> rakudo 750a024: OUTPUT«abc␤abc␤» > 12:55 < nymacro> I'm guessing enums are completely screwed at the moment :/ > 13:39 < moritz_> oh ouch > 13:40

[perl #99854] [BUG] Bareword hash keys 'grammar' and 'class' don't parse as hash keys in Rakudo

2011-09-23 Thread Carl Mäsak
# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #99854] # in the subject line of all future correspondence about this issue. # https://rt.perl.org:443/rt3/Ticket/Display.html?id=99854 > perl6: my %a = grammar => 5; pugs: ( no output ) ..rakudo 7a5174: OUTPUT«===SOR

[perl6/specs] 411f2a: [S32/Containers] removed parameter to .keys etc

2011-03-05 Thread noreply
/Containers.pod Log Message: --- [S32/Containers] removed parameter to .keys etc You could match on indexes/keys using an optional parameter on the .keys, .values, .pairs, .enums, .kv methods. I discovered this by accident, and went to check the source of both Rakudo and Niecza. Neither

Re: r31972 -[S05] specify what .keys, .values and .kv do on Match objects

2010-08-12 Thread Jon Lang
How does a Match compare to a Parcel? -- Jonathan "Dataweaver" Lang

r31972 -[S05] specify what .keys, .values and .kv do on Match objects

2010-08-12 Thread pugs-commits
Author: moritz Date: 2010-08-12 21:10:33 +0200 (Thu, 12 Aug 2010) New Revision: 31972 Modified: docs/Perl6/Spec/S05-regex.pod Log: [S05] specify what .keys, .values and .kv do on Match objects Modified: docs/Perl6/Spec/S05-regex.pod

What should be returned by the .keys method for Match invocants?

2010-08-10 Thread Stéphane Payrard
I edited my garbled sentences. [15:28:22] I know that a match is both an array and a hash and that both containers have a .keys method. But I would expect .keys for a Match to return a list of the named reductions [15:28:37] rakudo: grammar A { token TOP { }; token a { a } }; class A::A

[perl #77146] What should be returned by the .keys method for Match invocants?

2010-08-10 Thread via RT
ray and a hash and that both containers have a .keys method. But I would expect .keys for a Match to return a list of the named reductions [15:28:37] rakudo: grammar A { token TOP { }; token a { a } }; class A::A { method TOP($/) { say $.keys }} ; A.parse( 'a', :actions(A::A)) [15:28

[perl #75850] [BUG] > say %( \( (:a(2)) )).keys # a (:a(2)) should ends up as a positionnal

2010-06-18 Thread via RT
# New Ticket Created by Stephane Payrard # Please include the string: [perl #75850] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=75850 > > say%( \( (:a(2)) )).keys a (:a(2)) should ends up as a posit

[perl #73488] [BUG] LTA error message when an only sub fails to bind against hash keys in a nested signature in Rakudo

2010-04-05 Thread jn...@jnthn.net via RT
On Wed Mar 10 06:25:37 2010, masak wrote: > rakudo: sub foo(%h($left)) {}; foo({ no => "left key" }) > rakudo 5b81df: OUTPUT«Not enough positional parameters > passed; got 0 but expected 1 [...] > I guess that's a correct error message... wonder if it can be > made awesomer, though... Awesomize

[perl #73488] [BUG] LTA error message when an only sub fails to bind against hash keys in a nested signature in Rakudo

2010-03-11 Thread Carl Mäsak
# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #73488] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=73488 > rakudo: sub foo(%h($left)) {}; foo({ no => "left key" }) rakudo 5b81df: OUTPUT«Not eno

[perl #70894] [BUG] Cannot do .keys on enum type stash in Rakudo

2009-11-28 Thread Carl Mäsak
er? TimToady: simplest one I've found so far is SomeEnum.pick(*).sort hardly very idiomatic. masak: you might try SomeEnum::.keys since Type:: is supposed to be the stash of the type; no guarantees about rakudo though TimToady: oki, thanks. doesn't guarantee order either though of

Re: Assigning duplicate values to several hash keys using junctions?

2009-06-08 Thread Larry Wall
the list replication. Two problems. First, list replicaiton is xx rather than x, and second, you *don't* have to write the integer, because you can use the "Whatever" star: %hash = 'some value' xx *; That makes an arbitrarily long list of strings. : The best way is

Re: Assigning duplicate values to several hash keys using junctions?

2009-06-08 Thread Jon Lang
2009/6/8 Ville Koskinen : > Hello all, > > I was curious if this is possible in Perl 6: > > %hash{ 'foo' & 'bar' } = 'some value'; > # %hash{'foo'} eq 'some value' and %hash{'bar'} eq 'some value' By autothreading, this would be equivalent to: (%hash{'foo'} & %hash{'bar'}) = 'some value'; wh

Assigning duplicate values to several hash keys using junctions?

2009-06-08 Thread Ville Koskinen
Hello all, I was curious if this is possible in Perl 6: %hash{ 'foo' & 'bar' } = 'some value'; # %hash{'foo'} eq 'some value' and %hash{'bar'} eq 'some value' or perhaps %hash{ 'foo' | 'bar' }

[perl #62530] Assinging a $/ to a scalar and then accessing its extened .keys method produces a "Null PMC" error

2009-04-28 Thread Ron Schmidt via RT
Tests for this problem now added to t/spec/S05-match/capturing- contexts.t now pass. Recommend closing.

[perl #63686] Can't iterate over junctions in hash keys

2009-03-07 Thread via RT
# New Ticket Created by Moritz Lenz # Please include the string: [perl #63686] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=63686 > This works: 17:58 <@moritz_> rakudo: my %h = ( a => any(3, 4) ); say %h.WHAT; 17:58 < p6

[perl #62530] Assinging a $/ to a scalar and then accessing its extened .keys method produces a "Null PMC" error

2009-01-20 Thread Eric Hodges
# New Ticket Created by "Eric Hodges" # Please include the string: [perl #62530] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=62530 > class Match is also { method keys () {return %(self).keys }; }; rule a {H

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 =

Are keys, values, kv, pairs, etc. named unaries?

2008-09-21 Thread Patrick R. Michaud
functional form of kv(): my @array = ; say kv(@array).perl;# [ 0, "a", 1, "b", 2, "c", 3, "d" ] Is the C function (keys, values, pairs, etc.) a named unary? I.e., what is the result of... ? my @array = ; my @b = kv @array, ; say @b.perl; Pm

Re: [perl #58924] [BUG] my %a; %a = 't'; for keys %a { .say } misbehaving

2008-09-21 Thread Patrick R. Michaud
ultis that we use !EXPORT on (kv had been written specially rather than > just exporting the kv method on Mapping - just deleted that and added it > to export list). > > Fixing these passes us another 8 TODO'd spectests. w00t. Note, however, that the keys(), values(), and kv() meth

[perl #58924] [BUG] my %a; %a = 't'; for keys %a { .say } misbehaving

2008-09-18 Thread [EMAIL PROTECTED] via RT
On Tue Sep 16 08:56:29 2008, cognominal wrote: > It prints "0\n" instead of the expected "i\n" > Fixed this in 31227, and values, and also cleaned up kv. They are now multis that we use !EXPORT on (kv had been written specially rather than just exporting the kv method on Mapping - just deleted tha

[perl #58924] [BUG] my %a; %a = 't'; for keys %a { .say } misbehaving

2008-09-16 Thread via RT
# New Ticket Created by Stephane Payrard # Please include the string: [perl #58924] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58924 > It prints "0\n" instead of the expected "i\n" -- cognominal stef

Re: .kv, .keys, .values, on Array vs. List

2008-05-29 Thread Larry Wall
On the theory that a List is just a Capture that happens to contain only positionals, I'd say Lists should try to behave like Arrays when used as one. The only counterargument would be if it forces unnecessary mutation of otherwise immutable values, but that doesn't seem to be required for readonl

.kv, .keys, .values, on Array vs. List

2008-05-29 Thread Patrick R. Michaud
The draft Synopsis 29 [*] shows that the .keys, .kv, .pairs, and .values methods are defined for Array but not List. [*] http://svn.pugscode.org/pugs/docs/Perl6/Spec/Functions.pod However, t/spec/S29-array/kv.t has entries like: # (1,).kv works correctly { my @a = (); @a

[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: Set-returning .keys (was Re: Smart Matching clarification)

2006-11-28 Thread TSa
HaloO, Darren Duncan wrote: This may be a non-issue from a user's viewpoint, but as a user, I want set operations that have sets as input to return sets as output by default. Eg, unioning 2 Set that have common values should return a Set. First of all the operations could be overloaded. Secon

Re: Set-returning .keys

2006-11-28 Thread Darren Duncan
and more complicated. Look at these implemented in terms of a Hash-like collection, for example. A Set only has to maintain the list of keys, while the Bag also has to maintain the associated count values for each. When Hash values can be safely never defined, or ignored or dropped at any given

Re: Set-returning .keys

2006-11-28 Thread Dr.Ruud
Smylers schreef: > Ruud H.G. van Tol: >> Darren Duncan: >>> TSa: set operations ... make them Bag operations to start with. >>> >>> I agree with ... making Set the main type and making Bag an >>> extension built upon that, as complex is built upon num, etc. >> >> I don't think that will work

Re: Set-returning .keys

2006-11-28 Thread Smylers
Ruud H.G. van Tol writes: > Darren Duncan schreef: > > > TSa: > > > > set operations ... make them Bag operations to start with. > > > I agree with ... making Set the main type and making Bag an > > extension built upon that, as complex is built upon num, etc. > > I don't think that will work

Re: Set-returning .keys

2006-11-28 Thread Ruud H.G. van Tol
Darren Duncan schreef: > TSa: >> And I still think that it is a good idea >> to name the set operations after their equivalent boolean >> connectives: >> >> (|) union >> (&) intersection >> (^) symmetric difference >> >> Well, and to make them Bag operations to start with. > To start off wi

  1   2   3   >