»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend! | Rakudo Star Released!
Set by diakopter on 6 September 2010.
00:00 ruoso joined, ascent_ left 00:01 guidjos left 00:08 rgrau_ left 00:13 ascent_ joined 00:14 Helios joined 00:22 azert0x left 00:29 jhuni joined
Sec rakudo: ( [], { [$a+1]xx$^a+1 Z~ [1 .. *] } ... * )[6].say 00:33
p6eval rakudo dd6a03: OUTPUT«61 62 63 64 65 66␤»
Sec rakudo: ( [], { [$a+1]xx$^a+1 Z%% [1 .. *] } ... * )[6].say 00:34
p6eval rakudo dd6a03: OUTPUT«1 0 0 0 0 0␤»
Sec can someone explain this? I would expect <1 1 1 0 0 1>
colomon hmmmm 00:35
rakudo: ( [], { [$a+1] xx $^a+1} ... * )[6].say 00:36
p6eval rakudo dd6a03: OUTPUT«6 6 6 6 6 6␤» 00:37
colomon oh
you're expecting 6 %% 1, 6 %% 2, 6 %% 3, etc? 00:38
Sec jep.
colomon oh, that's what your first eval there was doing. gotcha. 00:39
precedence issue, maybe?
I think that's it.
~ and %% have difference precedences. 00:40
rakudo: ( [], { ([$a+1]xx$^a+1) Z%% [1 .. *] } ... * )[6].say
p6eval rakudo dd6a03: OUTPUT«1 0 0 0 0 0␤»
Sec nice idea, but that doesn't seem to fix it :)
colomon or not. very weird.
00:40 florz joined
colomon rakudo: ( [], { ([$a+1]xx$^a+1) Z%% [1 .. *] } ... * )[^6].sa 00:41
rakudo: ( [], { ([$a+1]xx$^a+1) Z%% [1 .. *] } ... * )[^6].say
p6eval rakudo dd6a03: OUTPUT«Method 'sa' not found for invocant of class 'Parcel'␤ in main program body at line 22:/tmp/pupK2R_M5U␤»
rakudo dd6a03: OUTPUT«11 01 0 01 0 0 01 0 0 0 0␤»
colomon rakudo: ( [], { ([$a+1]xx$^a+1) Z%% [1 .. *] } ... * )[^6].perl.say
p6eval rakudo dd6a03: OUTPUT«([], (Bool::True), (Bool::True, Bool::False), (Bool::True, Bool::False, Bool::False), (Bool::True, Bool::False, Bool::False, Bool::False), (Bool::True, Bool::False, Bool::False, Bool::False, Bool::False))␤»
Sec rakudo: ([6,6,6,6,6,6] Z%% [1,2,3,4,5,6]).say 00:42
p6eval rakudo dd6a03: OUTPUT«111001␤»
00:42 tylercurtis joined
colomon rakudo: ( [], { ([$a+1]xx$^a+1) Z%% (1 .. *) } ... * )[^7].perl.say 00:44
p6eval rakudo dd6a03: OUTPUT«([], (Bool::True), (Bool::True, Bool::False), (Bool::True, Bool::False, Bool::False), (Bool::True, Bool::False, Bool::False, Bool::False), (Bool::True, Bool::False, Bool::False, Bool::False, Bool::False), (Bool::True, Bool::False, Bool::False, Bool::False, Bool::False,
..Bool::False)…
Sec rakudo: ( [], { ([6,6,6,6,6,6]) Z%% ([1 .. *]) } ... * )[6].say
p6eval rakudo dd6a03: OUTPUT«1 1 1 0 0 1␤» 00:45
Sec rakudo: ( [], { ([6]xx 6) Z%% ([1 .. *]) } ... * )[6].say
p6eval rakudo dd6a03: OUTPUT«1 0 0 0 0 0␤»
Sec xx is probably not doing what I expected it to do.
colomon rakudo: ( [], { (6 xx 6) Z%% ([1 .. *]) } ... * )[6].say
p6eval rakudo dd6a03: OUTPUT«1 1 1 0 0 1␤»
colomon rakudo: say ([6] xx 6).perl; say (6 xx 6).perl
p6eval rakudo dd6a03: OUTPUT«([6], [6], [6], [6], [6], [6])␤(6, 6, 6, 6, 6, 6)␤»
colomon oh! 00:46
so you were getting [6] %% 2 (etc)
and [6] in numeric context is 1
Sec yes!
rakudo: ( [], { ($a+1)xx$^a+1 Z%% [1 .. * ] } ... * )[6].say
p6eval rakudo dd6a03: OUTPUT«1 1 1 0 0 1␤»
colomon there you go. :) 00:47
00:49 plobsing2 is now known as plobsing
snarkyboojum bonjour hardworking Perl 6 people! 00:52
colomon o/ 00:53
00:54 Psyche^ joined
snarkyboojum \o 00:54
snarkyboojum has barely looked at a computer screen for more than 2 weeks, so I have some catching up to do :) 00:55
00:58 Patterner left, Psyche^ is now known as Patterner
tylercurtis TimToady: regarding NFG, are you aware of darbelo's GSoC? 01:04
TimToady no 01:05
01:06 Wasp joined
TimToady colomon: Z should not be working on [] values, since that's a single item in list context 01:06
01:06 Wasp left
Sec how can I elegantly turn ([1,2],[3,4],[5,6]) into ([3],[7],[11]) or (3,7,11) ? 01:06
tylercurtis www.parrot.org/darbelo He implemented an NFG encoding for Parrot. 01:07
01:07 aloha left
TimToady tylercurtis: cool 01:07
Sec: that just looks like a map to me 01:08
rakudo: say ([1,2],[3,4],[5,6]).map(-> @x { [+] @x }).perl 01:09
p6eval rakudo dd6a03: OUTPUT«(3, 7, 11)␤»
01:09 bacek left
colomon TimToady: yeah, I was wondering about that. 01:10
I mean, it should work, it should just not work the way it is working.
Sec TimToady: thanks.
TimToady that's the difference between hypers and Z/X
hypers take a single item, and unpack it for you 01:11
Z and X expect two lists
by the same token, they're eager vs lazy, for similar reasons
hypers are for working through existing objects
list infixes are for being lazy with lists 01:12
so Z%% [] should not work over more than one item
regardless of how long the list inside [] is 01:13
in the case of Z%% [1..*], it should be the same as Z%% Inf
Z%% 1..* is fine though 01:14
no parens necessary
(or shouldn't be)
pmichaud rakudo: my $a = [3,5,7]; my @b = 0..10; say $b[$a]; # checking 01:19
p6eval rakudo dd6a03: OUTPUT«===SORRY!===␤Symbol '$b' not predeclared in <anonymous> (/tmp/zCGcUAog05:22)␤»
pmichaud rakudo: my $a = [3,5,7]; my @b = 0..10; say @b[$a]; # checking
p6eval rakudo dd6a03: OUTPUT«357␤»
pmichaud yes, bug.
so, what should happen there, ooc? (more) 01:20
rakudo: sub xyz(@a) { say @a.elems; }; my $a = [1,2,3]; xyz($a);
p6eval rakudo dd6a03: OUTPUT«3␤»
colomon rakudo: say <a b c> Z~ 1..* 01:22
p6eval rakudo dd6a03: OUTPUT«a1b2c3␤»
01:30 bluescreen joined, bluescreen is now known as Guest31998
lue hai o/ 01:32
.oO(Information on how to get a rakudo commit bit is about as scarce as the commit bits themselves)
01:33
Sec rakudo: (( [1], { ($a+1)xx$^a+1 Z%% 1 .. * } ... * ) ZZ* [1], { [1..($^a+1)] }...*).map(-> @x { (2*@x.elems == [+] @x)??@x.elems!!0 }).grep(*>0)[^2].perl.say 01:39
p6eval rakudo dd6a03: OUTPUT«(timeout)»
Sec rakudo: (( [1], { ($a+1)xx$^a+1 Z%% 1 .. * } ... * ) ZZ* [1], { [1..($^a+1)] }...*).map(-> @x { (2*@x.elems == [+] @x)??@x.elems!!0 }).grep(*>0)[^1].perl.say 01:40
p6eval rakudo dd6a03: OUTPUT«(6, )␤»
Sec yay. A really inefficiant way to calculate the first n perfect numbers.
someone who knows perl6 could probably beautify this a lot. But I'm happy that it works at all %) 01:41
Util rakudo: for [\,] < a b c > -> $n { my @o = @($n) ; say @o.elems, @o.perl }; 01:43
p6eval rakudo dd6a03: OUTPUT«1["a"]␤2["a", "b"]␤2[("a", "b"), "c"]␤»
Util rakudo: for [\,] < a b c > -> $n { my @o = flat(@($n)); say @o.elems, @o.perl };
p6eval rakudo dd6a03: OUTPUT«1["a"]␤2["a", "b"]␤2[("a", "b"), "c"]␤» 01:44
Util Trying to get all three elements.
How to recursively flatten? Doesn't S03 say that "The C<flat> contextualizer" will handle it?
01:45 whiteknight left
pmichaud rakudo: say ([\,] <a b c>).perl 01:45
p6eval rakudo dd6a03: OUTPUT«("a", ("a", "b"), (("a", "b"), "c"))␤» 01:46
pmichaud rakudo: say ([\,] <a b c>).flat.perl
p6eval rakudo dd6a03: OUTPUT«("a", ("a", "b"), (("a", "b"), "c"))␤»
pmichaud hmmmmm
(once again, I'm not happy with the definition of .perl)
rakudo: say ([\,] <a b c>).[0].WHAT
p6eval rakudo dd6a03: OUTPUT«Str()␤»
pmichaud rakudo: say ([\,] <a b c>).[1].WHAT 01:47
p6eval rakudo dd6a03: OUTPUT«Seq()␤»
01:47 JimmyZ joined
pmichaud Util: C<flat> only really handles one level of flattening 01:48
rakudo: say ([\,] <a b c>)>>flat.perl
p6eval rakudo dd6a03: OUTPUT«===SORRY!===␤Confused at line 22, near "say ([\\,] "␤»
pmichaud rakudo: say ([\,] <a b c>)>>.flat.perl
p6eval rakudo dd6a03: OUTPUT«(("a"), ("a", "b"), (("a", "b"), "c"))␤»
Util pmichaud: S03 says "The result will be recursively flattened" 01:49
pmichaud Util: I suspect that's a fossil. 01:50
Util Alternately, if I need recursive flattening, what should I use instead of `flat()`?
Sec rakudo: sub perf($n) { $n == ([+] grep ($n %% *), ^ $n) };(1..*).grep(perf(*))[^2].perl.say 01:51
p6eval rakudo dd6a03: OUTPUT«Can't take numeric value for object of type Whatever␤ in 'Any::Numeric' at line 1341:CORE.setting␤ in 'prefix:<^>' at line 6794:CORE.setting␤ in 'perf' at line 22:/tmp/g2Tay9MXjl␤ in main program body at line 22:/tmp/g2Tay9MXjl␤»
pmichaud I don't quite know the answer to that one. Also, I'm not sure that [\,] should be producing Seq's
Sec hm. why doesn't .grep(perf(*)) work as expected? 01:52
pmichaud Sec: perf(*) doesn't create a closure.
you need { perf($_) }
or you can do *.&perf
Sec ah, thanks :) 01:53
Util pmichaud: that was my next issue; S03 shows "triangular comma" as a list of arrays, not Seq. 01:54
pmichaud I suspect that is a rakudobug.
Sec rakudo: (( [1], { ($a+1)xx$^a+1 Z%% 1 .. * } ... * ) ZZ* [1], { [1..($^a+1)] }...*).map(-> @x { (2*@x.elems == [+] @x)??@x.elems!!0 }).grep(*>0)[^2].perl.say 01:55
ah, no.
p6eval rakudo dd6a03: OUTPUT«(timeout)»
Sec rakudo: sub perf($n) { $n == ([+] grep ($n %% *), ^ $n) };(1..*).grep(1==perf($_))[^2].perl.say' 01:56
p6eval rakudo dd6a03: OUTPUT«===SORRY!===␤Confused at line 22, near "(1..*).gre"␤»
Sec rakudo: sub perf($n) { $n == ([+] grep ($n %% *), ^ $n) };(1..*).grep(1==perf($_))[^2].perl.say 01:57
p6eval rakudo dd6a03: OUTPUT«Use of uninitialized value in numeric context␤Use of uninitialized value in numeric context␤(1, 2)␤»
Sec this confuses me %) 01:58
I should probably go to bed.
Or can anyone explain that to me? 01:59
pmichaud Sec: grep expects a closure there
rakudo: sub perf($n) { $n == ([+] grep ($n %% *), ^ $n) }; (1..*).grep({ perf($_) == 1 })[^2].perl.say 02:00
p6eval rakudo dd6a03: OUTPUT«Divide by zero␤ in 'infix:</>' at line 3856:CORE.setting␤ in 'infix:</>' at line 3475:CORE.setting␤ in 'infix:<%>' at line 3480:CORE.setting␤ in 'infix:<%%>' at line 449:CORE.setting␤ in <anon> at line 22:/tmp/unmLsnyM2X␤ in 'Block::ACCEPTS' at line 5803:CORE.setting␤
..in <an…
02:01 jhuni left
Sec pmichaud: thats an improvement :) ( but yes, thanks, i understand now i was mixing closure an block again) 02:04
still, i can't get it to work properly. 02:05
But I'll try tomorrow. its way to late here now
Util pmichaud: thanks
Util sleeps 02:06
02:06 JimmyZ left 02:08 agentzh joined
gfldex rakudo: my %a; %a.push("a" => Pair.new(:key("a"), :value(1,2,3))); say [+]%a<a>.value; 02:13
p6eval rakudo dd6a03: OUTPUT«3␤»
gfldex rakudo: my %a; %a.push("a" => Pair.new(:key("a"), :value(1,2,3))); say [+]@(%a<a>.value);
p6eval rakudo dd6a03: OUTPUT«6␤»
gfldex why do i need that typecast?
pmichaud because the value of a Pair is an item 02:15
(which doesn't flatten by default)
gfldex where would that be useful? 02:18
pmichaud anytime you want to treat an Array or Seq as a unit instead of as individual elements
tylercurtis for %foo.kv -> $k, $v {...} 02:19
Weirdness ensures if Pair.value flattens.
gfldex i c
pmichaud tylercurtis++ # excellent example 02:20
tylercurtis Or %foo.values, too.
gfldex could [+] be teach to behave nicely?
because that confusion will be found a lot 02:21
tylercurtis Although I guess those could be special-cased, but that would be unintuitive, I think.
02:40 kcwu joined 03:00 jhuni joined 03:07 justatheory left 03:12 flatwhatson joined 03:17 mfollett joined 03:20 colomon left 03:21 colomon joined, Guest31998 left 03:26 Guest31998 joined 03:37 Alias joined 03:39 meppel joined 03:43 meppl left 04:11 patspam left
mfollett If I make a subroutine with a parameter of type 'Rat' it can't be an 'Int', is that a bug or a feature? :D 04:14
sorear Feature, for now
mfollett ok
sorear We haven't completely figured out how type constraints work on numbers yet
for now, if you want to accept any real number, you need to use Real 04:15
04:15 meppel left
mfollett good to know, thanks! sorear++ 04:15
sorear eventually it would be cool if you could say "Num" and have 42, "42", 42.0, and 42.0 + pi - pi all work
and have them all be coerced to Num 04:16
mfollett that would be cool
sorear good * #perl6
araujo: You're the only native speaker of Spanish that I can remember being in here 04:17
tylercurtis sorear: as Num?
sorear other than darbelo, who has vanished and left the #parrot string rewrite dangling :(
mfollett Is there a service list gist.github where I can upload Perl6 snippets and they be color formatted? Gist won't do Perl6. :( 04:26
dalek kudo: 8cf7fcd | pmichaud++ | src/Perl6/Actions.pm:
Switch 'for' statement modifier to use 'map' internally.
04:29
04:32 mfollett left
sorear moritz_: What exactly did you want me to do with json-tiny? 04:38
04:44 QinGW joined 05:03 Sec left 05:07 Sec joined 05:08 plobsing left
TimToady a list in list context flattens to list, so .flat is of necessity recursive 05:12
05:42 masak joined
masak oh hai, #perl6! 05:43
sorear Hello masak! 05:44
masak missed the sunset today. ah well, can't catch 'em all. :)
s/sunset/sunrise/
sorear doesn't usually catch sunrises :( 05:45
masak sorear: where're you at?
specifically, what's your latitude? :) 05:46
sorear 32 N 05:48
masak ah. I live at 59 N 05:52
that should mean that your sunrises are more easily catchable than mine... :)
sorear not when your habitual sleep schedule is 3am-11am 05:53
otoh, I never miss a sunset.
masak :) 05:54
araujo sorear, oh, ok :) 05:55
05:57 kaare joined 05:58 kaare is now known as Guest27819
masak [backlog] +1 on special-casing leading whitespace in rules. 06:01
I just browsed through STD.pm6 looking for rules. they fall into a number of different classes wrt this.
(1) those that consist solely of a group with alternatives 06:02
(2) one that just calls down to another rule
(3) those that explicitly make sure not to have any leading whitespace 06:03
araujo masak!
masak araujo! \o/
it would be worth it just to get rid of (3). it's easy enough for people to add back a <.ws> call, should they wish to.
sorear masak: I skipped backlog 'cause there was so much of it
I am so +1 for special casing leading whitespace that I did it long ago 06:04
masak :)
sorear in fact, STD.pm6 depends on it
[ foo | bar ] # this won't work if there are <ws> calls at the beginning of the alternatives, since <.ws> always breaks LTM
masak right. 06:05
but S05 only makes it seem that this applies to alternatives.
not a whole rule block.
that's why I included (1) above, because I know there's such an exception.
sorear alternatives were the only case I needed when I was making STD-on-STD work
06:06 uniejo joined
masak right. what I'm arguing for here is a similar special case for start-of-rule. 06:06
06:14 cotto joined 06:15 wtw joined
moritz_ good morning 06:17
masak o/ 06:18
06:18 redicaps joined
moritz_ sorear: I gave you a commit bit so that you can maintain a niecza-compatible version of JSON::Tiny in a branch 06:18
sorear: just an offer, not a requirement
masak rakudo: ( [], { ($a+1)xx$^a+1 Z%% [1 .. * ] } ... * )[6].say 06:20
p6eval rakudo 8cf7fc: OUTPUT«1 1 1 0 0 1␤» 06:21
masak std: ( [], { ($a+1)xx$^a+1 Z%% [1 .. * ] } ... * )[6].say
p6eval std 32123: OUTPUT«===SORRY!===␤Variable $a is not predeclared at /tmp/DnStgHxFAw line 1:␤------> ( [], { ($a⏏+1)xx$^a+1 Z%% [1 .. * ] } ... * )[6].sa␤Check failed␤FAILED 00:01 119m␤»
masak that one's already submitted, on one for or other.
s/for/form/
diakopter well this is weird 06:22
where did TT's commit from this morning go.. 06:23
oh, it's in specs, nm
sorear moritz_: ah. 06:28
06:36 rbuels joined 06:42 cjk101010 joined 06:45 sftp left 06:48 rhebus joined
rhebus I'm trying to run Ovid's primes example from blogs.perl.org/users/ovid/2010/08/p...erl-6.html 06:49
but I get "Method 'Bridge' not found for invocant of class 'Failure' / in 'infix:<**>' at line 3425:CORE.setting / in 'is-prime' at line 107:P36-ovid.pl ..." 06:50
masak tries
rhebus line 107 is "die "$number is too large" if $number > @PRIMES[*-1]**2;"
06:50 svetlins left
rhebus you have to copy 2 code blocks mind, the prime-factors block and the my @PRIMES block 06:51
masak nodnod
ok, error reproduced.
debugging.
sorear finds a nasty niecza bug the hard way...
moritz_ rhebus: probably means that @PRIMES is empty 06:52
masak say @PRIMES[*-1].WHAT --> Failure()
say @PRIMES.elems --> 0 06:53
moritz_++
rhebus :/
masak oh!
the for loop must come after the @PRIMES assignment.
rhebus i just came to the same conclusion
06:53 lamstyle joined
masak Ovid's code layout is slightly misleading. 06:53
feel free to make a comment to that effect. 06:54
rhebus i would if I could comment, but ovid's blog won't let me
i could email him though
masak I'll try to comment. I think they fixed commenting for me.
it's been very broken in the past.
sorear It doesn't even let me *view* masak's blog comments 06:55
rhebus "Text entered was wrong."
masak sorear: that's use.perl.org
sorear niecza: say "c" ~~ / a | [ b || c ] / # RFC
p6eval niecza 83c3bc3: OUTPUT«0␤»
rhebus what is niecza?
masak sorear: don't see why that shouldn't match. 06:56
moritz_ neither
sorear masak: || hides any tokens on the right from LTM S05:2586 06:57
niecza's | sees that 'a' and 'b' are valid longest tokens, c matches neither
masak oh, ok.
moritz_ sorear: I'd expect it hide 'b' too
but it should still match, just not as LTM
sorear the only plausible things to do are 1. fallback to || semantics 2. fallback to <!>
masak sorear: what moritz_ said. 06:58
sorear rhebus: github.com/sorear/niecza 06:59
masak: I see
rhebus sorear: cool beans 07:00
is it a pun on nietzsche?
07:01 nadim joined
sorear no 07:01
masak posted.
sorear it was named by a late night brainstorming session with masak++
masak rhebus: based on a Czech music video :) 07:02
sorear it doesn't actually mean anything, because masak had his Polish and Czech wires crossed at the time
rhebus hehe
sorear but it still sounds cool and it's still unique
masak they're always crossed.
rhebus those crazy slavs
i had thought rakudo was the only active perl 6 implementation
masak sorear: and for what it's worth, it *is* the same word in Polish, "czas", as in Czech, "čas". the difference is just orthographic. 07:04
tylercurtis rhebus: You didn't even know about Yapsi? It's the only "official and complete" implementation of Perl 6! (use.perl.org/~masak/journal/40519) 07:09
masak "it's a feature for the compiler to look confused when it actually *is* confused. (In Perl 5 this was not always so)" -- A12
sorear Would it be reasonable to say that | always falls back to || if picking based on declarative prefixes doesn't work? 07:10
masak sorear: I have no gut feeling about that. do you have an example?
sorear masak: "a" ~~ / [a || b] | c / 07:11
masak sorear: at first blush, it feels like a safe fallback to me.
sorear hmm wait.
I think I have another, more subtle bug 07:12
masak because | is essentially || but with perks.
tylercurtis Good night, #perl6.
moritz_ [a || b] | c has a declarative prefix of c | ''
sorear [a || b] currently generates a declarative prefix automaton of /a/
moritz_ and if the c doesn't match, it tries a || b
masak good night, tylercurtis. dream of official and complete implementations.
sorear maybe it should generate /a?/ instead? 07:13
(or /<?>/, if moritz_ is right about || hiding both sides)
moritz_ note that [a || b] and [|| a || b] are synonymous
bbl 07:14
tylercurtis masak: more likely, I shall dream about an unofficial and completely incomplete implementation that I've finally gotten the tuits to work on. However, thank you, nonetheless. 07:18
masak :)
fair enough. dream about tuits.
07:18 tylercurtis left
dalek ecza: 4926d3c | sorear++ | / (6 files):
Implement caching of lexers
07:25
ecza: 4819d25 | sorear++ | / (2 files):
Fix || not generating any declarative prefix at all
sorear 60101 chars in 57.71s user, not too bad 07:28
07:29 azert0x joined
masak perl6: say +(3 => 4) 07:32
p6eval pugs: OUTPUT«2␤»
..rakudo 8cf7fc: OUTPUT«maximum recursion depth exceeded␤ in 'Cool::Numeric' at line 1747:CORE.setting␤ in 'Cool::Numeric' at line 1748:CORE.setting␤ in 'Cool::Num' at line 6794:CORE.setting␤ in 'Cool::Numeric' at line 1747:CORE.setting␤ in 'Cool::Numeric' at line 1748:CORE.setting␤ in
..'Cool::Num' a…
masak since pairs sort on keys nowadays, I'd argue that maybe they should numify to their key as well. 07:33
moritz_ they sort on key first, then on value 07:45
07:50 rhebus left
masak oh, indeed. 07:50
but that means that if you're only interested in sorting on key, then it'll DWYM. 07:51
moritz_ I'm not sure numification can be made sensible
masak TimToady++ has been utilizing that recently in Rossetta Code.
(sorting on key)
07:52 rhebus joined 07:53 daxim joined 07:54 rgrau joined
moritz_ do you have a specific use case for pair numification? 07:54
I imagine that in the context of hashes, a pair often has the form Str => Numeric 07:55
numifying that to .key.Numeric would be rather confusing (and often 0)
masak I just stumbled over this old p6l thread, and wanted to check how we eventually solved it: markmail.org/message/d5kxskrpsdolxcx3 07:58
seems we didn't.
moritz_ pseudo code on p6l for things where perfectly fine real Perl 6 code exists 07:59
moritz_ finds that sad, and very telling 08:00
masak not sure we had *.key et al in 2008. 08:01
if we did, it wasn't widespread.
moritz_ {.key} isn't too hard to remember either
masak I actually don't find it sad; p6l is full of interested people from other disciplines (Perl 5, or Haskell, or other ones) who bring in ideas but seemingly don't have time to fully learn the language. 08:02
08:02 zag joined
masak it fills the same function as one-time contributors to Wikipedia. 08:03
i.e. the core idea may be worth retaining even if the syntax is off, and core people will come afterwards and clean it up.
moritz_ that's right; but when I ask some question about how to implement a particular feature, that's not what I'm after 08:04
masak then you probably shouldn't ask on p6l :) 08:05
moritz_ rakudo: say "aaabaabc" ~~ m:ratchet/a .+*? bc/
p6eval rakudo 8cf7fc: OUTPUT«===SORRY!===␤Confused at line 22, near "say \"aaaba"␤»
masak in some ways, p6l is the continuation of the RFC process -- wild, unchecked, pie-in-the-sky, monte carlo.
moritz_ right, and I'd argue that our needs are shifting away from that 08:06
masak agreed.
moritz_ rakudo: say "aaabaabc" ~~ m/:ratchet a .+*? bc/
p6eval rakudo 8cf7fc: OUTPUT«===SORRY!===␤Confused at line 22, near "say \"aaaba"␤»
moritz_ std: say "aaabaabc" ~~ m/:ratchet a .+*? bc/ 08:07
p6eval std 32123: OUTPUT«===SORRY!===␤Quantifier quantifies nothing at /tmp/24FPao9zMa line 1:␤------> say "aaabaabc" ~~ m/:ratchet a .+*?⏏ bc/␤Check failed␤FAILED 00:01 119m␤»
moritz_ rakudo: say "aaabaabc" ~~ m:ratchet/a .+? bc/
p6eval rakudo 8cf7fc: OUTPUT«===SORRY!===␤Adverb 'ratchet' not allowed on m at line 22, near ""␤»
moritz_ rakudo: say "aaabaabc" ~~ m/:ratchet a .+? bc/
p6eval rakudo 8cf7fc: OUTPUT«aaabaabc␤»
masak but I'd rather let p6l evolve that way in its own pace than forcibly shut up people who still live in the RFC era.
moritz_ rakudo: say "aaabaabc" ~~ m/:ratchet a .+? 'b' 'c'/
p6eval rakudo 8cf7fc: OUTPUT«aaabaabc␤»
masak only to a limited extent can one redristibute people over the unevenly distributed already-here future. :) 08:08
moritz_ rakudo: my $c = 'c'; say "aaabaabc" ~~ m/:ratchet a .+? 'b' $c/
p6eval rakudo 8cf7fc: OUTPUT«aaabaabc␤»
moritz_ agreed
jnthn morning, #perl6
masak jnthn! \o/
mathw oh hai jnthn 08:09
moritz_ \o
masak and just like with natural torrents, the wild forces on p6l can be harnessed for good if one knows how.
jnthn ...we're looking at using p6l to generate electricity now? :-)
masak just don't expect them to run their code through an actual implementation :)
"We have a compiler now? What is this, 2010?" 08:10
"Quick, give me a newspaper!"
sorear hello jnthn 08:12
08:14 timbunce joined
jnthn hi sorear 08:17
08:19 robins joined
masak also, the only way to have higher code standards on p6l is to raise the code standards on p6l :) 08:20
maybe start to write "This code runs under the August release of Rakudo Star." 08:21
08:21 jiyinyiyong joined
masak and "I couldn't get your code to work. Did you try it with a real compiler?" 08:21
moritz_ nqp-rx: /a+/ 08:22
masak: :-)
nqp: /a+/
p6eval nqp: ( no output )
moritz_ nqp: /a+*/
p6eval nqp: OUTPUT«Confused at line 1, near "/a+*/"␤current instr.: 'parrot;HLL;Grammar;panic' pc 552 (src/cheats/hll-compiler.pir:205)␤»
dalek ecza: 09519c3 | sorear++ | / (4 files):
Add a very simple regex optimizer. ~2% win so far
moritz_ std: /a+*/
p6eval std 32123: OUTPUT«===SORRY!===␤Quantifier quantifies nothing at /tmp/5J9FdW0jth line 1:␤------> /a+*⏏/␤Check failed␤FAILED 00:01 116m␤»
sorear a+:, a+?, a+! 08:23
moritz_ tries to get good error messages in nqp-rx 08:26
08:26 dakkar joined 08:30 bacek joined
dalek p-rx: 237bf91 | moritz++ | src/Regex/P6Regex/Grammar.pm:
introduce "Quantifier quantifies nothing" error message
08:33
08:33 aloha joined
aloha aloha: rhebus asked me to tell you to shut up 08:33
08:34 qwebirc4893 joined, zag left
sorear interesting, ~25% of niecza's runtime is spent creating object slot hashes 08:34
masak wow, aloha actually delivers messages to herself.
sorear I knew that was a bit wasteful, but wow
rhebus aloha: you numpty 08:36
08:40 thebird joined 08:41 jiyinyiyong left 08:46 patrickas joined
patrickas hello all 08:46
moritz_ o/
patrickas \o boss 08:47
is perlcabal.org/syn/S03.html#line_1989 officially reversed? as per yesterday's discussion ?
moritz_ hasn't followed the discussion closely enough to know 08:48
patrickas I suppose my patch is still valid untill the spec actually changes && the fat lady sings! :-) 08:50
masak "Perl 6 -- continually released since 1997!" -- web.archive.org/web/20000815230706/...rbyh/perl6 08:51
not a quote from the email, which however contains lots of other memorable quotes.
08:52 Guest27819 is now known as kaare_
moritz_ it does :-) 08:54
smash mornin' everyone 08:58
patrickas 1997! 13 years any you guys haven't realeased anythign yet! Ha!
s/any/and/
jnthn How unlucky. :-) 08:59
smash moritz_: remember beadsort from rosetta code ? check gist.github.com/568057 09:01
masak patrickas: nono, the *release* was in 1997. that's why we haven't needed to release anything after that :)
moritz_ smash++ # very nice 09:02
masak ooh, in this old article, MJD describes a few more aspects of the fateful cup-smashing meeting (sans cup, though): www.perl.com/pub/2000/07/perl6.html
smash moritz_: i added the transposed fuction to my List::Util, which made everything else easier 09:03
masak other interesting tidbits: "Larry promised not to abandon Perl 5." -- "CPAN itself can serve as a test suite for Perl 6: When it can run most of the things in CPAN, either directly or post-translation, it's ready."
09:04 Axius joined
smash phenny: tell TimToady beadsort in Perl 6 (translated from haskell) gist.github.com/568057 09:05
phenny smash: I'll pass that on when TimToady is around.
moritz_ smash: now put it on rosetta code :-)
smash moritz_: first i would like to get the translation sub into List::Util
masak oh, and the end is hilarious: there was the possibility that Perl 6 would provide strong type checking. :) possibly with a `use strict 'typechecking'` directive :P 09:06
moritz_ who wrote the original List::Util?
masak smash++ # List::Utils
smash: parens on line 7 are redundant. but you probably know that. 09:07
09:07 daxim left
jnthn masak: That last one still isn't outside the realms of possibility. :-) 09:07
smash colomon is the owner of the github repo
09:07 M_o_C joined
masak jnthn: what I found funny is the idea of a pragma for it. it's much more grown into the language now. 09:07
smash masak: yes, but it feels more like a list with them :-) 09:08
09:08 REPLeffect left
masak smash: I disagree. to me it just looks like a holdover from Perl 5. 09:08
but you're free to write it as you want, of course.
smash well, you got a point there 09:09
jnthn masak: I dunno. A pragma that says "everything here must have statically known types" isn't so ridiculous. We're gradually typed by default, of course, and will use what info there is.
masak jnthn: oh, indeed. interesting.
smash masak: removed the parens :-) 09:10
09:10 daxim joined
jnthn masak: Reassuringly, I think the stuff I'll be doing in the coming months will give the infrastructure that will let somebody implement such a thing. 09:11
Nice when the design fits use cases I didn't consider yet. :-) 09:12
moritz_ waitwaitwait
everything is strictly type-checked in Perl 6
just often the type is Any or Mu 09:13
but it's still strictly type-checked
or are you thinking about compile time type-checking stuff? 09:14
jnthn moritz_: compile time
masak \o/
that'll be AWESOME.
moritz_ that would require return type declaration on basically all built-ins to work
jnthn moritz_: Yeah, just 'cus we'll be able to implement it doesn't automatically mean it'd be a particularly fun pragma to work under. 09:15
In fact, I suspect most Perl folks would find it annoying.
09:16 bacek left
jnthn We probably need some middle ground where it tells you helpful stuff. 09:16
09:16 aloha left
masak let's continue this discussion when we have the tech :) 09:17
daxim needs moar inference
jnthn masak: Aye.
masak: I really do want to give us the pieces we'll need to build just static analysis stuff in Rakudo though. 09:18
s/just/such/
masak daxim: autopun :)
daxim go go go grant manager!
sorear when you figure out, I'd like to know too 09:19
moritz_ even detecting things as my Int $x = "foo" at compile time would be great
sorear I have the tech to eliminiate runtime name lookups, given type data
moritz_ and invalidate significant parts of the test suite :-)
jnthn "Sorry, this test file is too stupid to run." 09:20
moritz_ exactly 09:21
daxim "Sorry, this is an infinite loop." perl.plover.com/yak/typing/samples/slide030.html 09:22
09:23 REPLeffect joined
moritz_ curios that in the article masak++ linked to, TimToady++ didn't seem to like having a spec, and favoured a reference implementation. 09:24
09:25 envi^home joined
masak aye. Pugs changed that view, I think. 09:27
09:30 ssm joined
rhebus wow, you can use - in identifiers \o/ I'm slightly too excited about this feature. 09:31
daxim apropos pugs, the haskell guy I wanted to meet yesterday is on vacation, so I'll just bug some knowledgable people on IRC about the compiler warnings when I have time, or perhaps hallway trackdown some at the opensuse conference 09:32
09:36 Axius left
sorear hi. I'm a haskell guy 09:39
masak rhebus: yes, you can use them between two alphabetics. 09:40
dalek ecza: c54087f | sorear++ | / (5 files):
Store object fields in an array

