Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-06-03

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:06 rindolf joined #perl6
00:17 finanalyst joined #perl6
00:32 rindolf joined #perl6
00:33 cpage_ joined #perl6
00:39 Actualeyes joined #perl6
01:03 Levine joined #perl6
01:04 Levine left #perl6
01:25 kalkin-_ joined #perl6
01:29 adu joined #perl6
01:33 finanalyst joined #perl6
01:41 molaf joined #perl6
01:46 ssotka joined #perl6
01:48 ilbot3 joined #perl6
01:48 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
01:48 gfldex is there a shorter (or more elegant) way to calling many methods on the same object?
01:49 sortiz joined #perl6
01:50 geekosaur something like given $foo { .bar; .baz; }
01:50 geekosaur ?
01:50 gfldex m: given &printf { say .name, .file, .line }
01:50 camelia rakudo-moar 6bb23a: OUTPUT«printfgen/moar/m-CORE.setting7889␤»
01:51 sortiz \o #perl6
01:52 gfldex m: given &printf { say [.name, .file, .line] }
01:52 camelia rakudo-moar 6bb23a: OUTPUT«[printf gen/moar/m-CORE.setting 7889]␤»
01:52 gfldex :)
02:00 grassass joined #perl6
02:12 Zoffix joined #perl6
02:13 Zoffix gfldex, .foo, .bar, .ber given $obj; also works.    printf "%s - %d, %d", .foo, .bar, .ber given $obj
02:14 gfldex we seam not to doc the trailing given form
02:15 Zoffix Well volunteered! :)
02:20 Zoffix m: say .perl, .Str, .ACCEPTS:       * given *
02:20 camelia rakudo-moar 6bb23a: OUTPUT«**True␤»
02:20 Zoffix ehehe
02:26 gfldex m: printf "%s %02i.%02i.%i", <Mo Tu We Th Fr Sa Su>[.day-of-week], .day, .month, .year given DateTime.now;
02:26 camelia rakudo-moar 6bb23a: OUTPUT«Sa 03.06.2016»
02:26 rindolf Zoffix: hi, sup?
02:26 Zoffix \o
02:26 tardisx joined #perl6
02:33 ribasushi joined #perl6
02:41 dalek doc: 2cd8cd1 | (Wenzel P. P. Peppmeyer)++ | doc/Language/control.pod:
02:41 dalek doc: link from given/when to signature literals
02:41 dalek doc: review: https://github.com/perl6/doc/commit/2cd8cd1942
02:41 dalek doc: 0ea5cd8 | (Wenzel P. P. Peppmeyer)++ | doc/Language/control.pod:
02:41 dalek doc: doc statement form of given
02:41 dalek doc: review: https://github.com/perl6/doc/commit/0ea5cd8df6
02:41 noganex joined #perl6
02:58 gfldex i just hit the print preview button on the one big page version of the docs. Firefox kindly crashed after a while.
02:59 rindolf gfldex: heh, heh.
03:00 gfldex 470 pages with Chrome
03:01 gfldex The Perl 6 Book might get fairly thick.
03:14 pierre_ joined #perl6
03:21 BenGoldberg joined #perl6
03:28 pierre_ joined #perl6
03:28 tardisx joined #perl6
03:30 jimbobby joined #perl6
03:36 jimbobby will Larry's recent OSCON talk be available for free at any point?
03:37 jimbobby I know u can pay on O' reilly at some point
03:40 ribasushi joined #perl6
03:46 cpage_ joined #perl6
03:53 john51 joined #perl6
04:00 Xliff .seen RabidGravy
04:00 yoleaux I saw RabidGravy 2 Jun 2016 22:01Z in #perl6: <RabidGravy> dogbert17, yes, or could be created by supply { } or from-list or something
04:01 Xliff RabidGravy: Any word on that OAuth2 stuff?
04:05 tardisx joined #perl6
04:07 adu joined #perl6
04:08 ribasushi joined #perl6
04:22 labster joined #perl6
04:25 ribasushi joined #perl6
04:28 Cabanossi joined #perl6
04:32 pierre_ joined #perl6
04:36 Levine joined #perl6
05:01 tardisx joined #perl6
05:05 adu joined #perl6
05:11 tardisx joined #perl6
05:33 pierre_ joined #perl6
05:35 stevieb9 camelia: help
05:35 camelia stevieb9: Usage: <(prof-m|star-j|debug-cat|rakudo-moar|niecza|nqp-parrot|star-m|p5-to-p6|nqp-js|nqp-jvm|nqp-moarvm|rakudo-jvm|rakudo-MOAR|std|pugs|rnP|sj|nPr|nqp-j|rPn|r-m|rj|nr|Prn|m|nqp-mvm|j|Pnr|nrP|p56|r|nom|nqp-m|P|nqp|perl6|rm|M|rn|p6|n|nqp-p|r-jvm|sm|nqp-q|rakudo|star|r-j)(?^::\s(?!OUTPUT))
05:35 camelia ..$perl6_program>
05:36 stevieb9 camelia: help m
05:36 camelia stevieb9: Usage: <(prof-m|star-j|debug-cat|rakudo-moar|niecza|nqp-parrot|star-m|p5-to-p6|nqp-js|nqp-jvm|nqp-moarvm|rakudo-jvm|rakudo-MOAR|std|pugs|rnP|sj|nPr|nqp-j|rPn|r-m|rj|nr|Prn|m|nqp-mvm|j|Pnr|nrP|p56|r|nom|nqp-m|P|nqp|perl6|rm|M|rn|p6|n|nqp-p|r-jvm|sm|nqp-q|rakudo|star|r-j)(?^::\s(?!OUTPUT))
05:36 camelia ..$perl6_program>
05:39 grassass joined #perl6
05:46 slobo joined #perl6
05:48 pierre_ joined #perl6
05:52 wamba joined #perl6
05:54 adu joined #perl6
05:59 tardisx joined #perl6
06:01 slobo nativecall q: how does one refer to a pointer to a struct? eg `typedef struct Elt {}; typedef struct List { int num; Elt* elts }` - i tried `Pointer[Elt]` and worked to get me the first element, but I can't index past 0; I tried `CArray[Elt]`, but i get null for [0] and SEGV for [1], I also tried Pointer[CArray[Elt]], and $b.elts[0].deref[0] is null too
06:15 _mg_ joined #perl6
06:22 jack_rabbit joined #perl6
06:33 maybekoo2 joined #perl6
06:36 sno joined #perl6
06:39 ribasushi joined #perl6
06:51 ribasushi joined #perl6
06:56 Zero_Dogg joined #perl6
06:56 Zero_Dogg joined #perl6
07:01 slobo i think my question is actually how to specify CArray[CStruct] where it's not pointers inside the CArray, but CStructs are packed one after another.
07:12 ribasushi joined #perl6
07:14 darutoko joined #perl6
07:22 masak good morning, #perl6
07:26 moritz \o
07:29 brrt joined #perl6
07:30 slobo joined #perl6
07:31 nadim joined #perl6
07:41 _nadim joined #perl6
07:46 abraxxa joined #perl6
07:47 sno joined #perl6
07:54 ufobat joined #perl6
07:55 zakharyas joined #perl6
07:56 g4 joined #perl6
07:59 nadim joined #perl6
08:03 ocbtec joined #perl6
08:06 nadim joined #perl6
08:10 ufobat hoi
08:11 RabidGravy joined #perl6
08:28 donaldh joined #perl6
08:28 masak \o
08:34 ggoebel116 joined #perl6
08:35 jevin_ joined #perl6
08:35 clkao_ joined #perl6
08:36 donaldh_ joined #perl6
08:36 RabidGravy harr!
08:37 parisba_ joined #perl6
08:37 nine_ joined #perl6
08:38 notostraca joined #perl6
08:38 ribasushi joined #perl6
08:38 psch_ joined #perl6
08:38 cosimo_ joined #perl6
08:38 Juerd_ joined #perl6
08:38 broquain1 joined #perl6
08:39 geekosaur joined #perl6
08:39 mrsolo joined #perl6
08:39 RabidGravy OooOOOooh
08:40 ssm joined #perl6
08:40 inokenty joined #perl6
08:44 wamba joined #perl6
08:51 b2gills joined #perl6
08:54 Humdai joined #perl6
08:56 AlexDaniel joined #perl6
09:00 vendethiel joined #perl6
09:03 user9 joined #perl6
09:13 brrt joined #perl6
09:57 yx_ joined #perl6
10:00 bjz joined #perl6
10:02 Gothmog_ joined #perl6
10:03 nine joined #perl6
10:04 camelia joined #perl6
10:06 Bucciarati joined #perl6
10:15 RabidGravy brane struggling to wake up this morning
10:15 RabidGravy is there a neater way of doing:
10:15 RabidGravy m: my %f = ( B => 1, D => 2, A => 3, C => 4); for %f.pairs.sort(-> $p { $p.key }) ->  $v { say $v.key, " => ", $v.value }
10:15 camelia rakudo-moar affe02: OUTPUT«A => 3␤B => 1␤C => 4␤D => 2␤»
10:16 DrForr I've barely gotten to work. Too much sh*t going on today.
10:16 RabidGravy that is get the key/value sorted by key?
10:16 timotimo m: my %f = ( B => 1, D => 2, A => 3, C => 4); say %f.pairs.sort( *.key )
10:16 camelia rakudo-moar affe02: OUTPUT«(A => 3 B => 1 C => 4 D => 2)␤»
10:16 timotimo no need to be so wordy in the middle part there
10:17 DrForr Also, just so I have some confirmation, is the phrase "beginning perl 5 programmer" or "beginner perl 5 programmer" more awkward? My feeling is the latter.
10:17 masak are you aiming for more awkward? :P
10:18 RabidGravy there is one less indirection of meaning in the latter
10:19 RabidGravy so I would use the latter as it more directly forms a noun-like thingy than the former
10:20 DrForr Asking which is more awkward. I'm being interviewed for builtinerl.com and I used the former "beginning Perl 5 programmer" in the interview, but apparently I also have an editor who feels it's more awkward than "beginner perl 5 programmer".
10:21 DrForr I don't give sufficient sh*t to fight the issue, however.
10:22 RabidGravy I think it does very much depend on the entire context
10:23 timotimo unfortunately, "the entire context" of a given event expands outwards at the speed of light
10:23 RabidGravy but if it's an interviiew then it should respect your idiom
10:23 timotimo so good luck with figuring that out!
10:28 gregf_ RabidGravy: are you looking for something similar to sort_by
10:29 DrForr Shrug. It is an interview, but I'm guessing I've already spent more time mentioning it than anyone will ever spend reading that word.
10:29 timotimo %)
10:30 xiaomiao joined #perl6
10:30 RabidGravy gregf_, don't know what "sort_by" is so I don't know, but timotimo's Whatever point works fine
10:31 timotimo if you wanted more complicated instead of less, you could also:
10:32 timotimo m: my %f = ( B => 1, D => 2, A => 3, C => 4); say %f{ %f.keys.sort }:pair
10:32 camelia rakudo-moar affe02: OUTPUT«Unexpected named parameter 'pair' passed␤  in block <unit> at /tmp/2WBNhgQGlQ line 1␤␤»
10:32 timotimo m: my %f = ( B => 1, D => 2, A => 3, C => 4); say %f{ %f.keys.sort }:p
10:32 camelia rakudo-moar affe02: OUTPUT«(A => 3 B => 1 C => 4 D => 2)␤»
10:33 domm joined #perl6
10:33 timotimo turns out that's a bit shorter, but just a tiny bit
10:34 RabidGravy yeah, but that is less clear IMO, it's more to find a clear idiom for the common P5 "foreach my $ky (sort keys %foo) { print $ky, " => ", %foo{$ky} }"
10:36 gregf_ RabidGravy: something similar to this: my %f = ( B => 1, D => 2, A => 3, C => 4); %f.kv.sort_by: ->$k,$v { $k }
10:36 gregf_ btw, i'm not able to understand how these 3 are the same
10:36 gregf_ m: my %f = ( B => 1, D => 2, A => 3, C => 4); my %f1 = [ B => 1, D => 2, A => 3, C => 4 ]; my $f2 = { B => 1, D => 2, A => 3, C => 4 }; [%f, %f1, $f2].map(*.^name.say);
10:36 camelia rakudo-moar affe02: OUTPUT«Hash␤Hash␤Hash␤»
10:37 timotimo when you're assigning into a % container, that plops the values of whatever's on the RHS into the hash
10:38 RabidGravy it would come out longer
10:38 timotimo when you assign a { foo => bar } literal, you get a hash object on the RHS, and assigning that into a scalar variable just stores the object in question
10:39 timotimo m: my %f = :1B, :2D, :3A, :4C; say %f.kv.perl
10:39 camelia rakudo-moar affe02: OUTPUT«("A", 3, "B", 1, "D", 2, "C", 4).Seq␤»
10:39 timotimo gregf_: you can't just sort a list in bunches of two without a rotor or something in between
10:39 gregf_ timotimo: when you say container, is it like some sort of a pool, like a servicemanager or somesuch?
10:40 timotimo ... service manager?
10:40 gregf_ when does the container come into the picture. or is it for GC?
10:40 timotimo no, it's a language semantics thing
10:40 timotimo m: my %foo; say %foo.WHAT
10:40 camelia rakudo-moar affe02: OUTPUT«(Hash)␤»
10:41 timotimo m: my @foo; say @foo.WHAT
10:41 camelia rakudo-moar affe02: OUTPUT«(Array)␤»
10:41 timotimo m: my $foo; say $foo.WHAT; say $foo.VAR.WHAT
10:41 camelia rakudo-moar affe02: OUTPUT«(Any)␤(Scalar)␤»
10:41 gregf_ m: my $h = { foo => 1}; say $h.WHAT
10:41 camelia rakudo-moar affe02: OUTPUT«(Hash)␤»
10:42 timotimo that's basically equivalent to having $h = Hash.new(...)
10:43 gregf_ right, and is that any different from my %h = { foo => 1 } or ( foo => 1 ) or  [ foo => 1 ]?
10:43 timotimo yes, quite
10:43 gregf_ or is Hash.new immutable or bound or whatever?
10:43 timotimo no, it's about what %h.STORE does
10:43 timotimo it'll hashify things
10:44 timotimo that's also why you can't just "my %foo = SetHash.new(...)"
10:44 gregf_ oh - so theres different implementations of STORE for each of those?
10:44 timotimo it'll take the pairs from your SetHash and put them info %foo one-by-one, and you end up with a regular Hash instead of the SetHash
10:44 timotimo yes
10:44 gregf_ or they've all got a base class which implements it for all?
10:44 gregf_ ok
10:45 gregf_ so then, one final question *forgive me for asking so many questions* :)
10:45 gregf_ theres just too many ways to do the same thing. but, do they differ in performance?
10:45 kid51 joined #perl6
10:45 timotimo probably, but of course that's muddied by things like compile-time-evaluation and such
10:45 gregf_ ah - i see
10:46 jevin joined #perl6
10:47 gregf_ timotimo: thanks for clarifying!
10:47 gregf_ *wonders how complex the parser for Perl6 would be*
10:47 timotimo and if one of those variants is particularly expensive, we may put in an extra optimization, or just improve the code of STORE or whatever
10:47 timotimo enh. it's okay
10:48 timotimo you can look at it in Perl6/Grammar.nqp
10:48 Zoffix huh. DrForr you specified yourself as beginer Perl 5 programmer? :S
10:48 Zoffix I thought you were an expert
10:48 gregf_ timotimo: sure, thanks
10:48 wamba joined #perl6
10:49 timotimo however, during parsing it also juggles a bunch of state and data structures; all definitions are managed by World.nqp, for example
10:49 jervo joined #perl6
10:49 Khisanth joined #perl6
10:49 richi235 joined #perl6
10:49 mls joined #perl6
10:50 as joined #perl6
10:51 Actualeyes joined #perl6
10:57 kaare_ joined #perl6
10:58 ilmari joined #perl6
11:01 gregf_ https://gist.github.com/anonymous/289fe4c637bbac515e19d76b9d811501 <== works but swiftmai
11:02 gregf_ oops :/ sorry wrong chat
11:03 avalenn joined #perl6
11:09 ribasushi joined #perl6
11:15 jjido joined #perl6
11:28 myfree joined #perl6
11:28 RabidGravy has anyone written an article about sorting in P6?  If not then it may need to happen, though I'm fairly sure I'm not the person to do it
11:28 myfree left #perl6
11:29 iH2O joined #perl6
11:33 grondilu joined #perl6
11:34 pierre_ joined #perl6
11:50 llfourn m: say ("a" cmp "a").^name
11:50 camelia rakudo-moar 03a403: OUTPUT«Order␤»
11:53 iH2O left #perl6
11:53 RabidGravy Order! Order!
11:54 llfourn m: say (3 <=> 2).^name
11:54 camelia rakudo-moar e403c1: OUTPUT«Order␤»
12:02 lizmat m: say Order
12:02 camelia rakudo-moar e403c1: OUTPUT«(Order)␤»
12:02 lizmat m: say Less.WHAT
12:02 camelia rakudo-moar e403c1: OUTPUT«(Order)␤»
12:04 gregf_ m: my $arr = qw|zero -ve +ve|;say [ [100, 2, 10, 0, -100].map: ->$i { $arr[$i <=> 0] }]
12:04 camelia rakudo-moar e403c1: OUTPUT«Index out of range. Is: -1, should be in 0..Inf␤  in block <unit> at /tmp/c9Iez5Vg1D line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/c9Iez5Vg1D line 1␤␤»
12:04 grondilu m: sub f {...}; our @a = map { f() }, ^Inf; sub f { rand }; say @a[^3]
12:04 camelia rakudo-moar e403c1: OUTPUT«(0.238678272330166 0.613512876716002 0.246485367891319)␤»
12:04 grondilu m: sub f {...}; our constant @a = map { f() }, ^Inf; sub f { rand }; say @a[^3]
12:04 camelia rakudo-moar e403c1: OUTPUT«Stub code executed␤  in sub f at /tmp/lgOado1quc line 1␤  in block  at /tmp/lgOado1quc line 1␤  in block <unit> at /tmp/lgOado1quc line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/lgOado1quc line 1␤␤»
12:04 grondilu ^not sure that's OK
12:06 ribasushi joined #perl6
12:06 llfourn that's what I expect. constant LHS is evaluated at compile time.
12:06 llfourn RHS*
12:08 llfourn I guess an argument could be made that it should be evaluated just after compile time... If people think the added complexity is worth it.
12:08 llfourn or just after BEGIN time rather
12:12 jnthn We expect to be able to use constants while compiling though, so they really do need evaluating at BEGIN time
12:13 pierre_ joined #perl6
12:13 jnthn It is curious that we end up not updating the code to point to the finally compiled version of f afterwards
12:13 jnthn I'm really curious if it gets the other answer (as in, "works") if you precomp :)
12:14 llfourn maybe if lazy was there it would work like that?
12:14 jnthn I don't think it'd make a difference
12:14 llfourn m: sub f {...}; our constant @a = lazy map { f() }, ^Inf; sub f { rand }; say @a[^3]
12:14 camelia rakudo-moar dfbf1e: OUTPUT«Stub code executed␤  in sub f at /tmp/Mut_oohvx4 line 1␤  in block  at /tmp/Mut_oohvx4 line 1␤  in block <unit> at /tmp/Mut_oohvx4 line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/Mut_oohvx4 line 1␤␤»
12:14 llfourn hermph
12:14 jnthn It's not an issue of it evaluating the thing at the wrong time
12:14 jnthn It's about it capturing an "out of date" f
12:14 pmurias joined #perl6
12:14 pmurias hi
12:14 yoleaux 2 Jun 2016 20:53Z <lizmat> pmurias: this could be of interest ?  https://zeit.co/blog/async-and-await
12:14 jnthn Or rather, an f that comes to be
12:15 jnthn Oh...
12:15 jnthn I wonder what re-defining a stub actually does
12:15 jnthn It may well be that it installs a replacement
12:15 jnthn Rather than takes over the stub
12:15 jnthn Which would also explain it nicely
12:15 jjido joined #perl6
12:16 llfourn yes.
12:16 jnthn That is, the symbol f is *rebound*, but the fake environment used for the constant won't be updated as part of that rebinding.
12:17 llfourn yes it still points to the stub
12:17 jnthn It's an interesting issue, anyway. I *think* it can be made to work, but there's multiple possible paths there and I don't immediately know which is the right one :)
12:17 jnthn I have for a while wondered if we might be able to make a better job of how we expose the "environment" to BEGIN-time evaluated things.
12:17 jnthn Because right now it's quite a costly thing to do
12:18 jnthn I suspect CORE.setting compilation spends some about of time building up those "shadow" contexts every time we run code at BEGIN time
12:18 pmurias lizmat: I can use async/await to implement gather/take, not sure how much faster it will work compared to the current method (it's something that will have to be benchmarked)
12:19 lizmat pmurias: it was just an idea that it might make life easier on you, as it would maybe take care of compatibility issues between javascript engines
12:20 lizmat this wasn't really about speed, as far as I'm concerned
12:21 pmurias you mean emitting code that will then get preprocessed by babel?
12:21 llfourn jnthn: is this in reference to those "can't call blah" when a closure is created inside a BEGIN or whatever and is called at runtime?
12:21 pmurias (babel being the javascript of the future to the current one converter)
12:21 jnthn llfourn: I thought I fixed that once... :)
12:22 * llfourn looks for the ticket
12:22 lizmat pmurias: I'm not sure...  I don't know enough about it
12:22 lizmat I just wanted to make sure that you were aware of that article / feature set
12:23 llfourn jnthn: from memory you were able to fix a few instances of it but not the general case
12:24 llfourn RT #125634. I thought this is what you were referring to just now :)
12:24 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=125634
12:26 jnthn Hmm
12:27 pmurias lizmat: thanks for keeping me aware about that, it's likely once it's available in browser it will give us a huge speedup for gather/take using code
12:29 llfourn grondilu: RT #128314 :)
12:29 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=128314
12:30 * [Coke] yawns.
12:40 donaldh joined #perl6
12:41 grondilu I guess it could have been golfed better.
12:41 grondilu m: sub f {...}; constant $ = f(); sub f { rand }
12:41 camelia rakudo-moar dfbf1e: ( no output )
12:41 grondilu m: sub f {...}; constant $x = f(); sub f { rand }; say $x
12:41 camelia rakudo-moar dfbf1e: OUTPUT«===SORRY!===␤Stub code executed␤»
12:42 grondilu m: sub f {...}; BEGIN say f(); sub f { rand };
12:42 camelia rakudo-moar dfbf1e: OUTPUT«5===SORRY!5=== Error while compiling /tmp/uM2yigYRP1␤An exception occurred while evaluating a BEGIN␤at /tmp/uM2yigYRP1:1␤Exception details:␤  Stub code executed␤    in sub f at /tmp/uM2yigYRP1 line 1␤    in any f at src/Perl6/World.nqp line…»
12:42 llfourn grondilu: but that one is fine
12:42 jnthn Both of those are correct.
12:43 jnthn Because you call f while the BEGIN or constant is being evaluated.
12:43 jnthn The other one was interesting precisely because f was called later
12:43 grondilu oh I c
12:43 rindolf joined #perl6
12:43 llfourn the issue is that Seq stores the closure to produce subsequent values when you do .map
12:43 llfourn but that closure is still pointing to the stub
12:50 girafe joined #perl6
12:53 abraxxa joined #perl6
12:55 jjido joined #perl6
12:55 grondilu well frankly I find it LTA.  I mean, it's an easy mistake to make, isn't it?
12:57 [Coke] I wouldn't call anything that used a stub sub an "easy" mistake.
12:57 llfourn usually you don't use stub subs yeah...
12:58 Humdai left #perl6
12:58 grondilu stub subs would be a natural thing to write for a C programmer, I suspect.
12:58 llfourn but if you do and you don't know how contant works I can see how this could happen :\
12:59 llfourn I guess most people assume "constant" is a way of doing read-only but it's more than that
13:00 [Coke] Can you suggest an improved error message?
13:01 krakan joined #perl6
13:01 llfourn I think the hard part is telling when to use the error message
13:02 llfourn how can you know at BEGIN that the sub is going to be declared properly later
13:02 grondilu joined #perl6
13:07 Ven joined #perl6
13:09 sufrostico joined #perl6
13:15 patrickz joined #perl6
13:17 silug joined #perl6
13:18 gtodd hoelzro: I was reading your "language of the month" blogs ... I thought I'd find a mapping from there to Inline::<language of month> but ...
13:22 skids joined #perl6
13:22 pierre_ joined #perl6
13:24 nicqbot joined #perl6
13:29 iH2O joined #perl6
13:39 ribasushi joined #perl6
13:39 dogbert17 o/ #perl6
13:40 iH2O hi Dagobert
13:40 dogbert17 hi iH20
13:41 dogbert17 m: my $s = Supply.from-list(1, 2, 3); $s.tap(&say); $s.done; # from http://doc.perl6.org/type/Supply
13:41 camelia rakudo-moar b2f8ba: OUTPUT«1␤2␤3␤Method 'done' not found for invocant of class 'Supply'␤  in block <unit> at /tmp/HiEr8BWyUT line 1␤␤»
13:43 stevieb joined #perl6
13:43 RabidGravy dogbert17, this is correct, Supplier has a done
13:44 dogbert17 RabidGravy, should the call $s.done be removed from the axample?
13:44 RabidGravy in the case of an on-demand  Supply as from-list it doesn't even make sense
13:44 RabidGravy yes
13:44 dogbert17 RabidGravy: many thanks, I'll fix it
13:53 pat_js joined #perl6
13:54 dalek doc: 645ed55 | (Jan-Olof Hendig)++ | doc/Type/Supply.pod:
13:54 dalek doc: Fixed a couple of errors in the examples. RabidGravy++
13:54 dalek doc: review: https://github.com/perl6/doc/commit/645ed550bb
13:57 daxim joined #perl6
14:01 pmurias joined #perl6
14:02 nicqbot RabidGravy: So if Supplier has a 'done' method, why would this error?
14:02 RabidGravy why would what error?
14:02 jnthn Because $s is a Supply, not a Supplier
14:03 RabidGravy ah that, yes
14:03 ZoffixW joined #perl6
14:03 nicqbot Oh, ok.
14:05 ZoffixW Does Inline::Perl5 support passing command line switches to Perl 5 stuff?
14:05 ZoffixW Try to do this but the message displayed suggests `daemon` did not reach whatever is looking for it:    perl6 -e 'use Mojolicious::Lite:from<Perl5>; app.start' daemon
14:07 dogbert17 do the methods 'can' and 'does' still do what's described in https://design.perl6.org/S32/Basics.html#Any even though they have now moved to Mu?
14:08 iH2O left #perl6
14:10 RabidGravy m: role F { method b() { } }; class C does F {}; say C.can("b"); say C.does(F)
14:10 camelia rakudo-moar b2f8ba: OUTPUT«(b)␤True␤»
14:11 RabidGravy so rougnhly yes, though 'can' returns the method itself, and does only checks for applied roles
14:12 dogbert17 RabidGravy: thanks again, i'll whip up some text about this then :)
14:12 RabidGravy if one wanted to do what "does" is described a smart match against a type object is probably better
14:13 RabidGravy as it gets both the superclasses and roles
14:14 ribasushi joined #perl6
14:14 dogbert17 so does as it is implemented is not as good as ~~
14:17 RabidGravy actually no, belay that, I was under a misapprehension
14:18 ptolemarch joined #perl6
14:18 RabidGravy m: role F { method b() { } }; class G {}; class C is G does F {}; say C.can("b"); say C.does(F); say C.does(G)
14:18 camelia rakudo-moar b2f8ba: OUTPUT«(b)␤True␤True␤»
14:20 pierre_ joined #perl6
14:20 RabidGravy though probably the smart match is favoured because it DTRT in nearly all cases
14:20 pmurias joined #perl6
14:21 stevieb zoffix: it doesn't look like the args get passed through: perl6 -e 'use Getopt::Long:from<Perl5>;say @*ARGS.perl; my $o; GetOptions("option"=>\$o); say $o' --option
14:22 dogbert17 RabidGravy; so if I 'steal' the docs for does and put it in Mu.pod it wouldn't be wrong?
14:22 RabidGravy it would be fine yes
14:22 stevieb btw, is it possible to give camilla a one-liner that requires args and have it processed like a normal statement?
14:23 dogbert17 RabidGravy: then I'll do it
14:32 ugexe stevieb: well you can do `BEGIN @*ARGS = 1, 2, 3`
14:36 stevieb that makes sense. on another note, I apologize for spelling Camelia wrong... s/camilla/camelia/. sigh
14:36 timotimo does that really get into the perl5 stuff?
14:36 ZoffixMobile joined #perl6
14:37 gregf_ camilla is fine too *sounds feminine*
14:37 cdg joined #perl6
14:37 ugexe it should handle his question on passing args to a camilla one-liner
14:37 ZoffixMobile ugexe, won't @*ARGS contain command line args anyway? why is it needed in a BEGIN
14:38 ZoffixMobile never mind, I missed a comment
14:38 azawawi joined #perl6
14:38 azawawi ..
14:38 azawawi ...
14:38 azawawi hi
14:39 raiph hi #perl6
14:39 raiph o/ azawawi
14:39 azawawi https://jamesfriend.com.au/pce-js/  # PCE.js Mac Plus emulator running Mac OS System 7 :)
14:40 dogbert17 RabidGravy: how about https://gist.github.com/dogbert17/b3f0aae68415e28903cd6c92d3bc40c2
14:40 ugexe not necessarily needed. but depending on where you put it and when MAIN_HELPER gets called its easier to just use BEGIN to do what they probably wanted instead of explain further
14:40 * azawawi rebuilds his 2016.05 after a .precomp corruption
14:41 ribasushi joined #perl6
14:45 RabidGravy dogbert17, that looks fine
14:46 dogbert17 RabidGravy: commit is on its way :)
14:48 raiph Is a hack admin around? Is it reasonable to install gui stuff, specifically GTK::Simple, for the shared rakudo per https://github.com/perl6/infrastructure-doc/blob/master/hosts/hack.p6c.org.pod#rakudobrew?
14:50 dalek doc: bcf70e6 | (Jan-Olof Hendig)++ | doc/Type/Mu.pod:
14:50 dalek doc: Added docs for Mu.does. RabidGravy++
14:50 dalek doc: review: https://github.com/perl6/doc/commit/bcf70e6a67
14:51 * dogbert17 suddenly finds a hot cup of coffee
14:52 profan it's super effective!
14:52 azawawi RabidGravy: the .precomp folder corruption is so bad in 2016.05... i hate it :)
14:55 RabidGravy boo!
14:56 tony-o azawawi: but can it run dinopark tycoon?
14:58 azawawi tony-o: PCE.js?
14:58 adu joined #perl6
15:12 dalek doc: 2727eab | (Jan-Olof Hendig)++ | doc/Type/Mu.pod:
15:12 dalek doc: Forgot a C<>
15:12 dalek doc: review: https://github.com/perl6/doc/commit/2727eab552
15:13 ssotka joined #perl6
15:15 aries_liuxueyang joined #perl6
15:15 Levine joined #perl6
15:16 jjido joined #perl6
15:16 dogbert17 m: say v1.0.1 ~~ v.1.*;  # from http://doc.perl6.org/type/Version
15:16 camelia rakudo-moar b2f8ba: OUTPUT«5===SORRY!5=== Error while compiling /tmp/7FBKjRZhzd␤Malformed postfix call␤at /tmp/7FBKjRZhzd:1␤------> 3say v1.0.1 ~~ v.7⏏1.*;  # from http://doc.perl6.org/type/V␤»
15:17 timotimo oh, shouldn't put a . after the v in that doc
15:17 azawawi https://gist.github.com/azawawi/49822a3f8ea304ad663aebce5550d981  # line 3055... cant install GTK::Simple... precomp corruption?
15:17 dogbert17 m: say v1.0.1 ~~ v1.*;  # from http://doc.perl6.org/type/Version
15:17 camelia rakudo-moar b2f8ba: OUTPUT«True␤»
15:17 dogbert17 timotimo++
15:18 ZoffixW azawawi, try with zef?
15:19 azawawi same
15:19 azawawi zef uninstall and install... also same
15:19 ZoffixW weird
15:19 azawawi cleared ~/.perl6 also and precomp folders... same
15:19 azawawi only a nuke/build makes it work for the first time
15:22 b2gills m: my %f = ( B => 1, D => 2, A => 3, C => 4); .say for %f.sort # RabidGravy: no need for .pairs or to give sort a Callable ( The default sorting for pairs is already smarter than just *.key )
15:22 camelia rakudo-moar b2f8ba: OUTPUT«A => 3␤B => 1␤C => 4␤D => 2␤»
15:22 Zero_Dogg joined #perl6
15:22 Zero_Dogg joined #perl6
15:23 dalek doc: a595d1e | (Jan-Olof Hendig)++ | doc/Type/Version.pod:
15:23 dalek doc: Fixed another broken example. timotimo++
15:23 dalek doc: review: https://github.com/perl6/doc/commit/a595d1e503
15:23 b2gills m: my $f = ( B => 2, B => 1, D => 2, A => 3, C => 4); .say for $f.sort # note that B=>2 always comes after B=>1
15:23 camelia rakudo-moar b2f8ba: OUTPUT«A => 3␤B => 1␤B => 2␤C => 4␤D => 2␤»
15:24 RabidGravy too late :-p
15:28 sjn joined #perl6
15:29 b2gills I think I'm just used to taking out parts of code until it breaks, because most of my code goes up on CodeGolf.
15:36 dogbert17 m: class Area { has $.size; submethod BUILD(:$x, :$y, $z) { $!size = $x * $y * $z; }} # http://doc.perl6.org/type/Submethod
15:36 camelia rakudo-moar b2f8ba: OUTPUT«5===SORRY!5=== Error while compiling /tmp/1z3pF8eeAg␤Cannot put required parameter $z after variadic parameters␤at /tmp/1z3pF8eeAg:1␤------> 3has $.size; submethod BUILD(:$x, :$y, $z7⏏5) { $!size = $x * $y * $z; }} # http://d␤    expectin…»
15:37 eiro j'étais fatigué ... iritable... c'était nul
15:37 eiro soorry
15:38 dogbert17 should I just put a : before $z in the BUILD signature?
15:38 perlpilot perl 6 is just so cool sometimes.  I needed to transpose a matrix.  How do I do this?   my @t = ([ @m[*;$_] ] for ^@m[0]);   That's just ... awesome
15:39 perlpilot dogbert17: yes
15:42 flaviusb joined #perl6
15:43 setty1 joined #perl6
15:44 ZoffixW dogbert17++ # fixing all the docs
15:44 dogbert17 ZoffixW: a bit here and a bit there :)
15:45 bjz_ joined #perl6
15:45 dalek doc: b3bdaa0 | (Jan-Olof Hendig)++ | doc/Type/Submethod.pod:
15:45 dalek doc: Fixed typo in code example
15:45 dalek doc: review: https://github.com/perl6/doc/commit/b3bdaa0957
15:49 dogbert17 since I'm on a roll atm, has any of you heard of a string like type called 'Cat'?
15:49 dogbert17 Common role for string types (such as Str) and types that can act as strings (such as Cat).   # http://doc.perl6.org/type/Stringy
15:50 timotimo Cat are specced to be lazy strings
15:50 timotimo we don't have them in any implementation yet
15:50 dogbert17 timotimo: that explains it
15:51 gfldex dogbert17: see https://github.com/rakudo/rakudo/blob/411e76fae23de10afee874907e62d8b0b7a4535f/src/core/Stringy.pm#L23
15:52 ZoffixW ???????????? FWIW: I wrote down contributing instructions for perl6.party, if anyone is itching to write Perl 6 blogs but has no place to host them: https://github.com/zoffixznet/perl6.party/blob/master/CONTRIBUTING.md
15:53 dogbert17 gfldex: thx
15:54 tony-o azawawi: yes PCE.js - was joking about dinopark tycoon.  pretty cool
15:54 ZoffixW So we have Rats and Cats? :D
15:54 * ZoffixW wonders if there's a FatCat
15:54 timotimo that'd be for Big Data applications, obviously
15:54 perlpilot dogbert17: There's more info on Cat at S03:3991
15:54 synopsebot6 Link: http://design.perl6.org/S03.html#3991
15:55 dogbert17 perlpilot: will check it out, thx
16:02 [Coke] (Cat) I would remove Cat from the docs; it's not part of any spec yet.
16:03 ZoffixW +1
16:10 dogbert17 can do :)
16:13 dalek doc: 187aef3 | (Jan-Olof Hendig)++ | doc/Type/Stringy.pod:
16:13 dalek doc: Removed reference to type Cat since it's NYI
16:13 dalek doc: review: https://github.com/perl6/doc/commit/187aef38d1
16:13 ZoffixW dogbert17++
16:13 [Coke] more than NYI, not yet spec'd.
16:14 dogbert17 oops
16:14 mst meow?
16:15 ilmari "nys", which is norwegian for sneeze
16:15 [Coke] hurm. I suppose it's -partially- spec'd, but this goes to the discussion on the quote blocker doc ticket. "if it's in 6.c-errata, but it's skipped or todo'd, is it really 6.c?" I think the answer to that is an implicit no. 6.c-errata was a snapshot in time just before the release because we didn't have time or cycles to vet every single test in roast.
16:16 [Coke] I don't think it's worth changing the 6.c files directly, but we need to plan extra time before a 6.d release to clean -that- spec version up
16:19 titsuki joined #perl6
16:22 titsuki Hi all. I have a question. Does anyone know how to call new in the following cases ?
16:22 titsuki m: class Foo { has @.array; submethod BUILD(Str :@!array!) {}; }; Foo.new(:array(["a"])).say;
16:22 camelia rakudo-moar b2f8ba: OUTPUT«Type check failed in binding @!array; expected Positional[Str] but got Array ($["a"])␤  in submethod BUILD at /tmp/BGl3WycmXm line 1␤  in block <unit> at /tmp/BGl3WycmXm line 1␤␤»
16:22 titsuki m: class Foo { has @.array; submethod BUILD(Str :@!array!) {}; }; Foo.new(:array("a")).say;
16:22 camelia rakudo-moar b2f8ba: OUTPUT«Type check failed in binding @!array; expected Positional[Str] but got Str ("a")␤  in submethod BUILD at /tmp/TkdrckcG9Y line 1␤  in block <unit> at /tmp/TkdrckcG9Y line 1␤␤»
16:22 titsuki I couldn't use the constructor.
16:23 titsuki m: class Foo { has @.array; submethod BUILD(Str :@!array!) {}; }; Foo.new(array => ["a"]).say;
16:23 camelia rakudo-moar b2f8ba: OUTPUT«Type check failed in binding @!array; expected Positional[Str] but got Array ($["a"])␤  in submethod BUILD at /tmp/TSWUnRIgvV line 1␤  in block <unit> at /tmp/TSWUnRIgvV line 1␤␤»
16:25 perlpilot titsuki: why put a type constraing in BUILD, but not the has declaration?
16:25 perlpilot *constraint
16:25 titsuki m: class Foo { has Str @.array; submethod BUILD(Str :@!array!) {}; }; Foo.new(array => ["a"]).say;
16:25 camelia rakudo-moar b2f8ba: OUTPUT«Type check failed in binding @!array; expected Positional[Str] but got Array ($["a"])␤  in submethod BUILD at /tmp/8PSh6rSPCM line 1␤  in block <unit> at /tmp/8PSh6rSPCM line 1␤␤»
16:26 perlpilot Sorry, that wasn't an answer, just curiosity
16:26 titsuki perlpilot: hmm, I see.
16:26 perlpilot m: class Foo { has @.array; submethod BUILD(Str :@!array!) {}; }; Foo.new :array(Array[Str].new("x") )
16:26 camelia rakudo-moar b2f8ba: ( no output )
16:26 perlpilot more of an answer there
16:27 titsuki Why Array
16:27 titsuki sorry
16:28 jnthn m: class Foo { has Str @.array; submethod BUILD(:@!array!) {} }; Foo.new: array => ["x"] # note that this works OK
16:28 camelia rakudo-moar b2f8ba: ( no output )
16:29 jnthn Because a @!foo parameter actually is assignment rather than binding.
16:29 jnthn And assignment is copying, and type checks element by element, as they are copied
16:29 titsuki hmm
16:30 jnthn Whereas if you put a submethod BUILD(Str :@!array) { } then you constraint that the thing already passed to the sub must already have a type Positional[Str]
16:30 jnthn *constrain
16:30 jnthn That is, a declared type
16:31 titsuki jnthn: I see. Thanks !
16:31 jnthn sub foo(Str @a) { }; foo(["a", "b"]) # that's just an untyped array
16:32 jnthn my @a = "a", "b"; sub foo(Str @a) { bar(); }; sub bar() { @a.push(42) }; foo(@a)
16:33 jnthn Imagine that `Str @a` did work by checking the values. Then after the call bar() you now have something in @a that isn't actually promised to contain only Str :)
16:35 titsuki m: my @a = "a", "b"; sub foo(Str @a) { bar(); }; sub bar() { @a.push(42) }; foo(@a).say;
16:35 camelia rakudo-moar b2f8ba: OUTPUT«Type check failed in binding @a; expected Positional[Str] but got Array ($["a", "b"])␤  in sub foo at /tmp/kiB6XVjqn5 line 1␤  in block <unit> at /tmp/kiB6XVjqn5 line 1␤␤»
16:35 titsuki m: my @a = "a", "b"; sub foo(Int @a) { bar(); }; sub bar() { @a.push(42) }; foo(@a).say;
16:35 camelia rakudo-moar b2f8ba: OUTPUT«Type check failed in binding @a; expected Positional[Int] but got Array ($["a", "b"])␤  in sub foo at /tmp/CHNjXQYc9t line 1␤  in block <unit> at /tmp/CHNjXQYc9t line 1␤␤»
16:35 jnthn m: my @a = "a", "b"; sub foo(Str @a) { bar(); }; sub bar() { @a.push(42) }; foo(@a)
16:35 camelia rakudo-moar b2f8ba: OUTPUT«Type check failed in binding @a; expected Positional[Str] but got Array ($["a", "b"])␤  in sub foo at /tmp/D11yC01IZP line 1␤  in block <unit> at /tmp/D11yC01IZP line 1␤␤»
16:35 jnthn m: my Str @a = "a", "b"; sub foo(Str @a) { bar(); }; sub bar() { @a.push(42) }; foo(@a)
16:35 camelia rakudo-moar b2f8ba: OUTPUT«Type check failed in assignment to @a; expected Str but got Int (42)␤  in sub bar at /tmp/5cKRhualdX line 1␤  in sub foo at /tmp/5cKRhualdX line 1␤  in block <unit> at /tmp/5cKRhualdX line 1␤␤»
16:36 jnthn Note how foo accepts it, and bar is not allowed to shove a non-Str into the array, so it's still safe :)
16:38 titsuki m: my Str @a = "a", "b"; sub foo(Str @a) { bar(); }; sub bar() { @a.push("42") }; foo(@a)
16:38 camelia rakudo-moar b2f8ba: ( no output )
16:38 dalek doc: 91eaf67 | (Jan-Olof Hendig)++ | doc/Type/Str.pod:
16:38 dalek doc: Tidied up some code examples a bit
16:38 dalek doc: review: https://github.com/perl6/doc/commit/91eaf678d0
16:38 titsuki m: my Int @a = 1, 2; sub foo(Int @a) { bar(); }; sub bar() { @a.push(42) }; foo(@a)
16:38 camelia rakudo-moar b2f8ba: ( no output )
16:39 titsuki jnthn: Thanks ! I understand.
16:40 jnthn :)
16:41 slobo joined #perl6
16:45 azawawi RabidGravy: https://github.com/azawawi/gtk-simple/blob/master/examples/09-toolbar.pl6  # Initial toolbar example
16:45 rurban joined #perl6
16:46 rurban left #perl6
16:47 azawawi http://pasteboard.co/1pxC81hw.png # screenshot of GTK::Toolbar example
16:48 timotimo that doesn't look enterprisy
16:48 RabidGravy nice
16:48 jnthn azawawi: Nice! :) Guess next comes the supplies for the events <3
16:50 azawawi jnthn: sure :)
16:54 gfldex m: sub f(|c){ given c { when :(Int, Int) { dd $_ }; when :(Str, Int) { dd $_ } } }; f(10,10); f("ten", 10);
16:54 camelia rakudo-moar b2f8ba: OUTPUT«\(10, 10)␤\("ten", 10)␤»
16:55 gfldex did I just invent semi-multidispatch?
16:57 perlpilot looks more like manual-multidispatch to me
16:58 slobo nativecall q: how to specify CArray[CStruct] where it's not pointers inside the CArray, but CStructs are packed continuously?
16:59 arnsholt slobo: You implement the feature in the backend and expose it in NativeCall.pm6
16:59 arnsholt Sorry =)
16:59 timotimo perlpilot: not quite manual :)
17:01 perlpilot manual-ish then
17:01 perlpilot What would be the point?  Doing some extra stuff "in between" the dispatch?
17:02 slobo arnsholt: thanks, i feel better I couldn't find a way :)
17:02 slobo i even tried https://github.com/salortiz/NativeHelpers-Blob, but couldn't quite figure it out that way either
17:02 firstdayonthejob joined #perl6
17:03 slobo (they provide 'LinearArray', but seems to be only able to create new CStruct arrays from perl side, but doesn't ingest existing ones)
17:03 sortiz joined #perl6
17:03 sortiz \o #perl6
17:05 tony-o dependency counts for modules on module.zef.pm are corrected -
17:06 sortiz slobo, See the example at https://github.com/salortiz/NativeHelpers-Blob/blob/master/t/02-cstruct.t
17:08 slobo sortiz, i was looking at that, but i need something like `@elts = LinearArray[Point3D].new($pointer, $numelements)`
17:09 sortiz Ah, you need to create one from a given Pointer! Umm
17:10 slobo and i also tried blob-from-pointer(..., Blob[MyCStruct]) but that bailed with 'nativesize' not found in Perl....HOW or something
17:11 slobo (was thinking i could rube-goldberg it via `carray-from-blob(blob-from-pointer(...` )
17:20 gregf_ m: my Str @a = "foo";say @a.^name
17:20 camelia rakudo-moar b2f8ba: OUTPUT«Array[Str]␤»
17:20 gregf_ m: my Str $a = "foo";say @a.^name
17:20 camelia rakudo-moar b2f8ba: OUTPUT«5===SORRY!5=== Error while compiling /tmp/bxdQLASy9q␤Variable '@a' is not declared. Did you mean '$a'?␤at /tmp/bxdQLASy9q:1␤------> 3my Str $a = "foo";say 7⏏5@a.^name␤»
17:20 gregf_ m: my Str $a = "foo";say $a.^name
17:20 camelia rakudo-moar b2f8ba: OUTPUT«Str␤»
17:22 gregf_ m: class Foo { has $.bar is rw;}; my Foo @foos = (^5).map({ Foo.new(bar => $_) });; say @foos
17:22 camelia rakudo-moar b2f8ba: OUTPUT«[Foo.new(bar => 0) Foo.new(bar => 1) Foo.new(bar => 2) Foo.new(bar => 3) Foo.new(bar => 4)]␤»
17:22 gregf_ Perl6++ :)
17:23 timotimo m: class Foo { has $.bar is rw }; my Foo @foos = Foo.new xx 5; @foos>>.bar Z= ^5; say @foos
17:23 camelia rakudo-moar b2f8ba: OUTPUT«[Foo.new(bar => 0) Foo.new(bar => 1) Foo.new(bar => 2) Foo.new(bar => 3) Foo.new(bar => 4)]␤»
17:23 timotimo put that in your pipe and smoke it :D
17:25 Emeric joined #perl6
17:26 sortiz slobo, NativeHelpers::Pointer implements pointer arithmetic, so if you use Pointer[Foo] $ptr, you can do $ptr++ to get a pointer to the next Foo.
17:27 timotimo don't we have that in core nativecall, too?
17:27 sortiz timotimo, sure.
17:28 timotimo so it should be thrown out in NativeHelpers::Pointer?
17:29 tony-o i'm curious too, so you'd use nativecast + nativesize + pointer arithmetic to consume an array of contiguous structs?
17:30 slobo Method 'succ' not found for invocant of class 'NativeCall::Types::Pointer[X11::Xlib::Raw::Screen]'
17:30 timotimo hm, same for "+ 1"?
17:31 slobo it casts it to int
17:31 slobo Method 'deref' not found for invocant of class 'Int'
17:31 timotimo er, of course
17:31 timotimo i really thought we had put in pointer arithmetic some time ago
17:31 Actualeyes left #perl6
17:31 sortiz slobo, You 'use NativeHelpers::Pointer' first?
17:31 tony-o you have to nativecast the pointer position to the cstruct class you defined
17:32 slobo this was witshout NativeHelpers::Pointer, let me try with it
17:32 timotimo don't forget you have to "panda install" that
17:32 ZoffixWin joined #perl6
17:33 ribasushi joined #perl6
17:33 sortiz timotimo, my plan is to PR well tested parts of NH into NC.
17:34 timotimo good!
17:36 azawawi https://github.com/azawawi/gtk-simple/blob/master/examples/09-toolbar.pl6  # G:S:Toolbar Enterprisy version with events :)
17:36 azawawi http://pasteboard.co/1pAS24jL.png
17:37 slobo `STable conflict detected during deserialization.`
17:37 wooy left #perl6
17:37 sortiz In particular, pointer arithmetic seems to works well, but right now the only "success histories" are the indirect ones from DBIish use.
17:38 sortiz slobo, Never seen that before :(
17:39 slobo happens when i put it in the unit module, but not in the main program
17:40 sortiz That smells that a precomp bug.
17:41 slobo i tried removing the precomp dir
17:41 azawawi https://github.com/perl6/gtk-simple/pull/41 # feedback appreciated
17:42 slobo anyways, even if I paste in NativeCall::Pointer stuff in my units, it still doesn't pickup the 'succ'
17:43 slobo this is my definition of the struct poiinter in a struct: https://github.com/slobo/Six11/blob/master/lib/X11/Xlib/Raw.pm6#L146
17:44 slobo and i'm trying this:   my $scr_ptr = $display.screens; say $scr_ptr.deref; $scr_ptr++; say $scr_ptr.deref;
17:46 slobo first deref succeeds and shows good looking data, so i think i got the struct correct
17:46 jjido joined #perl6
17:47 FROGGS joined #perl6
17:48 sortiz slobo, Right now I'm at $work, I'll check at detail tonight.
17:49 slobo cool, thanks!
17:51 jjido joined #perl6
17:51 FROGGS o/
17:52 RabidGravy harr
17:52 sortiz FROGGS o/ #nice to see you again!
17:53 FROGGS :o)
17:58 Emeric1 joined #perl6
17:59 AlexDaniel Zoffix: how is it going?
18:00 wamba joined #perl6
18:01 sexy-coder-girl joined #perl6
18:02 RabidGravy azawawi, fancy moving that "show-all" method from ::App to ::Widget - it's useful there
18:02 azawawi sure
18:05 dalek doc: 57e3a6a | (Jan-Olof Hendig)++ | doc/Type/Rational.pod:
18:05 dalek doc: Fixed typo in code example
18:05 dalek doc: review: https://github.com/perl6/doc/commit/57e3a6a929
18:10 azawawi RabidGravy: done :)
18:11 RabidGravy cool, you a star :)
18:12 sexy-coder-girl joined #perl6
18:12 RabidGravy gah, the travis takes so long
18:12 RabidGravy screw it
18:12 _mg_ joined #perl6
18:13 dalek gtk-simple: 02df3a0 | azawawi++ | lib/GTK/Simple/NativeLib.pm6:
18:13 dalek gtk-simple: Fix missed module name in refactor
18:13 dalek gtk-simple: review: https://github.com/perl6/gtk-simple/commit/02df3a07c3
18:13 dalek gtk-simple: f325241 | azawawi++ | lib/GTK/Simple/GDK.pm6:
18:13 dalek gtk-simple: Add missing module name
18:13 RabidGravy poor dalek
18:13 dalek joined #perl6
18:14 RabidGravy sorry dalek, you've just got to suck it up
18:14 nebuchadnezzar joined #perl6
18:17 azawawi RabidGravy: i missed a shebang :) https://github.com/perl6/gtk-simple/pull/43/commits
18:17 azawawi RabidGravy: do you think the second commit is correct or not?
18:18 shadowpaste joined #perl6
18:19 RabidGravy It'll be fine
18:19 RabidGravy let me test that
18:22 RabidGravy works great!
18:22 user9 joined #perl6
18:23 RabidGravy azawawi++ # making stuff
18:23 cdg joined #perl6
18:24 dalek gtk-simple: 79e73a7 | azawawi++ | examples/09-toolbar.pl6:
18:24 dalek gtk-simple: Add missing shebang
18:24 dalek gtk-simple: review: https://github.com/perl6/gtk-simple/commit/79e73a74e9
18:24 dalek gtk-simple: b6eb1eb | azawawi++ | /:
18:24 dalek gtk-simple: Merge remote-tracking branch 'upstream/master'
18:24 dalek gtk-simple: review: https://github.com/perl6/gtk-simple/commit/b6eb1eb5eb
18:24 dalek gtk-simple: a15aee1 | azawawi++ | examples/09-toolbar.pl6:
18:24 dalek gtk-simple: Merge pull request #43 from azawawi/master
18:24 dalek gtk-simple:
18:24 dalek gtk-simple: Missing shebang for example
18:24 dalek gtk-simple: review: https://github.com/perl6/gtk-simple/commit/a15aee1252
18:25 timotimo m: say ("foo" => [ { a => 1, b => 2 } ]).perl;
18:25 camelia rakudo-moar b2f8ba: OUTPUT«:foo([:a(1), :b(2)])␤»
18:26 timotimo m: say ("foo" => [ { a => 1, b => 2 }, ]).perl;
18:26 camelia rakudo-moar b2f8ba: OUTPUT«:foo([{:a(1), :b(2)},])␤»
18:29 shadowpaste joined #perl6
18:30 Emeric joined #perl6
18:30 kalkin-_ What does <.foo> means?
18:30 kalkin-_ (When used in a grammar)
18:30 kalkin-_ I know that <foo> is a token, but what does the dot mean?
18:30 FROGGS non capturing subrule 'foo'
18:30 timotimo F
18:30 timotimo froggs!
18:30 kalkin-_ ahh ic. thanks
18:31 FROGGS hi timotimo :o)
18:31 timotimo glad to see you!
18:31 FROGGS yes, it is nice to be back
18:32 Emeric1 joined #perl6
18:32 matiaslina joined #perl6
18:34 FROGGS I probably wont have time to hack much on Perl 6 but I'll at least hang out every evening again
18:34 timotimo OK! :)
18:35 _mg_ joined #perl6
18:36 sortiz FROGGS, Any plan about p6-XML-LibXML?
18:36 FROGGS sortiz: it is more a problem about time than about plant :/
18:36 FROGGS plans*
18:36 FROGGS but yeah, that wants finishing
18:37 FROGGS I'll work on it as soon as I can
18:37 sortiz Do you accepts PRs? ;-)
18:39 FROGGS of course
18:40 FROGGS hmm, I've got unpushed stuff locally
18:42 maybekoo2 joined #perl6
18:44 jjido joined #perl6
18:45 sortiz FROGGS, I'll have a few spare tuits and that's a project that specially interest me.
18:46 FROGGS yeah, me too (of course)
18:48 shadowpaste joined #perl6
19:06 azawawi RabidGravy: ping
19:06 RabidGravy boom
19:06 azawawi caught a nasty bug https://travis-ci.org/perl6/gtk-simple/jobs/135101419#L1321
19:07 azawawi https://github.com/perl6/gtk-simple/blob/master/lib/GTK/Simple.pm6  # added toolbar, which uses menuitembutton, somehow ::App gets deleted
19:09 RabidGravy it works fine locally
19:10 azawawi https://github.com/perl6/gtk-simple/blob/master/lib/GTK/Simple.pm6#L31 and https://github.com/perl6/gtk-simple/blob/master/lib/GTK/Simple/Toolbar.pm6#L6
19:11 azawawi it is a bug that happens on MacOSx after adding ::Toolbar and ::MenuItemButton to GTK::Simple
19:11 TEttinger joined #perl6
19:12 azawawi weird also ... https://travis-ci.org/perl6/gtk-simple/builds/135090818
19:16 sherwool joined #perl6
19:18 labster joined #perl6
19:19 sherwool Is Johnathan well?  Been over a month since he reported in on 6guts.
19:19 sherwool er, Jonathan
19:19 Emeric .seen jnthn
19:19 yoleaux I saw jnthn 16:48Z in #perl6: <jnthn> azawawi: Nice! :) Guess next comes the supplies for the events <3
19:19 moritz sherwool: yes, active in another channel just two hours ago
19:19 sherwool wow- thanks moritz
19:20 mst sherwool: there may've been fewer blog posts but there's plenty of commit history
19:20 mst DON'T PANIC
19:21 sherwool not panicked, but concerned .... maybe just nosey
19:21 sexy-coder-girl sherwool: 95 commits in the past month, 75 of which are for MoarVM (Perl 6's primary VM): https://github.com/jnthn?tab=contributions&amp;period=monthly
19:22 sherwool thx sexy, guess that would be a better place to check :>)
19:22 toto joined #perl6
19:26 Jim_ joined #perl6
19:26 |meta joined #perl6
19:30 gtodd hoelzro: looked at elm (one of those "compile to JavaScript" languages you mention) ... of course there's a difference between something that is language in its own rite versus a  advanced "DSL" that *compiles* to JavaScript/ES  (c.f. chromatic's funny piece about DSL), but still, perl6 seems like a language that one day could use grammars, slangs, macros, Inline etc. to facilitate writing "frontends" GUIs for data analysis or user interface t
19:30 gtodd oops
19:30 gtodd argh /msg
19:31 Zero_Dogg joined #perl6
19:32 dalek doc: 8eaa110 | (Jan-Olof Hendig)++ | doc/Type/Parameter.pod:
19:32 dalek doc: Fixed a broken code snippet
19:32 dalek doc: review: https://github.com/perl6/doc/commit/8eaa1108bb
19:36 adu joined #perl6
19:37 jnthn sherwool: I got into a pattern of writing my blog posts on weekends about what I'd done in the week or two prior...which worked well until I had a few weekends in a row where I was exhausted or distracted. :-) Got the next post partly drafted, so with luck this weekend there'll be something... :-)
19:39 azawawi is 'use Module' lexically scoped?
19:41 jnthn azawawi: Anything marked "is export" is lexically imported by use, yes. Any global packages are merged into the wider set of globals.
19:42 sherwool Double Wow, jnhtn!  watch the exhaustion, listen to your body, recalled you saying last year you had not be feeling well .... I learned recently I had "sub-clinical hypothyroidism" which in due course may turn clinical
19:42 azawawi https://github.com/azawawi/gtk-simple/commit/fc5c3b64ab33257a071229e6cb23fe60dedf0852  # weird fix
19:44 jjido joined #perl6
19:49 gtodd left #perl6
19:51 jnthn sherwool: Yeah, I did a lot too much last year and it did me no good... :S Taking rest a good bit more seriously these days.
19:52 jjido_ joined #perl6
19:54 stevieb9 joined #perl6
19:57 stevieb9 is it a standard in p6 to use a dash instead of underscore everywhere, even in variables? I see it all over the docs particularly in methods, and I'm wondering if long-time p6 programmers consider this an idiom across the board or not.
19:58 FROGGS stevieb: I'd call it idiomatic, yes
19:58 FROGGS and is easier to type too
19:59 FROGGS sortiz: I pushed some stuff so at least some tests pass again
19:59 FROGGS sortiz: and I gave you push access
20:00 [Coke] yes. a concerted effort was made to try to make sure everything "normal" in the spec used dashes, not underscores
20:00 [Coke] it's expected that user code would follow too. (but you can do what you want, we're not your parents.)
20:00 stevieb9 FROGGS: thanks. If I'm going to learn the language, I want to start off properly by using the same semantics as those who have been writing it for a long period.
20:03 Laurent_R joined #perl6
20:04 [Coke] stevieb9: well, the first official release was in December, so you're still ahead of the curve.
20:05 lolo78_ joined #perl6
20:05 stevieb9 Coke: I did a short stint in 2k12 with p6, wrote a brief blog post about some of the neat differences I found between it an p5, but due to life constraints, abandoned it. Now I'm back and I hope to get as proficient with p6 as I am with p5 ;)
20:05 sortiz FROGGS, thank you!
20:07 azawawi https://travis-ci.org/azawawi/gtk-simple/jobs/135118898#L1201  # Failure to install GTK::Simple from local directory after a successful test run... the 3055 line error :)
20:07 jjido joined #perl6
20:10 kent\n joined #perl6
20:10 kent\n joined #perl6
20:16 FROGGS stevieb9: is b9 the opposite of p6?
20:16 teatime no, that'd be 9d
20:17 FROGGS I see
20:17 stevieb9 m: 'b9' eq '6p'
20:17 camelia rakudo-moar b2f8ba: OUTPUT«WARNINGS for /tmp/EHMoYtjONO:␤Useless use of "eq" in expression "'b9' eq '6p'" in sink context (line 1)␤»
20:17 stevieb9 lol
20:17 stevieb9 m: 'b9' ~~ '6p'
20:17 camelia rakudo-moar b2f8ba: ( no output )
20:18 FROGGS you need to 'say' it
20:18 stevieb9 m: say 'b9' eq '6p'
20:18 camelia rakudo-moar b2f8ba: OUTPUT«False␤»
20:18 stevieb9 there :)
20:18 stevieb9 had to try camelia at some point
20:18 FROGGS m: say 'b9' leg '6p'
20:18 camelia rakudo-moar b2f8ba: OUTPUT«More␤»
20:19 lolo78 Hi folks, I have been trying to use SVG and SVG::Plot lately, but did not succeed to get proper SVG files. I found a talk by jnthn in which he used it. So I copied the code and tried it, but it still does not seem to work. This is one of many attempts:
20:19 lolo78 my @means = (1929 => 7, 1930 => 6, 1931 => 5, 1932 => 8, 1933 => 2, 1934 => 3);
20:19 lolo78 say SVG.serialize(SVG::Plot.new(
20:19 lolo78 width  => 600,
20:19 lolo78 height => 350,
20:19 lolo78 x      => @means.map(*.key),
20:19 lolo78 values => [[@means.map(*.value)]],
20:19 lolo78 title  => "TEST TEMP"
20:19 lolo78 ).plot(:xy-lines));
20:19 lolo78 Output:
20:19 lolo78 <svg xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="600
20:19 lolo78 " height="350" />
20:19 lolo78 In other words, the data is not there. When I don't use the serialize method  (but only SVG::Plot), it seems to produce quite a bit of data which I believe to be some form of SVG, but I can't do anything with is as it is without the serialize method. Can any one tell me what I am doing wrong? Or point me to some documentation?
20:19 FROGGS ufff
20:19 FROGGS dont paste in here please
20:19 FROGGS use a paste service
20:19 lolo78 Oops, sorry for the bad formatting.
20:20 lolo78 FROGGS: what is a pasting service?
20:20 FROGGS lolo78: https://nopaste.me/
20:21 stevieb9 FROGGS: when I'm learning a new language, I like to go off on tangents. leg(), which I've never heard of, led me to http://strangelyconsistent.org/blog/6-builtins-in-perl-6-that-you-never-knew-you-needed ... new things to learn!
20:21 [Coke] gist.github.com
20:21 FROGGS stevieb: yes, there is nice stuff out there :o)
20:23 stevieb9 I can't remember who (maybe Zoffix) posted yesterday a really interesting way to chain calls (haven't tested it yet). something like `.sort, .map, .reverse given obj;`. I'm noticing that there are so many ways to do things, completely trumping perl 5
20:26 raydiak joined #perl6
20:26 mst you can do more of those things in perl5 than you think, even if they're usually idioms rather than features
20:27 mst I mean, I agree with your positive estimate of perl6, but I doubt you know what perl5 is capable of to the extent that you think :)
20:31 FROGGS lolo78: is it perhaps related to this? https://github.com/moritz/svg-plot/issues/8
20:32 FROGGS lolo78: are you using rakudo star 2016.01?
20:32 stevieb9 oh, I'm very clear on that. There's a lot I don't know about perl5, but there's a lot I do use that you don't see often. That said, I'm by no means an expert. There are many things I come across that I just give up on trying to figure out what its supposed to do. I'm just finding this perl6 thing like a new Christmas toy I suppose :)
20:32 lolo78 FROGGS: Yes, it seems to be exactly the same problem.
20:33 lolo78 Using: This is Rakudo version 2016.04 built on MoarVM version 2016.04 implementing Perl 6.c.
20:33 ribasushi joined #perl6
20:33 FROGGS lolo78: you might want to try upgrading SVG::Plot and see if it helps...
20:34 lolo78 OK, FROOGS, thanks, I'll try that.
20:35 perlpilot stevieb9: Have you looked at rosettacode much?  Lots of good Perl 6 stuff there.
20:35 FROGGS gnight
20:36 stevieb9 I have not. I'll look it up and put it into a tab for later review. Thanks!
20:36 sno joined #perl6
20:36 stevieb9 one thing that I did wrong while using perl5 for years was not hanging around the IRC channels. In 3-4 days here, I've learned a heck of a lot.
20:38 AlexDaniel sexy-coder-girl: why would you pick this nickname? :/
20:38 perlpilot AlexDaniel: humor
20:39 AlexDaniel sexy-coder-girl: better tell me how your IRC client thingy is going, I NEED IT
20:39 AlexDaniel :)
20:39 perlpilot stevieb9: yeah, hanging out on IRC helps.  Especially for Perl 6 as most of the major players are active on #perl6
20:41 stevieb9 I see that. It works for me, because I love to help others, but I'm the type who takes criticism well, and can take being told "you're wrong". I also am keen to change my opinions/beliefs if something better comes along. I think I'll be happy here
20:41 mst same goes for perl5 though
20:41 mst the community's significantly co-ordinated via IRC
20:41 stevieb9 yeah, I've been hanging around perl5 IRC lately too. fwiw, perl5 is still, by far, my favourite lang
20:41 perlpilot mst: yeah, that's true ... you just have to pick the *right* #perl for Perl 5  ;)
20:41 stevieb9 perlpilot: which is the 'right' #perl5?
20:42 stevieb9 erm, #perl
20:42 mst well there's #perl on here, plus all of irc.perl.org
20:42 stevieb9 I'm on irc.perl.org. Not the one here. will be now though
20:44 perlpilot stevieb9: I'm pretty sure the EFnet #perl isn't very useful these days though it still exists.
20:44 perlpilot :)
20:44 stevieb9 perlpilot: thanks
20:45 sufrostico joined #perl6
20:48 dalek gtk-simple: ab0cccd | azawawi++ | t/01-sanity.t:
20:48 dalek gtk-simple: Run tests on windows
20:48 dalek gtk-simple: review: https://github.com/perl6/gtk-simple/commit/ab0cccd093
20:48 dalek gtk-simple: 2205667 | azawawi++ | lib/GTK/Simple/ (2 files):
20:48 dalek gtk-simple: unit classization
20:48 dalek gtk-simple: review: https://github.com/perl6/gtk-simple/commit/2205667702
20:48 dalek gtk-simple: fc5c3b6 | azawawi++ | lib/GTK/Simple/Toolbar.pm6:
20:48 dalek gtk-simple: Weird fix but it makes it work :)
20:48 dalek gtk-simple: review: https://github.com/perl6/gtk-simple/commit/fc5c3b64ab
20:48 dalek gtk-simple: d2f5aa8 | RabidGravy++ | / (3 files):
20:48 dalek gtk-simple: Merge pull request #44 from azawawi/master
20:48 dalek gtk-simple:
20:48 dalek gtk-simple: Windows test fixes + tidy code + weird fix :)
20:48 dalek gtk-simple: review: https://github.com/perl6/gtk-simple/commit/d2f5aa8a9c
20:49 stevieb9 I especially like the very high level of knowledge most folks here have of the language. As I move forward, that'll both help keep me in check, and get an understanding of who likes focusing on what
20:51 stevieb9 the experienced/newb ratio appears very high. I feel like I jumped in at the perfect time
20:52 kid51 joined #perl6
20:52 stevieb9 I note though that perl5 has just as many people willing to help (and I'm not complaining about newbies, particularly because I am one), but it's great knowing there's a place where you're pretty well immediately going to get great feedback instantaneously
20:53 RabidGravy well sometimes :)
20:53 stevieb9 lol
20:54 perlpilot stevieb9: you may also notice that some of the people on #perl6 are also on #perl.  This is not an accident ;)
20:54 yqt joined #perl6
20:54 stevieb9 perlpilot: I'm well aware of that, and I most definitely recognize names ;)
20:56 perlpilot though .... I'm pretty sure #perl never gave out hugs as freely as #perl6
20:56 stevieb9 perlpilot: some handles are different than what outside of here I'd recognize, but undoubtedly there are some people here where I've submitted perl5 patches/PRs to
20:56 dolmen joined #perl6
20:59 RabidGravy I'd hardly used irc for ten years before I got in here
20:59 stevieb9 so, besides everything else I've picked up here in the brief checkins, I've learned that people here prefer perl5/perl6 as opposed to shortened forms, and that #perl6 gives out free hugs ;)
20:59 stevieb9 RabidGravy: same here
21:00 mr-foobar joined #perl6
21:01 stevieb9 RabidGravy: it's a handy resource. right down to seeing the commits going in
21:02 AlexDaniel huggable: hug stevieb9
21:02 * huggable hugs stevieb9
21:02 stevieb9 LOL :D
21:02 AlexDaniel bisectable: bisect stevieb9
21:02 perlpilot stevieb9: you want to see something neat that I used today?
21:03 AlexDaniel :)
21:03 stevieb9 perlpilot: of course!
21:03 perlpilot m: my @mat = <a b c>, (1,2,3); my @tran = (@mat[*;$_] for ^@mat[0]);  say @tran.perl;
21:03 camelia rakudo-moar b2f8ba: OUTPUT«[("a", 1), ("b", 2), ("c", 3)]␤»
21:04 stevieb9 I took off of work early today using banked hours. Now I'm at home playing some vids and learning things on this IRC channel
21:04 moritz perlpilot: are you reinventing zip? :-)
21:04 moritz m: say zip(<a b c>, (1,2,3))
21:04 camelia rakudo-moar b2f8ba: OUTPUT«((a 1) (b 2) (c 3))␤»
21:06 perlpilot huh.  I'd not thought of transposition as zip
21:07 perlpilot So ... I guess I did :)
21:07 stevieb9 looks like something map()py... creating a list of lists. I don't know what the * means quite yet, but I'll play with this later, and it'll lead me to docs
21:07 perlpilot But ... that's the beauty of Perl (5 or 6) ...  TMTOWTDI!  :)
21:08 stevieb9 can tell already that I'm going to enjoy learning perl6
21:08 AlexDaniel m: say <a b c> »,« (1,2,3)
21:08 camelia rakudo-moar b2f8ba: OUTPUT«((a 1) (b 2) (c 3))␤»
21:10 AlexDaniel m: say <a b c> «,» (1,2,3)
21:10 camelia rakudo-moar b2f8ba: OUTPUT«((a 1) (b 2) (c 3))␤»
21:10 AlexDaniel and only now I've realized that there's a difference
21:10 AlexDaniel m: say <a b c> »,« (1,2,3,4)
21:10 camelia rakudo-moar b2f8ba: OUTPUT«Lists on either side of non-dwimmy hyperop of infix:<,> are not of the same length␤left: 3 elements, right: 4 elements␤  in block <unit> at /tmp/FfkvMIp9Cy line 1␤␤»
21:10 AlexDaniel m: say <a b c> «,» (1,2,3,4)
21:10 camelia rakudo-moar b2f8ba: OUTPUT«((a 1) (b 2) (c 3) (a 4))␤»
21:12 stevieb9 AlexDaniel: that's very interesting! are the '<<' and '>>', or are those double-quotes?
21:13 stevieb9 are they *operators*...
21:13 AlexDaniel stevieb9: you can use >> or »
21:13 AlexDaniel m: say <a b c> <<,>> (1,2,3,4)
21:13 camelia rakudo-moar b2f8ba: OUTPUT«((a 1) (b 2) (c 3) (a 4))␤»
21:13 perlpilot stevieb9: they are hyperops
21:13 stevieb9 ok, that's what I thought... I didn't come across the backwards one yet though in the docs
21:13 perlpilot backwards one?
21:14 stevieb9 sorry.... I've only seen >> as the hyper op
21:14 AlexDaniel ehhh, is it documented?
21:14 stevieb9 I haven't seen an example where it was used << like
21:14 stevieb9 ...yet
21:14 AlexDaniel stevieb9: which example did you see where » was used?
21:14 perlpilot stevieb9: yeah, they're symmetric.  You generally want the pointy end towards the smaller list and the fat end towards the bigger list.
21:15 RabidGravy It's also a bit more typing than
21:15 RabidGravy m: say <a b c> Z (1,2,3)
21:15 camelia rakudo-moar b2f8ba: OUTPUT«((a 1) (b 2) (c 3))␤»
21:16 AlexDaniel sure
21:16 stevieb9 it may have been in the intro... ...yep. sorry. it wasn't the official docs I saw it in. It is there: https://doc.perl6.org/language/operators#Hyper_Operators
21:16 stevieb9 just hadn't got to that part of the official docs yet
21:16 AlexDaniel ok, great, it is documented
21:16 stevieb9 yep
21:18 jjido joined #perl6
21:18 perlpilot m: my @mat = <a b c>, (1,2,3), <x y z>;   say [Z] @mat;  # for me, I already had @mat and just needed to rotate it 90 degrees
21:18 camelia rakudo-moar b2f8ba: OUTPUT«((a 1 x) (b 2 y) (c 3 z))␤»
21:19 RabidGravy cool
21:20 perlpilot But it's always nice to use a dimensional slice when you can  :)
21:22 stevieb9 I saw an example the other day here regarding chaining calls and have a question. Here's a dumbed down version: '.reverse, .sort given obj'. Now, this works: 'perl6 -e 'my @a = .sort given (3,1,2); say @a', but this: 'perl6 -e '.say, .sort given (3,1,2)' does not. Can someone please explain what the process flow here is?
21:23 perlpilot stevieb9: sure it wasn't .sort.say given (3,1,2);   #?
21:24 geekosaur stevieb, both methods are applied to the object in order. they are not chained (and if they were, they'd be in the wrong order). also .sort does not mutate. so you'd get the original value say-d, then it would be sorted (the result in sink context, uselessly)
21:24 geekosaur perlpilot, I'm thinking they saw discussion yesterday about how to shorten foo.x; foo.y; foo.z by using given
21:26 geekosaur anyway: `.say, .sort given (3,1,2)` does: (3,1,2).say; (3,1,2).sort; # the latter should warn because the result is not used
21:26 stevieb9 geekosaur: ahhh *right*! I forgot sort() is non-mutating. Thanks :)
21:32 Zoffix AlexDaniel, anything specific? :) RE <AlexDaniel> Zoffix: how is it going?
21:32 AlexDaniel Zoffix: yes
21:32 AlexDaniel Zoffix: IRC CLIENT
21:33 Zoffix stevieb9, yeah, it was me. And it's no surprise, given Perl 6 is [partially] an attempt to fix annoying things in Perl 5 :P
21:34 Zoffix AlexDaniel, yesterday, I figured out how to use Perl 5's PoCo::IRC::Server to launch an IRC server that I'll use to write tests. Hoping to do some good work this weekend, unless I find a very interesting game to play :P
21:34 AlexDaniel Zoffix: oh, tests! Great!
21:34 AlexDaniel Zoffix++
21:36 patrickz joined #perl6
21:37 stevieb9 geekosaur: thanks for the explanation. Zoffix: sorry to pick apart your example, but I found it intriguing :)
21:38 Zoffix It's fine :)
21:38 Zoffix Hoping you'll send a PR to document it (I recall you said it wasn't) :)
21:41 stevieb9 don't know yet. I've just been bouncing around the docs randomly... I read/test something, then I find something quasi-related to what I'm playing with, then jump off on a tangent. I tend to learn quicker that way. I do promise to create PRs for anything missing/incorrect in the docs though (much like the issue with IO::Handle I was having on PerlMonks that you verified/patched). Of course, I'll come here first to get verification
21:42 stevieb9 ...at least until I feel more confident after gaining more experienced, then I'll do so without someone hand-holding
21:58 literal aw, I was disappointed to find out that this doesn't work: $foo.bar($^a, $^b) for %baz.kv;
21:59 literal since $^a and $^b will be associated with the surrounding block
22:00 literal I suppose I'll have to make do with for %baz.kv { $foo.bar($^a, $^b) }
22:00 ugexe m: class Foo { method bar($a, $b) { say $a; say $b; }; }; my %baz = a => 1, b => 2; my $foo = Foo.new; $foo.bar(.key,.value) for %baz;
22:00 camelia rakudo-moar b2f8ba: OUTPUT«a␤1␤b␤2␤»
22:01 rurban joined #perl6
22:01 Sgeo joined #perl6
22:03 literal oh, forgot I could just do that
22:04 grondilu yeah that's a common idiom
22:04 rurban left #perl6
22:08 juantelez joined #perl6
22:09 AlexDaniel m: class Foo { method bar($a, $b) { say “$a↔$b”; }; }; my %baz = a => 1, b => 2; my $foo = Foo.new; for %baz.kv { $foo.bar($^a, $^b); }
22:09 camelia rakudo-moar b2f8ba: OUTPUT«a↔1␤b↔2␤»
22:09 AlexDaniel this is not too bad too
22:18 Zoffix m: class Foo { method bar($a, $b) { say “$a↔$b”; }; }; my %baz = a => 1, b => 2; my $foo = Foo.new; $foo.bar: |.kv for %baz
22:18 camelia rakudo-moar 56cc3a: OUTPUT«a↔1␤b↔2␤»
22:28 skids joined #perl6
22:34 TimToady m: class Foo { method bar($a, $b) { say “$a↔$b”; }; }; my %baz = a => 1, b => 2; my $foo = Foo.new; {$foo.bar($^a,$^b)} for %baz.kv
22:34 camelia rakudo-moar 48fe6a: OUTPUT«a↔1␤b↔2␤»
22:35 TimToady you can write it with a modifier if you use explicit curlies
22:41 pecastro joined #perl6
22:42 ribasushi joined #perl6
22:43 stevieb9 m: say "friday: \x1f37a"
22:43 camelia rakudo-moar 48fe6a: OUTPUT«friday: ????␤»
22:44 Zoffix TimToady, just curious, did you see my question about is-approx tolerance? Unsure if you don't have time/ideas for an answer or just missed it, 'cause you had toothwork and stuff.
22:44 Zoffix This: <Zoffix> TimToady: would you have time to offer a ruling on what the default tolerance to is-approx in Test.pm6 should be? Is it relative or absolute, and what value? My ideal choice would be to go with absolute at 1e-5. The specs/docs use absolute at 1e-5. And current impl uses relative at 1e-6. The ≅ uses relative at 1e-15. My more detailed plan for rewrite of is-approx: https://github.com/zoffixznet/debu​g/blob/master/mu/approx-rework.md
22:45 Zoffix and  both relative/absolute methods will still be available via :rel-tol<>/:abs-tol<>
22:46 Zoffix m: say "Friday: \x[1F3AE]"
22:46 camelia rakudo-moar 48fe6a: OUTPUT«Friday: ????␤»
22:46 stevieb9 :)
22:46 stevieb9 Zoffix: why the '[]'?
22:47 Zoffix Just for clarity
22:47 stevieb9 I'll remember that. It does stand out more prominently with the '\x'
22:48 AlexDaniel m: say “Friday: \x[1F6CC]”
22:48 camelia rakudo-moar 48fe6a: OUTPUT«Friday: ????␤»
22:48 Zoffix I'd say so.
22:49 AlexDaniel huggable: friday :is: ????????????
22:49 huggable AlexDaniel, Added friday as ????????????
22:50 Zoffix huggable, drinking is bad for you!
22:50 huggable Zoffix, nothing found
22:51 rurban1 joined #perl6
22:53 AlexDaniel Zoffix: sometimes gaming is worse ;)
22:53 stevieb9 m: say 'use Cannabis;'
22:53 camelia rakudo-moar 48fe6a: OUTPUT«use Cannabis;␤»
23:00 sortiz .tell slobo I push a new version of NativeHelpers::CStruct that allows you to create an "unmanaged" LinearArray from a Pointer (typed or not) and a count, hope that helps you.
23:00 yoleaux sortiz: I'll pass your message to slobo.
23:02 matiaslina joined #perl6
23:09 slobo thanks sortiz, i'll check it out hopefully tonigth!
23:09 yoleaux 23:00Z <sortiz> slobo: I push a new version of NativeHelpers::CStruct that allows you to create an "unmanaged" LinearArray from a Pointer (typed or not) and a count, hope that helps you.
23:11 stevieb9 in the following, what would I need to do before/in say() to print out the conversion of the codepoint back to the character? perl6 -e '"????".NFC.say'. I've tried a few random things, including $_, which clearly doesn't work.
23:13 stevieb9 I'm curious how to go from string character to codepoint, back to string char and then print
23:13 cdg joined #perl6
23:13 sortiz slobo, One important thing: be sure that the P6's reported 'nativesizeof' must be equal to C's sizeof of your structs.
23:14 timotimo stevieb9: you'll want to encode it to utf8 or something
23:15 Zoffix joined #perl6
23:16 adu joined #perl6
23:17 stevieb9 timotimo: ahhh, of course :) this perl6 venture has me very interested in Unicode, where I've previously not had to deal with it (barely)
23:18 stevieb9 same with dealing with IO in :bin mode
23:19 stevieb9 just from what I've learned so far (which is almost nil) has me already seeing potential improvements in my perl5 work
23:19 timotimo right, it can bend your brain a bit
23:19 timotimo with the many different representations that are available and useful for different situations
23:19 stevieb9 it's like perl5 references though... once you get it, you just get it (I hope ;)
23:20 timotimo i haven't had to deal with perl5 references yet :)
23:21 stevieb9 it's a time and dedication thing. just like I'm sure many things in perl6 are
23:22 timotimo mhm
23:22 timotimo on top of that, i haven't written more than one or two lines of perl5 code
23:22 stevieb9 I can only assume that everything in perl6 is by default passed by reference, yes?
23:22 timotimo yup
23:22 stevieb9 re: your perl5, I remember you saying you haven't coded there before
23:24 stevieb9 for many people, (at times myself), it seems mysterious that there are perl6 writers who haven't written perl5. however, the distinction is so significant, that it makes sense. I'm glad I decided to give perl6 a new look
23:24 timotimo ah, i already told you, then
23:25 timotimo yeah, i came from python :)
23:25 sortiz m: say "$_ {.chr()}" for "????????????".NFC; # btw, as NFC returns a list, you can use .chr to get the character back.
23:25 camelia rakudo-moar 48fe6a: OUTPUT«128716 ????␤127918 ????␤127866 ????␤»
23:25 stevieb9 yep, I remember you recommending pypy ;)
23:25 Zoffix I'm sure there are lots of Perl 5 coders who never wrote any Perl 4 :P
23:26 TimToady Zoffix: I don't really care much what is-approx does; I didn't write that, I only wrote ≅, which I made relative unless you're very close to 0
23:27 TimToady there's not much point in making $x ≅ 0 relative :)
23:27 stevieb9 zoffix: yes, there are :) there are also a lot of people who to this day use perl4 syntax. perhaps because they copy/pasted code from 15+ years ago
23:28 Zoffix Which reminds me
23:28 Zoffix m: $*TOLERANCE = 0; say 2 ≅ 2
23:28 camelia rakudo-moar 48fe6a: OUTPUT«Cannot modify an immutable Num␤  in block <unit> at /tmp/vz3vIlZci5 line 1␤␤»
23:28 Zoffix m: my $*TOLERANCE = 0; say 2 ≅ 2
23:28 camelia rakudo-moar 48fe6a: OUTPUT«False␤»
23:29 stevieb9 timotimo: you're experienced in python and perl6. may I ask which you prefer, and why, or is that too flamey here?
23:29 * TimToady doesn't believe in "zero tolerance" :)
23:29 Zoffix Eh, Python is just a dialect of Perl 6, why would it be flamey? ????
23:30 stevieb9 a dialect... I like that lol
23:30 Zoffix With slangs, it more than just a poetical statement :) You could make Perl 6 have Python's syntax, if you really wanted to :P
23:31 stevieb9 zoffix: honestly, the more I read/play, the more I notice that these things are possible
23:34 Zoffix m: sub infix:<⁢> {$^a+$^b}; say 2⁢22
23:34 camelia rakudo-moar 48fe6a: OUTPUT«24␤»
23:34 stevieb9 one big complaint I hear about perl6 is that there's no CPAN, and that people cite the recent leftpad fiasco while they say the current perl6 module ecosystem has the same faults (being on github et-al). Is there an official source for where this is moving to?
23:35 Zoffix stevieb9, well, those people are welcome to help build a better system  :)
23:35 Zoffix stevieb9, the direction is listed here: http://docs.perl6.org/language/modules#The_Future_of_Ecosystem (The Future of Ecosystem section)
23:35 Zoffix Though there's a severe shortage of hands to do the work.
23:38 timotimo stevieb9: i haven't done anything productive in python for a long time, tbh. i pretty much switched to p6 full-time for my hobby stuff. on the other hand, i started concentrating on perl6 core development relatively quickly
23:40 stevieb9 Zoffix: thank you for that. I will definitely have a look. Out of curiosity, do you (perl6 core people) get any feedback etc. from the perl5 CPAN people to create symmetry?
23:40 stevieb9 timotimo: thanks for the feedback. what was it that grabbed you about perl6?
23:41 Zoffix ¯\_(ツ)_/¯ I'm not core people. I just talk a lot :P
23:41 Zoffix mst might know more on that. He's a real bridge between the two communities
23:41 stevieb9 I apologize for the very general questions. I just see an opportunity to get information from very informative people, so I'm jumping ;)
23:42 * TimToady is glad he no longer has to control the narrative, except when he does...
23:42 stevieb9 Zoffix: perhaps you're not core, but you're very helpful anywhere I've seen you. You jump in and provide quality info, even if someone thinks you haven't looked in a direction in a long time
23:44 stevieb9 next time I see Matt online, I'll ask again about any cooperation
23:44 sufrostico joined #perl6
23:56 jdv79 Zoffix: i either forgot or didn't know that was documented
23:56 jdv79 nice to know in any case
23:59 robinsmidsrod joined #perl6

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo