Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-07-31

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 gfldex s34n_: as requested: https://docs.perl6.org/language/typesystem#index-entry-FALLBACK_%28method%29
00:17 sat joined #perl6
00:17 s34n_ gfldex: thanks
00:19 s34n_ As a little dink around to explore Perl 6, I'm playing with https://github.com/smcmurray/Mesquite/blob/master/Mesquite.pm6
00:19 s34n_ I'm sure it's doing almost everything wrong. But I'd appreciate learning all the things it does wrong and how to do them right.
00:21 webstrand joined #perl6
00:29 AlexDaniel joined #perl6
00:30 BenGoldberg s34n_, It looks like your method next clears out the @!middleware array.  This means that every time .run is called on your App object, you'll need to repopulate it.
00:31 cog_ joined #perl6
00:33 s34n_ BenGoldberg: right
00:35 sivoais joined #perl6
00:39 raiph joined #perl6
00:40 s34n_ BenGoldberg: So you could write a PSGI app like https://github.com/smcmurray/Mesquite/blob/master/examples/app.psgi
00:42 gfldex m: my $sig = :( $a:  @b, %c);
00:42 camelia rakudo-moar 373634: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Can only use the : invocant marker in the signature for a method␤at <tmp>:1␤------> 3my $sig = :( $a:  @b, %c7⏏5);␤    expecting any of:␤        constraint␤»
00:43 gfldex any reasons why this might not be a bug?
00:44 s34n_ gfldex: should you be able to alias the invocant on non-methods?
00:44 gfldex i can't alias anything with a Signature instance
00:45 gfldex m: my $m = method($a: $b){}; say $m ~~ :($a: $b);
00:45 camelia rakudo-moar 373634: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$a' is not declared␤at <tmp>:1␤------> 3my $m = method(7⏏5$a: $b){}; say $m ~~ :($a: $b);␤»
00:45 timotimo oh, interesting
00:45 gfldex m: my $m = method m($a: $b){}; say $m ~~ :($a: $b);
00:45 camelia rakudo-moar 373634: OUTPUT«5===SORRY!5===␤Can only use the : invocant marker in the signature for a method␤at <tmp>:1␤------> 3= method m($a: $b){}; say $m ~~ :($a: $b7⏏5);␤    expecting any of:␤        constraint␤Other potential difficulties:␤    Useless dec…»
00:46 gfldex m: my $m = method ::($a: $b){}; say $m ~~ :($a: $b);
00:46 camelia rakudo-moar 373634: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in indirect name; couldn't find final ')' ␤at <tmp>:1␤------> 3my $m = method ::($a:7⏏5 $b){}; say $m ~~ :($a: $b);␤    expecting any of:␤        colon pair␤»
00:46 timotimo yeah, a free-standing signature is a bit different from a signature on an explicit sub
00:46 gfldex m: my $m = method ($a: $b){}; say $m ~~ :($a: $b);
00:46 camelia rakudo-moar 373634: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Can only use the : invocant marker in the signature for a method␤at <tmp>:1␤------> 3 = method ($a: $b){}; say $m ~~ :($a: $b7⏏5);␤    expecting any of:␤        constraint␤»
00:47 * gfldex grabs a rakudobug form
00:49 s34n_ gfldex: can you walk me through $m ~~ :($a: $b);              ?
00:49 s34n_ starting with :($a: $b)  ?
00:50 gfldex :() is a Signature literal, see https://docs.perl6.org/type/Signature
00:50 gfldex (reading /type/Signature.pod6 should be mandatory)
00:51 timotimo yeah, probably
00:51 s34n_ remembering what you read might also be helpful :)
00:58 s34n_ To be honest, I'm still confused at the difference between object types Method, Routine, and Sub
00:58 s34n_ Subs can be used as methods
00:59 s34n_ Methods can be created outside Classes
00:59 s34n_ m: say sub{}.WHAT
00:59 camelia rakudo-moar 373634: OUTPUT«(Sub)␤»
01:00 s34n_ m: say {'hi'}.WHAT
01:00 camelia rakudo-moar 373634: OUTPUT«(Block)␤»
01:05 s34n_ neither Sub nor Method define any methods of their own? They both inherit from Routine? They have no other roles or mixins, etc?
01:06 timotimo methods mostly gain their magic by being returned from the find_method metaobject method
01:06 zacts joined #perl6
01:07 s34n_ I get defining them with different keywords inside a Class. But why make them different classes themselves?
01:09 timotimo method derives from routine, but has its own method gist, it seems like
01:10 s34n_ BenGoldberg: As a Plack app, exhausting @!middleware will cause problems between requests, won't it?
01:11 BenGoldberg That's what I was thinking... I think you want a for loop, instead of repeatedly shifting.
01:12 s34n_ timotimo: doesn't gist come from Mu?
01:13 BenGoldberg Something like, for @!middleware -> $n { self.&$n() }
01:13 timotimo yeah, it should be defined in Mu
01:13 timotimo but Method also has it
01:13 s34n_ BenGoldberg: thanks. Actually, I don't want a for loop because I want each middleware to be able to call next
01:13 cdg joined #perl6
01:13 timotimo if you have a for loop, each middleware can just "next"
01:15 s34n_ timotimo: please explain the for next thing
01:16 timotimo well: next, last, redo, ... those are all control exceptions
01:16 timotimo i.e. they travel up the stack; they are dynamically scoped
01:16 timotimo and the for you have for your middlewares can react to that
01:19 s34n_ run() returns a sub. Each time that sub is invoked, I want next() to start from the beginning of @!middleware
01:19 FROGGS_ joined #perl6
01:21 s34n_ timotimo: so I have to put a for loop in run, somehow?
01:21 gfldex s34n_: there are a few traits that only work on methods, they are MMDed via trait_mod:<is>(Routine:D \m, :$foo)
01:22 gfldex s34n_: there are quite a few things in the compiler that check for Routine:D
01:22 gfldex err Method:D
01:23 timotimo huh, next will start from the beginning of @!middleware?
01:23 timotimo not really what "next" would let you do, i think
01:24 s34n_ timotimo: for @!middleware {.next}  instead of just $.next ?
01:24 timotimo uuuh
01:24 timotimo sorry, i don't know enough about your use case to answer that
01:24 timotimo also, that doesn't look like what i wanted to suggest
01:25 s34n_ timotimo: how does next travel up the stack?
01:25 s34n_ actually, nm, I don't want that, I think
01:25 timotimo m: sub something { say "something."; next }; for ^10 { say "before $_"; something(); say "after $_" }; say "done"
01:25 camelia rakudo-moar 373634: OUTPUT«before 0␤something.␤before 1␤something.␤before 2␤something.␤before 3␤something.␤before 4␤something.␤before 5␤something.␤before 6␤something.␤before 7␤something.␤before 8␤something.␤before 9␤something.␤done␤»
01:26 timotimo you see how it doesn't output any "after" lines?
01:27 s34n_ yes
01:28 s34n_ I don't understand why
01:28 timotimo it's dynamic
01:28 timotimo the for loop installs a handler, like a CATCH would
01:30 s34n_ oh. yeah. I see it. hmm
01:32 s34n_ yeah. that's not what I want, because I want to process more after next(). I want to yield to next, then continue.
01:32 timotimo OK
01:32 s34n_ yield to the next midlleware, I mean
01:35 s34n_ can next() determine the identity of the caller, then find the index of that caller in @!middleware?
01:36 kalkin-_ joined #perl6
01:39 s34n_ nm. bad idea
01:46 gfldex m: sub one-arg (@)  { }; use MONKEY-SEE-NO-EVAL; EVAL 'one-arg(5, 6, 7);'; CATCH { when X::TypeCheck::Argument { put .^name } }; say 'alive'
01:46 camelia rakudo-moar 373634: OUTPUT«X::TypeCheck::Argument+{X::Comp}␤»
01:46 gfldex any way to get the alive?
01:46 geekosaur m: sub one-arg (@)  { }; use MONKEY-SEE-NO-EVAL; EVAL 'one-arg(5, 6, 7);'; CATCH { when X::TypeCheck::Argument { put .^name; resume; } }; say 'alive'
01:46 camelia rakudo-moar 373634: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    resume used at line 1. Did you mean 'rename', 'reduce'?␤␤»
01:46 geekosaur whoops
01:47 ilbot3 joined #perl6
01:47 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
01:50 timotimo s34n_: when handling the "next" control exception, it can grab a stacktrace and inspect things that way
01:55 gfldex geekosaur: thanks
02:00 cr1z joined #perl6
02:09 cdg joined #perl6
02:10 s34n_ better?: https://github.com/smcmurray/Mesquite/blob/master/lib/Mesquite.pm6
02:11 s34n_ BenGoldberg: I think that ^^ should fix the middleware exhaustion
02:16 BenGoldberg It looks like it should work.
02:20 s34n_ To use the Plack stuff I would need to Inline::Perl5?
02:24 s34n_ and I need a unit module declaration, right?
02:35 noganex joined #perl6
02:37 s34n_ or not?
02:38 s34n_ https://docs.perl6.org/language/modules.html#Creating_and_Using_Modules isn't really clear on whether I should actually declare a module with the 'module' keyword
02:44 dalek doc: 22408a8 | (Wenzel P. P. Peppmeyer)++ | util/extract-examples.p6:
02:44 dalek doc: allow to provide individual files for extraction
02:44 dalek doc: review: https://github.com/perl6/doc/commit/22408a8e5a
02:44 dalek doc: 13745bf | (Wenzel P. P. Peppmeyer)++ | util/extract-examples.p6:
02:44 dalek doc: make calculations with abspath
02:45 dalek joined #perl6
02:50 kid51 joined #perl6
03:03 s34n_ found Crust. Does it have traction as a successor to Plack?
03:07 BillSussman joined #perl6
03:33 s34n_ when I sudo panda install whatever, I get 'Found no writable directory into which panda could be installed'
03:43 holyghost why do you sudo ?
03:44 s34n_ because I thought it would install into system directories that require privs
03:45 s34n_ but I did try without sudo, too, and got a different error
03:45 holyghost Try to install perl6 in $HOME
03:45 holyghost then you don't have such problems
03:46 holyghost change the prefix in your install script to /Users/s34n or /home/s34n
03:46 holyghost piece of cake
03:47 holyghost ubumtu ?
03:47 s34n_ fedora
03:48 holyghost ok, do you need an install script ?
03:48 s34n_ so panda doesn't have a fixed location for installing modules? it's relative to p6's install location?
03:48 holyghost yes
03:48 holyghost you need panda and .../install/perl6 in your $PATH
03:48 s34n_ I'm using perl6 from stock fedora repo right now
03:48 holyghost but it tells you so
03:49 holyghost which for now is no good
03:49 s34n_ I have both in my path
03:49 holyghost wait a minute, I'll try something
03:50 s34n_ without sudo I got "moar: src/gc/collect.c:537: MVM_gc_collect_free_nursery_uncopied: Assertion `item->sc_forward_u.forwarder != ((void *)0)' failed."
03:51 s34n_ looks like this is a pre-Christmas release of perl6
03:51 s34n_ So I guess I better ditch the repo version
03:52 s34n_ is panda recommended over zef?
03:52 holyghost_ joined #perl6
03:52 holyghost_ Does the link work ?
03:53 holyghost_ In that script change prefixes of perl6
03:53 webstrand s34n_: Is it? my impression was that panda was dead, and zef was its successor
03:53 holyghost_ a prefix is an install dir
03:54 holyghost_ so chmod 744 get_rakudo.sh as your common user
03:54 holyghost_ then run it
03:54 holyghost_ with argument 2016 04 and you have post-Xmas perl6
03:54 s34n_ holyghost_: what link?
03:55 holyghost_ http://gomez.yellowcouch.org/get_rakudo.sh
03:55 holyghost_ it's  atext file
03:55 s34n_ holyghost_: no offense, but I'm pretty reluctant to run shell scripts downloaded off the internet
03:56 holyghost_ just read it then
03:56 gfldex panda is still shipped with Star but may be replaced with the next release.
03:56 holyghost_ It comes from the perl6 mailing list that's all
03:56 s34n_ I know I'm pretty ignorant. I admit that I have no idea what yellowcouch is or why I should trust them..
03:56 holyghost_ it's my server
03:57 holyghost_ Do you want me to give you the link in the mailing list archives or something ?
03:58 holyghost_ anyway, try installing perl6 yourself
03:58 holyghost_ else noone can be of much use here
03:58 holyghost_ this is a channel for current perl6 :-/
03:59 s34n_ holyghost: I got it. give me a minute
03:59 holyghost ok
04:00 holyghost I am no evil cracker but that script is pretty nifty
04:00 s34n_ holyghost: without arguments 2016 04, do I get 201607?
04:01 holyghost I don't know
04:01 holyghost try 04
04:01 holyghost 07 in development versiob
04:01 holyghost *07 is devel version I mean
04:02 holyghost It changes too much to do any actual work
04:04 gfldex since the last release at least 20 bugs where fixed. You may do better fetching rakudo from github.
04:04 rindolf joined #perl6
04:05 holyghost true
04:08 wamba joined #perl6
04:23 s34n_ gfldex: last release being 2016.07?
04:26 s34n_ why is it downloading and installing Template::Mojo?
04:27 s34n_ and DBIish...?
04:27 holyghost s34n_: if you mean the script, it installs several base mdules
04:27 holyghost so panda works better
04:27 s34n_ why are those base modules?
04:27 s34n_ oh
04:28 holyghost your panda is installed from source, then it just updates itself, it's not the script but the install of rakudo 2016 04
04:28 holyghost no worries about it
04:28 s34n_ ya. I understood that
04:29 s34n_ I was just wondering why those would be part of the base install
04:29 holyghost perl6 hackers :-)
04:29 s34n_ um.. mysql?
04:30 s34n_ Pg?
04:30 holyghost I don't know, many things you need for further installation as I said
04:30 s34n_ just part of DBIish?
04:30 holyghost mysql, and PostGres
04:30 s34n_ mysql and Pg are not small things
04:30 holyghost yes
04:31 holyghost it's just a .pm6 text file
04:31 holyghost AFAIK these things are available on your system
04:33 holyghost CStructs
04:34 s34n_ does zef update itself?
04:34 holyghost no idea
04:41 s34n_ holyghost: no panda
04:41 holyghost set you $PATH
04:41 holyghost s/you/your
04:42 holyghost it tells you at the end
04:42 holyghost \/install dir blurb
04:44 Cabanossi joined #perl6
04:46 cibs joined #perl6
04:53 s34n_ holyghost: thanks
04:53 holyghost np
04:53 holyghost Now you can hack
05:00 s34n_ hmm. it looks like install of HTTP::Server::Tiny fails because its tests fail.
05:00 jeek This guy fucks!
05:05 cdg joined #perl6
05:06 bob777 joined #perl6
05:07 kaare__ joined #perl6
05:09 bob778 joined #perl6
05:18 cibs joined #perl6
05:45 Possum joined #perl6
05:57 dalek gtk-simple: 8a6d92a | (Jonas Grabber)++ | / (3 files):
05:57 dalek gtk-simple: Fix DLL bundling by using %?RESOURCES
05:57 dalek gtk-simple: review: https://github.com/perl6/gtk-simple/commit/8a6d92ac2a
05:57 dalek gtk-simple: 64ffdab | jgrabber++ | Build.pm:
05:57 dalek gtk-simple: Interpolate ALL the $f ile variables
05:57 dalek gtk-simple: review: https://github.com/perl6/gtk-simple/commit/64ffdab3f2
05:57 dalek gtk-simple: 0920f5f | jgrabber++ | appveyor.yml:
05:57 dalek gtk-simple: Fix and extend Appveyor CI
05:57 dalek gtk-simple:
05:57 dalek gtk-simple: Fixes Appveyor builds and also builds with latest moar.
05:57 dalek gtk-simple: Zef is used instead of panda to build Build.pm before testing.
05:57 dalek gtk-simple: Running zef with '--debug' to be more verbose.
05:57 dalek gtk-simple: review: https://github.com/perl6/gtk-simple/commit/0920f5feba
05:57 dalek gtk-simple: f6e5990 | azawawi++ | / (4 files):
05:57 dalek gtk-simple: Merge pull request #59 from jobegrabber/fix-appveyor-builds
05:57 dalek gtk-simple:
05:57 dalek gtk-simple: WIP: Fix appveyor builds
05:57 dalek gtk-simple: review: https://github.com/perl6/gtk-simple/commit/f6e599063b
06:01 dalek gtk-simple: 4e6eb61 | (Jonas Grabber)++ | / (3 files):
06:01 dalek gtk-simple: Fix DLL bundling by using %?RESOURCES
06:01 dalek gtk-simple: review: https://github.com/perl6/gtk-simple/commit/4e6eb618a0
06:01 dalek gtk-simple: 17518de | jgrabber++ | Build.pm:
06:01 dalek gtk-simple: Interpolate ALL the $f ile variables
06:02 dalek gtk-simple: review: https://github.com/perl6/gtk-simple/commit/17518de511
06:02 dalek gtk-simple: 7b29e8c | azawawi++ | /:
06:02 dalek gtk-simple: Merge pull request #56 from jobegrabber/fix-dll-bundling
06:02 dalek gtk-simple:
06:02 dalek gtk-simple: Fix DLL bundling by using %?RESOURCES
06:02 dalek gtk-simple: review: https://github.com/perl6/gtk-simple/commit/7b29e8cdbe
06:08 bob777 joined #perl6
06:18 CIAvash joined #perl6
06:30 girafe joined #perl6
06:37 dj_goku joined #perl6
06:37 dj_goku joined #perl6
06:37 CQ joined #perl6
06:42 cibs joined #perl6
06:44 stigo joined #perl6
06:48 cibs joined #perl6
06:55 Tonik joined #perl6
06:58 darutoko joined #perl6
07:22 FROGGS joined #perl6
07:26 holyghost joined #perl6
07:42 bob777 joined #perl6
07:53 cdg joined #perl6
08:04 pmurias joined #perl6
08:12 freeside joined #perl6
08:12 cibs joined #perl6
08:13 freeside joined #perl6
08:16 firstdayonthejob joined #perl6
08:16 pmurias konobi: re the moving us up to ecmascript 6/etc. branch, it still should be possible to compile that down to ecmascript 5 without loosing (significant) performance?
08:16 yoleaux 30 Jul 2016 23:09Z <konobi> pmurias: yeah, there seems to be some mismatch between the code-ref.js and the Operations.nqp
08:20 ufobat joined #perl6
08:25 [particle] joined #perl6
08:26 bob777 joined #perl6
08:41 molaf joined #perl6
08:45 espadrine joined #perl6
08:45 cibs joined #perl6
08:53 cibs joined #perl6
08:59 khw joined #perl6
09:03 smls joined #perl6
09:05 smls "Zero to the zeroeth power" seems inconsistent between Complex and other numeric types: http://rosettacode.org/wiki/Zero_to_the_zero_power#Perl_6
09:06 smls Is that a problem?
09:07 RabidGravy joined #perl6
09:08 TEttinger what's the square root of i?
09:08 smls Compare the Perl 5 and Python results, where (0+0i) ** (0+0i) == (1+0i)
09:08 psch http://www.wolframalpha.com/input/?i=(0+0i)+**+(0+0i)
09:08 TEttinger is that i to the i, psch?
09:08 TEttinger oh nvm
09:09 smls psch: Right, there seems to be disagreement among mathematicians whether 0**0 is 1 or undefined.
09:10 smls But whatever Perl 6 chooses, it should be the same for all Numeric types, no?
09:10 psch ah
09:11 psch well, if there's no striking maths reason why Complex should be different, i'd agree
09:11 psch i don't know of any such reason, but i'm also definitely no maths buff :)
09:13 kurahaupo joined #perl6
09:13 khw joined #perl6
09:15 spider-mario joined #perl6
09:17 spider-mario joined #perl6
09:17 rindolf joined #perl6
09:20 psch well, it has been like that since 2011-12-12 apparently
09:22 psch and it's hardcoded, so probably easy to change if we were so inclined
09:28 smls m: say (0+0i) ** 0
09:28 camelia rakudo-moar 373634: OUTPUT«NaN+NaN\i␤»
09:28 smls ^^ also interesting...
09:39 TEttinger m: say (0+1i) ** (0+1i)
09:39 camelia rakudo-moar 373634: OUTPUT«0.207879576350762+0i␤»
09:39 TEttinger wasn't expecting that
09:53 kurahaupo joined #perl6
10:00 smls I wrote up an RT for this:  https://rt.perl.org/Ticket/Display.html?id=128785
10:02 vimal2012 joined #perl6
10:05 vimal2012 left #perl6
10:15 tx0h_ joined #perl6
10:38 canopus joined #perl6
10:51 grondilu joined #perl6
10:53 rburkholder joined #perl6
11:00 freeside joined #perl6
11:11 ufobat m: my $w = (Buf.new(66), Buf.new(67)).reduce: sub {$^a.decode ~ $^b.decode}; $w.WHAT.say
11:11 camelia rakudo-moar 6972d5: OUTPUT«(Str)␤»
11:11 ufobat m: my $w = (Buf.new(66,67)).reduce: sub {$^a.decode ~ $^b.decode}; $w.WHAT.say
11:11 camelia rakudo-moar 6972d5: OUTPUT«(Buf)␤»
11:11 ufobat :-(
11:12 psch m: my $w = (Buf.new(66,67)).reduce: sub ($a, $b = Buf.new()) {$a.decode ~ $b.decode}; $w.WHAT.say
11:12 camelia rakudo-moar 6972d5: OUTPUT«(Buf)␤»
11:16 ufobat I could add a Buf.new() to the list and then i would get a String.. but thats not elegant at all
11:16 psch ufobat: why is the default i demonstrated not good enough?
11:17 psch ufobat: you're reducing a one element list with a 2-ary function otherwise
11:18 ufobat well, first i am looking for the Str
11:18 psch oh right
11:18 psch i didn't actually help
11:18 psch sorry, nevermind :)
11:18 ufobat and when i do
11:18 ufobat m: my $w = (Buf.new(65)).reduce: sub {$^a ~ $^b}; $w.say
11:18 camelia rakudo-moar 6972d5: OUTPUT«Buf:0x<41>␤»
11:18 ufobat its working fine even with your $b = Buf.new()
11:19 ufobat i will do it in 2 steps, first reducing, then .decode
11:19 psch m: sub f($, $) { die }; (1).reduce: &f
11:19 camelia rakudo-moar 6972d5: ( no output )
11:19 psch m: sub f($, $) { die }; (1,).reduce: &f
11:19 camelia rakudo-moar 6972d5: ( no output )
11:19 psch m: sub f($, $) { die }; (1,2).reduce: &f
11:19 camelia rakudo-moar 6972d5: OUTPUT«Died␤  in sub f at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
11:20 ufobat it seems that there is no need to reduce a list with less then 2 elements
11:21 psch i don't know if there's no need, but we definitely don't even call the reducer on a single element or a one-element list
11:25 psch "return op.count <= 1 ?? op.(first) !! first if second =:= IterationEnd;" is what we do in METAOP_REDUCE_LEFT
11:25 psch m: (sub ($,$) { }).count.say
11:25 camelia rakudo-moar 6972d5: OUTPUT«2␤»
11:25 psch so, yeah, first is the single element, second is IterationEnd, the reducer is 2-ary, so we get first back
11:25 psch ...probably sensible
11:25 psch m: (sub ($,$?) { }).count.say
11:25 camelia rakudo-moar 6972d5: OUTPUT«2␤»
11:25 psch m: (sub ($,$?) { }).arity.say
11:25 camelia rakudo-moar 6972d5: OUTPUT«1␤»
11:26 psch hm, or should that actually be .arity and not .count?
11:26 psch so we could reduce a one-elems list with a sub that takes two args but has one with default..?
11:32 moritz we could. Not sure it#s a good idea
11:34 psch well, it's consistent across 2-county and more-county reducers at least
11:34 psch and, well, reducing a single-element-list is kind of a thinko i guess
11:37 smls psch: Wouldn't it be a little confusing since the optional element has to be the second one in the signature...
11:38 smls ...whereas the identity element should come *before* the first real element?
11:40 ufobat Private multi-methods are not supported <- why?
11:42 psch smls: maybe?  i don't have that much inside into reduce as an algorithm, i was mostly just poking at the source to see how we do what we do
11:42 psch s/inside/insight/
11:43 BillSussman joined #perl6
11:52 wiu joined #perl6
11:58 santhosh_k joined #perl6
11:58 hwcomcn joined #perl6
11:59 ufobat it seems that there is no need to reduce a list with less then 2 elements
11:59 ufobat oups!
11:59 ufobat wrong terminal, i am sorry!
11:59 moritz ufobat: re private multis: because nobody implemented them yet
12:00 ufobat i miss them :-)
12:00 moritz ufobat: submit a patch!
12:00 santhosh_k What is pod2onepage?  How do I install that command?
12:00 moritz santhosh_k: I've never heard of that
12:01 moritz santhosh_k: where did you come across a reference to that?
12:01 ufobat erlangen.pm perl6 workshop topic: writing a patch for private multi methods
12:02 ufobat ;p
12:02 santhosh_k When I ran "make html" inside the source code from "https://github.com/perl6/doc" , I got the error message pod2onepage command not found.
12:04 hwcomcn joined #perl6
12:05 cyphase joined #perl6
12:05 santhosh_k moritz,  Exactly in this file:  https://github.com/perl6/doc/blob/master/Makefile
12:12 Actualeyes joined #perl6
12:21 kid51 joined #perl6
12:23 dalek bisectbot: 4f3a756 | (Daniel Green)++ | benchable.pl:
12:23 dalek bisectbot: Add --no-merges to the git bisecting when "zoom"ing in on performance changes
12:23 dalek bisectbot:
12:23 dalek bisectbot: There may be a better way to handle merges and the commit history, but at least for now this prevents the bisect from going back in time
12:23 dalek bisectbot: review: https://github.com/perl6/bisectbot/commit/4f3a756950
12:25 telex joined #perl6
12:27 rindolf joined #perl6
12:35 benchable joined #perl6
12:43 cdg joined #perl6
12:54 tbrowder joined #perl6
13:00 tbrowder back on p6 marketing: how about another bold-face category at bottom-right of p6 home page called something like "Active User Projects" to list such things as the (yet to be started) Lego EV3 API
13:02 tbrowder In that same light, the canonical docs need to be more obvious than just the first in a list of docs.
13:04 CIAvash joined #perl6
13:04 * lizmat likes the idea
13:20 tbrowder hm, i should have said the main docs page about the canonical docs...
13:20 lizmat regardless, attracting more attention to user projects is a good thing  :-)
13:21 tbrowder anyway, you get the idea...
13:22 tbrowder left #perl6
13:26 dainis1 joined #perl6
13:37 skids joined #perl6
13:49 parabolize m: my $w = Buf.new(); $w.^methods.gist.contains('poop').say; $w.poop()
13:49 camelia rakudo-moar 4c773b: OUTPUT«False␤Method 'poop' not found for invocant of class 'Buf'␤  in block <unit> at <tmp> line 1␤␤»
13:49 parabolize m: my $w = Buf.new(); $w.^methods.gist.contains('reduce').say; $w.reduce: {$^a.decode ~ $^b.decode}
13:49 camelia rakudo-moar 4c773b: OUTPUT«False␤»
13:57 pochi m: class Foo { multi method !foo(4) {} }
13:57 camelia rakudo-moar 4c773b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Private multi-methods are not supported␤at <tmp>:1␤------> 3class Foo { multi method7⏏5 !foo(4) {} }␤»
13:57 pochi is that "not yet implemented" or "will never implement"?
13:58 bob777 joined #perl6
14:01 lizmat pochi: not sure what jnthn's ideas about that are
14:01 lizmat but I would not expect multi private methods any time soon
14:09 cyphase joined #perl6
14:10 nowan joined #perl6
14:15 nowan_ joined #perl6
14:19 zacts joined #perl6
14:24 skids joined #perl6
14:27 wamba joined #perl6
14:31 sena_kun joined #perl6
14:32 jnthn private multis are desirable, though implementing them will want a little refactoring in the MOP code to avoid epic code duplication :)
14:33 kaare__ joined #perl6
14:41 zacts perl6 is so so cool
14:41 zacts it's beyond cool. it's awesome for sures
14:47 TimToady it's pretty okay in spots
14:50 masak I like the "l" in "Perl 6", and the space between the "l" and the "6"
14:52 lizmat .oO( but will it break? )
14:56 lizmat .oO( or will it be a non-breaking space? )
14:58 bob778 joined #perl6
15:03 setty1 joined #perl6
15:04 dalek doc: dacb35d | Altai-man++ | doc/Type/Str.pod6:
15:04 dalek doc: Delete a non-existent methods documentation due to https://github.com/perl6/doc/issues/777
15:04 dalek doc: review: https://github.com/perl6/doc/commit/dacb35d024
15:15 mr-foobar joined #perl6
15:18 dalek doc: ff7e82b | (Wenzel P. P. Peppmeyer)++ | util/extract-examples.p6:
15:18 dalek doc: the empty array is undefined and false
15:18 dalek doc: review: https://github.com/perl6/doc/commit/ff7e82b863
15:19 gfldex o.0
15:19 gfldex ENEEDMORETEA
15:21 gfldex despite the bogus commit message it actually works now
15:22 sena_kun Oh, you've fixed it. gfldex++
15:25 gfldex having automatic test for examples in docs is pretty unpractical at this point because we use code blocks to list routine definitions
15:25 gfldex they tend not to have a body or use { ... } what makes rakudo unhappy
15:28 gfldex also there are some code blocks that are missused to display tabular content
15:28 gfldex see https://docs.perl6.org/language/regexes#Backslashed,_predefined_character_classes
15:33 sena_kun If something is misused, we need to fix it anyway. It's easier to do it with test results, than by lurking around the docs. There are many relatively easy problems like "add ';' to all examples" and such.
15:35 yan__ joined #perl6
15:39 BenGoldberg joined #perl6
15:48 NEveD joined #perl6
15:56 pochi m: class Foo { has $.x is required; method foo() { say $.x }; method bar() { say 42 } }; my Foo $a; $a.bar(); $a.foo()
15:56 camelia rakudo-moar fa84f1: OUTPUT«42␤Cannot look up attributes in a type object␤  in method foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
15:58 sena_kun pochi, you should create an instance.
15:58 pochi but it still kinda worked for bar()
15:59 pochi that's some kind of zombie-state?
15:59 pochi or is bar() static?
15:59 sena_kun pochi, you can use plain type object to call methods. Lets see...
16:00 sena_kun pochi, https://docs.perl6.org/language/classtut.html#Starting_with_class
16:00 zacts joined #perl6
16:00 sena_kun pochi, https://perl6advent.wordpress.com/2013/12/02/day-02-the-humble-type-object/ - this explains your question in details.
16:02 pochi sounds to me like perl6 needs a static keyword
16:03 araujo_ joined #perl6
16:04 ugexe because your signature wasn't ::CLASS:D
16:04 ugexe and naturally you cant access a required attribute if its not set
16:04 ugexe even if you are using ::CLASS:U
16:05 pochi signature for bar?
16:10 khw joined #perl6
16:10 ugexe m: class Foo { has $.x is required; method foo() { say $.x }; method bar(Foo:D:) { say 42 } }; my Foo $a; $a.bar(); $a.foo()
16:10 camelia rakudo-moar fa84f1: OUTPUT«Invocant requires an instance of type Foo, but a type object was passed.  Did you forget a .new?␤  in method bar at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
16:11 setty1 joined #perl6
16:11 pochi yes! that's what I want!
16:11 pochi why isn't this default?
16:12 pochi when would I ever allow to call methods on a type object unless I wanted the method to be static ...
16:12 dalek doc: 91812f0 | Altai-man++ | doc/Language/syntax.pod6:
16:12 dalek doc: Radix prefixes are now searchable
16:12 dalek doc: review: https://github.com/perl6/doc/commit/91812f0605
16:13 mst pochi: because perl family languages are traditionally shotgun-free
16:15 pochi yet I managed to shoot myself in the foot :-)
16:16 yan__ joined #perl6
16:17 nightfro` joined #perl6
16:19 pmurias is using ecmascript 6 for the nqp-js/rakudo-js runtime sane?
16:22 vike joined #perl6
16:27 BenGoldberg That would mean not being able to run inside of Firefox, MS Edge, Netscape.
16:28 BenGoldberg Well, I should say, "not being able to run without shims" ;)
16:29 harmil joined #perl6
16:30 harmil Afternoon all. Is there a simpler way to say "a non-zero unsigned integer parameter that could be passed as any Cool" than sub foo(Cool $i where {.Numeric.narrow ~~ Int and .sign == 1}) {...}'
16:30 pmurias BenGoldberg: doesn't MS Edge and Firefox support ecmascript 6?
16:31 harmil I'm finding myself typing that more than I'd like.
16:32 ugexe Cool(Int)?
16:32 BenGoldberg According to https://en.wikipedia.org/wiki/ECMAScript Edge uses the Chakra engine, which is 5.1 with some features from 6.
16:32 pmurias BenGoldberg: does anyone use the pre Firefox Netscape anymore?
16:33 BenGoldberg Dunno.  I use google chrome :)
16:35 harmil m: sub foo(Cool(Int) $a) { $a.say }; foo(1); foo(0); foo(-1); foo(0.1)
16:35 camelia rakudo-moar fa84f1: OUTPUT«1␤0␤-1␤Type check failed in binding to $a; expected Int but got Rat (0.1)␤  in sub foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
16:35 harmil It accepts 0 and -1...
16:35 ugexe you still have to put the other constraints on it
16:35 pmurias BenGoldberg: I also would use by default only those features that can be efficiently shimmed
16:36 harmil m: sub foo(Cool $a where {.Numeric.narrow ~~ Int and .sign == 1}) { $a.say }; foo(1); foo(0); foo(-1); foo(0.1)
16:36 camelia rakudo-moar fa84f1: OUTPUT«1␤Constraint type check failed for parameter '$a'␤  in sub foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
16:36 harmil m: sub foo(Cool(Int) $a where {.sign == 1}) { $a.say }; foo(1); foo(0); foo(-1); foo(0.1)
16:36 camelia rakudo-moar fa84f1: OUTPUT«1␤Constraint type check failed for parameter '$a'␤  in sub foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
16:36 harmil Okay, that's better
16:37 ugexe sub foo(Cool(Int) $i where *.sign == 1)
16:37 harmil m: sub foo(Cool(Int) $a where .sign == 1) { $a.say }; foo(1); foo(0); foo(-1); foo(0.1)
16:37 camelia rakudo-moar fa84f1: OUTPUT«1␤Constraint type check failed for parameter '$a'␤  in sub foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
16:41 harmil ugexe: Thanks. There's no way to construct a type that means the same thing, is there? Because the call (foo("1")) is going to search back in the type hierarchy of Str and not find my type, right?
16:41 ugexe subtype, interface roles, etc
16:44 harmil ugexe: If I subtype Cool, then foo(MyType $x) can't accept a Str, can it, because Str isa Cool not a MyType...
16:45 ugexe subset PositiveInt of Cool where { .?Int.?sign == 1 };
16:45 psch m: Cool.^can('Int')
16:45 camelia rakudo-moar fa84f1: ( no output )
16:45 psch m: Cool.^can('Int').say
16:45 camelia rakudo-moar fa84f1: OUTPUT«(Int)␤»
16:45 psch ugexe: i don't think you need those question marks
16:45 psch ...well, unless i confuse what it means again
16:46 psch m: class A { }; say A.?Int
16:46 camelia rakudo-moar fa84f1: OUTPUT«Nil␤»
16:46 harmil m: subset PositiveInt of Cool where { .?Int.?sign == 1 }; sub foo(PositiveInt $a) { $a.say }; foo(1); foo(0); foo(-1); foo(0.1)
16:46 camelia rakudo-moar fa84f1: OUTPUT«1␤Constraint type check failed for parameter '$a'␤  in sub foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
16:46 psch m: sub f(Cool $x where * > 1) { }; f "foo"
16:46 camelia rakudo-moar fa84f1: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5foo' (indicated by ⏏)␤  in sub f at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in sub f at <tmp> line 1␤  in block <uni…»
16:46 harmil Yep, that's the stuff
16:47 harmil ugexe: thanks!
16:47 psch yeah, definitely clearer with the constraint failure than with X::Str::Numeric
16:48 psch m: say Str.^can('Int')
16:48 camelia rakudo-moar fa84f1: OUTPUT«(Int Int)␤»
16:48 psch but yeah, i'm pretty sure you don't need the question marks, because any Cool type has a method Int
16:48 psch it might throw, yes, but that's not what the methodop .? checks for
16:49 psch https://docs.perl6.org/language/operators#postfix_.?
16:55 obfusk joined #perl6
16:56 ugexe yeah, thats more for the Str bit he mentioned although i'm not sure if he wanted the constraint or not (i.e. `subtype PositiveInt where { .?Int.?sign == 1 }`)
16:56 psch m: say "foo".?Int.?sign
16:56 camelia rakudo-moar fa84f1: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5foo' (indicated by ⏏)␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
16:56 psch ugexe: that's my point, it still throws
16:57 ugexe ugh, i wish there was a way to do that instead of .?Int && .Int.sign
16:57 BenGoldberg Could someone tell me what's causing this error:
16:57 BenGoldberg m: https://gist.github.com/BenGoldberg1/147f6ec10c0f4428f7767baa8ae9c15a
16:57 camelia rakudo-moar fa84f1: OUTPUT«5===SORRY!5===␤Function 'say' needs parens to avoid gobbling block␤at <tmp>:7␤------> 3^$!wheel-size.grep: { @!wheel-test[$_] }7⏏5;␤Missing block (apparently claimed by 'say')␤at <tmp>:3␤------> 3my class P does Iterator 7⏏5{␤␤»
16:58 psch ugexe: i think you're expecting the .? from C#?
16:59 BenGoldberg m: say Int.?say
16:59 camelia rakudo-moar fa84f1: OUTPUT«(Int)␤True␤»
16:59 BenGoldberg m: say "foo".?Int
16:59 camelia rakudo-moar fa84f1: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5foo' (indicated by ⏏)␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
17:00 BenGoldberg m: my $x = do if "foo".Int -> \ok { ok } else { 0 }; say $x;
17:00 camelia rakudo-moar fa84f1: OUTPUT«0␤»
17:00 psch m: ^3.map: *.say
17:00 camelia rakudo-moar fa84f1: OUTPUT«Potential difficulties:␤    Precedence of ^ is looser than method call; please parenthesize␤    at <tmp>:1␤    ------> 3^37⏏5.map: *.say␤WARNINGS for <tmp>:␤Useless use of "^" in expression "^3.map: *.say" in sink context (line 1)␤3␤»
17:01 psch BenGoldberg: that ^^^ is an error i would expect
17:01 psch BenGoldberg: not sure where the parser finds a say on line 3 :/
17:01 dainis joined #perl6
17:01 BenGoldberg Me either ;)
17:01 tbrowder joined #perl6
17:06 BenGoldberg Ok, I was missing a }, but that was really a less than awesome error message.
17:07 psch ah, the "until @outbuf" wasn't closed, was it
17:07 timotimo you had an unmatched} ?
17:15 nightfro` joined #perl6
17:20 dalek doc/animation-has-gone: d0dfc5a | Altai-man++ | html/js/main.js:
17:20 dalek doc/animation-has-gone: The TOC animation was removed
17:20 dalek doc/animation-has-gone: review: https://github.com/perl6/doc/commit/d0dfc5ab6f
17:25 FROGGS joined #perl6
17:31 cygx joined #perl6
17:32 cdg joined #perl6
17:32 cygx ugexe: you're looking for andthen
17:32 cygx m: subset Positive-y of Cool where (.Int andthen $_ > 0); say "foo" ~~ Positive-y; say "0" ~~ Positive-y; say "42" ~~ Positive-y
17:32 camelia rakudo-moar fa84f1: OUTPUT«WARNINGS for <tmp>:␤Useless use of ">" in expression "$_ > 0" in sink context (line 1)␤False␤False␤True␤»
17:34 cdg_ joined #perl6
17:34 psch m: "0" andthen say "foo"
17:34 camelia rakudo-moar fa84f1: OUTPUT«foo␤»
17:34 psch m: +"0" andthen say "foo"
17:34 camelia rakudo-moar fa84f1: OUTPUT«foo␤»
17:34 psch m: subset Positive-y of Cool where { .Int and $_ > 0 }; say "foo" ~~ Positive-y; say "0" ~~ Positive-y; say "42" ~~ Positive-y # huh
17:34 camelia rakudo-moar fa84f1: OUTPUT«False␤False␤True␤»
17:34 psch oh duh
17:34 psch cygx++
17:37 ldwrf joined #perl6
17:39 travis-ci joined #perl6
17:39 travis-ci Doc build passed. Altai-man 'The TOC animation was removed'
17:39 travis-ci https://travis-ci.org/perl6/doc/builds/148700280 https://github.com/perl6/doc/commit/d0dfc5ab6f6f
17:39 travis-ci left #perl6
17:52 harmil I was trying to define continuing fractions as a sub-type of Rat (LazyRat: http://pastebin.com/XfAthmkW) but am running into the strangest thing. Inside of my LazyRat.partial my &.whole-part-op appears to be set to Callable instead of &infix:<+>
17:53 harmil If anyone finds the inspiration to go peering at it and sees my (probably stupid) mistake, I'd be grateful. I have to go visit a friend in the hospital, but I'll check in in a bit.
17:57 tailgate How does one take a List and remove the first element from it? i.e remove the first item from $string.split('')
18:00 MasterDuke tailgate: shiftq
18:00 MasterDuke whoops, that's just 'shift'
18:02 MasterDuke and btw, $string.comb will do (nearly) the same things as $string.split('')
18:03 domidumont joined #perl6
18:04 cygx or subscripting with [1..*] if you do not want to modify the original list
18:11 devmikey joined #perl6
18:11 devmikey What is so special about perl6?
18:13 pmurias devmikey: I think the answer is different for everybody interested in the language
18:14 zacts joined #perl6
18:14 ufobat joined #perl6
18:14 pmurias devmikey: for me it's the attention to detail in all the little things, a hefty bunch of awesome features plus it's something that's fun to work on
18:15 pmurias devmikey: do you like Perl 5?
18:16 ufobat why is this blocking? https://gist.github.com/ufobat/9da94ef6d12f56a6f7b59804888d5237 i would have expected it differently
18:20 devmikey pmurias: i do like perl 5 for some things, yes
18:22 pmurias devmikey: so the intent of Perl 6 is to preserve the good parts of Perl 5 and get rid of the bad ones and add a bunch of new awesome ones
18:23 AlexDaniel unmatched}: there was also this: https://www.youtube.com/watch?v=KEal8B_36Ac
18:23 AlexDaniel unmatched}: which arguably requires a bit more skill than just getting into the net…
18:23 pmurias devmikey: but it's not a Perl 5 replacement (as Perl 5 is not going anywhere soon)
18:24 AlexDaniel devmikey: I'd say try it and see yourself
18:26 devmikey I hate it when they try to make languages be Java
18:26 devmikey That's what they are doing with php
18:26 pmurias_ joined #perl6
18:28 pmurias_ joined #perl6
18:29 FROGGS devmikey: Perl 6 does not feel like Java, really :o)
18:29 pmurias devmikey: that's not the direction Perl 6 is going in
18:29 devmikey good
18:31 FROGGS just as an example: http://rosettacode.org/wiki/Gray_code#Perl_6
18:32 FROGGS if you click on the Perl 6 caption you can look at other examples
18:38 avar Why is 'say lines + 0' not the same as 'say 0 + lines'? Presumably say has higher precidence? Does perl6 have a -MO=Deparse equivalent?
18:38 avar Or -MO=Concise|Terse
18:40 BenGoldberg The most java-like aspect of perl6 is that it uses . for calling methods, as opposed to the -> operator of per5.
18:51 cygx avar: lines optionally takes arguments, so the first example gets parsed as `lines(+0)` instead of `lines() + 0`
18:51 pmurias avar: perl6 --target=ast might help
18:52 pmurias avar: there doesn't seem to be a -MO=Deparse yet
19:04 ufobat m: my $s = Supplier.new; my $y = $s.Supply; $y.tap(-> $v {$v.say}, done => {say "done"}); $s.emit(42); $s.done; $y.wait'
19:04 camelia rakudo-moar fa84f1: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3 "done"}); $s.emit(42); $s.done; $y.wait7⏏5'␤    expecting any of:␤        infix␤        infix stopper␤        statement end␤        statement modif…»
19:05 ufobat m: my $s = Supplier.new; my $y = $s.Supply; $y.tap(-> $v {$v.say}, done => {say "done"}); $s.emit(42); $s.done; $y.wait
19:05 camelia rakudo-moar fa84f1: OUTPUT«(timeout)42␤done␤»
19:08 jnthn ufobat: $y.wait is a fresh and independent tapping of the Supply, which comes after the done and so won't see it.
19:09 jnthn (thus the timeout)
19:10 ufobat and the same here?
19:10 ufobat m: my $s = Supplier.new; my $y = $s.Supply; $s.emit(42); $s.done; say $y.list.reduce({$^a ~ $^b})
19:10 camelia rakudo-moar fa84f1: OUTPUT«(timeout)»
19:11 jnthn Yup
19:11 ufobat if a method gets passed a Supply, and i have no control of the Supplier, and i dont know if he has called .done yet?
19:12 gfldex ENODALEK
19:13 jnthn In general you don't know whether any supply you're given is infinite or finite
19:13 jnthn You can ask if it's live or on-demand
19:13 jnthn The use cases for live supplies tend to be infinite ones
19:14 jnthn But stepping back a little further, generally turning a supply (an async thing) into a synchronous thing is something you should be doing very rarely.
19:16 b2gills m: my $s = Supplier.new; my $y = $s.Supply; $y.tap(-> $v {$v.say}, done => {say "done"}); $s.emit(42); my $p = $y.Promise; sleep 1; $s.done; sleep 1; say $p.status
19:16 camelia rakudo-moar fa84f1: OUTPUT«42␤done␤Planned␤»
19:16 ufobat so basically i shouldn't use a supply for this scenario?
19:16 jnthn The example is way too far abstracted from a real problem for me to be able to suggest what to use or not :)
19:16 ufobat the Real World example is p6w
19:17 ufobat https://github.com/zostay/Smack/blob/master/lib/HTTP/Server/Smack.pm6#L167
19:17 ufobat i can not read from my $connection within the supply {} because of the threadcontext
19:18 ufobat and i can not use a Supplier, emit all values in this thread, call $supplier.done and get all the values in my webapp
19:19 ufobat i am not sure, but i have a feeling that it's hard or not possible to do p6w with supplies in a non multithreaded way
19:22 jnthn Surely it is, but IO::Socket::Async would be a much more natural starting point.
19:22 jnthn Since it's already thread-agnostic and spits data out on a Supply
19:22 gfldex sena_kun: problem solved: https://github.com/perl6/doc/commit/96acaf58d6f26fecf55393d17bf866b066aae472
19:22 ufobat yeah but then it is multithreaded, isnt it? (which would be better, of course)
19:24 zostay just a note that anything smack does currently is not intended to show what is a good way... just an initial JFDI to get started with the handful of tests currently written
19:24 jnthn Yes, as soon as you're using IO::Socket::Async your app is multi-threaded.
19:24 jnthn Note however that supply/react blocks include doing concurrency control :)
19:25 zostay P6W assumes multi-threading at its heart
19:25 sena_kun gfldex, oh, neat. I can use emacs macro to do easy work for test passing, such commits can be pushed into master directly, I suppose?
19:25 gfldex sena_kun: yes
19:26 ufobat zostay, i am not sure wether it is impossible to do it in a singlethreaded way, if so, souldn't it removed from the spec
19:26 sena_kun gfldex, good.
19:26 zostay which part needs to be removed?
19:26 ufobat setting 'p6w.multithread' to false?
19:27 * jnthn back later
19:28 ufobat thank for your help jnthn  :)
19:29 zostay p6w.multithread = False does not mean the server is not multithreaded, it's more of a promise that the application won't be run in multiple threads, which might be a server setting admits could set for apps that handle concurrency poorly
19:31 pmurias .tell konobi I'm applying your refactoring piece by piece as there was a bit of things that where breaking stuff and also I prefer run the tests after relatively small changes rather then debug complex interactions
19:31 yoleaux pmurias: I'll pass your message to konobi.
19:31 andrzejku joined #perl6
19:31 zostay s/admits/admins/ # butterfingers
19:33 ufobat zostay, i c :)
19:55 yqt joined #perl6
20:08 dainis joined #perl6
20:11 nightfrog joined #perl6
20:21 inkjetunito joined #perl6
20:22 inkjetunito left #perl6
20:24 yqt joined #perl6
20:27 labster joined #perl6
20:29 nightfrog joined #perl6
20:35 dainis joined #perl6
21:14 ldwrf left #perl6
21:15 kalkin-_ why does sub MAIN('foo', :$bar, Bool :$verbose) { say Foo if $verbose; }. Doesn't mach .perl6 bar.pm6 foo foo --verbose?
21:15 kalkin-_ Aehm
21:16 kalkin-_ Doesn't match perl6 bar.pm foo --verbose
21:16 kalkin-_ If i execute perl6 bar.pm6 --verbose foo. I get the error: Unexpected parameter verbose passed
21:16 kalkin-_ --help shows me: foo.pm6 [--bar=<Any>] [--verbose] foo
21:17 masak kalkin-_: I get "Undeclared name: Foo"
21:17 kalkin-_ which actually is not what I expect to see. I expect foo.pm6 foo [--bar=<Any>]....
21:17 kalkin-_ masak: of course say "Foo"
21:17 masak kalkin-_: right
21:17 kalkin-_ I have to many Foos in my example :)
21:18 masak kalkin-_: when I fix that, it works here
21:18 masak kalkin-_: `perl6 bar.pm6 --verbose foo` works
21:18 kalkin-_ masak: perl6 --version?
21:18 masak This is Rakudo version 2016.07.1-94-gfa84f13 built on MoarVM version 2016.07-3-gc01472d
21:19 kalkin-_ ups 20.16.06
21:19 geekosaur might also have to watch out for wrappers
21:21 Zoffix joined #perl6
21:21 buggable joined #perl6
21:22 buggable joined #perl6
21:23 Zoffix buggable, rt
21:23 buggable Zoffix, TOTAL: 1355, UNTAGGED: 611, BUG: 414, LTA: 90, JVM: 62, NYI: 32, SEGV: 28, UNI: 25, RFC: 24, PERF: 19, POD: 14, CONC: 11, @LARRY: 10, TODO: 9, PRECOMP: 8, GLR: 6, BUILD: 5, STAR: 4, WEIRD: 3, LTA ERROR: 3, MOARVM: 2, OSX: 2, FEATURE REQUEST: 1, CPP: 1, SPEC: 1, LIST: 1, LHF: 1, SPESH: 1, DOCS: 1, NATIVECALL: 1   Details: http://bug.perl6.party/1470000217.html
21:23 Zoffix buggable, rt RFC
21:23 buggable Zoffix, Found 21 tickets tagged with RFC. Details: http://bug.perl6.party/1470000228.html
21:23 * Zoffix plans to add search later on
21:25 kalkin-_ Hmm I changed to Rakudo version 2016.07.1 built on MoarVM version 2016.07, but still same issue, hmm..
21:25 skids joined #perl6
21:26 kalkin-_ perl6 bar.pm6 foo --verbose just prints out usage
21:26 ugexe what exactly are you trying? you showed both foo --verbose and --verbose foo
21:27 kalkin-_ ugexe: well both don't work
21:27 ugexe that doesnt help anyone map your error to what you actually did
21:27 kalkin-_ just a second
21:28 kalkin-_ this is the code https://gist.github.com/kalkin/579dd6973c860a5d518ab81e64a3c859
21:29 ugexe `say :$verbose`
21:29 ugexe s/://
21:30 kalkin-_ ompf. Thanks!
21:31 kalkin-_ But still ./mycode foo --verbose doesn't work
21:31 kalkin-_ I just get the usage
21:31 Zoffix left #perl6
21:31 ugexe it has to be named before positional
21:31 ugexe --verbose foo
21:32 kalkin-_ ugexe: why? I mean I understand if this is needed in Perl6 code, but why when parsing args from shell?
21:33 kalkin-_ Is this a bug, a feature or do I misunderstand some thing important?
21:33 ugexe its designed that way
21:34 kalkin- This design decision complicates writing git like commands
21:35 ugexe so dont use the built in getopts
21:36 gfldex kalkin-: the code that is handling mapping MAIN and command line arguments is incomplete and you are more then welcome to fix it. In the mean time you can use Getopt::Long to handle special cases.
21:36 ugexe gfldex: a PR already exists
21:37 ugexe https://github.com/rakudo/rakudo/pull/688
21:37 kalkin- gfldex: this is more what i wanted to hear. I already know where everything is happening. will look into that
21:37 ugexe afaik its a decision by TT
21:37 kalkin- ohh there are already patches for that
21:38 gfldex having named arguments before positionals is a good default because it plays well with alias
21:38 ugexe right. its working as designed right now. its up to TT if it should change
21:38 kalkin- gfldex: how do aliases work is this documented some where?
21:39 gfldex kalkin-: http://ss64.com/bash/alias.html
21:39 kalkin- ohh you mean like shell alias
21:39 kalkin- i thought there is a way to specify alias for the parameters read in from the shell
21:41 kalkin- Would be nice to know why TT has so strong opinion about that
21:42 ugexe not all OS use gnu style argument handling
21:42 ugexe like bsd
21:42 geekosaur because you can't write something sudo-like if you force gnu permute
21:43 kalkin- geekosaur: afaik you can always use --
21:43 geekosaur oh, and you will simplify part of your git-like while breaking other parts if you auto-permute
21:43 geekosaur uyes, you can insist that every sensible usage mode requires --
21:43 geekosaur haskell's tooling does that. ALWAYS have to write cabal exec -- ... or stack exec -- ...
21:44 geekosaur because it does the wrong thing otherwise
21:44 geekosaur becase, like you, it thinks permute is the only correct way
21:44 gfldex kalkin-: the problem is that the change can alter external behaviour of programs. Since we don't know yet how we handle versioning of the language, this change was put on hold.
21:44 kalkin- geekosaur: correcty me if i'm wrong, but don't bsd style tools have no long option? (looking at sudo(8) right now)
21:45 geekosaur not always true, and in any case gnu style permutes short options as well
21:45 kalkin- geekosaur: yeah that's true
21:45 geekosaur bsd just doesn't come with a standard long options function
21:45 ugexe its like saying gnu doesnt use --/
21:46 kalkin- I think I understand the issue
21:46 geekosaur consider x11 core programs, many of which predate gnu by some 20 years. in particular consider xterm -e ...
21:47 kalkin- hmm i always have to guess that if I put double quote around or do -- or if both works
21:47 geekosaur well, 10 years at least. which is why they do -long_option
21:47 b2gills You can modify @*ARGS in the mainline to get it to work like you want it, but it is error prone
21:48 kalkin- how does git gets around this problem? As far as I know git allows this kind of options
21:49 kalkin- IMHO I never had an issue during scripting git
21:50 geekosaur I think the main command parser just looks for the first non-option and then checks if it's an external command; at that level it accepts no options at all, so it can just pass the whole mess off.
21:50 geekosaur if they ever find a need to change that, things will become... entertaining
22:06 cdg joined #perl6
22:16 dainis joined #perl6
22:18 gfldex lolibloggedalittle: https://gfldex.wordpress.com/2016/08/01/walk-on-the-flats/
22:21 zacts joined #perl6
22:25 cyphase joined #perl6
22:27 kalkin- Is there something like setup_hooks (Python) in Perl6? setup_hooks allow specifying some key in setup.py for which all installable python modules can register. This simplifies writing stuff for which other people can develop plugins
22:28 MasterDuke gfldex: nice. this bit is a little awkward though: "what includes changes in halve a years time."
22:28 MasterDuke the end should be "half a year's time."
22:28 masak gfldex: s/deconstruction/destructuring/
22:29 masak also, `flat` is not a metaop, it's a listop
22:30 gfldex masak: that's not what I meant and hope the added comma helps
22:31 masak it does
22:32 timotimo i'm incredibly lucky
22:32 timotimo it's not my laptop that's b0rked, it's my PSU thingie
22:32 timotimo and i have something like a replacement
22:36 cdg joined #perl6
22:40 canopus joined #perl6
22:53 bjz joined #perl6
22:59 AndyBotwin joined #perl6
22:59 Actualeyes left #perl6
23:10 zacts joined #perl6
23:34 flaviusb left #perl6
23:44 captain-adequate joined #perl6
23:53 gfldex the map is slowly filling up: http://imgur.com/a/DbbM7

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

Perl 6 | Reference Documentation | Rakudo