We still use a dictionary and name lookup for getting indexes; that will need to be fixed. 50% speedup on the parser benchmark
09:44
masak is 'last LABEL' restricted to loop blocks? what'd happen if LABEL wasn't on a loop block? 09:52
09:55 bacek joined
sorear out 09:55
masak I don't believe it would (or should) work, but I can see how it could work. :) 09:56
probably should use 'leave LABEL' or something instead, and reserve 'last' for loops. 09:57
though now that I think about it, 'last' and 'leave' are very similar. 09:58
10:01 redicaps left 10:02 aloha joined, QinGW left, agentzh left 10:05 mahen joined 10:06 mahen left 10:12 smash left 10:20 smash joined 10:31 amkrankruleuen left, Cyrus joined 10:32 aloha left, aloha joined 10:36 amkrankruleuen joined
colomon masak, moritz_: should 3 => 4 numify to 3 + 4i? 10:38
jnthn o.O 10:40
10:44 amkrankruleuen left 10:45 kjeldahl joined 10:49 amkrankruleuen joined
colomon hmmm, actually, then what do you do if you numify 3 => (2 + 2i)? so probably not a good plan. 10:55
jnthn colomon: I thought that paris generally behave like the value. 10:56
Maybe that makes sense for numification too.
rakudo: say +(a => 42)
p6eval rakudo 8cf7fc: OUTPUT«maximum recursion depth exceeded␤ in 'Cool::Numeric' at line 1747:CORE.setting␤ in 'Cool::Numeric' at line 1748:CORE.setting␤ in 'Cool::Num' at line 6794:CORE.setting␤ in 'Cool::Numeric' at line 1747:CORE.setting␤ in 'Cool::Numeric' at line 1748:CORE.setting␤ in
..'Cool::Num' a…
jnthn youch
Quadrescence a => b numifies to a + bi, so 3 => (2+2i) numifies to 3 + (2+2i)i = 3 + 2i - 2 = 1 + 2i
colomon jnthn: for sorting, they generally behave like the key 10:57
jnthn Oh.
Yeah, that makes sense for sorting I guess.
colomon for comparison, I guess.
actually, can't say I understand why we're getting the recursion here.
jnthn Don't fancy pairs becoming another way to construct complex numbers though
That'd just be surprising.
s/be/be too/ 10:58
imho
10:59 mikehh joined
colomon oooo! 11:01
I see the problem.
Cool::Numeric does pir::set__NP(self) 11:02
which calls .Num on self
Cool.Num does (+self).Num
infinite loop
on any class which does not have its own .Numeric and/or .Num defined 11:03
my bad
11:06 jhuni left 11:10 M_o_C left 11:17 snearch joined
colomon i don't have any clever notions on how to fix it. :( 11:17
11:28 Axius joined 11:32 amkrankruleuen left
moritz_ add a Pair.Numeric method that fail()s? 11:33
11:35 Mowah joined 11:36 rschuster joined
masak colomon: re pairs numification and complex numbers: oh no please no 11:38
11:38 rschuster is now known as rainerschusetr 11:39 rainerschusetr is now known as rainerschuster
sjn moritz_, pmichaud: updated wall segment (which, if all goes well, is the one sent to the print shop): 1400 – 1700 Parallelle sesjoner: 11:39
gah
dl.dropbox.com/u/3809132/JavaZone/P..._Trykk.pdf 11:40
that's the one
sjn curses the clipboard schism on linuces
moritz_ nice 11:41
11:41 amkrankruleuen joined 11:42 meppl joined
sjn it doesn't say "Perl6" anymore, but is probably much better anyway, since people will ask "what's with the butterfly?" and give us opportunity to answer them :) 11:44
sjn has increased his marketing foo the last year. ^^ 11:45
daxim www.reddit.com/r/programming/commen...piler_for/ twitpic.com/2j1ys2/full
11:49 M_o_C joined, amkrankruleuen left, amkrankruleuen joined
daxim also, comment #c0ylhp7 on that page. "smelltalk" 11:51
11:56 bluescreen joined 11:57 bluescreen is now known as Guest59183
M_o_C sjn: I was always under the impression that Perl 6 is not intended to be a replacement for Perl 5, at least I remember masak saying sth. like that. So don't you think it might be a little bit too provocative to take a Perl 5 logo and "place Camelia over the 5"? Or at least that it will be misinterpreted to mean that? Note that I have nothing against the flyer, I just wanted to point out that this issue could arise. 12:00
masak if it's for a Perl Mongers group that traditionally has done Perl 5, it's a little more OK. :) but yes, people who want to get angry over such things have a splendid opportunity with such a flyer. 12:02
sjn M_o_C: don't worry. the logo say's "Welcome to the Perl Community", but now with an added Camelia :)
says* 12:03
moritz_ M_o_C: I've understood that as "we do 5 and 6"
masak fwiw, I'll advocate a total replacement of Perl 5 with Perl 6 when Perl 6 is faster, more stable and has a bigger module repository than Perl 5. :)
M_o_C Hehe^^
moritz_ ... has more active developers, and the p6 modules are a proper superset of the p5 modules 12:04
sjn my purpose is to get people interested in Perl again, and I think doing a trick like this might work for just that :)
M_o_C Yep, choosing Camelia was a good idea insofar (?) that it's harder to be angry at a butterfly ;)
sjn heheh
exactly :)
(There's even a trademark sign there, so if people ask "why use a child's drawing as a logo?" we can point to that and say "would a child be as professional/serious as to register the drawing as a trademark?" :) 12:06
masak sjn++ # tricking people into being interested in Perl again
sjn So, all in all, I'm very happy to have asked for feedback here. I only now hope the last changes end up on the actual print
[Coke] can I get appropriate github commit bits for the new broken-out repos? 12:07
moritz_ your github ID is 'Coke'?
done 12:08
sjn is starting to get TimToady's devious scheme with Camelia :)
[Coke] moritz_: danke. 12:12
moritz_ [Coke]: bitteschoen
takadonet morning all 12:13
masak morning, takadonet. 12:15
12:17 BaggioKwok joined
[Coke] take a donut? don'tindifidoooooo 12:18
takadonet :)
masak for @donuts { .take } 12:19
hm.
for @donuts { .&take }
[Coke] :headdesks: as he remembers that there were donuts at home for the taking.
masak man, I love that new trick. every sub is potentially also a method. 12:20
12:20 Axius left
masak and it feels correctly Huffmanized, too. 12:20
huf masak: .&take calls sub with $_ as the first argument?
masak huf: yep.
huf whereas .take would be an error, since it's not a method of $_ ? 12:21
masak indeed.
moritz_ EVIL
huf so this is similar to the perl5-ish undef->$coderef thing
masak not aware of that one.
huf either way, neat!
sjn doesn't want to know LALALAALALALAAL
moritz_ rakudo: say ~ gather for { .&take } 12:22
p6eval rakudo 8cf7fc: OUTPUT«===SORRY!===␤Missing block at line 22, near ""␤»
moritz_ rakudo: say ~ gather for 1..5 { .&take }
p6eval rakudo 8cf7fc: OUTPUT«1 2 3 4 5␤»
moritz_ wow
masak sjn: waitwait. you make PR for Perl using butterflies, and then you stick your fingers in your ear when we talk about cool Perl 6 tricks? :)
s/ear/ears/ 12:23
sjn perl -le'$foo=sub { print qq(oh yeah, baby) }; undef->$foo;' # EVIL
huf sjn: with great power comes great responsibility... to never use that construct in production code :) 12:24
but i wouldnt call it evil
masak undef -- the universal object.
which is why Perl 6 doesn't have it anymore -- it got too powerful :P 12:25
moritz_ nonono, Perl 6 has many of them
sjn instead, Perl 6 has Mu
huf once p6 escapes into the wild, i'm sure we'll see lots of creative undef usage
masak yeah, we scattered the power into many smaller objects.
moritz_ plugs the abilty to create new undefs 12:26
*plus
sjn With Perl 6, you can KISS bye-bye to simplicity :-P
huf pundef - a dialect of perl6 wholly based on undefs
masak sjn: sometimes I see blog posts about Perl 6, and things are actually really nice and simple. those posts are either made by people who've never been standing close to an implementor, or by those skilled enough to suppress insignificant details. anyway, I find simplicity to be an expository art more than anything else. 12:29
sjn true
masak: and it's still within the Perl way of doing things ("Perl, the Swiss Army Chainsaw of Programming") 12:30
masak oh, definitely.
Perl 6 just happens to be a nanotech string-theory nuclear swiss army chainsaw... 12:31
sjn the thing is, that all that Cool[TM] stuff in Perl 6 gives me license to complain and shout "MADNESS! IT'S ALL CRAZY LUNATIC MADNESS!" with regular intervals :)
which, of course, I'm quite happy to use :)
masak "There's some madness to the method after all..." 12:32
sjn anyhoo
sjn has to get back to prepare tonight's Oslo.pm presentation about YAPC
12:35 jaldhar joined 12:36 BaggioKwok left 12:38 _jaldhar_ left
gfldex std: my $a = sub(){}; 12:39
p6eval std 32123: OUTPUT«===SORRY!===␤Undeclared routine:␤ 'sub' used at line 1␤Check failed␤FAILED 00:01 118m␤»
moritz_ rakudo: sub sub { {} }; sub(){} 12:40
p6eval rakudo 8cf7fc: ( no output )
huf huh? 12:41
masak rakudo: sub sub { say "OH HAI"; {} }; sub(){}
huf std: my $a = sub () {};
p6eval rakudo 8cf7fc: OUTPUT«OH HAI␤»
std 32123: OUTPUT«ok 00:01 119m␤»
moritz_ it defines a sub called 'sub', which returns an empty hash
and it calls .{} on it
which is the empty hash slice
12:47 BaggioKwok joined 12:51 Axius joined
masak Interview question: "Given an array of 100 numbers, work out how to calculate the min, max and average." 12:52
12:52 Axius is now known as aigoo
masak rakudo: my @a = map { rand }, ^100; my $min = [min] @a; my $max = [max] @a; my $avg = ([+] @a) / +@a; say (:$min, :$max, :$avg).perl 12:52
p6eval rakudo 8cf7fc: OUTPUT«("min" => 0.00662271235197309, "max" => 0.968477256921648, "avg" => 0.497900331720313)␤»
masak \o/
man, these interview questions are *easy* :)
moritz_ who asked those? 12:53
masak this particular one was from stackoverflow.com/questions/445425/...loper-know 12:54
third answer.
the second one is not immediate, though. I'd like to see a nice Perl 6 one-liner for that one. 12:55
maybe if one can work with slicels as first-class objects, it's possible to make a short, nice one.
12:57 BaggioKwok left
moritz_ I guess you can simply make two two loops, and two explicit comparisons 12:57
you only have two possible diagonals, so it's probably easier to hard-code those 12:58
13:00 rhebus left 13:03 aloha left 13:04 rhebus joined
masak rakudo: my @b = [-1, 0, 0], [0, -1, 0], [0, 0, -1]; my @lines = [0,1,2],[3,4,5],[6,7,8],[0,3,6],[1,4,7],[2,5,8],[0,4,8],[2,4,6]; for @lines { if [==] (my @l = slicel(@b, $_)) { say "Someone won: @l[0]" }}; sub slicel(@a, @s) { map { @a[$_ div 3][$_ % 3] }, @s } 13:04
p6eval rakudo 8cf7fc: OUTPUT«Someone won: -1␤»
13:04 bacek left
masak so, it's possible. but real slicels would make it nicer, probably. 13:04
moritz_ not convinced 13:05
wouldn't that code detect three 0s in a row as a winner?
13:05 yrgd left
masak uhhh. yes. 13:05
rhebus a strange game. the only way to win is not to play. 13:07
masak rakudo: my @b = [-1, 0, 0], [0, -1, 0], [0, 0, -1]; my @lines = [0,1,2],[3,4,5],[6,7,8],[0,3,6],[1,4,7],[2,5,8],[0,4,8],[2,4,6]; for @lines { if ([==] (my @l = slicel(@b, $_))) && all @l { say "Someone won: @l[0]" }}; sub slicel(@a, @s) { map { @a[$_ div 3][$_ % 3] }, @s }
p6eval rakudo 8cf7fc: OUTPUT«Someone won: -1␤»
masak there :)
now, someone please blog a nice solution :)
takadonet wonder if one day Perl 6 will have a one liner for every interview/exam question out there 13:09
13:09 orafu left, colomon left
takadonet Interview question: "Given an array of 100 numbers, work out how to calculate the min, max and average without using the 'cheat' Perl 6 language" 13:09
13:09 orafu joined
rhebus hahaha 13:09
masak takadonet: the day it does, we'll update the Perl History to reflect that :) 13:10
moritz_ interview(MinMaxAvg).(map &rand, ^100)
masak "May 2032: Perl 6 now has a one-liner for every single interview question out there"
"August 2032: Perl 6.18 adds the .triggerSingularity method to the Mu class" 13:11
or should that be only the Cool class?
jnthn Triggering a singularity is srsly not cool. 13:12
masak jnthn: you say that *now*, but in 22 years, we'll be triggering a singularity every time we want to make coffee.
PerlJam singularities sound like a potent form of energy to me. 13:13
masak I hear they make great coffee.
moritz_ s/great/grand/ 13:14
frettled I hear they make great virtual realities while using our bodies for batteries. Environmentally suspect, but perhaps feasible.
PerlJam "Scientists accidentally explain the universe while constructing a Perl 6 program to model black holes"
frettled PerlJam: …using a one-liner
moritz_ perl6 -e 'use BlackHole; BlackHole.new.simulate' 13:15
PerlJam frettled: "after days writing a long complicated regex to model black holes, the chief scientist realized that it could be expressed in a single line of Perl 6"
:) 13:16
frettled /o\ (using regex)
masak PerlJam: and LTM help explain deeper black hole mechanisms. 13:17
s/help/helps/
PerlJam It's all joking ... until someone does it.
moritz_ speaking of which, lately I've been thinking about solving nonograms with regexes
but actually the need the inverse - string generators according to a pattern 13:18
13:21 rainerschuster is now known as rschuster-off
frettled misread that as "monograms" 13:22
13:24 snearch left, perlygatekeeper joined
masak frettled: monograms -- a time-honoured problem that still lacks a solution. 13:25
PerlJam idly wonders what no-no-grams would be :)
moritz_ so-grams
PerlJam moritz++
masak groans
rhebus moritz_: if you get one, it's problem P98 in 99-problems
moritz_ en.wikipedia.org/wiki/Nonogram
frettled My $entity, it must be Friday.
masak frettled: some people invoke a deity, but you content yourself with... an entity. :P 13:26
frettled masak: untyped, so it could contain a deity, if the reader is so inclined 13:27
The line between swearing, blasphemy and obsequiousness is thin. 13:28
pmichaud good morning, #perl6 13:30
takadonet pmichaud: morning
frettled good morning!
jnthn mornin,g pmichaud
frettled jnthn: you're doing what with a mornin, globally, on pmichaud? 13:31
jnthn no, no, ,g means "greet" :P
13:32 javs joined
rhebus rakudo: my @lines = (0,3,6 X+ 0,1,2),(0,1,2 X+ 0,3,6),0,4,8,2,4,6; my @b = -1,0,0,0,-1,0,0,0,-1; for @lines -> $a,$b,$c { if @b[$a] && [==] @b[$a,$b,$c] { say "@b[$a] won" } } 13:32
p6eval rakudo 8cf7fc: OUTPUT«-1 won␤»
rhebus masak: howzat?
13:35 M_o_C left
moritz_ nice! 13:36
masak rhebus: a nice improvement! 13:37
keep going! :)
moritz_ rhebus: how long have you been programming Perl 6? :-)
rhebus since sunday
masak rhebus++!
moritz_ impressed
frettled rhebus++
moritz_ rhebus++
rhebus shucks
maybe one for perl6-examples, don't know where to file it though
games I suppose
moritz_ yes
gfldex :o
moritz_ 0,1,2 can be made 0..2 13:38
rhebus are we golfing this or what? :)
masak totally!
^2
no wait
^3
moritz_ right
and 0,3, 6 is ^3 Z* 3
not shorter, but has a nice symmetry :-) 13:39
masak that's not shorter :)
:)
rhebus I series of steadily golfed tic tac toes would be a good example :)
masak there's already enough material here for a blog post. 13:40
rhebus I'm happy to aggregate it all
masak excellent
13:41 Holy_Cow joined
rhebus keep going with the improvements though 13:41
(also, I haven't had a chance to show off to anyone about this yet, but I'm the leader on codegolf.com/99-bottles-of-beer )
moritz_ rakudo: my @lines = (0,3,6 X+ ^3), (^3 X+ 0,3,6), 0,4,8,2,4,6; my @b = -1,0,0,0,-1,0,0,0,-1; for @lines -> $a, $b, $c { if @b[$a] && [==] @b[$a,$b,$c] { say "@b[$a] won" } } 13:42
p6eval rakudo 8cf7fc: OUTPUT«-1 won␤»
pmichaud rakudo: my @x = ( * + 4 for 0..3 ); say @x.perl; # checking 13:44
p6eval rakudo 8cf7fc: OUTPUT«[4, 5, 6, 7]␤»
pmichaud \o/
today I think I'll fix up string numification
13:46 Mowah left
gfldex is there a way to modify the values of a hash in place? 13:46
masak \o/ 13:47
pmichaud and maybe .Stringy
moritz_ rakudo: my %h = a => 1; %h<a>++; say %h<a>
p6eval rakudo 8cf7fc: OUTPUT«2␤»
masak rakudo: my %h = a => 1; %h<a> = 2; say %h.perl; # gfldex: does this count as in place?
p6eval rakudo 8cf7fc: OUTPUT«{"a" => 2}␤»
masak moritz_: interesting how similar those two lines are :) 13:48
gfldex kind of yes but i was thinking about something .map-ish :)
moritz_ rakudo: my %h = a => 1, b => 5; %h.values>>++; say %h.perl
p6eval rakudo 8cf7fc: OUTPUT«{"a" => 1, "b" => 5}␤»
pmichaud rakudo: my %h = <a 1 b 2 c 3>; for %h { .value++ };
p6eval rakudo 8cf7fc: ( no output )
moritz_ hrmpf
pmichaud rakudo: my %h = <a 1 b 2 c 3>; for %h { .value++ }; say %h.perl;
p6eval rakudo 8cf7fc: OUTPUT«{"a" => "1", "b" => "2", "c" => "3"}␤»
pmichaud hmmmmm 13:49
I'm guessing the hash pairs aren't being constructed properly
the values need to be bound instead of assigned
maybe I should re-do Hash today
moritz_ there's also a patch for .hash in RT, iirc 13:50
gfldex if would need: for %h { .value =[+] }
or however you say =[+] :)
moritz_ what do you want to do?
gfldex %h = a => [1,2,3], b => [10,20,30]; %h.magic({[+]*}); # a => 6, b => 60 13:51
13:52 kaare_ left
masak ah, sums. 13:52
gfldex or .uc all values in a hash without creating a new hash
moritz_ %h.values.map({ $_ = [+] @$_}) should work, doesn't 13:53
%h.values>>.uc
%h.values>>.=uc
pmichaud take Pair.new(key => $iter_item.key, value => $iter_item.value);
that's the likely culprit
value needs to be bound to $iter_item.value
masak rakudo: my %h = a => [1,2,3], b => [10,20,30]; say (map {; .key => ([+] .value.list) }, %h).perl
pmichaud (as a container)
p6eval rakudo 8cf7fc: OUTPUT«("a" => 6, "b" => 60)␤»
13:54 spq1 joined
[Coke] wonders if there's a way to ||-ize $min = [min] @foo; $max = [max] @foo; 13:57
moritz_ is more interested in optimizing [+] 1..1000 13:58
pmichaud actually, maybe I should work on something this morning that doesn't require rewriting an entire subsystem :-(
masak [Coke]: [minmax]
moritz_ could be made by calculating (1000) * (1000+1) / 2 or so
gfldex why do i need {; ?
[Coke] masak: I mean in general. 13:59
moritz_ gfldex: where?
pmichaud gfldex: without the semi, the braces end up being a hash constructor
masak gfldex: because of the rules that distinguish code blocks from hashes.
pmichaud (curly braces containing a single pair become a hash)
masak though the implicit use of $_ should be a determinant, IIRC.
masak checks that 14:00
pmichaud I have difficulty (both design and implementation) with that rule.
gfldex it's ugly for sure
14:00 uniejo left
pmichaud I'm not sure what qualifies as "implicit use of $_" 14:00
or how one can detect it reliably
moritz_ having distinct hash and block quoting would be nice 14:01
gfldex we need bigger keyboards :)
masak S04 is clear on it, though.
masak submits rakudobug
pmichaud masak: clear on what?
masak pmichaud: on implicit use making it a block.
pmichaud but it's not clear about what makes something "implicit use"
masak S04:1558
pmichaud: I don't really see how it's unclear. 14:02
a dotty without an lhs is an implicit use of $_
pmichaud { a => { .foo } } # does the outer block implicitly use $_ ?
masak what? no.
pmichaud why not?
masak because... it doesn't.
14:03 Kodi joined
masak it has no .foo in it, the inner block does. 14:03
and the inner block isn't immediate.
pmichaud but that inner block uses $_
masak yes.
masak must be missing something here
pmichaud and it defaults to the outer $_, yes?
how about now...?
masak yes, and that doesn't matter here.
pmichaud { a => { .foo }.() }
masak er.
14:03 mfollett joined
moritz_ now it gets interesting 14:04
pmichaud what about... ?
{ a => * + 2 }
Kodi masak: Could you either apply that patch or make me a Rakudo committer so I can do it?
pmichaud Kodi: have you submitted a CLA?
masak afk &
Kodi pmichaud: I'm sorry, I don't know what that is. 14:05
pmichaud CLA = Contributor License Agreement
those are required before obtaining rakudo commit bits
Kodi pmichaud: I see. How do I do that?
pmichaud Kodi: just a sed
*sec
Kodi Just an awk.
pmichaud www.perlfoundation.org/contributor_..._agreement 14:06
14:06 alester joined
gfldex Kodi: did they tell you that camelia feeds on souls? :-> 14:06
pmichaud Kodi: which patch are you wanting applied?
Kodi pmichaud: rt.perl.org/rt3//Public/Bug/Display...l?id=77560
pmichaud: So I can get a commit bit after I've mailed in that form? 14:07
moritz_ std: /\x/
p6eval std 32123: OUTPUT«===SORRY!===␤Unrecognized regex backslash sequence at /tmp/i2X5P21Dqw line 1:␤------> /\⏏x/␤Check failed␤FAILED 00:01 116m␤»
mathw pmichaud: Ah yes, I still need to send mine. Must do that.
pmichaud Kodi: yes, if the rest of the team feels you've earned a commitbit :)
the cla is necessary (but not sufficient :) 14:08
Kodi I guess I'll see. :)
pmichaud I'd likely recommend you for one :)
Kodi I'm happy to hear that much.
14:08 qwebirc4893 left
moritz_ too 14:09
pmichaud Kodi's patch looks good to me.... any reason I shouldn't apply it? 14:10
14:10 sahadev joined
pmichaud Kodi: testing patch now, will apply if it spectests cleanly 14:13
moritz_ pmichaud: is there any way to interpolate captures in <.panic: "foo"> error messages? 14:15
std: / , / 14:17
p6eval std 32123: OUTPUT«===SORRY!===␤Unrecognized regex metacharacter (must be quoted to match literally) at /tmp/5MDnxOfo4O line 1:␤------> / ,⏏ /␤Can't call method "from" on unblessed reference at /opt/perl-5.12.1/lib/site_perl/5.12.1/STD.pm line 53784.␤FAILED 00:01
..…
pmichaud I don't understand "interpolate captures"
moritz_ "Unrecognized backslash sequence \\$0"
s/captures/capture variables/
pmichaud in NQP or Rakudo ? 14:18
moritz_ NQP
pmichaud <.panic: "Unrecognized backslash sequence \\{$0}"> # maybe
<.panic: "Unrecognized backslash sequence \\{$/[0]}"> # more likely
moritz_ tries 14:19
Unrecognized backslash sequence: \{$/[0]} at line 1, near "/\n" 14:20
nqp: say("foo {2+3}")
p6eval nqp: OUTPUT«foo 5␤»
pmichaud that's weird. 14:21
nqp: my $/ := <a b c>; say("hello $1");
p6eval nqp: OUTPUT«hello $1␤»
pmichaud nqp: my $/ := <a b c>; say("hello {$1}");
p6eval nqp: OUTPUT«Unable to parse blockoid, couldn't find final '}' at line 1␤current instr.: 'parrot;Regex;Cursor;FAILGOAL' pc 2356 (src/Regex/Cursor.pir:233)␤»
14:21 wtw left
pmichaud nqp: my $a := 'hello'; say("hello $a"); 14:22
p6eval nqp: OUTPUT«hello hello␤»
pmichaud nqp: my $a := 'hello'; say("hello {$a}");
p6eval nqp: OUTPUT«hello hello␤»
pmichaud nqp: my $/ := <a b c>; say("hello {$/[1]}");
p6eval nqp: OUTPUT«hello b␤»
pmichaud nqp: my $/ := <a b c>; say("hello \{$/[1]}"); 14:23
p6eval nqp: OUTPUT«hello {3[1]}␤»
moritz_ nqp: "abc" ~~ / (.) <.panic: "$0">/
p6eval nqp: OUTPUT«Method 'panic' not found for invocant of class 'Regex;Cursor'␤current instr.: '_block14' pc 265 (EVAL_1:273)␤»
pmichaud nqp: my $/ := <a b c>; say("hello \\{$/[1]}");
p6eval nqp: OUTPUT«hello \b␤»
14:23 M_o_C joined
moritz_ + token backslash:sym<unrec> { {} (\w) 14:23
+ <.panic: "Unrecognized backslash sequence: \\{$/[0]}"> }
that's my patch 14:24
14:24 colomon joined
moritz_ seems to be different rules in mainline vs. regex 14:24
pmichaud just a sec
rhebus is there any difference between >>op<< and Zop ?
pmichaud rhebus: short answer: yes.
colomon rhebus: oh, yes.
moritz_ Z is lazy
>>op<< is eager (even hyper) 14:25
Z stops at the shortest list
>>op<< dies if they aren't of the same length
rhebus rakudo: say (1,2,3) Z+ (4,5)
p6eval rakudo 8cf7fc: OUTPUT«57␤»
rhebus aha
colomon >>op<< also recursively descends in structures 14:26
Zop doesn't.
rhebus do the structures have to match?
moritz_ yes
colomon rakudo: say ([1, [2, 3]] >>+<< [3, [10, 100]]).perl
p6eval rakudo 8cf7fc: OUTPUT«[4, [12, 103]]␤»
pmichaud moritz_: try <.panic("...")>
14:27 Kodi left
colomon rakudo: say say ([1, [2, 3]] Z+ [3, [10, 100]]).perl 14:27
p6eval rakudo 8cf7fc: OUTPUT«(4, 4)␤1␤»
pmichaud moritz_: or try <.panic("..." ~ $/[0] ~ "...")
>
moritz_ pmichaud: will do
pmichaud it may just be colon-arguments that aren't interpolating.
colomon rhebus: the second 4 there is the number of elements in [2, 3] + number of elements in [10, 100]
rhebus aha 14:28
thanks colomon++ moritz_++
moritz_ pmichaud: both produce the empty string for $/[0] 14:29
pmichaud I'm guessing $/ isn't being set then. 14:30
moritz_ possible
pmichaud colomon: does any of the str-to-num conversion code you wrote handle things like "0x0a" and the like? 14:32
colomon pmichaud: no
pmichaud oh. :-(
colomon it strictly handles base 10 decimal numbers.
(ie Rats and Nums)
pmichaud okay. that's going to require some refactoring then. 14:33
14:33 M_o_C left, M_o_C joined
dalek p-rx: 24b297f | moritz++ | src/Regex/P6Regex/Grammar.pm:
report unrecognized backslash sequences
14:33
PerlJam The grammar chapter of "Using Perl 6" says that the TOP rule anchors the match to the start/end of the string. I can't seem to find the particular section of the Synopses where it says this. 14:34
oh, never mind. 14:37
I just didn't read enough of the chapter. 14:38
rhebus bah, posterous--, i can't work their syntax out at all 14:41
colomon pmichaud: what are you trying to do? 14:45
pmichaud colomon: eliminate the Perl6Str PMC type
daxim where's the list of all built-in functions? $scalar.what-can-be-called-here @array.what-can-be-called-here
pmichaud it currently handles the 0x0a conversions
daxim: there's no canonical list at the moment ... but S32 is pretty close 14:46
moritz_ rakudo: my @a; say ~@a.^methods
p6eval rakudo 8cf7fc: OUTPUT«at_pos splice new perl delete Bool rotate pop Num perl Capture of elems Str munch list shift map exists push unshift ACCEPTS hash eager at_pos fmt flat sort new iterator list elems fmt item Num Str Int cosh succ subst sign Numeric chomp index uc chr acotanh samecase substr
..trim-tra…
moritz_ rakudo: say ~Cool.^methods
p6eval rakudo 8cf7fc: OUTPUT«fmt bytes pred acosec sinh Numeric asinh cosech trim asec trim-leading chr acotanh floor sech asech rand truncate round rindex sqrt asin split match cosh exp acosh succ words sign cotan atan2 lcfirst IO sec cis samecase log capitalize sprintf trans sin Int flip p5chop lc subst
..to-r…
pmichaud and, of course, $scalar.what-can-be-called-here depends heavily on the type of $scalar :)
daxim oh, introspection 14:47
that's nice
colomon pmichaud: ah, yes, refactor both necessary and useful there, then.
pmichaud colomon: plus we still need to eliminate the runtime conversion of string constants
sorry 14:48
runtime conversion of numeric constants
(to make them compile-time)
colomon I think we need Rats in nqp to do that...
pmichaud not at all.
moritz_ nope
you can emit Rat.new($nom, $denom) calls
pmichaud correct.
moritz_ as long as you do the calculations leading up there without rats
colomon yes, but in order to do that and have it work, you'll have to do dozens of those calls for each number. 14:49
pmichaud huh?
you mean more than we're already doing? ;-)
14:49 NABD40S joined 14:51 rodi joined
jnthn
.oO( one day we'll be able to just make constant(Rat.new($num, $dom)) in the akshuns :-) )
14:52
14:52 lichtkind joined
colomon I don't have the source up at the moment, but for fractional parts, each digit D is handled by adding D/10^N to the number we're calculating. 14:52
pmichaud colomon: that's not the issue.
currently, code like: for 1..1000 { say 1.5 }
colomon Rat.new($num, $dom) would be perfect if we had bigints...
lichtkind can i do no strict in perl ?
pmichaud generates
str2num-rat(0, "1", "5") 14:53
which internally calls Rat.new
I'm proposing that we change that to become
Rat.new(1,5)
er
Rat.new(3,2)
to avoid the runtime string conversion and pattern match and other overhead (that occurs on each iteration of the loop) 14:54
moritz_ lichtkind: you can in perl, but not in Rakudo Perl :-)
lichtkind moritz_: ah thanks
14:54 _jaldhar joined
moritz_ I guess it will be easy-ish to implement once we have compile time lexpads 14:55
colomon pmichaud: yes, but your example there skips the step where all the hard work is done.
pmichaud colomon: no, I'm simply saying we calculate the 3 and 2 at compile-time instead of at runtime
I'm not saying we use different steps.
we still call str2num-rat, but we do it once (at compile time) instead of on each execution
colomon oh. 14:56
so we can still use Rat calculations there?
moritz_ which implies rewriting str2num-rat in nqp, right?
pmichaud moritz_: no
I'm just going to put it in PIR
it's already PIR
jnthn Or being smart enough to only call it when we know we have the setting compiled so it's available.
Oh, OK
If it's in PIR then it's easy :-)
pmichaud there's no reason that str2num-rat needs to be in the setting--- it's just a Q:PIR { ... } block
14:57 mikehh left
pmichaud well, that one isn't... but it's easy enough to fix 14:57
and yes, what jnthn++ said
we just make sure it's defined first.
(before we encounter any rats)
rhebus masak: rhebus.posterous.com/learning-perl-...illy-games
pmichaud at any rate, doing .subst as part of string-to-num conversion is Evil as far as I'm concerned. We need to eliminate that part.
14:58 jaldhar left
pmichaud (since it involves an expensive pattern match) 14:58
(and calling a variety of closures, and ...)
anyway, it's perfectly valid for Actions.pm to call Perl 6 functions directly. 15:00
smash rhebus++ 15:01
15:02 cjk101010 left
pmichaud hmmm. HLL::Grammar already provides the int conversions (for arbitrary bases)... I should probably use it instead of str2num-int . 15:02
colomon is scratching his head, because that looks like his code, but he's not at all remembering writing it that way. 15:03
15:03 ash_ joined
colomon you can't make it a call to the Rat constructor, you'll have to make it a call to infix:</> to get it to work correctly. 15:03
pmichaud that's fine, it's still much cheaper than doing the string conversion on each encounter 15:04
colomon yeah, agreed.
pmichaud oh, why would I have to do that, ooc?
I don't think I have to call infix:</>
colomon because the arguments might be Nums instead of Ints
pmichaud doesn't str2num-rat already handle that for me? 15:05
colomon In which case you're not getting a Rat at all.
pmichaud right
colomon oh, sorry, you're saying run str2num-rat and store the result as a Rat constructor.
pmichaud so I call str2num-rat, then if it gives me a Rat back, I emit a Rat constructor, if it gives me anything else back, I emit the code for whatever else it is.
colomon gotcha, yes, that should work nicely. 15:06
pmichaud if it gives me back a Num, then I just emit a num constant
colomon so while optimizing str2num-rat would be a good thing, the main point of this operation is to rewrite the Actions.pm section that calls str2num-rat.
so that it does it at compile time instead of run time. 15:07
pmichaud actually, likely I'll rewrite the entire string to num conversion
str2num-rat will go away, or at the least Actions.pm won't be calling it directly
it'll get called by Str.Numeric
colomon pmichaud++ # that's the right refactor 15:08
jnthn +1
pmichaud: Sounds like it'll be easily upgradeable to keep the generated constant objects themselves around later on too
(Once we get serialization contexts.) 15:09
pmichaud actions will simply say "oh, I have a string that represents a number, call Str.Numeric to compute its value and generate code for that"
jnthn Right. And in the future it'll be "...compute its value, add it to the serialization context and emit the code to look it up in the constants table" :-)
pmichaud exactly. 15:10
jnthn likes
[Coke] moritz_: did you fix my cokewants at : wiki.github.com/perl6/nqp-rx/requests ? 15:12
moritz_ [Coke]: I did the split-in-setting thing 15:13
pmichaud I took it out.
(unless it's been fixed again)
it broke the parrot build.
[Coke] moritz_: I mean the .panic one. sounded like your earlier discussion.
moritz_ [Coke]: i needed it myself, and couldn't get it to work 15:14
[Coke] ah.
I suppose those requests should be converted to Issues ? 15:15
pmichaud that might work
I'm sure I can get the string interpolation to work.
masak rhebus: nice! rhebus++ 15:18
[Coke] rants at having to learn YAML to post a ticket. :P
moritz_ you have to?
on github?
[Coke] argh. markdown sucks. :P
colomon pmichaud: I don't see any obvious reason I can't handle the "rewrite Str.Numeric" part of things if you handle the Actions.pm end of the matter. Free your time up for deeper stuff? 15:19
[Coke] ah, you can just use straight html, that makes it easier. 15:20
moritz_ we should really invent the one true markup language :-)
[Coke] please no. 15:21
pmichaud colomon: it's likely to be fairly involved
moritz_ found asciidoc for program documentation quite nice
pmichaud because it also needs to handle the "0x..." and "0b..." conversions. 15:23
colomon pmichaud: I don't see why the "translate this string to a number" part should be too bad. the str2num stuff already has most of the needed logic -- it just needs to be updated to handle different bases.
pmichaud colomon: because I want it to use the HLL versions of those routines instead of duplicating them.
[Coke] pmichaud: github.com/perl6/nqp-rx/issues/labels/feature 15:24
colomon "the HLL versions"?
pmichaud HLL::Grammar already has the radix conversion subs available.
colomon ah 15:26
pmichaud well, HLL::Actions, actually
15:26 Guest59183 left
pmichaud rakudo: str2num-int("0x0a").say 15:26
p6eval rakudo 8cf7fc: OUTPUT«Could not find sub &str2num-int␤ in main program body at line 22:/tmp/cAPL8Ee2hW␤»
pmichaud rakudo: Str::str2num-int("0x0a").say
p6eval rakudo 8cf7fc: OUTPUT«Method 'panic' not found for invocant of class 'Str'␤ in 'Str::str2num-int' at line 4516:CORE.setting␤ in main program body at line 22:/tmp/kD93ay4IAu␤»
pmichaud hmmmm 15:27
15:27 aigoo left
colomon rakudo: Str::str2num-int("0x0a") 15:28
p6eval rakudo 8cf7fc: OUTPUT«Method 'panic' not found for invocant of class 'Str'␤ in 'Str::str2num-int' at line 4516:CORE.setting␤ in main program body at line 22:/tmp/Xem_ZjKu3f␤»
colomon oh, I see
src.'panic'('Invalid radix conversion of "', char, '"') is the code in question
pmichaud str2num-int expects a match object. 15:29
actually, it seems to expect a cursor.
colomon hmm? not the version in Str.pm. 15:30
pmichaud that's the one I'm looking at.
colomon .local pmc src
pmichaud if you're calling .panic, you're expecting a Cursor.
colomon .local string src_s
src = find_lex '$src'
src_s = src
pmichaud because .panic is only defined on Cursors.
src.'panic'('Invalid radix conversion of "', char, '"')
colomon Presumably the .panic call is just wrong.
15:31 risou joined, Ross joined 15:32 justatheory joined
colomon Spectest runs probably don't notice the different between call .panic and failing because you cannot call .panic. 15:32
s:1st/call/calling/ 15:33
15:33 mberends joined, rodi left 15:35 jaldhar_ joined
colomon rakudo: say 1e5.WHAT 15:36
p6eval rakudo 8cf7fc: OUTPUT«Num()␤»
pmichaud ooooh 15:37
we can haz 64-bit ints (on 64-bit machines)
15:39 _jaldhar left
jnthn pmichaud: ooh, nice :-) 15:42
15:42 perlnab joined
dalek kudo: d84752d | KodiB++ | / (6 files):
Implemented Instants and Durations.

Signed-off-by: pmichaud [email@hidden.address]
15:43
TimToady though actually, 64-bits that can't be guaranteed isn't terribly useful in the overall scheme of things 15:44
phenny TimToady: 09:05Z <smash> tell TimToady beadsort in Perl 6 (translated from haskell) gist.github.com/568057
TimToady if 32-bit machines could emulate int64, then they'd be more useful 15:45
colomon pmichaud: unless you've just changed it, upgrade_to_num_if_needed only knows about 32-bit ints. 15:47
15:47 perlnab left
ash_ the repl doesn't support non-ascii input, correct? 15:47
pmichaud colomon: I've just changed it.
colomon \o/
ash_ rakudo's repl that is
pmichaud I'm testing it now locally to see what happens.
TimToady ash_: readline doesn't handle utf8 15:48
pmichaud ash_: the repl supports non-asc... what TimToady++ said
ash_ ah, kk
TimToady the GNU folks have been singularly bass-ackwards when it comes to Unicode 15:49
15:49 Ross left, Ross^ joined
ash_ > « 15:49
Confused at line 1, near "\x{c2}\x{ab}\n"
alright, well that means, try.rakudo.org won't support utf8 input then
pmichaud ash_: you could turn readline off
or I can give an option to do it 15:50
is try.rakudo.org really using the standard input?
moritz_ I'm sure there's a parott Configure.pl has an option to disable readline
ash_ well, it uses whatever Perl6::Compiler.interactive(); uses
15:50 _macdaddy joined
pmichaud yes, just build Parrot w/o readline support. 15:51
ash_ k, i'll do that
15:52 rbuels left
ash_ i see --without-gettext, is that the same as readline? 15:52
pmichaud huh
I don't see a "no readline" option. 15:53
moritz_ ash_: no
pmichaud looking.
15:53 mj41_ joined
[particle] no, gettext is for i18n 15:54
ash_ i can just modify the confug/auto/readline.pm runstep... but it should look for --without-readline
pmichaud agreed.
15:54 mfollett left 15:57 mj41 left, mj41_ is now known as mj41
masak pmichaud: thanks for applying Kodi's patch. 15:58
15:58 risou left 15:59 kcwu left, kcwu joined 16:00 justatheory left, justatheory joined
moritz_ rhebus: seems your blog post made it to the top 10 on reddit, r/programming/ 16:00
16:01 meinwald joined
takadonet !!! 16:01
16:01 stepnem left, meinwald is now known as Guest57678
rhebus takadonet++ 16:01
i have never used reddit but i assume this is good 16:03
takadonet it is
hibou will be out soon....
16:04 stepnem joined
moritz_ rhebus: it means that you're probably getting at least 1k visitors for your blog, more if it stays up longer 16:04
rhebus shame it has an error which I can't fix because the posterous post editor is so godawful D: 16:05
i need a new blog platform really
moritz_ many people in here like wordpress 16:06
(I don't really like it, but then I'm a control freak in that respect)
I've created my own blogging system on top of my own templating system and blosxom (a perl 5 minimalistic blog system) 16:07
I don't like it either, but I can use my favorite editor to write blog posts, and have perl 6 syntax hilighting
16:07 timbunce left
ash_ i am lazy, i use wordpress 16:07
pmichaud rakudo: say (2147483647+0).WHAT; say (2147483647+2).WHAT; 16:10
p6eval rakudo 8cf7fc: OUTPUT«Int()␤Num()␤»
pmichaud > say (2147483647+0).WHAT; say (2147483647+2).WHAT;
Int()
16:10 Guest57678 is now known as meinwald_argh
TimToady rhebus: you have an <a b c> that is eaten as a tag 16:10
rhebus TimToady: yeah I know, but I can only fix it by deleting and reposting :(
posterous--
pmichaud TimToady: I have a question about 'flat'
TimToady flat is what does list context flattening, and () always flattens in list context, so it must be recursive 16:11
ash_ how does one set a perl6 variable as readonly via pir?
pmichaud okay; I don't think that's what we meant by recursive.
if I have (1, [1,2], [[1,2],3]) and flatten it, what do I get? 16:12
TimToady I thought the example had nested parens
16:12 Ross^ left
pmichaud that's a bug with .perl, imo 16:12
TimToady [] doesn't flatten in list context
pmichaud they were actually itemized Seqs
TimToady so you get the same thing
pmichaud right
okay, we're in agreement.
if I have: 16:13
(1, (1,2).item, (1,2,3).item).flat
the resulting list has 3 elements, yes?
and same for 16:14
(1, (1,2).item, ((1,2).item,3).item).flat
16:14 rbuels joined
TimToady if so, I don't think [\,] <a b c>) should be itemizing 16:17
pmichaud sure, I can agree with that.
I admit that [\,] is likely broken. 16:18
I just wanted to make sure our notion of 'recursive flat' was in sync. We probably need to clarify the spec.
TimToady I'm worried that we're going to get a lot of accidental itemizing in user code
I'm wondering if we have some default backwards somewhere 16:19
pmichaud so far the opposite complaint is prevalent also (more)
TimToady "first of all, do no harm"
pmichaud we also get lots of people worried about accidental flattening
in the case of [\,], I bet something is being put into a scalar 16:20
and returned
so there it's a matter of de-itemizing it.
TimToady ah well, it's likely that if some sig default is wrong, it's only a matter of adding one extra char
it's not like every sig is going to fill up with consts
pmichaud I also had a question about @x[$y] where $y ~~ Positional 16:21
something feels wrongish there
16:21 meinwald_argh is now known as meinwald
pmichaud in the general case of: 16:21
TimToady you thinking Match objects?
pmichaud my xyz(@a) { say @a.elems }; my $b = <1 2 3>; xyz($b)
correct answer is... 3? 16:22
it turns out to not be just Match objects
rakudo: my @a = 0..9; my $b = [3,7,4]; say @a[$b]
p6eval rakudo 8cf7fc: OUTPUT«374␤»
TimToady I don't think @x[$y] should be looking at whether $y is positional unless you say @$s
@$y even
pmichaud hmmmm 16:23
what about something like
@x[foo()]
I guess my question is... how does .[ ] dispatch here?
TimToady or @x[m/.../]
jnthn pmichaud: In the @x[foo()] case if foo() returns multiple things they'd be in a Parcel, if that helps clarify anything. 16:24
pmichaud currently Rakudo has postcircumfix:<[ ]>(@x) { ... }
jnthn (So it'd be a single Parcel parameter to the .[ ])
pmichaud sorry
currently Rakudo has postcircumfix:<[ ]>(@pos) { ... }
to handle the case of things like @x[1,2,3]
i.e., it looks for a Positional argument
jnthn: (foo() returns Parcel) -- yes, postcircumfix:<[ ]> relies on that 16:25
since Parcel ~~ Positional 16:26
jnthn Right.
16:26 rschuster-off left
jnthn All of the postcircumfixes today generally take a single parameter. 16:26
Including postcircumfix:<( )> (which gets a capture)
pmichaud Right. My question is about itemizing behavior.
in the case of @a[$b] where $b ~~ Positional, how does postcircumfix:<[ ]> know not to use the elements of $b as indexes? 16:27
TimToady seems $b should be Scalar of Mumble, which is never positional
jnthn I can't immediately thing of a way it can.
TimToady: That won't really fly. 16:28
TimToady: Scalar is always transparent
pmichaud TimToady: thus my earlier question of
my xyz(@a) { say @a.elems }; my $b = <1 2 3>; xyz($b)
TimToady to methods, but not to fundamental typology
pmichaud is $b "Scalar of ..." ?
huf what does Mumble mean? 16:29
is it Foo?
TimToady they are equivalently meta
pmichaud huf: "Mumble" is just "<insert appropriate value here>" 16:30
TimToady one gets tired of Foo and Bar
pmichaud and we can no longer say "of Whatever" :-)
unless we really mean "Whatever" :)
huf you're all MumbleFooQuuz
pmichaud huf: so, "Scalar of MFQ" :-P 16:31
jnthn ...a meme is born. :-)
16:31 Axius joined
jnthn TimToady: They're special even at a pretty fundemental level. 16:33
TimToady: We can't really make $foo in a signature mean Scalar of Any
16:33 stepnem left
jnthn Otherwise you couldn't pass anything that wasn't ~~ Scalar[Any] 16:33
pmichaud more to the point, if $foo = [<a b c>], I'm pretty sure that $foo has to be ~~ Positional
jnthn Yes 16:34
Agree.
TimToady there's some fundamentally missing circularity saw missing with your use of ~~
pmichaud could be... I just don't know what it is, thus the questions. :-) 16:35
more directly, Positional.ACCEPTS($foo) # probably True
16:35 stepnem joined
pmichaud now then, to resolve the .[ ] issue, I could potentially switch it back to taking slurpy arguments, but that gets tricky when trying to clip ranges and the like. 16:36
TimToady that is stripping the "I am only a simple scalar, leave me alone" info from $foo 16:37
jnthn Maybe "is it positional" is the wrong thing to dispatch on.
pmichaud if .[ ] has a slurpy parameter for its arguments, then $b wouldn't flatten.
jnthn *Positional
What if we had some way to dispatch on "does it have the flatten flag set"?
TimToady ACCEPTS must not loose that
*lose
if you're going to use ACCEPTS 16:38
pmichaud jnthn: yes, I'm wondering how/where we get flattening behavior into our type system
so far it's really orthogonal to types
jnthn TimToady: That's hardly the problem here.
TimToady: It's that - as pmichaud++ just pointed out - does Positional isn't really implying anything about flattening.
16:39 daxim left
pmichaud this is also the problem I have with .perl as it's defined now -- it doesn't know anything about flattening either 16:39
16:39 cdarroch joined, cdarroch left, cdarroch joined
jnthn TimToady: And we don't yet have a (not implementation specific) way to say "is the flattening flag set" 16:39
TimToady ACCEPTS needs to have a way of acting primitive, and it doesn't have access to the flattening flag, which is *logically* part of the capture, not either the arg or the parameter
pmichaud if @a and $a are both arrays, then (1, 2, $a).perl and (1, 2, @a).perl both result in the same output, even though they're really quite different.
16:39 thebird left
TimToady I think the fundamental mistake is to try to attach the flattening flag to the arg 16:40
pmichaud it's already attached to the arg.
TimToady or do you do that anymore?
pmichaud no
TimToady that's bogus
pmichaud it's attached to the container
TimToady the container is the capture
pmichaud that doesn't mean anything to me, for some reason.
ash_ ping sorear
TimToady it's one level down to where it belongs, I suspect 16:41
pmichaud the capture itself has containers
jnthn TimToady: No, no...like if you have an array then it's on that container.
TimToady that's what I think is wrong
jnthn TimToady: And that is referenced by the Capture
pmichaud consider: flat($a, @a)
TimToady I think the capture has to know the bitmap of what wants flattening, and the internal containers are just objects
pmichaud the capture is \($a, @a)
the capture can't syntactically know that 16:42
jnthn TimToady: You seem to be advocating a model where captures are going to be more than just a list/hash of arguments. I think that's a mistake.
TimToady yes, it can
pmichaud @a[foo()]
TimToady if $a and @a are the same object then *either* the capture must know that $a is non and @a is flattening, or $a *must* be Scalar of Array
pmichaud right now we do $a is Scalar of Array 16:43
jnthn TimToady: If captures are going to be richer than that, we'll have even more issues being able to optimize them away, for example.
pmichaud but it's still also Positional
TimToady then Scalar is being overloaded for two different purposes
and I think the bit really belongs to the capture, not the arg 16:44
it's "how was this expressed in the argument list", and the object itself shouldn't care
pmichaud if the argument list is a function, how do we know if it's Scalar or not?
sorry 16:45
if an argument is a function, how do we know if it's Scalar or not?
(argument is a return value of a function...)
16:46 tylercurtis joined
TimToady that is always treated as a subparcel, the contents of which depend on how the function returned it 16:46
pmichaud which means we can't know syntactically.
16:47 Axius left, mberends left
TimToady which means the capture thinks it's flattenable; probably also implies that it can bind to Positional 16:48
16:48 lichtkind left
jnthn sub foo { 42 }; @x[foo()] # argument to .[ ] is not going to be Positional here 16:49
e.g. there's only a Parcel created if there's multiple return values
dalek kudo: 0d6d574 | moritz++ | docs/ChangeLog:
update ChangeLog
TimToady correct, a single return value is its own Parcel, apart from not doing positional 16:50
pmichaud sub foo { [1,2,3] }; @x[foo()] # .....
jnthn But if we can't rely on the flag in the capture to tell us whether the thing will be flattening or not, what is the point?
It feels like much of the time it'll be a guess. 16:51
And if it's going to guess flattening, and we call something that returns a Match object, we're still no further forward on (what I guess anyway was) the original issue. 16:52
pmichaud jnthn: the original issue was that a Match object inside of .{ } is being treated as a slice, since Match ~~ Positional 16:53
I can certainly fix the Match object case simply enough
jnthn pmichaud: Right.
dalek p-rx: 99fe6e2 | moritz++ | src/stage0/ (3 files):
update bootstrap files
16:54
TimToady how?
jnthn pmichaud: I guess there's related cases though.
Well, the obvious fix is to add a candidate to .{ } that takes Match
pmichaud by defining postcircumfix:<{ }>(Match $m) { self{~$m} }
16:54 sekimura joined
TimToady that's a hack 16:54
jnthn It'll be tighter than Positional and thus win.
pmichaud right
jnthn I agree it's a hack, yes.
pmichaud it's a hack, and thus I'm asking about the "real solution"
TimToady a more general solution might be to always return certain objects inside a Parcel even if there's only one of it 16:55
pmichaud which is why I'm interested in .[$b] where $b ~~ Positional :-)
16:56 Chillance joined
jnthn TimToady: sub foo(Int $x) { say "ok" }; sub bar { 42 }; foo(bar()) # if the 42 lived in a Parcel, we hit issues in this example. At the moment, type checks happen before context is applied. We can't reverse that otherwise our multi-dispatches may have multiple solutions. 16:57
TimToady or maybe there's some kind of Don't-Flatten-Parcel
that's distinction from both Scalar and Parcel
jnthn (assuming it's item context application that makes the parcel evaporate)
(when it has one item in it, anyways...)
16:57 macroron joined
pmichaud I don't mind if there's a subset type that means "flattening" 16:58
jnthn It feels like we may well need to introduce flattening somewhere into the type system.
pmichaud it would be nice to say postcircumfix:<[ ]>(Item $x) { ... } and know that non-flattening values go here 16:59
TimToady it's almost feeling like the :U vs :D issue
pmichaud (or the inverse, if we need that)
jnthn TimToady: Hey, I was just typing that. :-)
TimToady: But was trying to think of nice names :-) 17:00
pmichaud similarly, with :U and :D, why did we avoid subset types of Defined and Undefined or the like?
TimToady which is likely a circularity saw flavor
jnthn TimToady: In a sense though, it is a "check a flag" thing, like :U and :D are "check if the REPR thinks it is defined"
pmichaud: :U and :D don't map to .defined
TimToady becuase it's a circularity saw issue
pmichaud okay.
jnthn pmichaud: They map to what the representation considers defined.
pmichaud: Which really boils down to "is this a type object or not"
TimToady we have to break away from normal semantics with ACCEPT in various spots 17:01
pmichaud jnthn: my point was more about subset type versus syntax, not whether it's really "defined" or not.
TimToady or we get these infinite regressions
17:01 macroron left
pmichaud i.e., we could conceivably have subset types with meanings similar to :U and :D 17:01
17:01 macroron joined
jnthn pmichaud: Subset types just feel a bit high level for that. 17:01
pmichaud (modulo circularity)
jnthn: sure, I can buy that.
jnthn pmichaud: I tend to see subset types as a way of adding imperative checks. 17:02
moritz_ maybe we need a general mechanism for introducing such subset types like :U and :D
jnthn pmichaud: And :U / :D are more declarative things.
TimToady don't see offhand how that helps circularity
moritz_ isn't that what traits were originally meant for?
TimToady something has to be primitive 17:03
jnthn moritz_: traits are more a thing we'd want to encourage people to use
pmichaud I wouldn't have trouble with postcircfumfix:<[ ]>($x is item) either
jnthn moritz_: For people people, if they're having to write :U and :D in their code, they're writing something odd.
pmichaud: Yeah, we could do that too 17:04
pmichaud similar to the way that $x is rw distinguishes the dispatch somehow.
jnthn pmichaud: OTOH, we could do traits for :U and :D too.
Maybe we [c|sh]ould eliminate :U and :D in place of traits, like we have for is rw and is ro.
pmichaud in that sense, rw-ness and item-ness arboth properties of the container
*are both 17:05
(or argument)
TimToady what does "is item" mean?
pmichaud it would only bind to arguments that aren't flattening
(could use "is scalar" too, I suppose) 17:06
(but that has a bad pun with "is Scalar")
TimToady not sure this solves the Match problem
pmichaud sure, Match isn't flattening
$/ is an item
so we'd end up with postcircumfix:<{ }>($x is item) { self.at-key(~x) } or something like that 17:07
TimToady I guess people will just have to get used to writing ~/.../ and +/.../
pmichaud er, 17:08
self.at_key(~$x)
which forces stringification of the key
jnthn I think something along the lines of what pmichaud++ is suggested would be workable.
pmichaud we do this now already (stringification) -- the problem is simply that Match as a Positional causes it to dispatch elsewhere first. 17:09
TimToady thing is, people expect two different things from .[/ (\d+) ** , /]
pmichaud yes, in that case I think it has to disambiguate
TimToady but only one thing from .[/ (\w+) ** , /]
they expect the Int type constraint of array subscripts to somehow figure out that it couldn't be a slice 17:10
17:10 timbunce joined
pmichaud more generally, what would we expect from for / (\w+) ** , / { ... } 17:10
one iteration per capture? 17:11
well, I guess it's still just one iteration
more likely:
TimToady that's what people would generally expect
but for expects a list
pmichaud for / (\w+) , (\w+) , (\w+) / { ... }
TimToady we knew that subscripts were going to be ambiguous
one reason we made + and ~ so short :) 17:12
pmichaud for expects a list, and the match object returned there is an item, yes? i.e., it doesn't flatten?
or I need an m//
for m/ (\w+) , (\w+) , (\w+) / { ... }
TimToady match objects must flatten
pmichaud j,,,
hmmmm
say (1, 2, m/ (\d+) , (\d+) /).elems # 4 if matched? 17:13
TimToady $/ doesn't because of the $, not because of the Match
pmichaud okay.
on a similar topic, does Array.new flatten?
TimToady yes, 4 17:14
17:14 envi^home left
pmichaud say (1, 2, Array.new).elems # 2 or 3 ? 17:14
TimToady I suspect we need to make that the choice of the function's return 17:15
if it said return $array, it shouldn't, and if it said return @array, it should 17:16
pmichaud right, that's what Rakudo does now
so you're saying there's not a general rule for .new ?
(I'm fine with that, just confirming) 17:17
TimToady why should .new be special, except insofar as we have a default one?
pmichaud wfm
and in the specific case of Array.new, flattens or doesn't flatten?
also Range.new
(1,2, Range.new(4, 7)).elems # 3 or 6? 17:18
17:18 timbunce left
pmichaud I'm fine with any answer (I think)... I just know these are corner cases I postponed until .... now :) 17:18
17:19 masak left
TimToady not sure this is a flatten flag, seems more like Range.new just returns the range in a parcel, and it depends on how the outer list is eventaully bound whether it's in list or scalar context 17:20
pmichaud feels an "I can argue that both ways" coming along.
TimToady it keeps feeling like returned object's that are Positional or Iterable should never serve as their own Parcel, but should always be Parcelized 17:21
pmichaud hmmm 17:22
so, in the case of
TimToady (1,2,Range.new(4,7) should end the same as (1,2,(4..7)) 17:23
pmichaud okay, so .new isn't flattening in that case.
i.e., it doesn't return a flattening value.
I think this is what rakudo does now:
rakudo: my $x = (1,2, Range.new(4,7)); say $x.perl;
p6eval rakudo d84752: OUTPUT«(1, 2, 4, 5, 6, 7)␤» 17:24
pmichaud rakudo: my $x = (1,2, Range.new(4,7).item); say $x.perl;
p6eval rakudo d84752: OUTPUT«(1, 2, 4..7)␤»
17:24 plainhao joined
TimToady rakudo: my sub foo ($a,$b,$c) { say $c.perl }; foo(1,2,Range.new(4,7)) 17:25
p6eval rakudo d84752: OUTPUT«4..7␤»
TimToady rakudo: my sub foo ($a,$b,*@c) { say @c.perl }; foo(1,2,Range.new(4,7))
pmichaud I'm not sure that saying that Positional/Iterable objects aren't self-Parcels solves the underlying problem.
p6eval rakudo d84752: OUTPUT«[4, 5, 6, 7]␤» 17:26
pmichaud rakudo: my sub foo ($a,$b,*@c) { say @c.perl }; foo(1,2,Range.new(4,7).item)
p6eval rakudo d84752: OUTPUT«[4..7]␤»
17:26 ruoso left
jnthn -> dinner, bbiab 17:27
TimToady it separates the positionality of the object itself from the positionality of its outer parcel interpoaltion
pmichaud except that Parcel ~~ Positoinal
*Positional
TimToady yes, but if it binds that positional, it leaves the internal positional alone
pmichaud only if it's marked as non-flattening :-)
17:28 Italian_Plumber joined
TimToady needs more coffee... 17:28
pmichaud I'm sure you do.
:)
I need lunch.
Anyway, I'm happy to let you think on it a bit.
I can put in the Match hack if we want temporarily, or we can just let it stew for a while. 17:29
subscripting based on match object results is likely to be common.
the others are markedly less common.
moritz_ we have at least three independent submissions (2 RT, on p6c iirc)
17:30 Mowah joined
pmichaud in fact, more important (to me at least) is to come up with a much better definition of .perl 17:30
the fact that it doesn't understand items versus non-items is very confusing to people.
(flattening versus non-flattening) 17:31
rakudo: say (4..7).perl
p6eval rakudo d84752: OUTPUT«4..7␤»
pmichaud rakudo: say ((4..7).item).perl
p6eval rakudo d84752: OUTPUT«4..7␤»
pmichaud my @a = 1,(4..7).item; say @a.perl; say @a.elems; say eval(@a.perl).elems; 17:34
rakudo: my @a = 1,(4..7).item; say @a.perl; say @a.elems; say eval(@a.perl).elems; 17:35
p6eval rakudo d84752: OUTPUT«[1, 4..7]␤2␤5␤»
pmichaud afk, lunch 17:36
colomon pmichaud: I just remembered one of the significant issues to worry about in str -> num conversion. right now, we use Nums (well, parrot equivalent) accumulate digits, and then convert to Int if possible. 17:37
diakopter phenny: tell sorear wow...! github.com/sorear/niecza/commit/c54...9870f98fe0
phenny diakopter: I'll pass that on when sorear is around.
colomon pmichaud: that works great for 32-bit ints, but a 64-bit int is more precision than a Num, which leads to potential issues. 17:38
pmichaud: of course, if you use Int to accumulate digits, then you have issues with Int overflow. (until the happy day we have arbitrarily large Ints.) 17:39
pmichaud I can always use Int to accumulate until we get to the point at which it'll overflow to num
anyway, I just ran a spectest locally and only run into one problem in an advent test 17:41
and we get a couple of passing todo's
17:41 ruoso joined
patrickas colomon: Got any comments on the series refactor? Or can we land it ? 17:41
colomon pmichaud: that's for 64-bit int in rakudo? 17:42
moritz_ I've cherry-picked the commits into the series-refactor branch
pmichaud colomon: yes.
colomon pmichaud: cool
17:42 avar joined
pmichaud so I'm thinking I might accept the difficulty with constant conversion 17:42
colomon pmichaud: Int switching to Num is great if you can do it reasonably easily. 17:43
pmichaud it just means that some ints will switch to nums earlier than a full 64-bit int might
er, some int *constants*
colomon pmichaud: oh, my warning was for your grand Str.Numeric refactor.
pmichaud ah
yes, that's good to remember
(and no, I hadn't thought of it yet. colomon++) 17:44
colomon pmichaud: if you're switching to 64-bit Ints mostly by changing upgrade_to_num_if_needed, then the issue isn't switching to nums too early -- it's output an int that was calculated internally using nums, so it's not as precise as it should be. 17:45
moritz_ phenny: tell Kodi fyi your patches don't have a proper email address (not problem, but if it's a misconfiguration, you'd might want to know)
phenny moritz_: I'll pass that on when Kodi is around.
colomon *outputing.
pmichaud but at that point it's no longer an int :-)
oh, I see. 17:46
yes.
it'll incorrectly act like an int when it's really not.
17:46 plobsing_ joined
colomon patrickas: if the series refactor passes all the spectests and is ready to go, I'm all in favor of using it ASAP. 17:46
pmichaud: specifically, it will generate an Int, but have lost some digits of precision along the way. 17:47
you can actually do that already on 64-bit machines, it's just tricky.
(I don't think it affects constants, but you can do calculations that cause the effect, I believe.)
patrickas colomon: great! Yes it passes all the currently unfudged spectests... as soon as it lands we can unfudge about a dozen more!
pmichaud colomon: sure, calculations that cause it are definitely possible. 17:48
I'll think about it a bit more, then.
we could arbitrarily stop at whatever int value won't cause num issues
colomon pmichaud: I don't know that it's a reason *not* to switch to 64-bit Ints, it's just something to be aware of.
pmichaud (if there is such a value)
well, claiming something is integer precision when it's really not sounds like a serious problem to me 17:49
so I'm inclined to not make that switch.
I may still get integer constants to use 64-bit when available. 17:50
(in NQP, at least.)
rakudo: say +('abc12def45' ~~ / \d+ /) 17:52
p6eval rakudo d84752: OUTPUT«12␤»
pmichaud rakudo: say +('abc12def45' ~~ / (\d)\d+ /) 17:53
p6eval rakudo d84752: OUTPUT«12␤»
pmichaud afk, lunch.
17:56 Holy_Cow left, Holy_Cow joined 17:57 cotto_work joined
cotto_work is "Mu" pronounced "moo" or "mew"? 17:57
[Coke] sees a conversation about twigils on p5p and is temporarily confused.
TimToady I do cow, not cat. 17:58
[Coke] assumed it was like the greek letter.
TimToady which is also pronounced both ways :)
patrickas pronounces it as the french vu , du
rhebus class TimToady does Cow
moritz_ cotto_work: I pronounce it 'moo'
like the greek µ
no, not quite 17:59
Util says 'moo'
rhebus i presumed it was the zen thing. I pronounce µ cat but zen mu cow
TimToady yes, it's the zen thing; doesn't really have anything to do with greek 18:00
actually it should be pronounced 無 :) 18:02
18:02 rainerschuster joined
rhebus got pinyin for that? :) 18:03
[Coke] is む ok? ;)
TimToady in Japanese it is
rhebus you know i think we're the only ones who have really benefited from unicode :)
[Coke] 무 is easier to draw.
TimToady in Chinese it would come out more /wu2/
moritz_ has too 18:04
[Coke] wonders if it's related to the wu in wushu.
smash TimToady: beadsort in Perl 6 (translated from haskell) gist.github.com/568057 18:05
TimToady I saw that 18:06
colomon smash: where is transpose coming from?
TimToady see the use
smash colomon: from my List::Utils (which i originally forked from yours)
TimToady most anything from that module ought to be built-in 18:07
smash but mine has the transpose
colomon smash: ah
smash TimToady: from which module ?
TimToady List::Utils
colomon smash: url?
TimToady transpose ought to be built in, anyway 18:08
cotto_work So the proper answer to my question is "learn Chinese". ;) 18:09
TimToady in this case, no, learn Japanese :)
cotto_work That's much easier.
TimToady which is why it's anglicized as Mu
but that should just be Texas version of 無 18:10
sbp talking of anglicisation, mu and moo aren't homophones in British English... :-)
phenny sbp: 16:49Z <MattRead> ask sbp I don't see the "not yahoo" phenny module in source. I assume it's like the last version and I need to please you to get it?
18:10 tadzik joined
tadzik hello 18:10
sahadev rakudo: ("f","oo","bar").>>.chars
TimToady sbp: we were just discussing that above 18:11
p6eval rakudo d84752: OUTPUT«===SORRY!===␤Confused at line 22, near "(\"f\",\"oo\","␤»
rhebus sbp: i'd argue "mu" as transliteration from japanese is still "moo" in british english
[Coke] TimToady: I eagerly anticipate the audio links on perl6.org with pronounciation guides. ;)
sbp hmm, I'm sure we have a Zen centre around here somewhere
I should go and ask them
rhebus wow, i've never had a blog post with nearly this many views before
tadzik what blog post? 18:12
rhebus up to 7 on reddit /r/programming
rhebus.posterous.com/learning-perl-...illy-games
moritz_ rhebus: how many did you have so far?
rhebus 777
TimToady note that they will not pronounce it "moo" like a cow, but with a very short u
rhebus TimToady: so, not like a cow.
TimToady but not palatalized either 18:13
rhebus gah, can't read. never mind
TimToady in isolation it will tend to come up with a glottal stop on the end
rhebus yay for glottal stops
they remind me of home
cotto_work like a short cow. got it
TimToady like the first o in oh-oh, only with u
like the first oo in oo-ooh :) 18:14
rhebus i'm imagining a cow which gets shot just as it starts mooing 18:15
TimToady otoh, a japanese cow doesn't say moo, it says moh 18:16
with a long o
moooooh
rhebus is that what the japanese say their cows say, or is it actually what the cows say?
(do cows have regional accents?)
TimToady and there's no native long mū sound, only in borrowings 18:17
18:17 mberends joined
TimToady no, they all speak Standard Cow, it's just the transliteration that differs 18:17
the Japanese u is a bit tighter than English's u, so o sounds hollower--more like a cow than u does, anyway 18:18
sbp hmm
OED says:
Brit. /mu:/, U.S. /mu/ 18:19
(mu, n.|3| and int.)
rhebus sbp: :P
TimToady that
that's what u: think
sbp hehe
[Coke] that's a terribull pun. 18:20
TimToady thinks that's a silly use of :
sbp well it should be ː of course... 18:21
rhebus regarding tic tac toe, I've just realised that (0,3,6 X+ ^3) could just be ^9...
i wish posterous's editor didn't suck so much 18:22
18:22 macroron left 18:27 jhuni joined 18:30 rainerschuster left
sahadev this example from perlcabal.org/syn/S03.html#Hyper_operators doesn't seem to work: ("f","oo","bar").>>.chars # should return (1,2,3) 18:30
has something changed? or is it a bug? 18:31
moritz_ >>.chars works
without the leading .
we already have a ticket for that
sahadev moritz_: thanks. which is right? with or w/o leading "."? 18:33
18:33 patrickas left 18:34 rainerschuster joined
lue ohai o/ #phasers today? 18:34
pmichaud back from lunch 18:37
colomon sahadev: ("f","oo","bar")>>.chars is correct code. not sure if the adding the leading '.' is legal or not. (there may be more than one way to do it.) 18:38
tylercurtis std:("f", "oo", "bar").>>.chars
p6eval std 32123: OUTPUT«ok 00:01 118m␤»
colomon tylercurtis++ 18:39
sahadev thanks, colomon and tylercurtis.
18:39 jhuni left
tylercurtis I think that the .>>.meth form is probably like .++, .(...), .<...>, etc. 18:41
18:46 tadzik left, mfollett joined 18:47 ashleydev left, ashleydev joined
mberends \o/ Amsterdam.pm is about to open the beers that were auctioned off for a record €444 in Pisa 18:48
jnthn yay beer! 18:49
Na zdravje!
TimToady I hear it's a really good label. :)
18:49 _jaldhar_ joined
ash_ just images Bender chugging them all real fast like (see Futurama) 18:49
TimToady looks at the T-shirt he got for bargain price of €440 18:50
18:51 timbunce joined
mberends Wendy was just telling the crowd here about the T-shirt :) 18:51
TimToady be sure to tell them that beer won an award :)
[Coke] jnthn: I know that's not bulgarian, but I have to squint to prove it. 18:52
18:53 jaldhar_ left
moritz_ #phasers pre-reports seem to be quite the fashion thoday 18:53
rakudo: say 'ab' Xxx 1, 3, 1 18:54
p6eval rakudo 0d6d57: OUTPUT«ababababab␤»
moritz_ rakudo: say ('ab' Xxx 1, 3, 1).perl
p6eval rakudo 0d6d57: OUTPUT«(("ab"), ("ab", "ab", "ab"), ("ab"))␤»
moritz_ rakudo: say ('ab' Xx 1, 3, 1).perl
p6eval rakudo 0d6d57: OUTPUT«("ab", "ababab", "ab")␤» 18:55
jnthn [Coke]: It was a perhaps mis-spelt attempt at Slovene this time. :-)
[Coke]: Was on holiday there last week :-)
lue
.oO(Molybdenum is available for me to buy? Wow!)
18:56
sorear good * #perl6 18:57
phenny sorear: 17:37Z <diakopter> tell sorear wow...! github.com/sorear/niecza/commit/c54...9870f98fe0
sorear ash_: pong 18:59
ash_ sorear: i was going to ask if i could control the encoding in IO::Pty::HalfDuplex on the subprocess, but it turns out that wasn't the problem, it was something else in my code that was broken, sorry about that 19:01
19:01 snearch joined, Ross joined 19:09 dalek left 19:10 dalek joined, ChanServ sets mode: +v dalek
TimToady rhebus: re irclog.perlgeek.de/perl6/2010-09-07#i_2793687 you can actually use hyphen or apostrophe between any two legal idents, so the left side could be numeric, but not the right side 19:14
a42-b33 is legal, but not a42-33b
19:15 tadzik joined
pmichaud so, $r2-d2 is legal, but $c-3p0 isn't. :-P 19:19
TimToady everyone knows that R2-D2 is street legal, and C-3PO isn't... 19:20
19:20 ashleydev left 19:21 ashleydev joined
TimToady though what "street legal" means in terms of X-wings, I'm not entirely clear... 19:22
pmichaud
.oO( "These aren't the droid identifiers you're looking for..." )
19:23
rhebus TimToady: wow, that's above and beyond the call of duty. thanks :) 19:24
ash_ ping lue 19:26
TimToady well, I really should've addressed it to masak++, but I don't like to leave misapprehensions unchallenged, no matter how minor. consider it a character flaw. :)
tadzik ash_: you want some assistance writing the chapters for try.rakudo.org?
ash_ tadzik: yes. that would be awesome, are you familiar with javascript?
tadzik ash_: not really 19:27
19:27 Ross left
ash_ tadzik: how about json? 19:27
tadzik well, that's not a hard one :)
ash_ if not thats fine, but i am keeping the chapter data in json format, i need to do some touch up to get the chapter loaded/example executer working properly, but i can try to get that taken care of asap so you (and hopefully others) can write chapters 19:28
i fixed the utf-8 issues, and the script tag issues on my test server, i am going to push those changes live tonight for try.rakudo.org
lue pong ash_ 19:30
sorear What should I call a Perl 6 object that fills the traditional role of an iterator?
19:30 _macdaddy left
ash_ lue: did you ever have a way of making perl6 identifiers read only? 19:30
using pir
i thought you had something that did that for := or ::=
19:31 Ross joined 19:32 plainhao left
lue pir::delprop__0Ps($target, 'rw'); # is this what you want? 19:32
ash_ maybe? that sounds right 19:34
thanks
19:34 ashleydev left, ashleydev joined
lue Note that it deletes the rw attribute, and does not set the readonly attribute (according to pmichaud, they're separate) 19:35
pmichaud there is no readonly attribute. 19:36
at least, not yet.
anything not marked rw is readonly.
ash_ alright, cool 19:37
pmichaud (but this doesn't say anything about whether a symbol can be rebound.)
jnthn fwiw, we used to flag readonly instead of rw and it was a Bad Idea to do it that way around. 19:38
pmichaud I find it's much safer to assume everything is readonly unless explicitly marked otherwise. :) 19:40
jnthn Aye, it's working _much_ better for us that way. 19:41
TimToady capabilities++
pmichaud and Perl 6 agrees, thus has $.xyz defaults to read-only accessor :)
19:42 rschuster joined
pmichaud afk, kid pickup 19:42
ash_ well, i was planning on making @*INC readonly for the try.rakudo site, to prevent people from trying mess with things that way
19:42 rainerschuster left
ash_ but since you can always just do my @*INC; later, does that matter? 19:42
19:43 rschuster is now known as rainerschuster
TimToady well, there are a whole bunch of things that shouldn't work in a sandbox 19:44
ash_ any obvious suggestions? for those of us who aren't thinking outside of the sandbox 19:45
TimToady a real capabilities model?
"you can't open this door because you haven't been given the key" 19:46
perhaps that's a bit beyond your current aspirations though. :)
sorear rakudo: eval 'pir::spawnw__is("ls")' 19:47
p6eval rakudo 0d6d57: OUTPUT«build␤Configure.pl␤CREDITS␤docs␤dynext␤LICENSE␤Makefile␤parrot␤perl6␤perl6.c␤perl6_group.c␤perl6_group.h␤perl6_group.o␤perl6.o␤perl6.pbc␤README␤src␤t␤Test.pir␤Test.pm␤tools␤VERSION␤»
tadzik oh funny
Util I am still looking for a way to recursively flatten (since flat() only does one level), or to make [\,] behave as described in S03.
( see irclog.perlgeek.de/perl6/2010-09-07#i_2792939 )
Any ideas? 19:48
TimToady Util: flat is supposed to be recursive in that case
we were discussing this earlier today
ash_ sorear: i disable pir, so hopefully that won't work
tadzik ash_: it doesn't 19:49
TimToady that is, flat is supposed to be recursive on mere Parcels
lue afk
TimToady rakudo: say (1, (2, (3, 4))) 19:50
p6eval rakudo 0d6d57: OUTPUT«1234␤»
TimToady rakudo: say (1, (2, (3, 4))).flat.perl
p6eval rakudo 0d6d57: OUTPUT«(1, 2, 3, 4)␤»
ash_ rakudo: my @a = (1, 2, [3, [[4]]); say flat(@a).perl
p6eval rakudo 0d6d57: OUTPUT«===SORRY!===␤Confused at line 22, near "my @a = (1"␤»
ash_ rakudo: my @a = (1, 2, [3, [[4]]]); say flat(@a).perl
TimToady flat is not supposed to flatten []
p6eval rakudo 0d6d57: OUTPUT«(1, 2, [3, [[4]]])␤»
ash_ ah
TimToady it's like the difference between $array and @array in list context 19:51
Util finally sees the scrollback on flat() that he missed. Catching up...
moritz_ rakudo: say ?'0abc'.index('0') 19:52
p6eval rakudo 0d6d57: OUTPUT«0␤»
moritz_ rakudo: say '0abc'.index('0').perl
p6eval rakudo 0d6d57: OUTPUT«0␤»
moritz_ rakudo: say '0abc'.index('3')
p6eval rakudo 0d6d57: ( no output )
moritz_ rakudo: say '0abc'.index('3').defined
p6eval rakudo 0d6d57: OUTPUT«0␤»
TimToady rakudo: say '0abc'.index('3').WHAT 19:53
p6eval rakudo 0d6d57: OUTPUT«Failure()␤»
TimToady that's probably better than Nil
should probably be StrPos though 19:55
and the StrPos of 0 should be true
tylercurtis jnthn: regarding Parrot profiling: I'd worry about getting it to work with Rakudo before worrying about getting it to be more useful with Rakudo.
jnthn tylercurtis: My guess was that "doesn't work with" was partly "gives meaningless positions". 19:56
tylercurtis jnthn: Rakudo doesn't run under the profiling runcore.
jnthn Oh.
I...thought it once did. :( 19:57
tylercurtis trac.parrot.org/parrot/ticket/1768
pmichaud it once did, but now is broken.
jnthn Well, scheise.
19:57 spq1 left
tylercurtis Not with NQP either, it seems: trac.parrot.org/parrot/ticket/1745 , for the same apparent reason. 19:58
pmichaud oh wow, that's.... intersting.
19:58 rlb3_ joined
pmichaud I would've expected it to work with nqp. 19:58
tylercurtis pmichaud: you submitted that NQP ticket. 19:59
sorear ash_: my $*FORBID_PIR; eval '' ?
pmichaud tylercurtis: that must've been my other brain.
19:59 Italian_Plumber left
jnthn Oh, the erorr is in Regex;Cursor 19:59
So it makes sense if it hits NQP, it'll hit Rakudo too
moritz_ rakudo: use FORBID_PIR; my $*FORMBID_PIR; eval 'pir::printerr__vS("foo")'; say $!
p6eval rakudo 0d6d57: OUTPUT«pir::op forbidden in safe mode␤␤»
pmichaud the one I have today hasn't been firing properly
moritz_ rakudo: use FORBID_PIR; my $*FORBID_PIR; eval 'pir::printerr__vS("foo")'; say $! 20:00
p6eval rakudo 0d6d57: OUTPUT«pir::op forbidden in safe mode␤␤»
colomon ah, that's the error I was getting when I tried to profile, indeed! 20:01
20:01 kjeldahl left
pmichaud Cursor.pir:22 is load_bytecode 'P6object.pbc' 20:01
so that doesn't really tell us much, other than this is likely the first place that load_bytecode is encountered. 20:02
so maybe profiling runcore doesn't like load_bytecode
pmichaud checks
20:09 Guest31998 left 20:10 Italian_Plumber joined
pmichaud trac.parrot.org/parrot/ticket/1745#comment:3 # load_bytecode seems a likely culprit 20:11
20:12 snearch left
ash_ sorear: my $*FORBID_PIR doesn't work (as far as i can tell) 20:13
tylercurtis pmichaud: perhaps check if that happens with other bytecodes than p6object.pbc in case the problem is actually somewhere in p6object.pbc(or in the profiling runcore breaking p6object.pbc)?
pmichaud tylercurtis: dumper.pbc works 20:14
but iirc P6object.pbc doesn't do anything terribly .... unusual
20:14 bacek joined, Italian_Plumber left
pmichaud istr that profiling runcore didn't like tailcalls, though. 20:16
removing the tailcalls in P6object.pir doesn't seem to help. 20:17
20:19 ash_ left, timbunce left 20:21 aloha joined 20:23 tadzik1 joined 20:25 cognominal left, cognominal joined 20:26 timbunce joined, tadzik left
sorear I could use a method on Mu which returns .list.[0] efficiently 20:26
What should I call it?
moritz_ .head ? 20:27
phenny Can't connect to ?
jnthn Doesn't (argumentless) .first do that?
moritz_ it's in Any, not Mu
sorear jnthn: I didn't realize it already existed
colomon rakudo: my @a = 1..10; say @a.first 20:28
p6eval rakudo 0d6d57: OUTPUT«No candidates found to invoke for method 'first' on object of type 'Array'; available candidates have signatures:␤:(Mu : Mu $test;; *%_)␤␤ in main program body at line 22:/tmp/Q9aFS9q_7L␤»
moritz_ but .first could certainly be made to default to True, if it doesn't already
colomon it doesn't.
jnthn Maybe a nice thing to do
colomon and it's not spec'd to do so, either.
moritz_ that can be changed :-) 20:29
colomon indeed. :)
moritz_ just make $test = True a default
\o/ Perl 6 solved my first nonogram :-)
rhebus moritz_: submit the code to perl6-examples/99-problems/P98-moritz.p6 :) 20:31
PerlJam feels a blog post coming soon. 20:32
moritz_ rhebus: currently I develop it in a separate repo
github.com/moritz/Nonogram/
20:33 timbunce left
PerlJam turtle++ 20:33
moritz_ it successfully solves this one here: de.wikipedia.org/wiki/Nonogramm#Beispiel
rhebus what does it do if you give it an ambiguous nonogram? 20:36
(eg 1,1/1,1)
moritz_ not solve it completely
rhebus fair enough
20:37 tadzik1 is now known as tadzik
pmichaud > my %h = a => 1; 'a' ~~ /./; say %h{$/}; 20:37
1
PerlJam moritz_: how long did it take to solve that one?
moritz_ PerlJam: about 6s
PerlJam moritz_: maybe you should add it to benchmarks :) 20:38
jnthn pmichaud: yay :-) 20:39
dalek kudo: 19a8b71 | pmichaud++ | src/core/Any-list.pm:
Add Match workarounds for .[] and .{} to (temporarily) allow match objects to do something sane. Addresses RT #75868.
moritz_ now curious what will make out of de.wikipedia.org/w/index.php?title=...0913140813 20:41
diakopter .head .
phenny Can't connect to .
20:41 mberends left
diakopter .head irc.perl6.org 20:41
phenny diakopter: 301, text/html, iso-8859-1, 323 bytes
moritz_ I've read that Nonograms are NP :/ 20:42
20:42 perlygatekeeper left 20:43 perlygatekeeper joined
PerlJam Perl 6: making NP-easy things easy and NP-hard things possible. 20:43
jnthn .head localhost
phenny jnthn: 200, text/html;charset=UTF-8, 2846 bytes
moritz_ .get localhost
20:44 ashleydev left
sbp .title localhost/ 20:45
phenny sbp: Index of /
moritz_ .title localhost/cgi-bin/
phenny Can't connect to localhost/cgi-bin/
20:46 stepnem left
colomon nonograms: oh, those! (backlogging) 20:46
20:47 stepnem joined 20:49 ashleydev joined 20:53 M_o_C left 20:55 mfollett left
dalek ecza: b6871bc | sorear++ | / (5 files):
Use fastpath code to get first list element

Avoiding lazy list iterators improves parser benchmark ~2x speed.
20:55
20:59 rlb3_ left, rgrau_ joined, Italian_Plumber joined 21:03 mfollett joined 21:04 Italian_Plumber left 21:15 whiteknight joined
sjohnson perl! 21:21
21:22 javs left
tadzik repl! 21:22
sjohnson bheh
21:23 lamstyle left 21:25 lamstyle joined 21:27 tadzik left 21:28 cpr joined, cpr left 21:30 dakkar left
diakopter read Kernel.cs with interest 21:31
hey, it's readable! :)
sorear really? 21:35
sorear out.
TimToady I get server not found. :) 21:36
diakopter heh 21:38
.head Kernel.cs
phenny Can't connect to Kernel.cs
21:40 Holy_Cow left 21:42 ash_ joined 21:45 ash_ left
sjohnson hi TimToady how's life 21:51
21:56 yrgd joined
rhebus -> sleepytimes 21:59
22:02 masonkramer joined, yrgd left 22:05 sahadev left 22:12 ash_ joined 22:13 stepnem left, Mowah left 22:14 rhebus left 22:16 stepnem joined 22:19 Italian_Plumber joined 22:20 _jaldhar_ left
lue hello o/ 22:22
22:22 jaldhar joined, mfollett left, masonkramer left 22:23 mfollett joined 22:26 Ross left, mfollett left 22:28 rainerschuster left 22:29 jaldhar left 22:30 tylercurtis left 22:32 mberends joined
flussence perl6: say sprintf('%1$d', 4).WHAT; # just me, or is %$ NYI? 22:32
22:32 jhuni joined
p6eval rakudo 0d6d57: OUTPUT«Failure()␤» 22:32
..pugs: OUTPUT«pugs: Printf.printf: bad formatting char $␤»
flussence hmm, I didn't expect them both to barf. 22:33
22:34 dalek left 22:37 dalek joined, ChanServ sets mode: +v dalek 22:42 mberends left 23:00 krakan joined 23:12 sekimura_ joined, fridim left 23:14 sekimura left 23:15 yrgd joined, patspam joined 23:22 bluescreen joined, bluescreen is now known as Guest82491 23:25 azert0x left 23:27 crythias joined 23:42 svetlins joined 23:58 risou joined, Patterner left