Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2015-08-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:12 llfourn joined #perl6
00:18 daxim joined #perl6
00:21 laouji joined #perl6
00:39 laouji joined #perl6
00:46 laouji joined #perl6
00:47 Sgeo As someone who has limited experience with Perl but much more experience with Python and Haskell, what's interesting about Perl6?
00:50 Sgeo augment: benign parasitic. supersede: deadly parasitic
00:50 ShimmerFairy Not that I can speak much to comparing P6 to P5 (since I only know 6), but the design of Perl 6 is a bit more "modern" than P5; for example, when I initially tried using P5, I got tripped up on an introductory Qt tutorial because of -> for methods, among other things.
00:51 ugexe you can sum that up as MONKEY-TYPING in general, and thats hardly new to perl6
00:52 Sgeo I have no idea what parasitic means nor why PErl6 has something called deadly parasitic
00:53 ugexe i thought those were your words
00:53 ShimmerFairy Sgeo: "augment" means "let me give this class some new features", "supersede" means "I can do a better job than you, move over!"  :)
00:54 Sgeo ugexe, https://raw.githubusercontent.com/perl6/mu/master/docs/Perl6/Cheatsheet/cheatsheet.txt
00:55 timotimo yo Sgeo
00:55 Sgeo hi
00:55 timotimo for a moment i was surprised you didn't know anything about perl6, since i've seen you in here for so long ... then i noticed i know you from a differen tchannel %)
00:59 ugexe yea i dont know what those mean either Sgeo
00:59 Sgeo timotimo, heh. I don't really talk much on that channel though
01:02 ShimmerFairy "parasitic" I assume refers to the fact that, like any good parasite, "augment" and "supersede" attach to and affect classes that didn't really ask for it :)
01:03 ugexe sounds like a role
01:04 ShimmerFairy It's not like a role or mixin though, because it affects the class in question for the entire scope (and maaaaybe outer scopes too, but I can't recall)
01:07 ugexe the benign/deadly parasitic are referring to scopes though. so i guess maybe its scope is dependent on the parasites host, but doesnt do much to explain benign/deadly
01:08 ShimmerFairy No, benign/deadly is surely a description of what the keywords do ("augment" changes, "supersede" replaces)
01:09 ugexe its grouped directly under my, our, has, anon, and state under a header titled scope. if thats what it means then its organization is confusing to me
01:11 ShimmerFairy It's because 'augment' and 'supersede' occupy the same position as those other keywords in code, though admittedly they're the odder ones in the collection :)
01:15 BenGoldberg joined #perl6
01:16 ShimmerFairy To be fair, 'state' doesn't have much to do with scoping either (it's more about having the variable persist in its current scope)
01:17 Sgeo m: my $chapter = 3; undefine $chapter; say defined $a;
01:17 camelia rakudo-moar d8fa56: OUTPUT«5===SORRY!5=== Error while compiling /tmp/vzsvMQQ_g7␤Variable '$a' is not declared␤at /tmp/vzsvMQQ_g7:1␤------> 3ter = 3; undefine $chapter; say defined 7⏏5$a;␤»
01:17 Sgeo http://tablets.perl6.org/tablet-3-variables.html
01:17 Sgeo :/
01:17 Sgeo Starting to think that this tablet is garbage
01:18 timotimo the tablets aren't the most up to date resource, sadly
01:19 ShimmerFairy That should probably say 'chapter' instead of 'a'
01:19 timotimo you may want doc.perl6.org instead
01:19 timotimo and i believe the difference between augment and supercede is that augment will just augment a class whereas supercede will supercede it
01:20 ShimmerFairy And yes, the tablets are a pretty old resource, I wouldn't recommend them really.
01:20 Sgeo ty
01:20 Sgeo Maybe they shouldn't be mentioned, or noted as an old resource, on perl6.org
01:21 Sgeo Oh there is a disclaimer but it applies to all resources on the page
01:21 Sgeo http://perl6.org/documentation/
01:22 ugexe we were discussing the descriptions "benign parasitic" and "deadly parasitic" as related to what augment and supercede do
01:23 timotimo oh
01:23 ShimmerFairy which, as I understand it, is in relation to what augment and supersede do, specifically :)
01:23 timotimo well, in "benign parasitic", the host survives, in "deadly parasitic", it doesn't
01:24 dalek rakudo-star-daily: be23065 | coke++ | log/ (8 files):
01:24 dalek rakudo-star-daily: today (automated commit)
01:24 dalek rakudo-star-daily: review: https://github.com/coke/rakudo-star-daily/commit/be23065ac3
01:24 Sgeo What does ~~ :e mean, what kind of thing is :e, a pair? How does smartmatch work against a pair?
01:25 ugexe existence adverb on a file
01:25 Sgeo How does smartmatch work on that?
01:26 timotimo :e is short for e => True, smart matchign against that calls the method .e and checks if the result is True
01:26 timotimo m: say "yay" if "hi" ~~ uc => "HI"
01:26 camelia rakudo-moar d8fa56: OUTPUT«yay␤»
01:26 timotimo m: say "yay" if "hi" ~~ :say
01:26 camelia rakudo-moar d8fa56: OUTPUT«hi␤yay␤»
01:26 timotimo simple as that
01:26 Sgeo timotimo, http://doc.perl6.org/type/Pair
01:27 Sgeo I don't see an ACCEPTS listed, it would be helpful if it was
01:27 timotimo ah
01:27 timotimo yes, very true
01:27 rmgk joined #perl6
01:27 Sgeo Also that : isn't required?
01:27 Sgeo m: say "yay" if "hi" ~~ say
01:27 camelia rakudo-moar d8fa56: OUTPUT«5===SORRY!5===␤Argument to "say" seems to be malformed␤at /tmp/8IZkeuxgR_:1␤------> 3say "yay" if "hi" ~~ say7⏏5<EOL>␤Other potential difficulties:␤    Unsupported use of bare "say"; in Perl 6 please use .say if you meant $_, or use an …»
01:27 timotimo it is
01:27 Sgeo Oh I missaw the uc one
01:28 Sgeo I can imagine someone trying .e but that won't work except in a when because it's against the $_ not against the argument
01:29 timotimo "the argument"?
01:30 timotimo oh
01:30 timotimo you mean "foo.txt" ~~ .e
01:30 Sgeo yes
01:30 timotimo you'll get a warning, but you'll not likely immediately get what it tries to tell you
01:30 timotimo m: given "foo.txt" { when .e { say "hi" } }
01:30 camelia rakudo-moar d8fa56: OUTPUT«Method 'e' not found for invocant of class 'Str'␤  in block <unit> at /tmp/LtKKhM3dv9:1␤␤»
01:31 timotimo m: given "foo.txt" { when :e { say "hi" } }
01:31 camelia rakudo-moar d8fa56: OUTPUT«Method 'e' not found for invocant of class 'Str'␤  in block <unit> at /tmp/JPWu7VcWCv:1␤␤»
01:31 Sgeo THat when would work though because of the given
01:31 timotimo oh, also, the .e and stuff don't work on strings directly, you'll need to .IO that
01:31 Sgeo It's ~~ directly that could be an issue
01:31 timotimo m: given "foo.txt".IO { when :e { say "hi" } }
01:31 camelia rakudo-moar d8fa56: ( no output )
01:31 timotimo m: given "foo.txt".IO { when .e { say "hi" } }
01:31 camelia rakudo-moar d8fa56: ( no output )
01:31 timotimo er, huh
01:31 timotimo m: say "foo" ~~ True
01:31 camelia rakudo-moar d8fa56: OUTPUT«Potential difficulties:␤    Smartmatch against True always matches; if you mean to test the topic for truthiness, use :so or *.so or ?* instead␤    at /tmp/5ZNEMnKVB9:1␤    ------> 3say "foo" ~~7⏏5 True␤fooTrue␤»
01:31 timotimo m: say "foo" ~~ say "hi"
01:31 camelia rakudo-moar d8fa56: OUTPUT«hi␤True␤»
01:31 timotimo m: say "foo" ~~ (say "hi")
01:31 camelia rakudo-moar d8fa56: OUTPUT«hi␤True␤»
01:31 timotimo it only warns if the True or False is syntactic, i see.
01:32 Sgeo m: "foo.txt".IO ~~ .e
01:32 camelia rakudo-moar d8fa56: ( no output )
01:32 Sgeo m: say "foo.txt".IO ~~ .e
01:32 camelia rakudo-moar d8fa56: OUTPUT«False␤»
01:32 Sgeo m: say "foo.txt".IO ~~ :e
01:32 camelia rakudo-moar d8fa56: OUTPUT«False␤»
01:32 timotimo oh, hold on
01:32 timotimo m: say "hello there" ~~ .say
01:32 camelia rakudo-moar d8fa56: OUTPUT«hello there␤True␤»
01:32 timotimo m: "hello there" ~~ .say
01:32 camelia rakudo-moar d8fa56: OUTPUT«hello there␤»
01:32 timotimo $_ is set on the RHS of ~~
01:32 Sgeo Ah
01:46 [particle]1 joined #perl6
01:50 Hor|zon joined #perl6
01:59 llfourn joined #perl6
02:16 Sgeo "In the case of my $x, the lexpad entry for the variable $x is a pointer to an object of type Scalar, usually just called the container."
02:16 Sgeo Is this still true? I don't see Scalar on the list of types
02:17 ShimmerFairy m: my $a = 42; say $a.WHAT; say $a.VAR.WHAT
02:17 camelia rakudo-moar d8fa56: OUTPUT«(Int)␤(Scalar)␤»
02:18 ShimmerFairy As far as I can tell, yes, and Scalar should probably be on a list of Perl 6 types :)
02:22 Sgeo m: my $a; my $b := ($a, 0); $b[0] = 5; say $b;
02:22 camelia rakudo-moar d8fa56: OUTPUT«5 0␤»
02:23 Sgeo Can I imagine $ and @ to be namespaces where default assignment to a non-rebinded thing in that namespace behaves different?
02:24 Sgeo Or what can illustrate the difference between $ and @?
02:26 ShimmerFairy m: my $a = [1,2]; my @b = [1,2]; my @c = 1,2;    say $a.perl; say @b.perl; say @c.perl;  # here's a difference
02:26 camelia rakudo-moar d8fa56: OUTPUT«[1, 2]␤[[1, 2]]<>␤[1, 2]<>␤»
02:32 Sgeo m: my $a = 0; $a[0]=5; say $a;
02:32 camelia rakudo-moar d8fa56: OUTPUT«Cannot modify an immutable Int␤  in block <unit> at /tmp/hKWAZrBNeh:1␤␤»
02:32 Sgeo Works with @
02:46 noganex joined #perl6
02:49 zostay what's the difference between [] and []<>?
02:50 zostay ah... []<> flattens and [] does not?
02:51 kaare_ joined #perl6
03:01 davido__ joined #perl6
03:02 skids zostay: []<> is going away.
03:03 skids It was a pre-GLR experiment/workaround.
03:03 skids (As far as I know, at least)
03:05 Sgeo If I have a capture like \($a, $b), am I capturing the containers or values? Can I pass that to things expecting is rw?
03:05 Sgeo Did I get Capture syntax right?
03:05 zostay syntax is correct
03:06 Sgeo ty
03:06 zostay i don't know the answer to your first question, though
03:09 PerlJam Sgeo: you can find out what Rakudo thinks with a little experimentation :)
03:09 Sgeo m: sub foo($a is rw, $b) { $a = 5; say $a; }; my $f = 10; my $x = \($f, 12); foo(|$x);
03:09 camelia rakudo-moar d8fa56: OUTPUT«5␤»
03:11 PerlJam A "say $f;" at the end could have told you the value/container answer.
03:15 Sgeo Huh, where? $f wouldn't be transformed. Maybe a say $x?
03:15 dayangkun joined #perl6
03:15 Sgeo m: sub foo($a is rw, $b) { $a = 5; say $a; }; my $f = 10; my $x = \($f, 12); foo(|$x); say $x;
03:15 camelia rakudo-moar d8fa56: OUTPUT«5␤\(5, 12)␤»
03:15 Sgeo m: sub foo($a is rw, $b) { $a = 5; say $a; }; my $f = 10; my $x = \($f, 12); foo(|$x); say $x.perl;
03:15 camelia rakudo-moar d8fa56: OUTPUT«5␤\(5, 12)␤»
03:15 Sgeo ??
03:20 skids m: sub foo($a is rw, $b) { $a = 5; say $a; }; my $f = 10; my $x = \($f, 12); foo(|$x); say $f;
03:20 camelia rakudo-moar d8fa56: OUTPUT«5␤5␤»
03:23 Sgeo say @bar.perl;          # [7, 9]<>
03:23 Sgeo If a doc says that, is it old?
03:23 Sgeo Because if it is, I'll be sad because it's the clearest $ vs @ I've seen
03:23 Sgeo http://doc.perl6.org/language/variables
03:24 skids It's current/recent but people did not like it.
03:25 Sgeo So something's changing?
03:25 Sgeo :/
03:25 skids Yes we still have the GLR to go before release.
03:27 yeahnoob joined #perl6
03:29 Sgeo m: my $foo\ bar = 5; say $f\ oobar
03:29 camelia rakudo-moar d8fa56: OUTPUT«5===SORRY!5=== Error while compiling /tmp/p9fCJi8QWz␤Bogus postfix␤at /tmp/p9fCJi8QWz:1␤------> 3my $foo7⏏5\ bar = 5; say $f\ oobar␤    expecting any of:␤        infix␤        infix stopper␤        statement end␤        statement …»
03:30 Sgeo I was expecting that to work, I thought those are unspaces
03:31 Sgeo Ah "Although we say that the unspace hides the whitespace from the parser, it does not hide whitespace from the lexer. As a result, unspace is not allowed within a token."
03:42 ChoHag joined #perl6
03:43 ChoHag In particular, a role may say
03:43 ChoHag trusts ::?Class;
03:43 ChoHag to allow self!attr() access to the role's $!attr variables with the class or from other roles composed into the class.
03:43 ChoHag Surely self!foo() allows access to the *methods*, which may or may not be accessors. How are trustworthy attributes accessed?
03:44 ChoHag (Also: 'from the class')
03:47 ChoHag (Also also: Amongst pet examples, it discusses using proto to disambiguate conflicting methods and uses the example 'proto method shake {...}' - shaking pets is bad)
03:48 davido__ joined #perl6
03:49 ChoHag (From the top of S14)
03:50 Sgeo Is subset basically like contracts except with nicer syntax than in Racket?
03:50 Sgeo How careful are they to maintain correct blame in higher-order function situations?
03:51 Sgeo *{$x}       -> %h { %h[$x] }
03:51 Hor|zon joined #perl6
03:51 Sgeo Is that correct or should it be
03:51 Sgeo *{$x}       -> %h { %h{$x} }
03:51 Sgeo http://design.perl6.org/S02.html
03:56 skids That's a typo I'm pretty sure.
03:56 ShimmerFairy Yeah, using [] on a hash just does the normal "non-list is treated as one-item list" thing, which is certainly not what you want in that situation.
04:00 Sgeo m: (-> $x { say "foo"; })(1|2); (sub ($x) { say "bar"; })(1|2)
04:00 camelia rakudo-moar d8fa56: OUTPUT«foo␤bar␤bar␤»
04:00 Sgeo Also that mandatory space after sub for that second statement threw me for a loop, Javascript doesn't need that
04:00 llfourn joined #perl6
04:00 Sgeo So why is Mu default for the first and Any default for the second?
04:04 skids Sgeo: general and consistent rule (I think) is all "ident()" are calls.
04:04 Sgeo If you want to be able to match normal values and Junctures it's preferred to use Any|Juncture, in case there are future things added to Mu-but-not-Any?
04:07 Sgeo m: my $failure = fail "I fail."; say "No fail.";
04:07 camelia rakudo-moar d8fa56: ( no output )
04:07 virtualsue joined #perl6
04:07 Sgeo Shouldn't it have either failed or succeeded?
04:07 dalek specs: e2ee789 | skids++ | S02-bits.pod:
04:07 dalek specs: Fix a copy-paste that had left hash example with wrong brackets
04:07 dalek specs: review: https://github.com/perl6/specs/commit/e2ee78992a
04:08 skids Sgeo++
04:09 ShimmerFairy m: say Nil ~~ Any; say Failure ~~ Any;
04:09 camelia rakudo-moar d8fa56: OUTPUT«True␤True␤»
04:09 skids Sgeo: No because you never sunk the failure.
04:09 ShimmerFairy Huh, S02 says this shouldn't be the case:
04:10 skids m: my $failure = fail "I fail."; $failure; say "No fail.";
04:10 camelia rakudo-moar d8fa56: OUTPUT«WARNINGS:␤Useless use of variable $failure in sink context (line 1)␤»
04:10 skids Oh I guess that gets caught these days.
04:10 Sgeo skids, if I never sunk the failure, why didn't the say go through?
04:10 ShimmerFairy > Any         Perl 6 object (default routine parameter type, excludes Junction, Nil, Failure)
04:11 skids Hrm good question, it does with -e.
04:13 ShimmerFairy Oh, I think I got the smartmatches reversed, nvm
04:14 Sgeo Tieable role should be documented imo
04:14 skids Oh right.  fail() actually tries to return unlike Failure.new.  And right now there's a bug when it tries to do it at the top level.
04:15 Sgeo Also tying reminds me of Tcl
04:15 Sgeo https://core.tcl.tk/tcllib/doc/trunk/embedded/www/tcllib/files/modules/tie/tie.html
04:15 Sgeo A more complicated API around something Tcl itself provides in a simple manner, lemme see
04:16 skids m: sub a { my $failure = fail "I fail."; say "No fail."; }; a(); #...but...
04:16 camelia rakudo-moar d8fa56: OUTPUT«I fail.␤  in sub a at /tmp/p4nGRo7QVH:1␤  in block <unit> at /tmp/p4nGRo7QVH:1␤␤Actually thrown at:␤  in block <unit> at /tmp/p4nGRo7QVH:1␤␤»
04:16 skids m: sub a { my $failure = Failure.new("I fail."); say "No fail."; }; a(); #...but...
04:16 camelia rakudo-moar d8fa56: OUTPUT«No fail.␤»
04:16 Sgeo http://tcl.tk/man/tcl8.6/TclCmd/trace.htm#M14
04:17 skids m: sub a { my $failure = Failure.new("I fail."); $failure; say "No fail."; }; a();.
04:17 camelia rakudo-moar d8fa56: OUTPUT«5===SORRY!5=== Error while compiling /tmp/92XB3tXRkD␤Bogus statement␤at /tmp/92XB3tXRkD:1␤------> 3l."); $failure; say "No fail."; }; a();.7⏏5<EOL>␤    expecting any of:␤        dotty method or postfix␤»
04:17 Sgeo "trace add variable name ops commandPrefix
04:17 Sgeo : Arrange for commandPrefix to be executed whenever variable name is accessed in one of the ways given by the list ops.
04:17 skids m: sub a { my $failure = Failure.new("I fail."); $failure; say "No fail."; }; a();
04:17 camelia rakudo-moar d8fa56: OUTPUT«No fail.␤»
04:17 skids hrm.
04:18 Sgeo Tcl has a few too many ways to pass code to be executed to something
04:18 Sgeo As in, a subroutine might expect a script, or a command prefix, or (I forget what else)
04:18 Sgeo Command prefix is the modern way, but Tk is old and expects scripts
04:19 ChoHag Haha! Expects scripts. Because expect is written in ... never mind
04:19 skids Something strange with camelia's context WRT failures I guess.
04:19 Sgeo ChoHag, heh, forgot about that, pun not intended
04:20 ChoHag Forgetting about expect is a net positive.
04:20 ChoHag I would like to do the same.
04:21 Sgeo I never actually used it. 100% of my interest in Tcl is because I like learning about languages, although it did come in handy on the job because needed to add a thing to a load balancer that uses Tcl
04:22 Sgeo s/it/expect/
04:23 skids Yeah every once in a while I'm like "crap Im going to have to lear TCL" because it is popular on network gear, but a better solution than device-side scripts seems to always appear.
04:24 skids Thank goodness most of the next-gen stuff is moving to python, not that I know that either but...
04:24 ChoHag Python's easy.
04:24 Sgeo Tcl is actually... interesting IMO, in its model of metaprogramming
04:24 Sgeo But I very strongly recommend learning Tcl via tutorial instead of example
04:25 skids Yeah but metaprogramming is the last thing you want happenning on routers :-)
04:25 ChoHag But (and probably because) it's not very expressive.
04:25 Sgeo Tcl is beautiful if learned properly, horrific trying to guess $ vs no $ and expr and all these other things if not learned properly
04:26 Sgeo Although due to lack of garbage collection of mutable things, I tend to... be really really bad at not leaking gigs of memory
04:29 Sgeo "That is, if $a interpolates, so do $^a, $*a, $=a, $?a, $.a, etc. It only depends on the $."
04:29 Sgeo IIUC, $a does not interpolate? Not that the text is wrong if I'm understanding correctly, but maybe a better example could be used?
04:30 ShimmerFairy $a does interpolate in places that allow it.
04:32 Sgeo "It will not automatically dereference to its contents unless placed explicitly in some kind of dereferencing context."
04:33 Sgeo What are dereferencing contexts
04:35 skids I think prety much everything but a binding context?
04:36 Sgeo lol context
04:36 ShimmerFairy Sgeo: in the part you're reading (AFAICT), it's saying that $x will never expose itself as anything aside from a singular item _unless_ you put it in @($x) or such.
04:36 Sgeo m: my $a = (1,2,3); my @b = $a, 4, 5; say @b;
04:36 camelia rakudo-moar d8fa56: OUTPUT«1 2 3 4 5␤»
04:37 vendethiel joined #perl6
04:37 skids m: my $a = (1,2,3); my @b = $a, 4, 5; say @b.perl;
04:37 camelia rakudo-moar d8fa56: OUTPUT«[1, 2, 3; 4; 5]<>␤»
04:40 Sgeo Ah
04:42 ShimmerFairy The .gist method for lists tends to be lacking, in my opinion.
04:44 skids up too late again.  Gotta stop dieseling and go to bed.
04:45 cognominal joined #perl6
04:48 Sgeo Can a parcel be interpreted as a capture at runtime? THat is, a thing with a dynamically created Pair being used to mean named argument?
04:51 ChoHag Is this a bug or expected behaviour:
04:51 ChoHag m: class A { multi submethod BUILD { say "...A" } }; class B is A { submethod BUILD { say "...B" } }; class C is A { }; say "B:"; B.new; say "C:"; C.new
04:51 camelia rakudo-moar d8fa56: OUTPUT«B:␤...A␤...B␤C:␤...A␤...A␤»
04:51 ChoHag vs.
04:51 ChoHag m: class A { submethod BUILD { say "...A" } }; class B is A { submethod BUILD { say "...B" } }; class C is A { }; say "B:"; B.new; say "C:"; C.new
04:51 camelia rakudo-moar d8fa56: OUTPUT«B:␤...A␤...B␤C:␤...A␤»
04:53 ChoHag Seems like A's submethod is leaking into C when it's a multi.
04:53 llfourn joined #perl6
05:10 Sgeo http://doc.perl6.org/type/Pair
05:10 Sgeo Should probably have the :x($foo) syntax
05:12 ShimmerFairy it does, though. (see :key<value> near the top)
05:13 Sgeo That's for strings though, iiuc
05:16 ShimmerFairy yeah, but it's just sugar for :key('value')
05:17 Sgeo Might not be obvious to a newbie reading the docs?
05:17 ShimmerFairy Fair enough, though there might be some sort of "general overview" page describing it already. (Certainly wouldn't hurt, I don't think.)
05:19 tony-o ChoHag: that looks like a bug
05:23 Sgeo m: grep Failure.new("FAIL"), 0, 1
05:23 camelia rakudo-moar d8fa56: ( no output )
05:23 jdv79 tony-o: why did you create 2 HTTP::Server dists?
05:24 tony-o jdv79: what do you mean?
05:24 tony-o one is a role..
05:24 jdv79 Async and Threaded seem odd name choices as rakudo's async uses threads.
05:24 tony-o one uses an ::Async socket, the other uses blocking sockets in threads
05:25 jdv79 they both look like classess to me
05:25 jdv79 ah
05:25 tony-o i thought you meant HTTP::Server - not those two things
05:26 jdv79 do you see both being used long term or just for experimentting?
05:27 tony-o the ::Threaded one will go away, it was temporary while the IO::Socket::Async problems were hammered out
05:28 tony-o they're interchangable, though, both abide by 'HTTP::Server'
05:30 Sgeo Does it make sense to have both async and sync? If some library uses sync it becomes harder to do async stuff with that library. That's, like, a good thing (of few) that Node.JS does, force the entire ecosystem async with cultural and technical pressure
05:31 ChoHag Then don't use that library if you want async code.
05:32 jdv79 easier said than done
05:32 jdv79 sometimes there is no alternative
05:32 ChoHag Do you not have a text editor?
05:34 ChoHag (Yes yes. I know. I'm joking ... mostly)
05:35 tony-o they both use threads, they just use them differently
05:40 ChoHag If I have a class B is class A, and class C is class A, can I (at run time) create an instance of class B is class C?
05:45 rurban joined #perl6
05:45 ChoHag NB. Not "should I", "can I".
05:46 laouji joined #perl6
05:48 diana_olhovik_ joined #perl6
05:51 tony-o do you care if A is a role ?
05:52 Hor|zon joined #perl6
05:52 tony-o m: class A { has $.x = 5; }; class B is A { }; role C is A { }; my B $r .=new;  $r does C; $r.x.say;
05:52 camelia rakudo-moar d8fa56: OUTPUT«5␤»
05:53 tony-o m: class A { has $.x = 5; }; class B is A { }; role C is A { has $.y = 50; }; my B $r .=new;  $r does C; $r.y.say;
05:53 camelia rakudo-moar d8fa56: OUTPUT«50␤»
05:53 tony-o i'm too tired for this
05:53 ChoHag Yes because this is a thought experiment and I already know I can get a similar effect with roles.
05:54 ChoHag This is just sticking fingers in the plug socket to see what happens, not anything practical.
05:54 ChoHag If you want something practical and easy before you finally succumb to sleep, tell me how to distinguish at runtime between an instance and a type.
05:55 ugexe .DEFINITE?
05:57 ChoHag Ah! "There is one more macro:", just below the visible page.
05:59 domidumont joined #perl6
06:03 moritz \o
06:03 moritz http://blogs.perl.org/users/sterling_hanenkamp/2015/08/p6sgi-perl-6-web-service-gateway-interface.html
06:08 [Sno] joined #perl6
06:11 domidumont joined #perl6
06:14 jdv79 zostay++
06:15 domidumont joined #perl6
06:18 telex joined #perl6
06:35 zacts joined #perl6
06:45 krunen joined #perl6
06:48 FROGGS joined #perl6
06:53 Hor|zon joined #perl6
06:58 Sgeo m: my @a = 1,2,3; say map *+1, @a
06:58 camelia rakudo-moar d8fa56: OUTPUT«2 3 4␤»
06:58 Sgeo But map seems to use vararg, so how does it take @a like that?
06:59 Sgeo Does @a become multiple arguments in that context or something?
06:59 Sgeo s/vararg/slurpy/ # Use Perl6 terminology
07:00 ChoHag Can anything other than the first argument be the routine to apply?
07:01 ChoHag In which case all subsequent arguments are values to map over, and @a flattens.
07:02 ChoHag m: my @a = [1,2,3]; say map *+1, @a;
07:02 camelia rakudo-moar d8fa56: OUTPUT«4␤»
07:02 moritz note that [] does not flatten in slurpies
07:02 ChoHag m: my @a = [1,1,1]; say map *+1, @a;
07:02 camelia rakudo-moar d8fa56: OUTPUT«4␤»
07:03 ChoHag I know.
07:03 ChoHag Hooray! I had (whether given or not) an answer rather than a question!
07:03 ChoHag <-- Progressing.
07:10 darutoko joined #perl6
07:12 azawawi joined #perl6
07:12 azawawi hi
07:12 moritz \o azawawi
07:18 RabidGravy joined #perl6
07:21 Sgeo m: say [1,2,3].WHAT
07:21 camelia rakudo-moar d8fa56: OUTPUT«(Array)␤»
07:21 Sgeo Do I need to know Perl 5 to make sense of all this context stuff?
07:23 ChoHag It might help if you didn't.
07:23 brrt joined #perl6
07:24 dalek doc: ef6ea00 | moritz++ | / (2 files):
07:24 dalek doc: Document X::Channel::SendOnClosed
07:24 dalek doc: review: https://github.com/perl6/doc/commit/ef6ea002e0
07:24 dalek doc: 3446cd5 | moritz++ | lib/Type/ (2 files):
07:24 dalek doc: Document X::Channel::ReceiveOnClosed
07:24 dalek doc: review: https://github.com/perl6/doc/commit/3446cd5d64
07:33 pdcawley joined #perl6
07:38 RabidGravy morning!
07:40 jdv79 is it possible to make an obj look like a scalar and a list?
07:40 brrt yes, why not?
07:41 jdv79 how?
07:41 brrt m: my $a = [1,2,3]; say $a;
07:41 camelia rakudo-moar d8fa56: OUTPUT«1 2 3␤»
07:41 jdv79 cause i can't seem to do it.
07:41 virtualsue joined #perl6
07:41 brrt then you'll have to specify your question a bit more :-)
07:42 jdv79 no, i mean $foo = "asdf" would set $foo's scalar member and $foo.[1] would set into $foo's list member
07:50 brrt hmmm
07:50 brrt i think you can fake that
07:50 brrt but why would you
07:51 jdv79 i'm trying an overly clever interface for a path, either operate on the whole in str form or operate on the seperate parts
07:51 jdv79 surely p6 is up to the task;)
07:52 llfourn do you have a MyPath obj? If so I think you can just define a postcircumfix for MyPath...
07:52 jdv79 that gets me list ops, sure
07:52 llfourn though im not sure how assignment like MyPath $path = '/foo/bar' would work
07:52 jdv79 but how about $foo = '/bar/baz'?
07:52 jdv79 yeah
07:53 RabidGravy overr-ride assignment ;-)
07:53 llfourn I think in future you can do MyPath() $path to coerce it
07:53 jdv79 i think that is not allowed
07:54 Hor|zon joined #perl6
07:54 RabidGravy it's just make it a string sub-class with some list-like features
07:55 RabidGravy then the assignment would Just Work™
07:55 jdv79 that's what i'm asking about
07:55 jdv79 i don't know how to do it if its possible even
07:55 RabidGravy right, yiour question about assignment confused me
07:56 llfourn m: class Path is Str { }; my Path $p = '/foo/bar';
07:56 camelia rakudo-moar d8fa56: OUTPUT«Type check failed in assignment to '$p'; expected 'Path' but got 'Str'␤  in block <unit> at /tmp/E1SZkXxAvL:1␤␤»
07:57 llfourn How do you make subclass str assignment work to string?
07:57 dalek nqp: 3fec6e0 | hoelzro++ | src/vm/jvm/ (2 files):
07:57 dalek nqp: Create mapping and implementation for force_gc on JVM
07:57 dalek nqp: review: https://github.com/perl6/nqp/commit/3fec6e073b
07:57 dalek nqp: a317d34 | hoelzro++ | src/vm/jvm/stage0/ (10 files):
07:57 dalek nqp: Re-bootstrap JVM files for force_gc
07:57 dalek nqp: review: https://github.com/perl6/nqp/commit/a317d34a6d
07:57 dalek nqp: 426ca43 | hoelzro++ | src/vm/jvm/HLL/Backend.nqp:
07:57 RabidGravy I lied
07:57 dalek nqp: Add force_gc implementation for JVM backend
07:57 dalek nqp: review: https://github.com/perl6/nqp/commit/426ca43c74
07:57 dalek nqp: e99940c | FROGGS++ | src/vm/jvm/ (13 files):
07:57 dalek nqp: Merge pull request #240 from perl6/jvm-force-gc
07:57 dalek nqp:
07:57 dalek nqp: JVM force_gc
07:57 dalek nqp: review: https://github.com/perl6/nqp/commit/e99940c8fb
08:00 Sgeo How do you do a named argument slurpy that collects names that are used multiple times?
08:01 Sgeo :@x collects multiple xs, but *% is used for named slurpy
08:01 RabidGravy jdv79, would applying a role to the attribute work for you?
08:01 jdv79 example =?
08:02 RabidGravy Speo
08:02 jdv79 maybe in a lame way i can "is Proxy" to get hold of assignment 
08:02 Sgeo If I call
08:02 Sgeo foo :x(5) :x(6)
08:02 RabidGravy Speo, er you'd have to create the hash from a bunch of pairs
08:02 Sgeo ANd foo wants all named arguments
08:02 llfourn Sgeo: I think named args have to be unique, you want a list of pairs
08:03 Sgeo m: sub multix(:@x) {say @x; }; multix :x<hi> :x<bye>;
08:03 camelia rakudo-moar d8fa56: OUTPUT«Type check failed in binding @x; expected 'Positional' but got 'Str'␤  in sub multix at /tmp/cqCf3Nm6b8:1␤  in block <unit> at /tmp/cqCf3Nm6b8:1␤␤»
08:04 llfourn m: sub multix(:@x) { say @x }; multix [ :x<hi>, :x<bye> ];
08:04 camelia rakudo-moar d8fa56: OUTPUT«Too many positionals passed; expected 0 arguments but got 1␤  in sub multix at /tmp/niUx8P02Pp:1␤  in block <unit> at /tmp/niUx8P02Pp:1␤␤»
08:04 llfourn m: sub multix(:@x) { say @x }; multix :x([ :x<hi>, :x<bye> ]);
08:04 camelia rakudo-moar d8fa56: OUTPUT«x => hi x => bye␤»
08:05 Sgeo Look for this: sub fun (Int :@x) { ... }
08:05 Sgeo http://design.perl6.org/S06.html
08:06 llfourn Sgeo: You're right, looks like not yet implemented then..
08:06 Sgeo So... how to slurpy?
08:06 Sgeo And also I assume this will be fixed by December?
08:06 llfourn We can only hope :)
08:07 llfourn m: sub foo(*@pairs) { say @pairs }; foo x => 1, x => 2;
08:07 camelia rakudo-moar d8fa56: OUTPUT«Unexpected named parameter 'x' passed␤  in sub foo at /tmp/fdsfnW1ZuW:1␤  in block <unit> at /tmp/fdsfnW1ZuW:1␤␤»
08:08 llfourn m: sub foo(@pairs) { say @pairs }; foo [x => 1, x => 2];
08:08 camelia rakudo-moar d8fa56: OUTPUT«x => 1 x => 2␤»
08:08 Sgeo m: sub foo(*%pairs) { say %pairs }; foo x => 1, x => 2;
08:08 camelia rakudo-moar d8fa56: OUTPUT«x => 2␤»
08:08 llfourn that's only way I can think of
08:08 llfourn yeah % will always uniqueify
08:11 Sgeo Maybe by requesting the capture?
08:11 vytas joined #perl6
08:11 Sgeo m: sub foo(|cap) { say cap }; foo x => 1, x => 2;
08:11 camelia rakudo-moar d8fa56: OUTPUT«\(:x(2))␤»
08:12 Sgeo m: sub foo(|$cap) { say $cap }; foo x => 1, x => 2;
08:12 camelia rakudo-moar d8fa56: OUTPUT«5===SORRY!5=== Error while compiling /tmp/EO8X5hd6T3␤Obsolete use of | or \ with sigil on param $cap␤at /tmp/EO8X5hd6T3:1␤------> 3sub foo(|$cap7⏏5) { say $cap }; foo x => 1, x => 2;␤    expecting any of:␤        shape declaration␤»
08:13 RabidGravy Speo,
08:13 RabidGravy m: sub f( *@x) {say @x}; f((x => 1), (x => 2))
08:13 camelia rakudo-moar d8fa56: OUTPUT«x => 1 x => 2␤»
08:13 RabidGravy you can also de-nameify them by making the keys variavle
08:14 Sgeo Please stop calling me Speo, it's Sgeo and Speo does not ping me
08:15 RabidGravy please type in a bigger font then ;-p
08:16 llfourn sub f(*@x) {say @x}; f (x => 1, x => 2)
08:16 RabidGravy m: sub f( *@x) {say @x};my $x ="x"; f($x => 1, $x => 2)
08:16 llfourn m: sub f(*@x) {say @x}; f (x => 1, x => 2)
08:16 camelia rakudo-moar d8fa56: OUTPUT«x => 1 x => 2␤»
08:16 camelia rakudo-moar d8fa56: OUTPUT«x => 1 x => 2␤»
08:16 llfourn seems like they are the same :)
08:17 llfourn the space before the openning ( actually matters in p6
08:21 sqirrel joined #perl6
08:21 jnthn morning, #moarvm
08:21 yoleaux 2 Aug 2015 12:09Z <nine> jnthn: your commit 56ae33ea0a5ac3d54a5fef2aa15eab34f9e9594b broke &?CALLER::ROUTINE: role Marker { }; sub foo { say &?CALLER::ROUTINE ~~ Marker; }; my $test = sub { foo(); }; $test(); $test does Marker; $test();
08:21 yoleaux 2 Aug 2015 14:32Z <nine> jnthn: I can workaround missing &?CALLER::ROUTINE with nqp::getcodeobj(nqp::ctxcode(nqp::ctxcaller(nqp::ctx)))
08:21 nine Good morning, jnthn!
08:22 nwc10 jnthn: but this is #perl6!
08:22 jnthn oops!
08:22 jnthn good morning, #perl6 :)
08:22 jnthn nine: &?ROUTINE access through CALLER only worked before by accident; note that none of &?BLOCK/$?FILE/$?LINE are available that way either.
08:23 jnthn nine: I don't intend to put it back; ratehr, that functionality should be exposed through callframe.
08:23 jnthn *rather
08:24 nine jnthn: ok. Unfortunately callframe doesn't give any access to the CALLER ROUTINE either. But at least nqp does.
08:25 jnthn nine: Yes, I know callframe doesn't at the momnet; I was saying that it should get a method that calls nqp::getcodeobj(nqp::ctxcode, ...) to let you get hold of it.
08:26 nine Shall we call it .routine?
08:26 jnthn No, 'cus not everything is a routine
08:27 jnthn Hm, I see that CallFrame lacks .caller and .outer methods to navigate around too
08:28 jnthn .code would perhaps be general enough
08:28 nine S06 says: "(For instance, caller.hints('&?ROUTINE') will give you the caller's routine object."
08:28 azawawi hmmm what's wrong with this code: $method = $method.subst(/ (<[A..Z]>) /, {$0.lc}, :g);
08:29 nine jnthn: I'd be fine with .code. I can have a shot at implementing the mentioned methods over the next couple of days.
08:32 Hor|zon joined #perl6
08:38 jnthn nine: Wow, that's...ugly :) Please lets just make it .code, to match .line and .file. ;)
08:39 jnthn nine: Also, please do feel free to take that one; I need to use what brane I have for GLR.
08:40 DrForr .file, .line, .column ? - Though I imagine there *are* some people out there that read their code in proportional fonts...
08:40 jnthn DrForr: We can only present information we actually have. :)
08:41 jnthn (We don't store column in the bytecode annotations)
08:41 DrForr Ah.
08:41 nine jnthn: will do :)
08:42 rindolf joined #perl6
08:47 jnthn From backlog: you can't collect all arguments with the same name, later ones override earlier ones. I know S06 speculates on something with the @ sigil in the receiving method, but it's actually pretty much impossible to implement (to see why, think about how it interacts with multi-dispatch, or Capture literals)
08:55 dalek doc: 21fdb8b | moritz++ | lib/Type/Channel.pod:
08:55 dalek doc: Channel: document what happens when calling .close while a .receive is blocking
08:55 dalek doc: review: https://github.com/perl6/doc/commit/21fdb8bc90
08:57 spider-mario joined #perl6
09:05 vendethiel joined #perl6
09:10 vytas joined #perl6
09:10 virtualsue joined #perl6
09:24 vytas joined #perl6
09:31 moritz zostay: ping
09:32 moritz zostay: regarding P6SGI: on the one hand I love the ability to return a Promise or a Channel; OTOH it makes writing middlewares much more complicated, because a middleware must implement all the calling conventions, no?
09:33 moritz I wonder if there's a simpler solution
09:33 jnthn I read the doc and need to ponder it more, but I suspect a Supply might allow better throughput for the streaming stuff
09:34 moritz that was another thing I considered
09:34 azawawi joined #perl6
09:35 moritz but supplies are tricky in this situation, no?
09:35 jnthn How so?
09:35 moritz because the caller must be able to tap before any events are emitted
09:35 moritz or is that only a problem for on-demand supplies?
09:36 jnthn Oh, I was more thinking the API would return a Supply that is tapped in order to process the request.
09:36 jnthn Which will be much neater with the new "supply" keyword
09:37 jnthn Looking at the examples:
09:37 jnthn sub app(%env) {
09:37 jnthn start {
09:37 jnthn ...
09:37 jnthn Is how you write something to process a request off in the thread pool
09:37 espadrine joined #perl6
09:37 jnthn So you can use await, presumably
09:37 jnthn Though I guess maybe to spread computation
09:38 jnthn But with what I'm suggesting the streaming case becomes more like:
09:38 jnthn sub app(%env) {
09:38 jnthn supply {
09:38 jnthn ...
09:39 jnthn Which middleware - if it's not already on a thread pool thread - can just ".tap-on(ThreadPoolScheduler).tap(&send-output-to-client)
09:39 jnthn "
09:40 jnthn This gives much better thread affinity for the data in question
09:40 jnthn And so CPU cache locality
09:40 leont Yeah, supplies would make more sense to me too, but that's only after having worked with them for some time. To some extend it's an ackquired taste I guess.
09:42 jnthn Yeah, it's a producer/consumer threading model vs. a reactive one.
09:42 jnthn Generally, though, good performance depends on keeping inter-thread communication down.
09:43 jnthn And so far as I can see, that's only going to become more and more the case.
09:44 jnthn So any place that lacks natural temporal decoupling to render the cache effects of the inter-thread communication unimportant will suffer when you make unneeded movement of a flow between threads.
09:44 jnthn And that's the case here really: you just produced a bunch of data and you want to toss it into a socket (maybe after some further processing).
09:46 jnthn The Channel approach means you shove inter-thread communication there, and if the next layer down wants to actually process the data then the thread doing so will have to grab all of the data into its cache, while with the Supply one you're still on the same thread.
09:47 jnthn If anyone with a blogs.perl.org account wants to post a link to this, feel free
09:47 * jnthn gets back to GLRing :)
09:48 brrt S32-io/IO-Socket-Async.rakudo.moar hangs, but you're probably aware of that
09:49 jnthn brrt: I wasn't; haven't seen it do that in a long, long time... :(
09:49 brrt oh :-(
09:50 brrt well, you probably know i'm on linux
09:50 brrt and maybe it helps if i say that i use unoptimized builds?
09:50 jnthn Maybe
09:50 jnthn Does it happen repeatably?
09:54 brrt quite :-)
09:58 g4 joined #perl6
09:58 g4 joined #perl6
10:03 azawawi tony-o: ping
10:03 darutoko- joined #perl6
10:04 dalek doc: 0441841 | smls++ | lib/Language/subscript (2 files):
10:04 dalek doc: rename page 'subscripting' -> 'subscripts'
10:04 dalek doc: review: https://github.com/perl6/doc/commit/0441841633
10:06 aindilis` joined #perl6
10:07 TimToady_ joined #perl6
10:08 ponbiki_ joined #perl6
10:08 rindolf joined #perl6
10:08 smls joined #perl6
10:11 araujo joined #perl6
10:16 silug_ joined #perl6
10:22 RabidGravy joined #perl6
10:30 pecastro joined #perl6
10:35 renormalist joined #perl6
10:36 sqirrel joined #perl6
10:42 dalek doc: fb90586 | moritz++ | lib/Language/subscripts.pod:
10:42 dalek doc: Fix typo, LLFourn++
10:42 dalek doc: review: https://github.com/perl6/doc/commit/fb90586a5b
10:45 smls oops :P
10:51 nine Posted an irc.perl6.org link to the P6SGI blog post
10:54 pierrot joined #perl6
10:57 dalek doc: 32aa3fd | smls++ | lib/Language/subscripts.pod:
10:57 dalek doc: subscripts: fix :delete section example; ronaldxs++
10:57 dalek doc: review: https://github.com/perl6/doc/commit/32aa3fd7eb
11:05 tony-o azawawi: whats up? im getting ready to leave for the airport?
11:05 tony-o s/\?$//
11:05 azawawi tony-o: any plans to integrate Bailador with HTTP::Server::* ?
11:07 tony-o what do you mean?
11:08 azawawi tony-o: Bailador to use HTTP::Server::Threaded as a backend instead of HTTP::Easy::PSGI
11:09 tony-o if youd like to and you build it around the http::server role - http::server::async is almost ready
11:09 azawawi Bailador::Async ?
11:10 azawawi or Bailador::Threaded...
11:10 tony-o i didnt have anything i intended to write right away or anything
11:10 azawawi ok on it :)
11:10 azawawi thanks for the reply
11:11 tony-o after async, i have like 10 other modules that are probably broken :/)
11:12 azawawi like?
11:22 nine The modern way would be a PSGI (or P6SGI) backend for Bailador and HTTP::Server::* based PSGI implementations.
11:22 tadzik well, internally that's how it works :)
11:22 * nine shuts up then
11:22 tadzik bailador is only using http-easy because it was the only thing that worked anyway
11:23 tadzik or so I remember :)
11:23 tadzik yeah, Bailador::dispatch_psgi seems to be the psgi app
11:24 tadzik https://github.com/tadzik/Bailador/blob/master/lib/Bailador.pm#L108
11:26 azawawi tadzik: i see
11:26 azawawi nine: thanks :)
11:27 tony-o psgi seems dated
11:33 RabidGravy well it's six or so years old
11:39 Zoffix joined #perl6
11:42 gfldex joined #perl6
11:43 brrt joined #perl6
12:10 zakharyas joined #perl6
12:11 itz much of the perl5 world probably still uses CGI TBH
12:13 Zoffix Probably. Legacy stuff and what not.
12:13 virtualsue a lot of the world is legacy
12:15 jnthn Legacy = the code made it into production and is doing useful stuff. Becoming legacy is success. :)
12:16 Zoffix Legacy = the code that is too expensive to upgrade. :)
12:16 jnthn We might often wish folks had left us a better legacy, alas... :)
12:18 brrt huh, i recently read 'technical depth' for 'technical debt'
12:19 brrt and i thought, that's not even wrong
12:21 colomon joined #perl6
12:22 itz the code you wrote might be "legacy" but mine is "heritage" ;)
12:23 Zoffix lol
12:24 kkielak joined #perl6
12:25 oxide94 joined #perl6
12:26 oxide94 left #perl6
12:31 leont joined #perl6
12:31 jdv79 self.bless returns an instance?
12:32 nine yes
12:33 nine m: class Foo { method new() { return self.bless } }; Foo.new.perl.say
12:33 camelia rakudo-moar d8fa56: OUTPUT«Foo.new␤»
12:35 RabidGravy m: enum G (Boo); # somewhat less that fabulous error message
12:35 camelia rakudo-moar d8fa56: OUTPUT«===SORRY!===␤Cannot invoke this object (REPR: Null, cs = 0)␤»
12:35 jdv79 i was getting : Cannot look up attributes in a type object
12:36 nine jdv79: with what code exactly?
12:37 lucasb joined #perl6
12:38 TimToady joined #perl6
12:41 jdv79 now i'm getting a different error
12:41 jdv79 https://gist.github.com/anonymous/4d6c3cff038c4b3131bd
12:41 jdv79 trying to access a private array attr in new
12:43 RabidGravy you probably want to pass the a => 1,2,3 to bless
12:43 jdv79 the docs are lacking on this sort of thing 
12:43 nine The whole process is somewhat less magical than one would expect. bless returns an instance, but it doesn't magically replace self in your class method. self still is your type object
12:43 jdv79 ok, but i used $obj not self
12:43 nine If you need to access the new object's privates, you have to do so in an object method like BUILD
12:45 jdv79 why not in new?
12:46 RabidGravy when you create the object using bless, you are getting a new object, you are not in *its* new so the attribute is private to you
12:47 jdv79 seems unusual
12:47 jdv79 and i didn't notice that in the docs
12:47 nine jdv79: it's really just a consequence of the construction process being as little magical as possible. The advantage is, that it's very customizable.
12:48 cognominal joined #perl6
12:49 RabidGravy just added something to that gist
12:50 jdv79 so to set a priv attr at construction one needs to pass to bless and defined a BUILD to catch it?
12:50 RabidGravy dunno why it shagged up the formatting thoug
12:51 RabidGravy well that's one way of doing it yes
12:52 jdv79 ok
12:52 * jdv79 can't wait for comprehensive docs
12:52 jdv79 i thought i had more patient to dig but its like every little thing
12:53 jdv79 gets to be too much :(
12:53 jdv79 *patience
12:53 jdv79 thanks
12:53 RabidGravy this is explained in the http://docs.perl6.org/language/classtut#Constructors
12:56 jdv79 ok.  i see it now.
12:57 jdv79 i was reading the spec and then hit that doc and missed taht bit
12:59 RabidGravy :)
13:04 dalek doc: c470d2c | smls++ | lib/Language/subscripts.pod:
13:04 dalek doc: subscripts: Fill in the "Basics" section
13:04 dalek doc: review: https://github.com/perl6/doc/commit/c470d2c8da
13:09 smls jnthn, lizmat: Since you seem to be the experts on that topic, it would be nice if one of you could take a look at http://doc.perl6.org/language/subscripts#Custom_types (everything from that heading to the end of the page) to check if what I wrote is correct and if the example code looks sane.
13:15 PerlJam smls++ nice example
13:16 timotimo oi
13:16 timotimo er
13:16 timotimo o/
13:16 timotimo do we really want the heading as well as the first line of tables rendered in yellow?
13:17 timotimo rather than having headings in a different color, so that the colors stay somewhat alternating?
13:17 timotimo or perhaps switch up even and odd in tables?
13:17 timotimo it's probably important to make the style work for tables with and without headers ...
13:18 PerlJam timotimo: I'm fine with the even/odd colors, but the headings need a different color IMHO
13:18 smls PerlJam:  My intention for that example was to demonstrate all 3 different "levels" of providing AT-KEY:  1) simple delegation  2) explicit method that simply forwards another object's AT-KEY   3) method that returns a custom container
13:18 smls timotimo: I'm not really happy with the table style either. It's somewhere on my todo list.
13:19 timotimo good to know, thanks!
13:22 PerlJam smls: one random thing that occurs to be because of your doc is that .elems seems out of place.  Or it makes me think that there should be an .ELEMS that .elems is automatically aliased to.
13:23 khw joined #perl6
13:23 smls Well, in general you'd also implement .list .keys .values .iterator etc
13:24 smls .elems just happens to be used by subscripts in addition to users calling it directly
13:24 awwaiid joined #perl6
13:24 smls but that's not so different from .list/.iterator being called by `for` or `map`.
13:25 PerlJam true
13:26 PerlJam I guess my nice, neat mental box that says "uppercase may be called for you by Perl" doesn't want it to be any other way :)
13:27 smls everything is better than Python's ghastly __foo__ naming scheme for special/interpreter-called methods ;)
13:30 PerlJam I dunno ... those are certainly unambiguous :)
13:30 dalek roast: 86cfb03 | (Stefan Seifert)++ | S06-advanced/callframe.t:
13:30 dalek roast: CallFrame.code should now return the code object
13:30 dalek roast:
13:30 dalek roast: As per jnthn++'s suggestion:
13:30 dalek roast: http://irclog.perlgeek.de/perl6/2015-08-03#i_10994354
13:30 dalek roast: review: https://github.com/perl6/roast/commit/86cfb03faf
13:30 dalek rakudo/nom: a38b59c | (Stefan Seifert)++ | src/core/CallFrame.pm:
13:30 dalek rakudo/nom: Support CallFrame.code to return the code object
13:30 dalek rakudo/nom:
13:30 dalek rakudo/nom: As per jnthn++'s suggestion:
13:30 dalek rakudo/nom: http://irclog.perlgeek.de/perl6/2015-08-03#i_10994354
13:30 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/a38b59cc8c
13:37 skids joined #perl6
13:47 brisby joined #perl6
13:50 synbot6 joined #perl6
13:52 synbot6 joined #perl6
14:00 lucasb evalbot control version
14:00 camelia This is evalbot revision eb33872
14:00 lucasb idk if "evalbot control pull" is enough to update the evalbot
14:01 lucasb it seems there is a newer revision that makes github gist api work again
14:06 lucasb sorry! I issued 'evalbot control restart'. I thought it would come back automatically
14:07 lucasb I thought it was running inside a 'while true; do ...; done' loop
14:08 jnthn lucasb: It...usually does come back, from memory.
14:08 synbot6 joined #perl6
14:09 RabidGravy boom
14:15 timotimo it ought to, yeah, i think so
14:15 timotimo nine: can you have a quick look-see?
14:15 lucasb I'm very very sorry! My intent was just update it. Someone with a hack account will have to take a look, I guess.
14:16 FROGGS it is not not running on hack AFAIK
14:16 timotimo correct
14:16 lucasb oh
14:16 timotimo it runs on nine's box
14:17 timotimo it's no problem, lucasb, we'll be back to working order in no time
14:26 RabidGravy and in the interim we can talk among ourselves ;-)
14:31 nine Can't locate JSON.pm in @INC (you may need to install the JSON module) BEGIN failed--compilation aborted at lib/EvalbotExecuter.pm line 79..
14:33 timotimo huh, that's interesting
14:33 lucasb oh, right, Mouq++ added the JSON dependency when he fixed the github gist api
14:33 timotimo would it have to be JSON::PP or JSON::XS?
14:33 brrt joined #perl6
14:35 RabidGravy don't they have the same interface?
14:35 FROGGS I think so
14:35 nine JSON will use JSON::XS if installed
14:36 nine Is this something camelia should be able to do or should I try to install JSON into camelia's perlbrew perl?
14:36 FROGGS I don't think camelia can install Perl 5 modules
14:37 camelia joined #perl6
14:37 nine m: say "I'm back :)"
14:37 RabidGravy got the arse now
14:38 camelia rakudo-moar a38b59: OUTPUT«I'm back :)␤»
14:39 lucasb thank you, nine++; and sorry for the trouble :)
14:39 lucasb evalbot control version
14:39 camelia This is evalbot revision 2267d41
14:39 lucasb m: https://gist.github.com/anonymous/d2efba968f2a8be140a2
14:39 camelia rakudo-moar a38b59: OUTPUT«hi␤»
14:40 lucasb works fine now :)
14:40 timotimo very good
14:42 RabidGravy fix it real good
14:49 hoelzro good morning, #perl6!
14:49 nine And a very good morning to you, hoelzro!
14:49 hoelzro o/ nine!
14:51 nys joined #perl6
14:52 b2gills Chrome crashed so I think it's time for $ apt-get upgrade && reboot
14:52 b2gills left #perl6
14:53 RabidGravy chrome has been really, really bad since the last update
14:54 * geekosaur has not had problems with chrome since disabling gpu support
14:54 * brrt has actually been using firefox for a while now
14:54 geekosaur somehow that makes it suck both cpu and memory without limit
14:54 brrt oh, and i can't for the life of me get nouveau to do something interesting
14:54 geekosaur every so often I fire up an updated firefox, promptly get reminded why I detest it, and go back to chrome
14:55 jnthn Funny, chrome crashed here today too...after running for a month solid.
14:55 jnthn Remembered my tabs across two windows <3
14:57 b2gills joined #perl6
14:57 brrt hmm, i actually hard shutdown my laptop usually
14:58 geekosaur that said, I update chrome as often as updates are released, so it's unusual (at least of late, "thanks" Hacking Team) for Chrome to reach a week of uptime ;)
15:00 b2gills My computer has been trying to get me to update Chrome, and the kernel for more than a week
15:06 zostay jnthn, moritz: i'm not opposed to using a Supply instead
15:06 zostay as for whether or not using a Promise/Channel/Supply will cause trouble for the middleware, that will happen anyway
15:07 zostay if you want to write complete middleware in PSGI, you have to handle all the callback cases, generally done by using a Plack helper
15:08 zostay completely functional middleware must implement everything for both the server and app sides of the spec
15:08 b2gills I think there is a better interface "hiding" in Perl 6 that no-one has "found" yet.
15:09 [ptc] joined #perl6
15:09 burnersk joined #perl6
15:09 moritz b2gills: maybe one could come up with a middleware design where dispatching to the application is just a callsame() came
15:10 moritz *call
15:14 zostay i hadn't suggested it in the spec, but i don't see why middleware can't be applied by just calling .wrap() on the app routine
15:15 moritz one could also imagine an API built around returning promises (even in the synchronous cases)
15:15 moritz zostay: well, the problem isn't calling; it's dealing with the return value
15:15 moritz zostay: imagine a middleware that always wants to add a header ("Cache-Control", for example)
15:15 ugexe i use the promise method for synchronous stuff quite a bit
15:16 moritz zostay: so it has to do check the type of the return value, and do one thing if it's Positional, and another if it's a Promise, and a third if it's a Channel
15:17 zostay right... the only way around that is to require every app implement a promise that returns an iterable that returns a channel/supply for content
15:17 zostay afaict
15:17 zostay the point is to make app writing easy for the app authors, and make server and middleware writing possible
15:18 zostay if you use the channel or the promise interface you are making a statement that something about your performance is different than a typical app
15:18 telex joined #perl6
15:18 zostay that's the case if you return a callback in PSGI
15:19 moritz well, there's an alternative
15:19 moritz one could pass around proper objects insteads of hashes / arrays
15:20 moritz and those have event callbacks
15:20 moritz so a middleware could register a on-header-available callback that adds a header, for example
15:21 zostay is there a generic type in P6 that does that?
15:21 moritz (I know this is quite a departure from the current API)
15:21 moritz zostay: no; would need be a custom type
15:21 moritz another option would be to supply such a type as a utilty/wrapper around the data structure
15:22 zostay then i demur and say you've described a high level framework, not P6SGI which is lowest-common-denominator
15:22 zostay the reference implementation can provide helpers, but the standard itself must be low level
15:22 zostay PSGI/Plack have demonstrated success in this
15:23 moritz agreed, but it's a small low-level API
15:23 moritz the larger it becomes, the more painful its low-levelness becomes
15:34 zostay i need to finish the reference implementation and then we can try things out better
15:37 nine In any case I'm happy to see things moving on this front :)
16:00 Begi joined #perl6
16:01 Begi Hey #perl6 ! How can I get the total number of lines in a file ?
16:02 Begi Is there like perl 5 a $. var ?
16:02 PerlJam Begi: $*IN.ins  (or some other filehandle)
16:04 PerlJam m: END { say $*IN.ins }  # curious
16:04 camelia rakudo-moar a38b59: OUTPUT«0␤»
16:04 PerlJam figured
16:04 PerlJam m: END { say $*ARGFILES.ins }  # how about this?
16:04 camelia rakudo-moar a38b59: OUTPUT«(Any)␤»
16:05 PerlJam that was unexpected
16:05 PerlJam (I would have expected 0 alos)
16:20 spider-mario joined #perl6
16:23 timotimo $*ARGFILES isn't quite perfectly smart yet
16:40 rangerprice joined #perl6
16:48 yogan joined #perl6
16:53 Begi Ok thanks. And what's the easiest way to select the last 5 lines of a file ?
16:54 TimToady m: my @lines = lines(); say @lines[*-5 .. *]
16:54 camelia rakudo-moar a38b59: OUTPUT« Slán! Slán go fóill, a Dhún na nGall, a chontae shéimh gan smál, Is do d’fheara breáth’ in am an ghá nár úmhlaigh riamh roimh Ghall; Tá áit i mo chroí do gach fear is gach mnaoi is gach páiste beag agus mór Atá beo go buan gan bhuairt …»
16:57 Begi Ok thanks. Eh... Is camelia ok ?
16:59 moritz m: say 'yes, sir'
16:59 camelia rakudo-moar a38b59: OUTPUT«yes, sir␤»
17:00 Begi :P
17:00 DarthGandalf joined #perl6
17:05 * TimToady wonders if the Prince of Wales knows Welsh...
17:06 llfourn fairly sure he doesn't
17:10 itz he spoke some Welsh at his investiture
17:12 domidumont joined #perl6
17:12 colomon joined #perl6
17:16 RabidGravy he did indeed, but we're old enough to remember that
17:19 RabidGravy it of course could have been garbage as I for one don't know Cymraeg at all
17:20 RabidGravy horrifyingly I know more Catalan
17:20 vendethiel my "Programming Perl" books (page 1008, under the "use charnames;" section): `"AMELIA" => "DROMEDARY CAMEL"`. Did camelia change name? :P
17:21 dalek perl6-roast-data: b8b5cbe | coke++ | / (9 files):
17:21 dalek perl6-roast-data: today (automated commit)
17:21 dalek perl6-roast-data: review: https://github.com/coke/perl6-roast-data/commit/b8b5cbe23b
17:24 lucasb .u camel
17:24 yoleaux U+1F42A DROMEDARY CAMEL [So] (🐪)
17:24 yoleaux U+1F42B BACTRIAN CAMEL [So] (🐫)
17:24 [Coke] .u moose
17:24 yoleaux U+1509 CANADIAN SYLLABICS MOOSE-CREE SK [Lo] (ᔉ)
17:26 lucasb No butterfly in unicode :(
17:27 mohij joined #perl6
17:30 [Coke] .u butt
17:30 yoleaux U+1F518 RADIO BUTTON [So] (🔘)
17:30 yoleaux U+1F532 BLACK SQUARE BUTTON [So] (🔲)
17:30 yoleaux U+1F533 WHITE SQUARE BUTTON [So] (🔳)
17:34 dha joined #perl6
17:45 lizmat joined #perl6
17:57 vendethiel are the "less" directives actually considered in P5?
17:58 aristotle joined #perl6
18:00 llfourn joined #perl6
18:00 aristotle zostay: I think you are being too all-or-nothing when you say if you use the channel or the promise interface you are making a statement that something about your performance is different than a typical app
18:01 FROGGS joined #perl6
18:02 aristotle zostay: I don’t think there’s any point in Perl 6 for distinguishing the deferred/immediate cases. while there may be a case for distinguishing the streaming case
18:03 lizmat good *, #perl6!
18:03 lizmat PSA: working on the P6W at the moment...
18:03 aristotle zostay: you don’t want to have to use the PSGI deferred style in Perl 5 if you don’t need to, because it’s so damn inconvenient, because the language doesn’t give you any better option
18:03 aristotle zostay: but in Perl 6 it’s just putting `start { }` around your code. that’s nothing
18:04 lizmat if anybody thinks of something that should be mentioned, please let me know!
18:06 aristotle zostay: the real inconvenience when writing middlewares is the deferred vs immediate case difference. the streaming vs immediate body difference would be simple to handle
18:06 zakharyas joined #perl6
18:06 [Coke] the upcoming swiss perl workshop, maybe?
18:06 [Coke] (for liz)
18:06 lizmat [Coke]: already in there, but [Coke]++ for mentioning  :-)
18:12 aristotle zostay: many middlewares (maybe most) don’t need to look at the response body at all, so would be unaffected by the body having two possible forms. but many middlewares need to modify the response headers, so they do have to handle the deferred vs immediate distinction
18:15 diana_olhovik joined #perl6
18:15 ChoHag joined #perl6
18:16 aristotle zostay: and I don’t see the value of making that distinction in Perl 6, since it doesn’t cost apps anything appreciable to uniformize the response (and that’s the only place where that might incur any costs. every other part of the system becomes simpler for having fewer cases to deal with)
18:16 aristotle moritz, leont: ping ^
18:19 pierrot joined #perl6
18:20 bartolin_ good evening, #perl6
18:34 leont aristotle: you mean something like always returning a Supply, and middlewares essentially doing .map on those?
18:42 tphilipp joined #perl6
18:42 tphilipp left #perl6
18:46 aristotle leont: possibly. not firm enough in Perl 6 to say for sure what to use
18:50 PerlJam But, laziness + composable async primitives for the win in any case.
18:50 estrabd joined #perl6
18:51 Mhoram joined #perl6
18:52 zostay aritstotle, thx... so can i sum up your thoughts as being, "Why not always return a Promise?"
18:53 aristotle leont: all I can say is the real pain point of PSGI is deferred vs immediate response, whereas streaming body is a side show, and it would be good to remove the inconvenient distinction. I’d question the need for non-/streaming body distinction too, on principle, but I don’t feel strongly about that one
18:53 aristotle zostay: yeah
18:54 zostay that sounds doable to me
18:54 jnthn A Promise is trivially coercable into a Supply
18:55 jnthn Which probably helps the streaming thing
18:55 jnthn Uh, or uniformly coding against the streaming thing
18:55 jnthn But letting folks write start { ... } when that's enough
18:56 zostay well, the streaming thing is primarily for the content... generally while deferred mostly impacts the delivery of headers
18:56 zostay there are too many adverbs in that last sentence
18:56 aristotle and the headers are of much greater interest to other components than the body
18:57 b2gills Is there a nicer way of writing `my %h := Hash[Any,Any].new;` or `my %h := :{};` where %h will always be of the same type?
18:57 jnthn my Any %h{Any};
18:57 jnthn Though the first Any is a tad redundant if you just want the keys to be objects
18:57 zostay anyone have a suggestion on what the reference implementation should be called? i have a name, but i don't like it
18:59 jnthn Well, psgi is an anagram of pigs, so something about ham or bacon maybe... :P
19:00 b2gills Porki?
19:00 mst for some reason I always end up with the Tool satan song in my head except with baaaacon instead of saaaatan
19:01 TimToady what's your kevin psgi number?
19:01 aristotle ouch
19:01 zostay lol
19:02 TimToady Inversion of Puntrol...
19:02 timotimo mst: UND KEINE SCHINKEN!!
19:04 mst timotimo++
19:06 aristotle zostay: the only thing that comes to mind that’s vaguely in keeping with Rack (Ruby) → Plack (Perl) is maybe Clack (Camelia), which is meh. can’t think of any good way to finnagle “perl 6” or “Six” or something like that into there
19:06 ChoHag Clacks
19:07 ChoHag A la Discworld
19:07 aristotle oh wow I totally missed that
19:07 lucasb Clack is the Common Lisp implementation
19:07 aristotle lucasb: oh :(
19:07 [Coke] Plack6?
19:07 jjido joined #perl6
19:07 ChoHag Oh now *that's* exciting.
19:08 jnthn Slack?
19:08 jnthn (For six...)
19:08 zostay that's where i went with it, i want to avoid confusing it with Plack... i ended up with Spackle
19:08 RabidGravy +1
19:09 TimToady well, how 'bout Plack -> Gingivitis?
19:09 aristotle slack occurred to me but I dunno? tho in a way it’s cool. but it’s going to have a hell of a time competing against the slack.com chat service thing for googlejuice
19:09 zostay could name it after the startup script, slackup
19:09 TimToady Pl6ck would really confuse the dyslexics
19:10 aristotle TimToady: you’re not helping :)
19:10 RabidGravy shouldn't the start up script be call slackoff ;-)
19:10 jnthn Heh, "Filling" is what comes after plack...and middleware kinda fills the gap ;P
19:11 b2gills I've been trying to come up with a Perl 6 implementation of https://en.wikipedia.org/wiki/De_Bruijn_sequence that shows off Perl 6's features, but I've got nothing.
19:12 zostay Crack and then the startup script is crackup
19:12 aristotle jnthn: yeah re gingivitis, I was going to say it’s unfortunate enough that “Plack” is the colloquial spelling of (dental) plaque in German
19:13 TimToady if you implement with Supply, you could call it Supple
19:13 moritz b2gills: if you post a straight Perl 6 version, I can try to make it more idiomatic
19:14 zostay there was an early attempt by someone named Plackdo
19:15 * aristotle . o O ( Sixpack? )
19:15 moritz aristotle: Sixplack?
19:15 ChoHag Sixplack
19:15 aristotle heh
19:16 zostay Cameliack
19:16 [Coke] sixplack++
19:16 lizmat this weeks Perl 6 Weekly just got published!   https://p6weekly.wordpress.com/2015/08/03/2015-31-blogging-along/
19:17 cognominal joined #perl6
19:17 lizmat publishing a P6W while going at 180 km/hour on the German Autobahn is a special experience
19:17 aristotle how does it feel
19:17 b2gills moritz: Part of the problem is I don't really know Python so I'm guessing as it is, I did find one in JS that was easier to figure out https://en.wikipedia.org/wiki/De_Bruijn_sequence (throw out all code dealing with `memoArr`)
19:18 lizmat aristotle: like living in the fast lane  :-)
19:18 lizmat seems it is my turn to drive
19:18 lizmat &
19:19 RabidGravy sorry I didn't do any new modules but I started four new ones each more distracting than the last
19:20 ChoHag Put the yaks away.
19:25 RabidGravy but at least I've got a nice pattern for warapping C++ libraries, a lot of ideas for building objects from binary data and some crack induced ideas about ovr-riding enumerations
19:26 moritz today's one-liner: finding all the p6 modules that have a 1; at the end
19:26 virtualsue joined #perl6
19:26 moritz moritz@hack:~/p6/perl6-all-modules$ git ls-files|grep -E 'pm6?$' | perl6 -ne '.say if slurp($_) ~~ /1\;\s*$/'
19:26 ChoHag Wrapping C++ would be nice. People do insist on using it despite it.
19:27 leont People use C++ because there's not much alternative in its genre. D is largely a cleaned-up C++, but it doesn't have the same momentum or exosystem
19:28 [Coke] leont: that sounds… familiar.
19:28 leont It does
19:28 timotimo .o( it wouldn't be terribly bad if what we have was called Frack )
19:29 RabidGravy :) yeah but the hippies might start a camp outside worried we're poisoning the water
19:30 ChoHag I killed the debugger.
19:30 ChoHag Unhandled exception: ctxlexpad needs an MVMContext
19:30 RabidGravy but you did'nt shoot the sheriff
19:30 ChoHag Nor deputy.
19:31 ChoHag Don't wanna fuck with LEOs these days.
19:31 yqt joined #perl6
19:31 ugexe in america it is safer to just shoot the LEO
19:35 rjbs on the contrary, SpaceX has been having a lot of trouble shooting things into LEO
19:36 timotimo m)
19:36 timotimo what's that other meaning of LEO?
19:36 timotimo oh
19:36 timotimo law enforcement officer?
19:36 itz low earth orbit
19:38 timotimo i was asking for "that other meaning"
19:38 timotimo i know about low earth orbit :)
19:38 itz ah
19:38 RabidGravy leprechaun emerency organization
19:38 itz leo sayer?
19:38 timotimo http://blogs.perl.org/users/aaron_baugher/2015/08/simple-game-in-perl-6.html ← can somebody send a comment this person's way that .pick isn't mutating on the array you're using, and perhaps suggest using .pick(*) to get a shuffled list of the cards to shift or pop from?
19:38 dalek roast: 1d56978 | usev6++ | S02-types/nested_arrays.t:
19:38 dalek roast: Change test for RT #98954
19:38 dalek roast:
19:38 dalek roast: and remove duplicate ticket number
19:38 dalek roast: review: https://github.com/perl6/roast/commit/1d569789b9
19:38 synbot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=98954
19:40 timotimo and calling methods "postfix functions" is ... interesting %)
19:41 hoelzro does nqp-j have anything like MoarVM's special_return
19:41 * hoelzro was thinking of trying his hand at implementing DESTROY on the JVM
19:48 [Coke] 1,031 RTs open
19:50 b2gills m: https://gist.github.com/dwendt/5cc5223d4686d0e33209
19:50 camelia rakudo-moar a38b59: OUTPUT«5===SORRY!5=== Error while compiling /tmp/AyW8s4XgOd␤Preceding context expects a term, but found infix = instead␤at /tmp/AyW8s4XgOd:1␤------> 3memoArr =7⏏5 {};␤»
19:51 b2gills damn middle click
19:51 b2gills m: https://gist.github.com/b2gills/18d9496d0634bb83cf78
19:51 camelia rakudo-moar a38b59: OUTPUT«0 0 0 1 0 1 1 1␤a a b a c a d b b c b d c c d d␤a a a bb a a ccc a a dddd a bb bb a bb ccc a bb dddd a ccc bb a ccc ccc a ccc dddd a dddd bb a dddd ccc a dddd dddd bb bb bb ccc bb bb dddd bb ccc ccc bb ccc dddd bb dddd ccc bb dddd dddd ccc ccc ccc dddd…»
19:54 jjido b2gills: nice!
19:55 jjido b2gills: what does [^$k] do?
19:55 b2gills Array.new( 0 ..^$k )
19:56 b2gills Array.new( Range.new( 0, $k, :excludes-max ))
19:57 jjido b2gills: all right got it
19:57 jjido b2gills: and "!%%" ?
19:58 lucasb not divisible :)
19:59 jjido makes sense
20:00 b2gills I really don't like the sub `db` in the middle
20:01 [Coke] RT #121145 is closable with tests if someone wants some karma. :)
20:01 synbot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=121145
20:01 llfourn joined #perl6
20:02 jjido b2gills: I see what you mean but that's the algorithm. You could pass @a and @sequence as arguments
20:02 * skids still finds it strange that with all the crazy operators we never got something for ($a - $a % $b) and the ciel version thereof.
20:04 jjido $a -% $b
20:04 [Coke] m: say 20 -% 10
20:04 camelia rakudo-moar a38b59: OUTPUT«5===SORRY!5=== Error while compiling /tmp/1uM5pz_IsP␤Two terms in a row␤at /tmp/1uM5pz_IsP:1␤------> 3say 20 -%7⏏5 10␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement end␤        statem…»
20:05 jjido [Coke]: see, it could be added
20:05 jjido [Coke]: btw the answer is 20
20:14 skids "set phasers to stun."  "Captain, there appears to be a parrot in my phaser"
20:15 [Coke] didn't we just talk about chaining ~~ ?
20:15 [Coke] r: say 0 ~~ 0 ~~ 0;
20:15 camelia rakudo-{moar,jvm} a38b59: OUTPUT«False␤»
20:16 [Coke] masak: if the current state of ~~ and chaining is settled, maybe RT #81336 can be rejected?
20:16 synbot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=81336
20:19 ShimmerFairy [Coke]: it was decided that ~~ is chaining after all (since it was determined that learning that ~~ chains is less disruptive than changing its precedence)
20:20 RabidGravy so I can roll back all the changes that occasioned?
20:21 ShimmerFairy m: say ("foo" ~~ "foo") && ("foo" ge "bar");  say "foo" ~~ "foo" ge "bar";  # these should be the same, so the bug is still valid
20:21 camelia rakudo-moar a38b59: OUTPUT«True␤False␤»
20:22 dalek roast: 235a8c9 | usev6++ | S02-types/set (2 files):
20:22 dalek roast: Add another two tests for RT #125611
20:22 dalek roast: review: https://github.com/perl6/roast/commit/235a8c9339
20:22 synbot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=125611
20:23 [Coke] ShimmerFairy: can you clarify on the ticket, then?
20:24 ShimmerFairy [Coke]: well, that's how all chaining ops work, so unless you're referring to something else, I'm not sure what there is to clarify.
20:25 PerlJam ShimmerFairy: I think he means to add that example.
20:25 brisby joined #perl6
20:26 PerlJam ShimmerFairy: and if he didn't mean that, I'll ask you to please add your "expanded" chaining example to the ticket.  :-)
20:28 [Coke] PerlJam++
20:28 [Coke] yes, please add that example as something that shoudl work but doesn't. (even better, write a test, and mention in the ticket which file the test went in)
20:29 mr_ron joined #perl6
20:30 mr_ron m: https://gist.github.com/ronaldxs/fe83eac02aa690f787d3
20:30 camelia rakudo-moar a38b59: OUTPUT«0␤4␤»
20:30 mr_ron Could someone look at the gist - I think it's a bug with Proxy
20:31 timotimo huh?
20:31 timotimo you mean the 0 in there is problematic?
20:32 timotimo what did you expect it to print instead, mr_ron?
20:32 mr_ron Yes - the zero doesn't make much sense.  I don't know that the 4 result makes sense either though ...
20:33 timotimo i think the 0 is absolutely correct
20:33 timotimo what else would it be?
20:33 mr_ron something like Proxy.new
20:33 timotimo oh
20:33 timotimo well, you'll have to := instead of =
20:33 timotimo otherwise you'll just fetch the value of that proxy and put it into $p
20:35 timotimo m: my $p := Proxy.new( FETCH => { 1 }, STORE => -> $, $ { say "boing" } ); say $p.perl
20:35 camelia rakudo-moar a38b59: OUTPUT«1␤»
20:35 timotimo m: my $p := Proxy.new( FETCH => { 1 }, STORE => -> $, $ { say "boing" } ); $p = 10
20:35 camelia rakudo-moar a38b59: OUTPUT«boing␤»
20:35 timotimo m: my $p = Proxy.new( FETCH => { 1 }, STORE => -> $, $ { say "boing" } ); $p = 10
20:35 camelia rakudo-moar a38b59: ( no output )
20:35 timotimo you see? the := vs = makes the big difference
20:37 mr_ron I am playing with it now ... thank you very much for your clarification
20:38 ShimmerFairy [Coke]: yeah, I'm thinking of trying to fix it in a couple of minutes, and I'd start by writing tests :)  (if I don't start on that soon, I'll just update the ticket)
20:40 timotimo sure, no problem :)
20:41 vendethiel http://www.reddit.com/r/perl6 <- can whoever has access to this subreddit modding remove the ad?
20:41 ShimmerFairy btw, would it be wise/recommended for me to symlink t/spec to my existing roast repository, so I don't have to deal with going between two copies of the same repo anymore? :)
20:42 timotimo i clicked the "remove" button
20:42 timotimo is it gone?
20:43 timotimo seems to be
20:45 mr_ron m: state $p := Proxy.new( FETCH => { 1 }, STORE => -> $, $ { say "boing" } ); $p = 10
20:45 camelia rakudo-moar a38b59: OUTPUT«(signal SEGV)»
20:45 timotimo ooooh
20:45 rindolf joined #perl6
20:45 timotimo yeah, state and := is not compatible
20:46 timotimo m: state $test := 1; say $test
20:46 camelia rakudo-moar a38b59: OUTPUT«(signal SEGV)»
20:46 timotimo no need for a proxy there, no need for an assignment even
20:47 kaare_ joined #perl6
20:48 mr_ron sorry - I am prematurely optimizing and worrying that every access to a mutator needs to allocate a new Proxy object.
20:49 brisby joined #perl6
20:50 timotimo proxies aren't terribly expensive; the more interesting part is probably taking the closures for the fetch and store blocks
20:51 RabidGravy mr_ron, really only need to start worrying about that when you want to do something after the value is set :)
20:53 llfourn joined #perl6
20:54 bartolin_ r: my $str; my $i = 0; while $i < 2 { LEAVE { last }; $i++; $str ~= ~$i; }; say $str; $str = ""; $i = 0; while $i < 2 { LEAVE { $str ~= "leaving" }; $i++; $str ~= ~$i; }; say $str
20:54 camelia rakudo-moar a38b59: OUTPUT«1␤1leaving2leaving␤»
20:54 camelia ..rakudo-jvm a38b59: OUTPUT«1␤␤»
20:55 mr_ron m: https://gist.github.com/ronaldxs/e0a325c9e3bc716cf7f7
20:55 camelia rakudo-moar a38b59: OUTPUT«246␤»
20:55 bartolin_ [Coke]: ^^ alas, there still seems to be something wrong on JVM with RT #121145
20:55 synbot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=121145
20:55 dha joined #perl6
20:56 [Coke] bartolin_: hokay.
20:56 jnthn I promised to share whatever progress I'd made on GLR implementation by today. Here it is: https://gist.github.com/jnthn/aa370f8b32ef98e4e7c9
20:57 timotimo oh, GLR interacts with Whatever?
20:57 [Coke] We can at least add a test and make sure we don't regress on moar - don't have to get JVM 100% before christmas.
20:57 jnthn timotimo: It interacts with most things :P
20:57 bartolin_ [Coke]: I'll add a test for that ... what you said
20:58 mr_ron the gist is fine.  while I have some people looking I was just wondering whether I could get comment on - is the attribute mutator technique a kludge or something likely to work going forward.  Technique was displayed yesterday
20:59 dha Out of curiosity, do we have a command-line option parsing mechanism at this point? I'm not seeing a relevant module (like the Getopt modules in p5) or anything built-in.
20:59 [Coke] dha: sub MAIN
20:59 jnthn dha: Look up sub MAIN
20:59 timotimo yeah, sub MAIN exists and is pretty great
20:59 jnthn mr_ron: There's no plans for Proxy to go away
21:00 arnsholt What they said about sub MAIN. Basically, Getopt and friends are obsolete in Perl 6
21:00 timotimo but it has some design decisions in place that you sometimes want to work against
21:00 dha Ah, ok. Again, the documentation does not make things easy to find...
21:01 timotimo pretty often, people get annoyed by having to put positionals in the back and all nameds in front
21:01 * jnthn sees we're going from "argh no docs" to "argh I can't find the docs" :)
21:01 arnsholt That's an improvement of sorts, I guess. Good point =)
21:01 timotimo "too many docs, make them go away!"
21:02 mr_ron I didn't mean proxy is going away - the way it is used as an attribute mutator is different from the example in roast which is why I asked - https://github.com/perl6/roast/blob/master/S12-attributes/mutators.t
21:02 dha Which raises a troubling question for me. I know everyone's working hard to get Perl 6 out the door, but... without useful docs, is anyone going to be able to use it?
21:02 Ven joined #perl6
21:02 dha And I want to stress that that question is not intended to start throwing blame around. but it seems like it might be important.
21:04 jnthn dha: Looking at the doc repo, it seems a bunch of people are contributing to the docs too. Heck, I thought you'd done a rather sizable contribution...
21:05 dha I've done a good deal in my own repo. Mostly for changes from p5 to p6 so far.
21:06 jnthn Ah...and planning to migrate that work into doc.perl6.org at some point?
21:06 dha But when I see that things like use and while loops (with the new pointy block stuff) isn't in the main docs, that seems troubling.
21:06 dha jnthn-  I would like to, yes. Not sure yet how best to do that. suggestions welcome.
21:07 [Coke] dha: yes, it's troubling. Please open tickets on the docs site when you can't find stuff, that'll help.
21:07 [Coke] https://github.com/perl6/doc/issues
21:07 dha [Coke]-  how so? put stuff in Wanted?
21:07 dha ah.
21:07 dha ok.
21:07 [Coke] Or in wanted, that's probably fine also.
21:08 dha I've added some stuff to wanted.
21:08 dha I don't want to just turn it into a behemoth that's simply mind-numbing, though. :-)
21:09 jnthn dha: What're you blocking on exactly? Where it belongs, whether it wants a section of it's own becasue it's in many parts, etc?
21:09 dalek roast: 7ce647a | usev6++ | S04-phasers/in-loop.t:
21:09 dalek roast: Add tests for RT #121145
21:09 dalek roast: review: https://github.com/perl6/roast/commit/7ce647a18a
21:09 synbot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=121145
21:09 TEttinger joined #perl6
21:10 dha jnthn-  The stuff I've done so far might warrant its own section, if only because it's primarily for perl5 people, documenting the changes from p5 to p6.
21:10 [Coke] for sub MAIN, being able to find it via search would be nice - or command line options. I couldn't find it either way. I know there's info in the SYN, though.
21:11 jnthn In general, though, please don't suggest that everyone is working on implementation and nobody on docs. It's clear various people are, and I imagine it's a good bit better to motivate them to keep going by acknowledging that. :)
21:11 [Coke] me grabs a copy of doc to see if he can fix the search-didn't-find-anything bug.
21:11 dha Although I'm currently also working on a "new stuff in perl 6 that might make you want to use perl 6"
21:12 jnthn dha: A "Perl 5 to Perl 6" section sounds sensible enough to me, fwiw.
21:12 dha jnthn-  I apologize for making it sound that way. That really wasn't what I was trying to say. I guess I just don't know who's doing docs, and I'm seeing holes in the docs, so I said what I said. In reality, I'm quite sure people are working on the docs, just not in my immediate vision.
21:13 dha Certainly no insult intended.
21:14 * [Coke] is seeing lots of Use of Nil in numeric context  in block  at lib/Panda/Builder.pm:125
21:15 Ven joined #perl6
21:15 dha Also, although I don't know how much this holds in general practice, but in my own investigations, I wind up going to the design documents a lot for information, and I don't think (although I could be wrong) that someone trying to learn Perl 6 would go there. Also, true or not, I can't get away from the feeling that the design docs are necessarily what's actually going on in the implementation.
21:15 dha Again just my, possibly limited, view.
21:15 jnthn dha: I was already sure you didn't mean it badly; I've just spent plenty of time listening to "argh why isn't Perl 6 getting done" when I was working hard on the darn thing over the years, and know it can be demotivating. :)
21:16 dha And, [Coke] , yes, being able to find MAIN through a search would be helpful.
21:16 jnthn Yes, I agree the design docs aren't where we want people to be looking.
21:16 jnthn They're certainly in places "plans of where we're heading", whereas docs very much want to be "what's there and how to use it"
21:17 dha jnthn-  I completely understand that. And if anyone was listening to me and got discouraged, I profusely apologise and open myself to suggestions as to how I can help.
21:17 dha jnthn-  that's how I see it as well.
21:18 jnthn Given the amount of work you're doing on 5to6 docs, I'd say you already are helping. Please do record what you find missing, though. Like with bugs in the implementation always going into RT, it's better to have them recorded than forgotten.
21:19 dha I will do my best.
21:19 jnthn dha++
21:19 ShimmerFairy Not to mention the synopses are to some extent written with the expectation that you know a thing or two about writing compilers :) (as opposed to simply being a regular Perl 6 user)
21:19 timotimo jnthn: liking your gist so far, but i'm not so far into it
21:19 dha And if anyone has the time to review what I've written, just to make sure it's accurate, I would be thrilled to put it into the official doc repo.
21:19 mst the supplies one? if so, looks *really* good to me
21:19 [Coke] mst: new one is the GLR one
21:20 mst very much the sort of thing I'd like to see if we could arrange in perl5 if leonerd ever gets certain of his crazy plans to work
21:20 mst ah
21:20 mst not looked at that one
21:20 RabidGravy also doing docs is a strange subset of people in some ways, comfident enough with writing, familiar enough with the subject but not tied up doing stuff to or with the language
21:20 [Coke] jnthn++ # Do ALL THE THINGS
21:20 beastd joined #perl6
21:20 * [Coke] wonders if he can make the graphviz stuff go faster when building docs...
21:20 jnthn mst: Glad it looked good to you; I'll be working to get that stuff implemented in the next couple of weeks. :)
21:22 jnthn timotimo: I think you'll have some fun profiling things. I do have the biases of having written the thing, but the profile output does feel more accessible and easier to work out where the costs are than what's in CORE now...
21:22 jjido joined #perl6
21:22 brisby joined #perl6
21:22 dha And, in case anyone missed the link all the other times I mentioned this... https://github.com/dha/perl5-to-perl6-docs  :-)
21:22 timotimo :3
21:22 dha Also, currently taking suggestions as to features that might make people want to give Perl 6 a try.
21:23 tony-o Stage parse      :  40.659
21:23 tony-o dha: web scale asynchronous solutions
21:24 TEttinger the only problem I have with perl 6 is that it's extremely massive and includes a lot of history that I am not familiar with.
21:24 jjido grammars are quite cool.
21:24 TEttinger so stuff like, "oh it's just like in perl 5, but X"
21:24 TEttinger doesn't help me at all
21:25 b2gills jnthn: Would it make sense for List.elems to ask its iterator(s) about how many elems it thinks it has? For example `(1 xx 100).list.elems` would know that it should return 100 without iterating
21:25 [Coke] if you want the history, then dha's 5-6 is a good place to start. If not, then where we stole the features from probably doesn't matter to you.
21:25 TEttinger I don't know perl 5, why would I seek that out?
21:25 dha TEttinger - Granted, but I'm guessing a lot of the initial potential audience for p6 are p5 users.
21:26 TEttinger I'm guessing a lot of p5 users are now not p5 users
21:26 dha So, yeah, it may not be useful to you, but it may be useful to (many?) others.
21:26 tony-o TEttinger has a good point in that isolates just about everyone but p5 users
21:26 jnthn b2gills: Do you have a use case?
21:26 RabidGravy dha, modern extensible object model, composable concurrency features. consistent design
21:26 tony-o who aren't that likely to port existing production code just because
21:27 ShimmerFairy dha: I have no problem with docs that help with going from P5 to P6. I think the issue of "don't assume people know Perl 5" is more of a general gripe with P6 documentation (the specs have a bad habit of leaving out "just like P5" stuff in some cases)
21:27 jnthn b2gills: There's going to be a very limited nuber of situations where we could take that shortcut, is all
21:27 TEttinger I mean, from what I know about perl 6, which is not much, some of the really good features are that it's extremely good at handling language-like things, with grammars, moar's unicode support, and the best regexes anywhere
21:28 mr_ron left #perl6
21:28 lucasb b2gills: I had a similar idea about .combinations and .permutations knowing how many elements they have without having to iterate everything :)
21:28 tony-o a grammar tutorial would have been super helpful, froggs and a couple others in here are the only reason i got through the first one i wrote
21:28 jjido TEttinger: huh Unicode is a bit of an advanced topic
21:28 dha ShimmerFairy-  indeed. I am in no way suggesting that the p5->p6 stuff I've done should be the main or, god forbid, only docs. :-)
21:28 TEttinger no one else supports 8.0
21:28 tony-o a grammar tutorial with actions -
21:28 TEttinger java 9 will support 7.0
21:28 TEttinger java 9 comes out next year
21:29 jnthn lucasb: OK, now we have an extra use case :)
21:29 flussence grammars are cool, but working with data that isn't perfectly formed utf-8 feels like a massive chore atm
21:29 jjido flussence: yeah
21:30 ShimmerFairy dha: My only question is how your work will sit alongside the existing 5to6 doc, if your work will go to doc.perl6.org: http://doc.perl6.org/language/5to6
21:30 leont Has anyone talked to the unicode people about or NFG?
21:30 leont *our
21:30 [Coke] ShimmerFairy: I think it will replace it if he can get someone to review it.
21:30 ShimmerFairy ah
21:30 RabidGravy to be honest I strongly believe that the majority documentation should just treat it as a completely new language with no antecedents
21:31 TEttinger RabidGravy: agreed
21:31 tony-o RabidGravy++
21:31 b2gills Perhaps someone should go and find things that are in the current 5to6 that aren't in dha++'s version
21:31 ShimmerFairy leont: I forget what they called it, but they do have a thing on handling text in more-or-less the same way we do with NFG.
21:31 [Coke] RabidGravy: yes, that's the plan.
21:31 dha ShimmerFairy -  My current off-the-cuff thought is that the Essentials doc I'm currently trying to structure might replace the current 5to6
21:31 jnthn Agree, but that doesn't mean we can't have a really give 5 -> 6 guide as well (and heck, a [other language] -> 6 guide)
21:31 TEttinger p5->p6 could be in a sidebar even in existing docs, but not assumed knowledge
21:31 RabidGravy and I've been doing perl for more than twenty years
21:32 [Coke] TEttinger: yes. the official docs will not assume knowledge of p5. the only reason the syn do is because they aren't meant for end users.
21:32 TEttinger ah
21:32 dha The other docs I've done have been a bit more exhaustive and probably more useful as reference than tutorial
21:32 ShimmerFairy dha: yeah, that makes sense. I was thinking the current one could serve as the introductory doc too, if it's still useful. :)
21:33 leont TPF has some sort of membership to Unicode consortium, it may be useful to have one of the p6 core people involved there too (though I suspect the obvious people may be too busy anyway)
21:33 jnthn leont: Not that I'm aware of, but I didn't come up with the idea, just read what Larry'd written in the design docs, asked some questions, read up on Unicode normalization forms, found the most natural algorithmic extension to NFC, and implemented it. :)
21:33 b2gills Perhaps there will be other *to6 docs in the future
21:33 ShimmerFairy [Coke]: I guess that explains it for the synopses, though someone like me who is both A) interested in the compiler-writing portions of P6, to an extent, and B) doesn't know P5, that doesn't make things better :P
21:33 TEttinger 0to6
21:33 dha ShimmerFairy -  Actually, now that I'm thinking it through, it might be best to leave the current 5to6 sort of as is, but maybe add some stuff to it and make *that* the de factor Essentials doc
21:34 jnthn leont: I've got my plate quite full at the moment, as have most of us, but yes, I agree it'd be good if someone from the Perl 6 side was involved there.
21:34 jnthn leont: I may be willing, but not for a few months... :)
21:34 dha And, yes, the 5to6 stuff would be for a specific audience, and *DEFINITELY* not a replacement for actual p6 docs
21:35 ShimmerFairy leont: Well, if I can help out interacting with the Unicode consortium in some way, I did write the initial version of S15, so I guess I might know a thing or two :P
21:36 ShimmerFairy dha: incidentally, the 5to6 docs help me learn a bit about how Perl 5 does things, which is interesting even if I'll never use it :)
21:36 jnthn ShimmerFairy: I'm curious, did you look over the NFG impl at all? :)
21:36 dha ShimmerFairy -  An unintended, but useful outcome. :-)
21:37 ShimmerFairy jnthn: I don't think I've looked at the code, but I do like what I've tried using so far :)  jnthn++ for doing the actual implementation, I'm just the girl who likes to design stuff :P
21:38 * ShimmerFairy needs to fix up the rest of the docs to line up with S15 (mainly S05) sometime, now that she's reminded of it.
21:40 timotimo jnthn: if an iterator pushes all it knows how to push, it'll wait for push-at-least to be called again so that it'll return IterationEnd?
21:40 ShimmerFairy dha: > although arrays start with "@", but array I<elements> start with "$", and the like, we've given up.
21:40 timotimo push-all returns IterationEnd, so ... ?
21:40 jnthn timotimo: It returns IterationEnd also if it knows it ran out
21:41 ShimmerFairy dha: I'm not sure I like how defeated that sounds. I think it's for the best we put an end to that :)
21:41 ShimmerFairy (also, Essentials.pod is missing an  =end pod)
21:41 jnthn timotimo: It says that in the comment even, no? :)
21:41 timotimo ah
21:41 jnthn Returns the number of things # pushed, or IterationEnd if it reached the end of the iteration.
21:41 timotimo i wasn't 100% sure
21:41 timotimo fair enough
21:41 timotimo so when the end is reached, it'll never tell you how much was pushed
21:41 jnthn The default impl delegates to push-exactly, which can return IterationEnd
21:42 jnthn No. Though tbh I don't know of anything that's actually using the number of things pushed yet...
21:43 jnthn So we may stop doing that.
21:44 dha ShimmerFairy -  Valid points. And I've just tossed some stuff in there kind of randomly so far, so I forgot the =end. Thanks.
21:46 ShimmerFairy dha: in Functions.pod, "A I<lot> of things are objects.": well, _everything_ in Perl 6 is an object, unless the term 'object' means something different in P5. :)
21:46 dha *nod*
21:47 jnthn Time for me to get some rest
21:47 timotimo good rest, jnthn
21:47 jnthn More GLoRious hacking tomorrow
21:47 jnthn 'night o/
21:47 timotimo and thanks for your gist!
21:47 dha How about "in perl 6 everything is an object, even though you may not treat them that way in practice" or something along those lines?
21:48 dha Having just taken Damian's "Perl 6: Transparadigm Programming" class, I don't want to give the impression that, even if everything is an object, you have to do things in an object oriented way. :-)
21:49 RabidGravy "may not need to care or need to treat them that way"
21:50 lucasb Differences.pod is so lonely there in the mu repo. Shouldn't it be moved to the doc repo and be merged with 5to6?
21:50 ShimmerFairy dha: yes, I believe S01 or S02 describes it as something along the lines of "everything is an object, but Perl 6 lets you ignore that if you're not interested in using OOP"
21:50 smls dha: +1 to expanding the '5to6' doc
21:51 smls if its getting too long, maybe split off separate '5to6-functions' and '5to6-operators' pages
21:51 ShimmerFairy dha: Ah-ha! From S01:  "If you want to treat everything as objects in Perl 6, Perl will help you do that. If you don't want to treat everything as objects, Perl will help you with that viewpoint as well."
21:53 dha Well put.
21:54 RabidGravy actually a reasonable test of whether that aspiration is met would be to take some complex procedural code and see if it can be ported cleanly
21:55 RabidGravy with the caveat there is a lot of system interaction P6 doesn't do out the box
21:55 aristotle left #perl6
21:56 dha Well volunteered, sir!
21:56 ShimmerFairy I think at minimum it means you don't suddenly need to declare the types of all your variables, though if Perl 6 forces you to treat everything as an object in parts, that could potentially be remedied.
21:56 ShimmerFairy (Though I should point out that S01 is just the introductory text to the synopses, more or less, and thus isn't likely to receive updates to line up with modern thinking on P6)
21:57 RabidGravy dha, you pick up the samplerate, soundtouch, xbase and soundcloud modules I'm doing and we're good ;-P
21:58 dha Heh.
22:00 ShimmerFairy dha: when it comes to SIGALRM at least, I suggest trying to find an example of intercepting SIGINT (I recall seeing an example of that wrt concurrency a while back).
22:00 RabidGravy being way too distracted the last week
22:03 dha_ joined #perl6
22:09 lizmat joined #perl6
22:15 dha_ ShimmerFairy -  Changed the language a bit in Essentials.pod and Functions.pod. thanks for the input.
22:15 ShimmerFairy dha_: I'll be sure to go over the rest of it when I've got time. I hope my odd perspective of "I would actually need a 6to5 document" is helpful :)
22:16 dha_ I hope so too. :-)
22:16 Begi joined #perl6
22:18 lsm-desktop joined #perl6
22:26 RabidGravy isn't the common alarm case more like "Promise.in($secs).then({#do something});"   seeing as there is no alarm()?
22:28 skids joined #perl6
22:31 smls joined #perl6
22:38 telex joined #perl6
22:39 ShimmerFairy oof, I discovered why smartmatch won't chain, and it's not pretty. Here's another issue that's brought forth by the problem (I'll check to see if it's already rakudobug'd):
22:39 ShimmerFairy m: class Foo { }; multi sub infix:<~~>(Foo $a, Foo $b) { 42.6 }; say Foo.new ~~ Foo; say infix:<~~>(Foo.new, Foo)
22:39 camelia rakudo-moar a38b59: OUTPUT«True␤42.6␤»
22:39 ShimmerFairy (basically, the Perl 6 grammar treats ~~ specially, so stuff like this and the chaining bug pop up)
22:42 Sgeo Perl gather/take, unlike Python and ES6 and C# etc. etc., take seems to be abstract-over-able, that is, you can hide the take inside a function call. Those other languages let you abstract usage of yield and equivalent, but to use the abstraction you need to syntactically indicate you're doing so, which makes it obvious control is being given up
22:42 Sgeo You can't abstract over the fact of a yield
22:43 Sgeo I wonder if Perl 6's direction on this is deliberate. I guess personally I prefer explicit. Also you can force a higher-order function to give up control unexpectedly by playing tricks with this
22:45 vendethiel Sgeo: yeah, it's deliberate, it's the same with most other features
22:45 vendethiel the spec says something along the lines of "if no <keyword> is found in the lexical scope, the dynamic scope will be used"
22:45 Sgeo Wait, gather/take mixes lexical and dynamic scope?
22:46 vendethiel no.
22:46 vendethiel Sgeo: quoting the spec "The take function is lexotic if there is a visible outer gather, but falls back to purely dynamic if not. "
22:47 vendethiel It's not mixed, it's one or the other -- can't be both.
22:47 Sgeo So what if I use gather, an inner closure uses take, then I give that closure to something else to run later?
22:47 smls isn't a dedicated  gather { }  block *more* explicit than resusing a normal function block like in python?
22:48 smls *reusing
22:48 vendethiel m: sub genval(){ take 3; take 4; }; say do given ^3 { genval; }; say ';;;;'; say do given ^2 { genval; }
22:49 vendethiel m: say 1
22:49 camelia rakudo-moar a38b59: OUTPUT«take without gather␤  in sub genval at /tmp/MJoo_RMWSL:1␤  in code  at /tmp/MJoo_RMWSL:1␤  in block <unit> at /tmp/MJoo_RMWSL:1␤␤»
22:49 camelia rakudo-moar a38b59: OUTPUT«1␤»
22:49 RabidGravy gather? not given
22:50 vendethiel RabidGravy: whoops;
22:50 Sgeo smls, I'm referring to the sense that you can hide a take behind a function definition so any subroutine might secretly hold a take
22:50 vendethiel m: sub genval(){ take 3; take 4; }; say do gather { genval; }; say ';;;;'; say do gather { genval; } # Sgeo
22:50 camelia rakudo-moar a38b59: OUTPUT«3 4␤;;;;␤3 4␤»
22:50 RabidGravy begins with a g and has an e in it, fair enough
22:51 Sgeo vendethiel, now how about if genval was defined in a function that itself had a gather, but was stored somewhere and the later calls called it
22:54 vendethiel m: my $closure; gen gengen { $closure = sub { take 3; take 4; }; }; gengen; say do gather { $closure(); }; say ';;;;'; say do gather { $closure(); }
22:54 camelia rakudo-moar a38b59: OUTPUT«5===SORRY!5=== Error while compiling /tmp/zfuVwer6Vf␤Undeclared routines:␤    gen used at line 1. Did you mean 'get'?␤    gengen used at line 1␤␤»
22:54 vendethiel m: my $closure; sub  gengen { $closure = sub { take 3; take 4; }; }; gengen; say do gather { $closure(); }; say ';;;;'; say do gather { $closure(); } # >>
22:54 TimToady I believe rakudo currently only implements the dynamic form, not the lexotic form
22:54 camelia rakudo-moar a38b59: OUTPUT«3 4␤;;;;␤3 4␤»
22:54 llfourn joined #perl6
22:55 RabidGravy don't worry I'll be safely retired in fifteen years time ;-)
22:55 Sgeo I think for it to be lexical the literal take would need to be textually inside the literal gather
22:56 dalek roast: 18413a7 | ShimmerFairy++ | S03-operators/relational.t:
22:56 dalek roast: Add TODO'd tests for RT #81336
22:56 dalek roast: review: https://github.com/perl6/roast/commit/18413a7e30
22:56 synbot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=81336
22:58 RabidGravy anyway toodlpip, bed before I turn into a pompkin
23:17 dha Question: Apparently (according to the docs) "no warnings" doesn't work currently. does "no strict"?
23:18 vendethiel m: no strict; say $a;
23:18 camelia rakudo-moar a38b59: OUTPUT«(Any)␤»
23:18 ShimmerFairy m: no strict; $a = 42; say $a; # dha: does this mean 'yes' ? :)
23:18 camelia rakudo-moar a38b59: OUTPUT«42␤»
23:19 dha I guess so. Debating whether that should be explicitly stated in 5to6, since it does say that "no warnings" doesn't work.
23:19 dha m: $a = 42; say $a;
23:19 camelia rakudo-moar a38b59: OUTPUT«5===SORRY!5=== Error while compiling /tmp/XheqfJL0uN␤Variable '$a' is not declared␤at /tmp/XheqfJL0uN:1␤------> 3<BOL>7⏏5$a = 42; say $a;␤»
23:20 dha yep. Looks like that works as I'd expect.
23:21 ShimmerFairy 'no warnings' shouldn't be too hard to implement, I don't think (we got 'no worries' a while back, whose intention is to stop P5 gotcha warnings for those who don't know P5)
23:21 [Sno] joined #perl6
23:24 dha I suppose it would be helpful for me to actually learn how things are implemented so I can look and see what is actually going on in the code. But... ow.
23:24 * vendethiel wishes #perl6 good night
23:24 vendethiel (you might want to look at "no worries" in the meantime)
23:24 vendethiel (I mean -- it does MORE than just P5 worries right now, IIRC)
23:25 dalek rakudo-star-daily: b7fa490 | coke++ | log/ (9 files):
23:25 dalek rakudo-star-daily: today (automated commit)
23:25 dalek rakudo-star-daily: review: https://github.com/coke/rakudo-star-daily/commit/b7fa4900dc
23:25 ShimmerFairy vendethiel: yeah, because there isn't a special category for P5 worries or anything. That's why I said "intention", and not anything more concrete :P
23:25 vendethiel ShimmerFairy: I actually didn't read your message when I typed mine, and then I was like -- "oops, stale backlog!"
23:25 ShimmerFairy and ♞ vendethiel o/
23:26 ShimmerFairy dha: it definitely takes a bit of time to get used to reading the Perl 6 grammar as opposed to grammars written in Perl 6 :)
23:27 dha I would imagine. What do I need to be able to read to make sense of the rakudo source? C? nqp? Farsi?
23:28 ShimmerFairy dha: The underlying stuff is written for NQP, which is a subset of Perl 6 specifically geared towards compiler writing. It's only for the vm-specific stuff that you need to know how to read C or Java or what-have-you
23:29 dha Ok. Guess I'll try to find time to learn nqp, then.
23:29 ShimmerFairy dha: There was a two-day course a couple years back that explained how to write a compiler in nqp (talking about rakudo, with exercises to implement your own mini-compiler). I can link you to it if you like.
23:30 dha That would be great. Thanks.
23:30 ShimmerFairy dha: here you go :)    https://github.com/edumentab/rakudo-and-nqp-internals-course
23:31 dha Oops. I think I found a mistake in the 5to6 doc. It says that -M and -m have been replaced by --use, but perl6 -h says that -M is how you load a module on the command line.
23:32 ShimmerFairy dha: yeah, I recall being confused a bit by that. (--use might work too, but it certainly hasn't replaced anything)
23:32 flussence `perl6 --use` agrees with `perl6 -h` there (illegal option)
23:33 dha Ah. So that needs to be changed. Will look into that.
23:33 ShimmerFairy I was just about to say, turns out --use does nothing in the first place :)
23:37 dha And, I'm guessing that the ability to "no" a module on the command line via "perl -M -Perl::Module" is gone?
23:37 lucasb joined #perl6
23:37 dha (it is, to my surprise, in Perl 5)
23:37 ShimmerFairy perhaps, I've never heard of that before.
23:38 ShimmerFairy Note that -e turns off strict, if that's what you're going after :)
23:38 dha Oh? That's interesting.
23:39 ShimmerFairy I personally don't see why it should, but I chalked it up to another one of those P5 things I'll never understand :P
23:39 dha Huh. When I try "perl6 -M -Linenoise" it starts up the REPL, but when I *exit* it spits at me that "-Linenoise" can't be found. That seems... late.
23:40 ShimmerFairy dha: or if you try typing a statement
23:40 dha Also, it doesn't let me actually exit.
23:41 flussence would be nice to have a perl6 -E which means "keep strict on", that'd be sorta-consistent with what perl -E does
23:41 dha In any case, I'm going to assume that behavior has changed from p5.
23:43 lucasb m: say 'abc'.index('a')
23:43 camelia rakudo-moar a38b59: OUTPUT«0␤»
23:43 lucasb m: say (<a b c>).combinations('abc'.index('a')).perl
23:43 camelia rakudo-moar a38b59: OUTPUT«()␤»
23:44 lucasb m: say (<a b c>).combinations(0).perl
23:44 camelia rakudo-moar a38b59: OUTPUT«((),)␤»
23:44 lucasb Maybe someplaces will need to change 'if/unless $n' to explicit test for equal/not-equal zero to accomodate for the existence of the new Index type.
23:45 dha flussence -  -E doesn't turn strict on on Perl 5.
23:47 flussence I know, that's not what I mean though. It turns on "new stuff after 5.8", and here strict-by-default would also be new stuff
23:49 dha Hm... I don't know. In the context of Perl 6, *everything* is "new stuff". :-)
23:50 Zoffix But it's not. Warnings by default, it seems.
23:54 Sgeo Is gather/take magic, or does it use control exceptions or something?
23:55 TimToady yes, control exceptions
23:55 TimToady at least in the current implementation
23:56 TimToady this may change after the GLR, at least in cases where we know it's in an eager context
23:57 Zoffix GLR?
23:59 TimToady Great List Refactor

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

Perl 6 | Reference Documentation | Rakudo