Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-08-29

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:00 grondilu m: use NativeCall; role Foo[Sub &native] { has &.native }; role Bar is repr('CPointer') {};
00:00 camelia rakudo-moar d43ea0: ( no output )
00:00 grondilu m: use NativeCall; role Foo[Sub &native] { has &.native }; role Bar is repr('CPointer') {}; class :: does Foo(sub {}) {}
00:00 camelia rakudo-moar d43ea0: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in typename; couldn't find final ')' ␤at <tmp>:1␤------> 3 repr('CPointer') {}; class :: does Foo(7⏏5sub {}) {}␤»
00:00 grondilu m: use NativeCall; role Foo[Sub &native] { has &.native }; role Bar is repr('CPointer') {}; class :: does Foo(my & = sub {}) {}
00:00 camelia rakudo-moar d43ea0: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in typename; couldn't find final ')' ␤at <tmp>:1␤------> 3 repr('CPointer') {}; class :: does Foo(7⏏5my & = sub {}) {}␤»
00:00 grondilu m: use NativeCall; role Foo[Sub &native] { has &.native }; role Bar is repr('CPointer') {}; class :: is Foo(sub {}) {}
00:00 camelia rakudo-moar d43ea0: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Cannot resolve caller trait_mod:<is>(<anon|78520784>, Foo, Sub); none of these signatures match:␤    (Mu:U $child, Mu:U $parent)␤    (Mu:U $child, :$DEPRECATED!)␤    (Mu:U $type, :$rw!)␤    (Mu:U $ty…»
00:00 grondilu wth
00:01 grondilu oh
00:01 grondilu m: use NativeCall; role Foo[Sub &native] { has &.native }; role Bar is repr('CPointer') {}; class :: is Foo[sub {}] {}
00:01 camelia rakudo-moar d43ea0: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Cannot resolve caller trait_mod:<is>(<anon|59022496>, Foo, Array); none of these signatures match:␤    (Mu:U $child, Mu:U $parent)␤    (Mu:U $child, :$DEPRECATED!)␤    (Mu:U $type, :$rw!)␤    (Mu:U $…»
00:02 grondilu m: use NativeCall; role Foo[Sub &native] { has &.native }; role Bar is repr('CPointer') {}; class :: does Foo[sub {}] {}
00:02 camelia rakudo-moar d43ea0: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤No appropriate parametric role variant available for 'Foo'␤at <tmp>:1␤»
00:02 grondilu damn it
00:02 grondilu back to basic:
00:02 grondilu m: role Foo[Int $] {}; class :: does Foo[13] {}
00:02 camelia rakudo-moar d43ea0: ( no output )
00:03 grondilu ok
00:03 grondilu m: role Foo[Sub &] {}; class :: does Foo[sub {}] {}
00:03 camelia rakudo-moar d43ea0: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤No appropriate parametric role variant available for 'Foo'␤at <tmp>:1␤»
00:03 grondilu hum
00:03 grondilu m: say .WHAT given sub {}
00:03 camelia rakudo-moar d43ea0: OUTPUT«(Sub)␤»
00:03 grondilu Can't I use a Sub as a parameter in a parametric role?
00:16 mtj_ joined #perl6
00:18 grondilu m: role Foo[$] {}
00:18 grondilu m: say "hi"
00:18 camelia rakudo-moar d43ea0: ( no output )
00:18 camelia rakudo-moar d43ea0: OUTPUT«hi␤»
00:18 grondilu wow that first one took its time
00:18 grondilu m: role Foo[$] {}
00:18 camelia rakudo-moar d43ea0: ( no output )
00:18 grondilu actually not
00:19 grondilu m: role Foo[$] {}; class :: does Foo[my $ = sub {}] {}
00:19 camelia rakudo-moar d43ea0: ( no output )
00:20 grondilu m: role Foo[$f] { my $.f = $f; method f { $!f() } }; class :: does Foo[my $ = sub { say "hi!" }] {}.f
00:20 camelia rakudo-moar d43ea0: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Package 'Foo' already has a method 'f' (did you mean to declare a multi-method?)␤at <tmp>:1␤»
00:20 grondilu m: role Foo[$f] { my $.f = $f; method talk { $!f() } }; class :: does Foo[my $ = sub { say "hi!" }] {}.talk
00:20 camelia rakudo-moar d43ea0: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Attribute $!f not declared in role Foo␤at <tmp>:1␤------> 3] { my $.f = $f; method talk { $!f() } }7⏏5; class :: does Foo[my $ = sub { say "hi␤    expecting any of:␤        horizontal whitespac…»
00:21 grondilu m: role Foo[$f] { has $.f = $f; method talk { $!f() } }; class :: does Foo[my $ = sub { say "hi!" }] {}.talk
00:21 camelia rakudo-moar d43ea0: OUTPUT«Cannot look up attributes in a type object␤  in method talk at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
00:21 grondilu m: role Foo[$f] { method talk { $f() } }; class :: does Foo[my $ = sub { say "hi!" }] {}.talk
00:21 camelia rakudo-moar d43ea0: OUTPUT«hi!␤»
00:22 grondilu m: role Foo[$f] { method fork { $f() } }; class :: does Foo[my $ = sub fork() is native {}] {}.fork; say "hi"
00:22 camelia rakudo-moar d43ea0: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Can't use unknown trait 'is native' in a sub declaration.␤at <tmp>:1␤    expecting any of:␤        rw raw hidden-from-backtrace hidden-from-USAGE␤        pure default DEPRECATED inlinable nodal␤   …»
00:22 grondilu m: role Foo[$f] { method fork { $f() } }; class :: does Foo[my $ = sub fork() is native() {}] {}.fork; say "hi"
00:22 camelia rakudo-moar d43ea0: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Can't use unknown trait 'is native' in a sub declaration.␤at <tmp>:1␤    expecting any of:␤        rw raw hidden-from-backtrace hidden-from-USAGE␤        pure default DEPRECATED inlinable nodal␤   …»
00:22 grondilu m: use NativeCall; role Foo[$f] { method fork { $f() } }; class :: does Foo[my $ = sub fork() is native {}] {}.fork; say "hi"
00:22 camelia rakudo-moar d43ea0: OUTPUT«hi␤hi␤»
00:22 grondilu nice
00:23 mtj_ joined #perl6
00:24 grondilu m: use NativeCall; role Foo[$f] { method fork { $f() } }; class :: does Foo[sub fork() is native {}] {}.fork; say "hi"
00:24 camelia rakudo-moar d43ea0: OUTPUT«hi␤hi␤»
00:25 grondilu m: use NativeCall; role Foo[$f] is repr('CPointer') { method fork { $f() } }; class :: does Foo[sub fork() is native {}] {}.fork; say "hi"
00:25 camelia rakudo-moar d43ea0: OUTPUT«hi␤hi␤»
00:25 grondilu that looks a lot like what I was considering doing.  Cool.
00:29 b2gills 「Sub &」 declares that it requires a Callable that returns a Sub
00:31 tbrowder ugexe: thanks
00:32 tbrowder .tell ugexe thanks
00:32 yoleaux tbrowder: I'll pass your message to ugexe.
00:33 mcmillhj joined #perl6
00:38 BenGoldberg joined #perl6
00:40 nbrown joined #perl6
00:43 nbrown joined #perl6
00:43 grondilu m: role Foo[Sub &] {}; class :: does Foo[sub (--> Sub) { sub {} }] {}
00:43 camelia rakudo-moar d43ea0: ( no output )
00:43 grondilu b2gills: you're right
00:44 grondilu m: role Foo[&] {}; class :: does Foo[sub {}] {}
00:44 camelia rakudo-moar d43ea0: ( no output )
00:53 pierre_ joined #perl6
00:55 araujo_ joined #perl6
00:58 mcmillhj joined #perl6
01:13 Actualeyes joined #perl6
01:14 zengargoyle joined #perl6
01:14 mcmillhj joined #perl6
01:17 woodruffw joined #perl6
01:17 woodruffw joined #perl6
01:18 _slade_ joined #perl6
01:19 Lucas_One joined #perl6
01:20 SmokeMachine____ joined #perl6
01:23 olinkl joined #perl6
01:24 beatdown joined #perl6
01:25 kipd joined #perl6
01:26 mithaldu_ joined #perl6
01:27 notbenh_ joined #perl6
01:27 AngeloMichael joined #perl6
01:28 BuildTheRobots joined #perl6
01:33 mcmillhj joined #perl6
01:38 zacts joined #perl6
01:45 TEttinger joined #perl6
01:45 r_i_d joined #perl6
01:51 mcmillhj joined #perl6
02:05 mcmillhj joined #perl6
02:12 _slade_ joined #perl6
02:16 wamba joined #perl6
02:23 mcmillhj joined #perl6
02:37 mcmillhj joined #perl6
02:43 noganex_ joined #perl6
02:51 mcmillhj joined #perl6
03:07 r_i_d joined #perl6
03:09 r_i_d is there a built-in way to check if a variable is an element in a given array?
03:10 r_i_d right now i iterate over the array with a for-loop and trigger a duplicate flag accordingly -- is there a better way?
03:11 cuonglm joined #perl6
03:12 cuonglm jnthn: Is there any design doc about NFG implementation in MoarVM?
03:12 harmil r_i_d: you can use a Set, but if you are doing this just once, it's more efficient to just scan the list
03:13 cuonglm I read your article http://www.jnthn.net/papers/2015-spw-nfg.pdf
03:13 r_i_d okay, thanks
03:13 ugexe m: my @arr = <a b c d>; say "a" ~~ @arr.any; say "z" ~~ @arr.any
03:13 yoleaux 00:32Z <tbrowder> ugexe: thanks
03:13 camelia rakudo-moar d43ea0: OUTPUT«True␤False␤»
03:14 r_i_d oh, that's nice.
03:14 ugexe m: my @arr = <a b c d>; say @arr.contains("a"); say @arr.contains("z")
03:14 camelia rakudo-moar d43ea0: OUTPUT«True␤False␤»
03:16 r_i_d perfect.
03:18 harmil I didn't even know there was a contains. That's handy. I assume it just scans the array?
03:18 r_i_d Larry thought of everything, aparently.
03:18 geraud m: my @a = <a b c d e>; say "d" ∈ @a;
03:18 camelia rakudo-moar d43ea0: OUTPUT«True␤»
03:18 ugexe m: say "abc".contains("a"); say "abc".contains("z")
03:18 camelia rakudo-moar d43ea0: OUTPUT«True␤False␤»
03:19 mcmillhj joined #perl6
03:21 ugexe `cd rakudo && git grep "method contains"` will generally make it easy to find where and how something is implemented
03:32 mcmillhj joined #perl6
03:41 TEttinger joined #perl6
03:44 zacts joined #perl6
03:46 araujo__ joined #perl6
03:52 TEttinger joined #perl6
03:53 nester joined #perl6
03:54 mcmillhj joined #perl6
04:04 notostraca joined #perl6
04:15 notostraca joined #perl6
04:37 notostraca joined #perl6
04:39 mcmillhj joined #perl6
04:47 pierre_ joined #perl6
04:48 notostraca joined #perl6
04:48 mohae_ joined #perl6
04:56 mcmillhj joined #perl6
05:14 notostraca joined #perl6
05:20 mcmillhj joined #perl6
05:22 zacts joined #perl6
05:32 mcmillhj joined #perl6
05:36 Actualeyes joined #perl6
05:38 notostraca joined #perl6
05:50 notostraca joined #perl6
05:50 pierre_ joined #perl6
05:52 CIAvash joined #perl6
06:03 pierre_ joined #perl6
06:04 mcmillhj joined #perl6
06:06 robinsmidsrod joined #perl6
06:06 pierre_ joined #perl6
06:09 avuserow m: class Foo {has $!x; method x {return Proxy.new(FETCH => sub ($) {$!x}, STORE => sub ($, $v) {note "got here"; $!x = $v;})}}; my $f = Foo.new; $f.x = 1; say $f.x; my @attrs = Foo.^attributes(:local)[0].set_value($f, 2); say $f.x; note "pre-3"; $f.x = 3; say $f.x;
06:09 camelia rakudo-moar d43ea0: OUTPUT«got here␤1␤2␤pre-3␤got here␤Cannot assign to an immutable value␤  in sub  at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
06:09 avuserow looks like set_value and Proxies interact poorly?
06:10 avuserow anyway I don't need to use a Proxy per se, I just want to update one attribute whenever another is set... not sure what good ways there are for that
06:19 nine harmil: do _not_ use .contains! That checks if the given value is a substring. On lists it will check if the value is a substring of the stringified list. So it'll find "1" in (10, 11, 12).
06:19 nine ugexe: ^^^
06:19 mcmillhj joined #perl6
06:20 nine lizmat++ noticed this and already suggested a fix, but for now that's unfortunately how it is.
06:21 labster joined #perl6
06:33 nadim joined #perl6
06:41 domidumont joined #perl6
06:46 domidumont joined #perl6
06:47 nadim_ joined #perl6
06:47 mcmillhj joined #perl6
07:02 mcmillhj joined #perl6
07:11 cgfbee joined #perl6
07:11 notostraca joined #perl6
07:24 notostraca joined #perl6
07:28 espadrine joined #perl6
07:33 RabidGravy joined #perl6
07:34 mcmillhj joined #perl6
07:38 canopus joined #perl6
07:40 ufobat joined #perl6
07:44 firstdayonthejob joined #perl6
07:45 mcmillhj joined #perl6
07:45 notostraca joined #perl6
07:47 ufobat joined #perl6
07:48 darutoko joined #perl6
07:54 pierrot joined #perl6
07:58 notostraca joined #perl6
07:59 mcmillhj joined #perl6
08:02 jonas2 joined #perl6
08:06 quester joined #perl6
08:07 notostraca joined #perl6
08:09 Jody_ joined #perl6
08:09 g4 joined #perl6
08:19 leont joined #perl6
08:20 firstdayonthejob joined #perl6
08:22 araujo joined #perl6
08:30 TEttinger joined #perl6
08:31 salva joined #perl6
08:37 mcmillhj joined #perl6
08:44 TEttinger joined #perl6
08:45 mvorg joined #perl6
08:47 xiaomiao joined #perl6
08:49 jnthn .tell cuonglm No design doc, though the key data structures are described somewhat in the .h files; of note see https://github.com/MoarVM/MoarVM/blob/master/src/strings/nfg.h and https://github.com/MoarVM/MoarVM/blob/master/src/strings/normalize.h
08:49 yoleaux jnthn: I'll pass your message to cuonglm.
08:53 mcmillhj joined #perl6
08:59 TEttinger joined #perl6
08:59 Actualeyes1 joined #perl6
09:06 smls joined #perl6
09:08 TEttinger jnthn: is that grapheme normalization stuff? guessing by names
09:09 TEttinger joined #perl6
09:09 mcmillhj joined #perl6
09:10 jnthn TEttinger: Yes :)
09:10 jnthn (Was answering a question from the backlog :))
09:12 user9 joined #perl6
09:15 quester left #perl6
09:16 notostraca joined #perl6
09:26 mcmillhj joined #perl6
09:54 Actualeyes joined #perl6
09:57 mcmillhj joined #perl6
10:16 melezhik Good day gentlemen
10:17 melezhik how I can create a perl6 class with a "nested" name? Like class Foo::Bar::Baz
10:17 melezhik looks like simple having "class Foo::Bar::Baz {}" does not work
10:22 jnthn m: class Foo::Bar::Baz { method m { 'bacon' } }; say Foo::Bar::Baz.m
10:22 camelia rakudo-moar f2df2c: OUTPUT«bacon␤»
10:23 jnthn Seems to work fine, so I suspect you're running into some other problem :)
10:24 melezhik jnthn: will double check thanks!
10:26 melezhik ok, I see the root now. Had to add class Name / file path  into META.info , so t/ succeed when run panda --force install .
10:27 kaare_ joined #perl6
10:28 melezhik anybody knows the reference to Perl6 Test ? all I find is http://perl6maven.com/how-to-test-perl6-modules but it is not enough for me ...
10:30 DrForr https://docs.perl6.org/language/testing
10:30 melezhik DrForr: thanks
10:30 melezhik looks good :)
10:31 melezhik how can have panda installer to show verbose test output when run my tests with `panda install .`
10:31 melezhik ?
10:31 melezhik looks like --verbose don't work
10:31 mcmillhj joined #perl6
10:33 DrForr "Doesn't work" isn't as helpful as "I would have expected... but didn't see it."
10:34 melezhik ok. "panda --force --verbose install ." give me a panda help info, instead of running tests
10:35 melezhik "panda --force install ." runs my tests and makes install
10:36 DrForr I'll have to install locally to confirm.
10:37 nine melezhik: add --verbose to your ~/.proverc
10:37 melezhik DrForr: https://github.com/melezhik/outhentix
10:38 melezhik head  ~/.proverc
10:39 melezhik --verbose
10:39 DrForr 'panda --force --verbose install .' appears to be failing correctly as '.' isn't a list of modules, but a directory. If you're used to that from Perl 5 tools, keep in mind this is perl 6 :)
10:39 melezhik but still have a none verbose output from "panda --force install ."
10:40 nine DrForr: but "panda install ." can actually be used to install an unpacked dist from a directory
10:40 melezhik DrForr: ok, let me say in other words. I have  unit tests under t/ and I want to run them  and see verbose output ...
10:40 melezhik how can I do this?
10:41 melezhik prove --exec perl6 -r t ?
10:41 nine melezhik: I usually run tests with prove -e 'perl6 -Ilib' -v t
10:41 melezhik yes, prove --exec perl6 -r t works
10:42 tbrowder melezhik: I'm having better luck with zef.
10:42 melezhik I just expected that pand would respect --verbose
10:42 melezhik ok. for now, "prove" is fine for me
10:42 salva joined #perl6
10:49 mcmillhj joined #perl6
10:56 leont joined #perl6
11:01 tbrowder ugexe: do you know how to get info or verbose output from Build.pm? I'm using zef and only get info messages using --debug, nothing with --info (default) or --verbose.
11:07 dalek ecosystem: cae96fc | (Sam Gillespie)++ | META.list:
11:07 dalek ecosystem: Adding Numeric::Pack to ecosystem.
11:07 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/cae96fcd51
11:07 dalek ecosystem: 4f525ef | azawawi++ | META.list:
11:07 dalek ecosystem: Merge pull request #245 from samgwise/patch-2
11:07 dalek ecosystem:
11:07 dalek ecosystem: Adding Numeric::Pack to ecosystem.
11:07 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/4f525eff9e
11:10 rindolf joined #perl6
11:10 avar shorter oneliner for this in perl6: perl -le"print substr(hex(substr(shift,0,2)),-1)" $(hostname -f | md5sum) ?
11:11 bjz joined #perl6
11:11 avar for "Pick N% of hosts depending on their hostname"
11:15 avar best I can think of:
11:15 avar perl6 -e 'exit :16(@*ARGS[0].substr(0,2)) % 10 == 0 ?? 0 !! 1' $(hostname|md5sum)
11:18 xinming joined #perl6
11:20 avar substr not needed due to native bigint:
11:20 avar perl6 -e 'exit :16(@*ARGS[0]) % 10 == 0 ?? 0 !! 1' $(hostname|md5sum)
11:26 mcmillhj joined #perl6
11:28 MasterDuke joined #perl6
11:29 MasterDuke avar: perl6 -e 'exit :16(@*ARGS[0]) %% 10 ?? 0 !! 1' $(hostname|md5sum)
11:29 bioduds joined #perl6
11:29 bioduds im having trouble installing perl6
11:30 DrForr What kind of trouble?
11:30 bioduds i have it installed but a very old version
11:30 bioduds ===SORRY!=== Error while compiling hello.pl Can't use unknown trait 'is required' in an attribute declaration.
11:30 El_Che that reads like Moo/Moose
11:31 bioduds and i dont seem to be able to update it
11:31 bioduds no matter what I do
11:31 bioduds I can't get it to work
11:33 El_Che bioduds: have you tried rakudobrew?
11:33 bioduds yes
11:33 bioduds tried a couple of times
11:33 El_Che how did you install the version you have?
11:33 El_Che os package?
11:34 bioduds i installed by running sudo apt-get install rakudo
11:34 pierre_ joined #perl6
11:34 bioduds im on ubuntu 14.04
11:34 moritz try uninstalling it, and building from source instead
11:34 bioduds I did
11:34 El_Che sudo apt-get remove --purge rakudo
11:35 bioduds let me do it again
11:35 El_Che then just follow the rakudo instructions, that should work
11:35 DrForr Right, so you got the versionfrom the repository, which isn't up-to-date. Have you tried removing the package that you installed, and building via rakudobrew?
11:35 bioduds i actually only removed it not purged
11:35 El_Che (as there is no rakudo on the system)
11:35 El_Che (removed should be ok, purge is because I am a digitally clean type :) )
11:35 bioduds let me try
11:36 bioduds i would like to make a suggestion to the top cat p6 guys if i may and if they see this. The best installing way is Meteor
11:37 bioduds curl https://install.meteor.com/ | sh
11:37 bioduds perhaps this may be done with Perl6
11:38 DrForr Well-volunteered, grab the file, change it to download rakudobrew and post a link in the channel?
11:38 mcmillhj joined #perl6
11:39 bioduds ok, so I did sudo apt-get remove --purge rakudo
11:39 moritz you can also use the docker container: https://github.com/perl6/docker
11:39 bioduds now Im to follow which line?
11:39 bioduds this here? http://perl6.org/downloads/
11:42 DrForr bioduds: Are you Eduardo Capanema? If so, welcome!
11:43 bioduds yep, I am. thanks DrForr
11:43 DrForr (and even if you're not, still, welcome!)
11:43 bioduds I have one successful installation on my local machine
11:43 bioduds ubuntu 16.04
11:43 bjz joined #perl6
11:43 bioduds but on my AWS server ubuntu14.04 it is not working
11:44 bioduds i believe 16.04 repo apt is correct and 14.04 is not
11:44 bioduds and once you put bad p6 version there is no way to upgrade it
11:47 DrForr Well, the version from Ubuntu 16.04 is certainly going to be more recent. Like any other project, you can either wait for the next version to become available as a package, or go out and install it yourself.
11:48 El_Che bioduds: read your post!
11:48 El_Che :)
11:48 El_Che bioduds: damn straight to the point :)
11:48 DrForr Installing from packages is more convenient, certainly, but means that you have to wait until someone else packages the latest version, or you can go out and get the latest yourself.
11:49 El_Che bioduds: I build often from source for my docker setup and it's pretty straightfwd (but it takes a long time to finish)
11:49 El_Che pkgs is something we indeed need to provide
11:49 bioduds im trying again
11:50 Actualeyes joined #perl6
11:50 El_Che ls
11:50 El_Che oops
11:50 bioduds my point is if perl6 is aimed at beginners, installation must be made reaaaaaly easy
11:51 bioduds i purged current p6 version
11:51 bioduds now i downloaded rakudobrew
11:51 moritz then help making it easy
11:51 bioduds and im running the script
11:51 DrForr No argument there. But doing that takes time and effort, effort that people have channeled into making the software actually work.
11:52 bioduds I am helping, I am trying to point out the easiest way I know
11:52 bioduds which is Meteor shell script after curl
11:52 DrForr Right. Feel free to rewrite it to use rakudobrew and submit it here.
11:53 DrForr perlbrew has almost exactly the same setup, you might want to look at that first.
11:53 moritz bioduds: thing is, throwing "hey everybody, please do what I want" rarely works for open source projects, even if you offer a valid perspective
11:54 bioduds moritz, i am not throwing do what i want
11:54 bioduds not at all
11:54 bioduds I am suggesting
11:54 bioduds very different
11:54 moritz bioduds: the difference is just in wording, not in action
11:54 bioduds Im not demanding a thing moritz
11:54 bioduds it is merely a suggestion
11:55 smls_ joined #perl6
11:55 El_Che ok, let's get past this. bioduds, is rakudobrew running?
11:55 moritz bioduds: and it's received. And I'm merely suggesting that you actually implement your suggestion, because that has the best chances of success
11:55 bioduds no not running
11:55 bioduds Command failed (status 512): make Failed running /usr/bin/perl Configure.pl --backends=moar --gen-moar --git-reference="/home/ubuntu/.rakudobrew/bin/../git_reference" --make-install  at /home/ubuntu/.rakudobrew/bin/rakudobrew line 58. main::run('/usr/bin/perl Configure.pl --backends=moar --gen-moar --git-r...') called at /home/ubuntu/.rakudobrew/bin/rakudobrew line 386 main::build_impl('moar', undef, '') called at /home/ubuntu/.rak
11:55 DrForr And your suggestion is noted. Feel free to modify install.perlbrew.pl's script and submit it.
11:56 DrForr bioduds: That's cut off. Please post your full install log as a github gist or something like that, where we can see it.
11:56 El_Che bioduds:
11:56 El_Che How to get Rakudo Perl 6
11:56 El_Che The recommended way to use Rakudo is by downloading Rakudo Star – a useful and usable production distribution of Perl 6. Rakudo Star includes both the Rakudo compiler and some commonly used libraries.
11:56 El_Che OS_Windows_8 .msi Rakudo Star
11:56 El_Che 2016.07
11:56 El_Che left #perl6
11:56 El_Che joined #perl6
11:57 bioduds how do i do that?
11:57 tbrowder jnthn: where is specification for the META6 file?
11:57 El_Che sorry for the flooding. Damns copy paste. I hope my leaving the channel stopped the flooding
11:57 bioduds post as a github gist?
11:57 El_Che bioduds: sudo apt-get instal build-essential git
11:57 jnthn tbrowder: No idea, sorry; I don't really work on that side of things. :)
11:58 El_Che bioduds: maybe you're missing a depency for building rakudo
11:58 jnthn tbrowder: S11 or S22 at a guess though
11:58 DrForr Whatever pastebin you prefer. The point is that we could only see part of the log. pastebin.ca, snit.ch, any pastebin will do.
11:58 bioduds well, happened twice
11:58 bioduds once in a digital ocean ubuntu 1404
11:58 bioduds and now on AWS ubuntu 14.04
11:58 DrForr bioduds: Yes, and if you don't install the dependency it'll keep breaking.
11:59 tbrowder thanks, but how did you develop yr meta6 test?
11:59 bioduds sorry?
11:59 bioduds not following you tbrowder
11:59 DrForr tbrowder: He's talking to someone else.
12:00 bioduds oh, sorry
12:00 tbrowder sorry, question was for jnthn
12:00 bioduds any ideas how should i proceed?
12:00 jnthn tbrowder: Um...I don't think I did, are you confusing me with then other Jonathan? :)
12:01 jnthn (Who goes as RabidGravy here :))
12:01 DrForr bioduds: Yes, put your full install log somewhere that we can see it.
12:01 tbrowder probably, sorry!
12:01 jnthn :)
12:01 DrForr bioduds: Otherwise we're going to have to guess at what's going on, and that takes more time and patience than most of us have.
12:01 jnthn You wouldn't be the first one ;)
12:01 bioduds ok
12:01 pierre_ joined #perl6
12:02 bioduds i installed build-essential git
12:02 bioduds can you tell exactly how to put log on?
12:02 bioduds please
12:02 bioduds im doing rakudobrew build moar
12:03 El_Che bioduds: http://paste.ubuntu.com/ <-- copy the code there, paste the url here
12:03 El_Che by code I mean error
12:03 DrForr bioduds: Go to the site El_Che mentioned, paste the log there, share the link with us here.
12:03 DrForr That way we can see what failed and can try to help.
12:04 bioduds doing it
12:05 eliasr joined #perl6
12:06 bioduds posted
12:06 bioduds http://paste.ubuntu.com/23107097/
12:08 tbrowder ref META6 test: i did find the reference right where it should be expected: Jonathan Stowe has the reference to S22 toward the end of the README--i just hadn't read far enough: "RTFM, tbrowder!"
12:08 SpaceMario joined #perl6
12:08 moritz bioduds: looks like too little RAM. How much do you have available?
12:08 SpaceMario m: https://gist.github.com/zoffixznet/dc095946bc3ebb5413769b29756bb11c
12:08 camelia rakudo-moar f2df2c: OUTPUT«False␤»
12:08 bioduds not much
12:08 DrForr Stage parse      : MVM_platform_alloc_pages failed: 12 # I'm guessing you're RAM-limited.
12:08 bioduds its a free tier in amazon
12:08 SpaceMario Are <ws> tokens not available for use in regular regexes?
12:09 bioduds and same error occurred in digital ocean minimal vps slice
12:09 moritz bioduds: you need a bit more than 1GB
12:09 moritz maybe 1.5
12:09 bioduds but my local machine is much better and worked
12:09 SpaceMario I'd say like 2
12:10 SpaceMario bioduds: get more swap. I successfully built on 1GB boxes with tons of swap
12:10 moritz m: say so 'a b' ~~ /a <ws> b/
12:10 camelia rakudo-moar f2df2c: OUTPUT«True␤»
12:10 moritz SpaceMario: ^^ seems to work
12:10 bioduds im not sure i can manage swap in vps
12:10 SpaceMario moritz: Hm, I wonder why my gist fails. I seem to have all the right bits in place https://gist.github.com/zoffixznet/dc095946bc3ebb5413769b29756bb11c
12:10 moritz bioduds: or build on your local machine, and copy over the resulting files (but you need the same paths)
12:11 nine DrForr: PLEASE stop recommending rakudobrew to normal users. There's probably only 5 people in rakudobrew's actual target audience and I don't think any one of us is actually using it.
12:12 DrForr Okay, done, over with.
12:12 smls nine: Explain?
12:12 smls I'm using rakudobrew and have recommended it to some people.
12:12 SpaceMario m: https://gist.github.com/zoffixznet/1e0f8db3f777afa21bb3c31072d98f6a
12:12 camelia rakudo-moar f2df2c: OUTPUT«True␤»
12:13 DrForr Then you get the privilege of being chided as well :)
12:13 SpaceMario (was doing .lc on input, but regex still had uppercase letters)
12:13 bioduds so, just for me to know, I need at least 2 Gb Ram to safely install perl6?
12:13 nine smls: rakudobrew is for when people need to manage _multiple_ different rakudo installations on the same machine. It's not a good way to safe a user from typing in 3 commands on the shell. It causes much more problems than it solves.
12:14 DrForr Or 1GB and sufficient swap, as somene else says.
12:14 SpaceMario bioduds: to build it, yeah, somewhere around that. And not RAM but memory, so swap will do in a pinch.
12:14 bioduds ok
12:14 nine smls: there have been lots and lots of reports of issues with module installation reported here and I actually stop reading once I see rakudobrew mentioned.
12:14 bioduds got it
12:15 DrForr Note to self: remove from slides :)
12:15 smls nine: Interesting. Why would modules care where $PATH and stuff is set to?
12:16 * SpaceMario uses rakudobrew
12:16 nine smls: the problems usually come from having a mix of outdated and current rakudoversions installed and are undebuggable as rakudobrew users usually don't even know where the stuff gets installed to
12:16 buggable joined #perl6
12:16 SpaceMario I just nuke everything when I upgrade :P
12:16 MilkmanDan joined #perl6
12:16 smls OK, so what is the best alternative for normal users? (Assuming their distro doesn't have a Rakudo package, or only an ancient one.)
12:16 nine SpaceMario: exactly! That's completely unnecessary. Perl 6 is designed so you never have to re-install modules when upgrading Perl 6.
12:17 SpaceMario :)
12:18 nine git clone git@github.com:rakudo/rakudo.git && cd rakudo && perl Configure.pl --gen-moar --make-install
12:18 smls ok
12:18 nine That ^^^ is all you need to do to install rakudo. Put that in a script, put that onto perl6.org and point people at curl http://rakudo.org/install-script | curl
12:19 nine | bash of course
12:19 Juerd joined #perl6
12:19 nine Upgrading that is just git pull && bash config.status && make install
12:20 bioduds yep, or better yet https://install.rakudo.org
12:20 DrForr bioduds: ^^^ There you go, first contribution!
12:20 bioduds im happy with that :)
12:20 bioduds I learned to program in Perl!
12:20 bioduds In 2006
12:22 bioduds you dont see many 'I began in Perl' guys out there and let me tell you one thing. It made me look at programming languages veeeery differently as I went out learning c, c++, java and stuff
12:22 bioduds and this is the reason Im very excited with Perl6
12:22 MasterDuke i have a perl6 directory in my home, i clone moar, nqp, and rakudo into there and then point them all at the same --prefix
12:23 MasterDuke it works well for testing changes to those three individual components
12:23 MasterDuke but having to clone a ton of modules and run everything with a giant -I list is kind of annoying
12:24 MasterDuke but when i first used panda several months ago it didn't work very well (and i apologize, but i don't remember why)
12:24 buggable joined #perl6
12:25 nine MasterDuke: if panda or zef give you trouble, please report that. Also until that is solved, you can install the cloned modules by: cd whatever-module ; perl6 ~/rakudo/tools/install-dist.pl .
12:26 MasterDuke nine: ah ha! i had no idea about install-dist.pl
12:29 mcmillhj joined #perl6
12:33 nine It is fairly unknown. But I do have plans to rename it to raccoon and have it installed alongside perl6
12:34 RabidGravy boo!
12:41 Woodi is there some way to clone module code and install it "manually", without panda or zef ?
12:41 nine Woodi: what I just told MasterDuke?
12:43 Woodi nine: oops, -dist part hijacked my understanding of that :) thanx
12:46 RabidGravy nine, +1 on actually installing it, have no feelings about the name
12:47 RabidGravy there should be a caveat with the above that if the module in question requires some build action (such as compiling so helper library,) it probably won't work
12:49 El_Che nine: I am kind of surprised. I get that rakudobrew does too much. But the only alternative according to the doc (http://rakudo.org/how-to-get-rakudo/#Installing-Rakudo). Isn't rakudo a better solution than directly compiling the src for a regular use (who will install systemwide and won't be able to clean it up afterwards)?
12:52 nine RabidGravy: I actually hope we are gonna make some progress on the build front soon. I do want raccoon to be able to execute build steps. Primary use case being creating distro packages for Perl 6 modules.
12:53 RabidGravy totally up for that :)
12:54 nine El_Che: the steps listed as manual installation will _not_ install rakudo system wide. It will install into rakudo/install which can be removed easily.
12:54 nine El_Che: that's even easier than some hidden .rakudobrew directory.
12:56 Averna joined #perl6
12:57 nadim joined #perl6
13:01 nadim hi, quick question, eqv is still not implemented for matches, right?
13:02 bjz_ joined #perl6
13:08 mcmillhj joined #perl6
13:14 cdg joined #perl6
13:17 rmmm joined #perl6
13:20 Woodi possibly it's problem with current *nix practicess of sharp distinction between system wide and ~user private only...
13:21 timotimo Woodi: yeah, we should teach our platforms (like rakudo or v8 or python) to look into every user's home directories for libraries when they aren'n in the system's repository
13:21 timotimo "huh, today 'import sys' generated 95 terabyte of traffic over samba and nfs shares."
13:21 timotimo i meant to say 'import syss'
13:22 timotimo typos are hard when you're trying to make them intentonially
13:23 Woodi timotimo: :) i will write some story when system update will finish :)
13:26 * [Coke] wonders how quickly irclog adds sends to its own search index.
13:27 zakharyas joined #perl6
13:29 [Coke] stmuk_: you end with $COLON because you're also avoiding having a literal : in a file on disk, which isn't pleasant on some platforms (and we support people running the app out of a checkout)
13:29 * [Coke] is sure there's a prettier way to solve this eventually, but this works.
13:31 wamba joined #perl6
13:33 [Coke] nine: I'm using rakudobrew for my local development.
13:33 [Coke] if we're not supposed to be recommending it, why do we even have it?
13:33 MilkmanDan joined #perl6
13:33 [Coke] .... and I caught up, seeing nine's objections later in backlog.
13:34 [Coke] I don't think recommending "install from source" is a better option for most users.
13:34 mr-foobar joined #perl6
13:34 nine [Coke]: the best option would probably we a small script that does pretty much those manual steps.
13:35 nine [Coke]: btw. even tadzik said that rakudobrew was actually more for developers :)
13:35 mst [Coke]: rakudobrew is for developers, just like using perlbrew isn't something you should ever suggest to newbies
13:35 [Coke] I respectfully disagree with him, building from source is for developers. :)
13:35 mst [Coke]: that's ... not the point
13:36 mst the point is rakudobrew has lots of extra moving parts designed to accommodate multiple rakduo installs
13:36 [Coke] in my mind, it would be (devs) -> source -> rakudobrew -> R * (non devs)
13:36 mst and also is rather inflexible and weird
13:36 mst similar to perlbrew
13:36 mst whereas if you just want *A* perl, then you use perl-build
13:36 mst what we need basically is a rakudo-build equivalent
13:36 [Coke] As a user of perl 5, I use perlbrew all the time. YMMV.
13:36 mst if you're develop[ing against multiple perl5 installs it's useful
13:37 nebuchadnezzar joined #perl6
13:37 pmurias joined #perl6
13:37 mst for newbies, it's a bunch of complicated fragile stuff they won't understand
13:37 * [Coke] has never heard of perl-build, and a google search is not enlightening.
13:37 mst http://p3rl.org/Perl::Build
13:37 domidumont joined #perl6
13:38 mst honestly, once I get Alien::Rakudo shipped I would argue that that's the simplest installer for newbies we have available currently
13:38 [Coke] mst: that page doesn't really help explain what that is to someone who doesn't know, btw.
13:38 mst though, equally, I might consider obsoleting myself again later
13:38 [Coke] but I trust your collective judgement, that'sf ine.
13:38 pmurias for perl5 programmars 'cpanm Alien::Rakudo' seems like the easiest option
13:39 mst right, *if* you already have cpanm+local::lib I think it's a no-brainer
13:39 mst if you don't, well, I'll see about providing something for that case as well later
13:40 pmurias works for cpanm+perlbrew too ;)
13:41 mst I am still a little bit smug about how short https://twitter.com/shadowcat_mst/status/769294212365946883 is
13:43 MasterDuke arch linux has a relatively recent rakudo in the AUR, but the rakudo available to apt in kubuntu 16.04 is 2015.11
13:44 tadzik nine, [Coke]: well, I am to blame for advertising it as an easiest way to install rakudo at some point :3
13:44 tadzik (because it is/was)
13:45 pmurias mst: in addition to having Alien::Rakudo it would also be nice to have something that installs zef/panda
13:45 mst yes. but I'm unhappy with Alien::Rakudo::Inline::Perl5 currently
13:46 nine tadzik: it may as well still be the easiest way to get up and running. But unfortunately also an easy way to run into trouble later on.
13:47 mst tadzik: it was. and I am both very glad you wrote it, and very glad I've now got something else I can use
13:47 pmurias mst: what's wrong with it?
13:48 mst 14:36 < mst> the point is rakudobrew has lots of extra moving parts designed to  accommodate multiple rakduo installs
13:48 mst 14:37 < mst> for newbies, it's a bunch of complicated fragile stuff they won't  understand
13:49 mst I mean, I was never able to entirely work out what rakduobrew was *doing*
13:49 mst eventually I straced the fucker and grepped for exec() calls
13:49 mst but it's hardly the most transparent of systems
13:49 mst as a result of which, that nine said
13:49 mst *what
13:49 timotimo what's wrong with Alien::Rakudo::Inline::Perl5 except the long name?
13:50 mst it doesn't write a .packlist correctly yet because there's no way to get file lists out of the CUR, and I'm not sure there necessarily should be, so I'm not sure how I want to implement that
13:50 nine mst: is there anything in the target CUR besides Inline::Perl5?
13:51 mst nine: currently, yes, it has to install into the Alien::Rakudo site CUR so that Inline::Perl6 finds it
13:51 mst I'm tempted to give it its own CUR instead and tweak Inline::Perl6 to know to look for it
13:52 mst but basically then we're looking at "how does one handle module installation for Alien::Rakudo in general"
13:52 mst and that's a bit more complicated
13:52 ugexe which files do you want to get from CUR? I'm pretty sure they should all be available in the meta
13:53 mst ok, so, during ::EU nine and I looked at it and it wasn't immediately obvious to me how to convert that to a .packlist
13:53 nine The way baking rpm packages will work is: install-dist.pl --to /tmp/some_empty_temporary_build_directory --for vendor /path/to/module
13:53 mst also really I don't just want to do that
13:53 mst I want to stage via blib/
13:54 nine The files in /tmp/some_empty_temporary_build_directory can then be packaged and extracted over / on installation
13:54 mst nine: ah, and --to is your snowflake name for DESTDIR?
13:54 nine yes
13:55 nine Because of course it was amateur hour :)
13:55 tadzik joined #perl6
13:55 tadzik nine: yeah, true
13:55 nine --for vendor or --for site is so the paths in the precomp files will be relative to those repositories.
13:56 brrt joined #perl6
13:56 mst nine++ # bahahahahahaha
14:06 r_i_d joined #perl6
14:07 ilmari[m] joined #perl6
14:12 telex joined #perl6
14:13 r_i_d when writing a test, how do I include the file to be tested?
14:14 dalek whateverable: b919be5 | MasterDuke17++ | Bisectable.p6:
14:14 dalek whateverable: Convert Bisectable to use get-short-commit
14:14 dalek whateverable: review: https://github.com/perl6/whateverable/commit/b919be5ce9
14:14 ugexe use lib 'lib'; but really you should be passing it via the command line: `prove -e 'perl6 -Ilib' t/` (the -Ilib)
14:15 zakharyas joined #perl6
14:16 r_i_d when using 'lib', do I use the whole filename like "../filename.pm6"?
14:17 ugexe if you have a module "Foo::Bar" in lib, then: `use lib 'lib'; use Foo::Bar;`
14:17 moritz r_i_d: use lib is for directories containing modules, not for file names
14:18 r_i_d oh, okay, i don't have my module set up right.
14:18 ugexe you can map the module name to file name differently in your META6.json `provides` field but its generally a good idea to follow the s{::}{/} naming convention
14:19 r_i_d how would i do it if I had in my project directory "filename.pm6" and "t/test-filename.t"?
14:20 timotimo if filename.pm6 is supposed to be an executable script, it'd go into bin/ and most of its code into lib/App/YourMagicalApp.pm
14:20 ugexe if your shell is in the project root: -I. otherwise `use lib <..>`
14:20 timotimo then the whole thing would be called App::YourMagicalApp
14:21 timotimo when panda, zef, and friends install your lib, they'll have the "lib/" folder set up appropriately for modules in it to be found with just "use TheModuleName"
14:21 skids joined #perl6
14:21 ugexe ~/my_project $ prove -v -e 'perl6 -I.' t/test-filename.t
14:22 timotimo in general, though, it's quite uncommon to have scripts or modules in the root directory of a project
14:23 r_i_d yeah, that makes sense.  If i have "bin/filename.pm6" and "t/test-filename.t", how do I install it using panda?
14:23 ugexe Build.pm
14:23 pmurias joined #perl6
14:24 ugexe pm6 is a perl module extension, it probably doesn't belong in bin/
14:24 moritz uhm, adding them to the META6 file should be enough, no?
14:27 ugexe r_i_d: just look at other perl6 modules to get a feel for the boilerplate/layout
14:28 tbrowder i'm still experimenting but i'm not sure the META6 file can handle a complex installation. Does the presence of a Build.pm override the META6?
14:28 ugexe no
14:29 nine @all: please push people into putting their modules into a lib/ dir more strongly. Otherwise they will run into problems, e.g. when trying %?RESOURCES
14:30 domidumont joined #perl6
14:31 timotimo ugexe: um, are you sure Build.pm6 is needed for that at all?
14:32 ugexe timotimo: is needed for what?
14:32 benchable6 joined #perl6
14:33 timotimo ugexe: having a bin/filename.pm6
14:33 literal avar: perl6 -e 'exit +!(:16(@*ARGS[0]) %% 10)' $(hostname|md5sum)
14:34 ugexe no, i was pointing out Build.pm is a module that is typically found in the project root
14:34 timotimo oh
14:34 timotimo OK, that's fair. i wouldn't expect it to be installed along with my module, though
14:34 timotimo that's potentially far beside the point
14:34 ugexe it doesnt get installed
14:34 timotimo of course not :)
14:35 timotimo so is the rule "modules directly inside the project root don't get installed"?
14:35 ugexe its more like only files inside bin/ get automatically installed. everything else must be declared explicitly in the META6
14:36 ugexe so technically you could install modules from the root
14:36 ugexe "provides" : { "Build" : "Build.pm" }
14:36 timotimo huh. for some reason i have completely forgotten about the existence of provides
14:37 timotimo clearly, you shouldn't come to me for thoughts/advice on modules at all
14:38 ugexe but really `Build.pm` needs to be replaced with something more sane
14:38 nine oh yes, please!
14:38 harmil Sometimes it's impossible for me to express how much I love working in this language. From my recent sequences commit (Pascal's Triangle): "𝕀.triangle.map: -> ($n,$k) { $n choose $k }"
14:39 mcmillhj joined #perl6
14:39 ufobat joined #perl6
14:39 timotimo ugexe: a set of common functionalities as directives for the meta6.json?
14:39 nine ugexe: I thought about just starting by giving raccoon everything it needs to build Inline::Perl5
14:39 nine driven by META6.json of course
14:40 ugexe well Inline::Perl5 has dependencies, so that requires finding all that stuff as well
14:40 acrussell joined #perl6
14:41 mst does it?
14:41 mst Inline::Perl5 was the only thing I had to add to a vanilla rakudo
14:41 mst to have sstuff work
14:41 nine ugexe: I made them optional last week to simplify mst's life a bit
14:41 mst ah
14:42 ugexe the META.info still lists them as deps
14:42 nine LibraryMake didn't help all that much anyway and File::Temp was only used in tests.
14:42 ugexe timotimo: essentially. or hooks https://design.perl6.org/S22.html#hooks
14:43 nine ugexe: Build.pm still uses LibraryMake and having File::Temp for tests is nice, too. And panda and zef have no problem installing it.
14:43 committable6 joined #perl6
14:43 benchable6 joined #perl6
14:43 nine ugexe: installation via perl6 configure.pl6 && make && make install works without any dependencies
14:45 khw joined #perl6
14:45 ugexe nine: why not have the Build.pm just be `class Build { method build($dir) { run "perl6", "configure.pl6", :cwd($dir); } }`
14:46 nine That.....is quite clever
14:50 r_i_d where are modules stored so I can look at the layout for comparison?
14:50 rindolf joined #perl6
14:51 n1lp7r joined #perl6
14:54 harmil r_i_d: That depends on how you installed Perl 6. If you used rakudobrew, then they're in your ~/.rakudobrew if you used Star, then they're under Star's prefix. If you used a Windows installer, then there's going to be a  c:\rakudo I think
14:54 r_i_d I used rakudobrew under ARM linux -- should I put my modules with the rest?
14:54 tbrowder ugexe: ref zef: for option '--verbose' how does one get a message in Build.pm visible to the user?
14:56 ugexe tbrowder: set `ZEF_BUILDPM_DEBUG=1`
14:57 mst ugexe: amusingly, I *almost* ended up making Alien::Rakudo::Inline::Perl5's Makefile.PL that ;)
14:57 harmil r_i_d: If you're writing a module, see https://docs.perl6.org/language/modules#Distributing_Modules Once you've written your META6.json, you should be able to just "panda install ."
14:58 r_i_d ah, I have to WRITE a META6, got it.
15:01 melezhik Hi! Anybody could help me with '~' in perl6 regexps?
15:02 melezhik let's I have  perl6 -e "say 'OK jjj OK' ~~ /OK ~ OK [ jjj ]/;"
15:02 melezhik it says Nil
15:02 notbenh joined #perl6
15:03 melezhik I could not find an proper explanation of ~ in perl6 regexp, but probably ( I might be wrong ) it is something for looking inside some sub area ?
15:04 melezhik delimited by some regexps ( in my trivial case this is OK ... OK )
15:04 ugexe mst: you can also execute the Build.pm itself ala `perl6 -Ilib -I. -e '::("Build").new.build($*CWD.absolute);'` (this is how zef executes the Build process)
15:04 ugexe er add a -MBuild after -I.
15:04 Ven joined #perl6
15:04 mst aha
15:04 * mst was about to ask
15:05 Ven o/
15:05 mcmillhj joined #perl6
15:06 melezhik another example for this construction is https://github.com/moritz/json/blob/master/lib/JSON/Tiny/Grammar.pm#L26
15:07 melezhik I understand this, and how this work  but can't use the same thing at my regexps constructions
15:07 tbrowder ugexe: that doesn't work for me; the question is, what print-type statements inside Build.pm will show on stderr or stdout when using option --verbose? so far i can see say msgs with --debug but then i also get extra msgs from zef, verbose seems to do nothing
15:11 ugexe ZEF_BUILDPM_DEBUG=1 will pass the stdout and stderr outwards to zef. zef filters messages based on --verbose/--debug etc
15:13 pmurias Ven: \o
15:13 kaare_ joined #perl6
15:14 ugexe if you are just testing your build then use `ZEF_BUILDPM_DEBUG=1 zef -v build .`. This will also output the exact command used to execute the Build.pm so you can do it without zef
15:15 M-Illandan joined #perl6
15:15 Matthew[m] joined #perl6
15:19 kurahaupo joined #perl6
15:21 Ven awww.. do we not have a grep-not of sorts? mmh
15:22 [Coke] melezhik: you're looking for "OK" delimited by "jjj"?
15:23 melezhik no, jjjj  b/w 'OK' delimiters
15:24 [Coke] I think you want the %% operator
15:24 [Coke] not sure where you got ~
15:25 Ven well, ~ is useful for this kind of things as well
15:26 melezhik ok , please take a look at https://github.com/moritz/json/blob/master/lib/JSON/Tiny/Grammar.pm#L5 or https://github.com/moritz/json/blob/master/lib/JSON/Tiny/Grammar.pm#L26
15:27 melezhik I know that this one works. It validates something inside '[' .. ']' or something inside '"'
15:28 melezhik now I want to have the similar regexps working on my code but I can't
15:28 melezhik as far as I guess ( I might be wrong ) a construction kinda foo ~ bar is for looking something between foo and bar
15:29 moritz melezhik: note that ~ doesn't work too well with backtracking
15:29 melezhik but I can reuse this approach at my regexps
15:29 melezhik mortiz: I don't need a backtracking at least now ...
15:30 moritz melezhik: so, give a small example of what's not working for you?
15:30 melezhik sure, just a second
15:30 melezhik for example this one works fine "say '{ OK 9 OK }' ~~  /OK+ % \d /;"
15:30 melezhik 「OK」
15:31 melezhik and I want to changes this
15:31 [Coke] melezhik: btw:
15:31 [Coke] m: say '{ OK 9 OK }' ~~  /OK+ % \d /
15:31 camelia rakudo-moar f2df2c: OUTPUT«「OK」␤»
15:31 melezhik to this one - say '{ OK 9 OK }' ~~  /'{' ~'}' [ OK+ % \d ]/
15:32 melezhik and have - Nil
15:32 melezhik not sure that this chunk - [ OK+ % \d ] is correct
15:32 moritz melezhik: nothing matches the whitespace in there
15:33 moritz melezhik: you also see that "OK 9 OK" ~~ /OK+ % \d/ matches only one OK, not the whole string
15:33 moritz m: say "OK 9 OK" ~~ /:s OK+ % \d/
15:33 camelia rakudo-moar f2df2c: OUTPUT«「OK 」␤»
15:33 moritz m: say "OK 9 OK" ~~ /:s OK + % \d/
15:33 camelia rakudo-moar f2df2c: OUTPUT«「OK 」␤»
15:33 moritz m: say "OK 9 OK" ~~ /:s OK + % \d /
15:33 camelia rakudo-moar f2df2c: OUTPUT«「OK 」␤»
15:33 moritz grml
15:33 melezhik this one "say '{OK9OK}' ~~  /'{' ~'}' [ OK+ % \d ]/;"
15:33 melezhik still return Nil
15:33 moritz ok
15:33 moritz oh
15:33 smls 'OK' +
15:33 moritz OK
15:33 moritz right
15:33 moritz what smls said
15:34 moritz OK+ matches OK, OKK, OKKK etc.
15:34 melezhik sure I know
15:34 moritz m: say "OK 9 OK" ~~ /:s 'OK' + % \d /
15:34 camelia rakudo-moar f2df2c: OUTPUT«「OK 9 OK」␤»
15:34 moritz m: say '{ OK 9 OK }' ~~ /:s '{ 'OK' + % \d /
15:34 camelia rakudo-moar f2df2c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in single quotes; couldn't find final "'" ␤at <tmp>:1␤------> 3ay '{ OK 9 OK }' ~~ /:s '{ 'OK' + % \d /7⏏5<EOL>␤    expecting any of:␤        single quotes␤»
15:34 moritz m: say '{ OK 9 OK }' ~~ /:s '{' 'OK' + % \d /
15:34 camelia rakudo-moar f2df2c: OUTPUT«「{ OK 9 OK 」␤»
15:34 moritz m: say '{ OK 9 OK }' ~~ /:s '{' ~ '}' [ 'OK' + % \d ] /
15:34 camelia rakudo-moar f2df2c: OUTPUT«「{ OK 9 OK }」␤»
15:35 moritz ... and it works if you do it right :-)
15:35 moritz m: say '{ OK 9 OK }' ~~ /:s '{' ~ '}'  'OK' + % \d  /
15:35 camelia rakudo-moar f2df2c: OUTPUT«「{ OK 9 OK }」␤»
15:35 moritz the brackets aren't necessary, it seems
15:35 n1lp7r joined #perl6
15:36 avuserow m: class Foo {has Int $.bar is rw;}; my $f = Foo.new(:bar(1)); say $f; $f.^attributes(:local).first(*.name eq q{$!bar})[0].set_value($f, 2); say $f; $f.bar = 3; # Anyone know why `bar` has become immutable here?
15:36 camelia rakudo-moar f2df2c: OUTPUT«Foo.new(bar => 1)␤Foo.new(bar => 2)␤Cannot modify an immutable Int␤  in block <unit> at <tmp> line 1␤␤»
15:36 jnthn Because set_value binds rather than assigns, I'd guess
15:36 moritz avuserow: because set_value binds
15:37 melezhik yes, but this one still return Nil - say '{ OK 9 OK }' ~~ /:s '{' ~ '}' [ OK + % \d ] /
15:37 jnthn Do get_value and assign to the returned container
15:37 moritz avuserow: try .set_value($f, (my $ = 2))
15:37 melezhik if I have OK without quotes
15:37 moritz melezhik: that's the problem with OK+ again
15:37 melezhik strange
15:37 moritz melezhik: that matches OK, OKK, OKKK etc.
15:37 moritz melezhik: the + only applies to the last token, which is the K
15:38 moritz (so here, it matches OK, OK 9 K, OK 9 K 5 K etc.)
15:38 moritz you can observe this by matching without the ~ part
15:38 avuserow moritz, thanks, that works.
15:38 moritz m: say say '{ OK 9 OK }' ~~ /:s [ OK + % \d ] /
15:38 camelia rakudo-moar f2df2c: OUTPUT«「OK 」␤True␤»
15:38 melezhik yes, but can't still understand why + prevent in succeed , this one is at least one K which is true ...
15:38 gfldex joined #perl6
15:39 shicheng joined #perl6
15:39 Ven moritz: what do you say say?:)
15:39 moritz it doesn't match the whole string inside the curlies
15:39 Zoffix3 joined #perl6
15:39 moritz Ven: whatever I want, in every way way!
15:40 Zoffix3 Are goroutines like perl 6 promises? I'm preparing a talk and wanna know what to answer if someone asks...
15:40 gfldex Zoffix3: no, there are more like processes in erlang (IIRC)
15:41 melezhik mortiz: thanks for help, need to rethink all of this )))
15:41 Zoffix3 hm /me doesn't know earlang.
15:41 gfldex you don't know go either, so it's all good :->
15:42 moritz Zoffix3, gfldex: I think they share some similiarities; they are both threads managed by a thread pool
15:42 Zoffix3 Well, I'm reading about them and I see they're concurrent and not parallel, but if you increase GOMAXPROCS then they will use more cores and so I see the difference blur between P6 promises
15:43 gfldex m: enum Collision(<Str Int>); my %c{Collision}; %c{Str}++; dd %c; my Str $s;
15:43 camelia rakudo-moar f2df2c: OUTPUT«===SORRY!===␤This type cannot box a native string: P6opaque, Collision␤»
15:43 gfldex should that ^^^ work or is it just LTA?
15:44 moritz gfldex: this roughly the same as
15:44 moritz m: my class Str { }; say "foo"
15:44 camelia rakudo-moar f2df2c: OUTPUT«===SORRY!===␤This type cannot box a native string: P6opaque, Str␤»
15:45 elohmrow joined #perl6
15:45 moritz LTA, well-known, and kinda "shoot your own foot"
15:45 Zoffix3 Is it? The hash is typed, so it shouldn't be stringifying things.
15:45 Zoffix3 m: enum Collision(<Str Int>); my %c{Collision}; %c{Str}++;
15:45 camelia rakudo-moar f2df2c: ( no output )
15:45 * dj_goku is currently learning elixir at work.
15:45 Zoffix3 Ah, nevemind
15:45 moritz Zoffix3: the enum Collision locally overrides the Int and Str types
15:46 gfldex m: enum Collision(<Collision::Str Collision::Int>); my %c{Collision}; dd %c;
15:46 camelia rakudo-moar f2df2c: OUTPUT«Hash[Any,Collision] %c = (my Any %{Collision} = )␤»
15:46 gfldex m: enum Collision(<Collision::Str Collision::Int>); my %c{Collision}; dd %c.enums.keys;
15:46 camelia rakudo-moar f2df2c: OUTPUT«Method 'enums' not found for invocant of class 'Hash[Any,Collision]'␤  in block <unit> at <tmp> line 1␤␤»
15:46 moritz so the compiler tries to look them up to box stuff into, and gets something that cannot (un)box
15:46 gfldex m: enum Collision(<Collision::Str Collision::Int>); my %c{Collision}; dd %c.keyof.enums.keys;
15:46 camelia rakudo-moar f2df2c: OUTPUT«("Collision::Str", "Collision::Int").Seq␤»
15:46 gfldex m: enum Collision(<Collision::Str Collision::Int>); my %c{Collision}; %c{Collision::Str}++; dd %c;
15:46 camelia rakudo-moar f2df2c: OUTPUT«Could not find symbol '&Str'␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
15:46 gfldex should quallified enum keys work?
15:47 moritz uhm, not really :-)
15:48 tbrowder ugexe: here is a simple Build.pm file:
15:49 elohmrow The README for rakudo-star-2016.07 says: "Please note that this release of Rakudo Star is not fully functional with the JVM backend from the Rakudo compiler. Please use the MoarVM backend only." <-- what is the most recent version I can rely on, if I super-really want to use the jvm backend, please?
15:49 tbrowder https://www.irccloud.com/pastebin/7EHwoo17/Build.pm
15:50 tbrowder using that file, the only way a msg gets to the user is by using --debug.  -verbose doesn't work.  suggestions?
15:51 Zoffix3 elohmrow: 2016.08.1 but it's not really fully functional there either.
15:51 stmuk_ elohmrow: that release probably does basically work in terms of simple code examples
15:51 Zoffix3 elohmrow: http://rakudo.org/downloads/rakudo/
15:51 kaare_ joined #perl6
15:51 ugexe 1: you dont need `use Panda::Builder` or `is Panda::Builder`. secondly i guess you could print to $*ERR
15:52 tbrowder but what is the intent of the verbosity options then?
15:52 Zoffix3 elohmrow: note that you can use our bot camelia with j trigger to run code on JVM:  /msg camelia j: say 'hello'
15:53 elohmrow Zoffix3 stmuk_: perhaps I have an env problem then.  I can build on Moar, but on JVM fails every time, on every machine I tried.
15:53 stmuk_ I think I could only get it to work with OpenJDK 1.6
15:54 ugexe Build.pm is not specced and will go away, so its output is not a major concern
15:54 stmuk_ I successfully built a week or two back using that version from debian stable
15:54 obfusk joined #perl6
15:54 ugexe the verbosity flags are used in many other places
15:54 elohmrow I have tried J7 and J8 on OSX 10.10.5 (2 different machines), CentOS 7, and Ubuntu 16.04
15:55 zacts joined #perl6
15:55 stmuk_ I couldn't get OpenJDK 1.7 (7) to work
15:55 Zoffix3 elohmrow: what's the error output that you get?
15:56 tbrowder um, printing to $*ERR doesn't work, either.
15:56 elohmrow Zoffix3: well, if i do get an error, it ends up being about lack of RAM, and an error file.  so if i fix up the jvm opts to give lots-o-ram, then i get a blank error 2 with no output file
15:56 dj_goku Just at first glance a lot of the Perl6 concurrency stuff feels very similar in erlang/elixir. But I have very little knowledge of both.
15:56 Zoffix3 no idea
15:57 dj_goku Zoffix3: what kind of talk are you doing?
15:57 ugexe dont count on Build.pm for delivering messages to the user
15:57 Zoffix3 dj_goku: it's a short lightning talk: "Perl 6: What Programming In The Future Is Like?"
15:57 tbrowder ugexe: then what will be the future, any ideas?  the "run ..." thing you showed earlier?  is that the way to go?  or use the META6 hook attribute?
15:57 Zoffix3 dj_goku: where I convert a 7-line password hashing program that runs in 63 seconds, to one that runs in 3.1 seconds, to one that's just one line of code.
15:58 ugexe i dont know. long ago zef had a hook implementation that simply ran a script ala `hooks/$pre-or-post_$phase.pl6`
15:58 stmuk_ elohmrow: I didn't see that with 1.7 .. I can't remember the errors I saw .. but it does work with 1.6 (or did a week or so ago when I tried it)
15:58 dj_goku Zoffix3: nice! any new modules coming out from the talk?
15:59 ugexe whatever the solution is should allow the user to run it directly
15:59 elohmrow so, stmuk_: you got 08.1 or 07.1 working with java 6? what OS? <-- debian, you say? v?
15:59 Zoffix3 dj_goku: nope, it's all raw, core Perl 6.
15:59 tbrowder ugexe: thanks, i'll keep experimenting then
15:59 dj_goku Zoffix3: cool!
16:00 cdg joined #perl6
16:00 stmuk_ elohmrow: I got a version close to 08.1 to work .. one sec I will see if I have more details
16:01 elohmrow stmuk_: thanks!
16:01 dj_goku Zoffix3: where is the lightning talk at?
16:02 stmuk_ elohmrow: I don't have access to the laptop :( but I'm sure it was OpenJDK 1.6 (6)
16:02 Zoffix3 dj_goku: Toronto. There also should be a live online feed and (later) a YouTube vid: http://www.meetup.com/Toronto-Perl-Mongers/events/233588645/
16:02 dj_goku cool. are you in toronto?
16:02 Zoffix3 Brampton, about a 40-minute drive from Toronto.
16:03 dj_goku ahh
16:03 elohmrow stmuk_: no problem, you've been a big help with this info alone.  do you recall roughly the debian version?
16:08 grondilu joined #perl6
16:08 grondilu hello #perl6
16:10 stmuk_ elohmrow: I think I was wrong and I used 1.7 (I recall I had to downgrade a version for it to work)
16:10 stmuk_ elohmrow: https://github.com/rakudo/rakudo/blob/nom/README.md
16:10 stmuk_ elohmrow: the instructions there refer to JDK 1.7 and also have a possible fix for your out of memory error
16:11 elohmrow stmuk_: the memory error i'm not very concerned about, as i can make it go away by changing the -X options
16:12 stmuk_ probably was openjdk-7-jdk:amd64     7u111-2.6.7-1~deb8u1
16:12 stmuk_ I can confirm in a day or two
16:12 elohmrow stmuk_: but, i will admit i had not read that part of the README :( <-- i only read the Configure line and then ran make, make test.  but then make install always died
16:13 elohmrow stmuk_: armed with the info from your experience, i will try once more ... thanks again!
16:13 stmuk_ I'm not even sure I ran "make install" I probably ran some code "in place"
16:13 stmuk_ also see
16:13 stmuk_ https://irclog.perlgeek.de/perl6-dev/2016-06-18#i_12688822
16:14 stmuk_ "rakudo-j compiles but installing fails due to a precomp related error"
16:17 elohmrow stmuk_: ^^ very useful - maybe an older version of rakudo is better then ... 2016.04 seems like the one before the ones i tried?
16:18 elohmrow so i downgrade java to 7, fiddle with some X-opts through the code, and use a slightly older rakudo, might be the trick to getting something that works right now
16:18 stmuk_ elohmrow: I doubt that helps .. the JVM backend has had problems for a while
16:20 stmuk_ I mean I don't know if older versions are better .. the rest of your plan is sound
16:25 elohmrow stmuk_: yeah, and yest i already tried for ex: install/bin/nqp-j <-- mucking around in there for memory stuff.  but then i get sad --> note slides 16-19, and thene specially 20, here: http://www.slideshare.net/tokuhirom/perl6-meets-jvm <-- seems to have a very different experience than i have ;)
16:25 geekosaur mostly you're trading off different bugs; the jvm backend has never been stable
16:25 elohmrow slide 20 is a vicious, vicious lie
16:26 [Coke] elohmrow: there is no fully functional JVM version.
16:27 [Coke] not since (and including) the Christmas release in 2015.12
16:27 elohmrow [Coke]: but can i at least install with ?
16:27 elohmrow i am all for using the version i used last year (august-ish) ... which is the last time i tried p6 :(
16:27 elohmrow i'm just trying to get it to work.  nothing fancy yet
16:28 [Coke] elohmrow: you can install any version you want from source.
16:28 [Coke] you'll have to experiment yourself to find the one that works for you, though.
16:28 [Coke] I would recommend using the latest version and opening tickets for any issues you find.
16:29 [Coke] but our release process doesn't test to make sure it even compiles on the JVM at this point.
16:29 elohmrow [Coke] only reason i had not done this yet is everywhere i looked, it seemed easy to do, so i began to suspect a deficiency between KAC
16:29 stmuk_ elohmrow: one of the probs is that the JVM version didn't fully survive a radical list refactoring (GLR) so even an old functioning version would be different to modern perl 6
16:29 [Coke] KAC?
16:29 elohmrow kayboard and chair, sorry
16:29 [Coke] ah, PEBKAC. :)
16:29 [Coke] no, it's not you. It's us. :0
16:29 elohmrow yeah, but i left out the peanut butter ;-P
16:29 [Coke] er, :)
16:30 [Coke] I will fire up a build right now and see how HEAD is doing.
16:30 nadim_ joined #perl6
16:30 elohmrow ok well, this is all very good info.  i will give one more good try, then i will give up for now.
16:31 [Coke] ok. if you're will to be a canary, bug reports on what's not working make it easier to get it running again.
16:31 elohmrow thanks again all, especially stmuk_ Zoffix3 [Coke]
16:31 elohmrow will do.  i have pretty good notes on what i have tried, and on different machines.
16:33 [Coke] I can tell you that back when it was closer to working, it was missing most of the unicode work. pretty sure concurrency didn't land there.
16:34 * elohmrow wanders off for a bit to try once more
16:52 lizmat joined #perl6
17:03 mcmillhj joined #perl6
17:06 tbrowder ugexe: rooting around I see the zef client (the Build class in Build.pm I believe) is supposed to have a logger. can you, or anyone say how to use it?  maybe that's the tie to verbosity
17:07 stmuk_ Stage jast       :     72.799
17:14 [Coke] Stage jast       :  45.793
17:15 [Coke] (having just got to the same spot.)
17:16 stmuk_ you will probably overtake!
17:21 [Coke] make test has a lot of failures (mostly nativecall)
17:21 [Coke] one or two non nativecall.
17:21 [Coke] REPL is busted.
17:22 timotimo uh oh :(
17:22 timotimo but that's just java?
17:22 timotimo er, that came out wrong
17:22 [Coke] that's what I'm testing, yes.
17:22 timotimo only on the java backend, yes?
17:22 [Coke] m: / "asdfadsf" / ~~ 'asdf'
17:22 camelia rakudo-moar f2df2c: OUTPUT«Regex object coerced to string (please use .gist or .perl to do that)  in block <unit> at <tmp> line 1␤»
17:22 [Coke] m: (/ "asdfadsf" / ~~ 'asdf').perl
17:22 camelia rakudo-moar f2df2c: OUTPUT«Regex object coerced to string (please use .gist or .perl to do that)  in block <unit> at <tmp> line 1␤»
17:23 [Coke] hee
17:23 [Coke] m: 'adsfasdf' ~~ / 'asdf' /
17:23 camelia rakudo-moar f2df2c: ( no output )
17:23 [Coke] so, jvm's issue there is that it can't give you the nice error message when you do something dumb. :)
17:23 grondilu a very basic example of NativeCall use with a typedef-ed structure:  https://gist.github.com/grondilu/dc60a8f759149340809da3015505302a
17:25 grondilu I thought it could be a useful example to add for instance in https://github.com/jnthn/zavolaj/tree/master/examples
17:25 timotimo we still don't have an easy way to put an array of things with a given length in-line into a CStruct
17:27 grondilu you mean that for instance with something like:  struct vector_t { double coeff[3]; }  ?
17:27 timotimo yup
17:27 grondilu that's regrettable.
17:27 timotimo and we also don't yet have arrays of in-lined CStructs
17:27 timotimo that's also qiute regrettable
17:29 stmuk_ make install does work on JVM so that's been fixed in the last 2 mon
17:29 grondilu on the other hand, isn't that only a problem if we need to access the members of the CStruct from the Perl 6 code?  Usually only the C code does it, it's often opaque to libraries.
17:30 timotimo hmm.
17:30 timotimo of course you can create an array of 8bit ints that's the right size
17:36 stmuk_ I get an impressive traceback trying to install panda
17:37 domidumont joined #perl6
17:37 webstrand left #perl6
17:40 bartolin fwiw, I'm still running my daily spectest for rakudo-j. apart from one failing test file (which runs fine standalone) there are no failures. (but there are quite some fudged tests)
17:40 bartolin https://github.com/usev6/perl6-roast-data/blob/master/log/rakudo.jvm_summary.out
17:42 elohmrow doesn't work for me yet, stmuk_: == Installing modules for JVM cd modules/panda && sh -c "PATH=/home/ghost/rakudo-star-2016.07/install/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games /home/ghost/rakudo-star-2016.07/install/bin/perl6-j bootstrap.pl" ^@==> Bootstrapping Panda ^@^@^@^@Cannot unbox a type object   in result (gen/jvm/stage2/QAST.nqp) ...
17:42 bartolin I've seen some strange failures recently (when all test files starting with integration/advent2014-something started to fail), but those seemed to be due to an OOM for the eval-server
17:42 [Coke] bartolin: are you not running 'make test' ?
17:42 elohmrow I did not this time, because it takes approximately as much time as the universe has existed
17:43 bartolin [Coke]: no, I don't. I'm really only running the spectest to keep roast up to date wrt rakudo-j
17:43 bartolin (in order to make it easier to start working on the JVM backend)
17:44 elohmrow stmuk_: <-- same-ish as what i pasted?
17:44 stmuk_ elohmrow: yes I got "Cannot unbox.." too
17:45 [Coke] theoretically, 'make test' is more core than 'make spectest'
17:46 elohmrow stmuk_: then i get at the end,   in  (gen/jvm/main.nqp) The spawned process exited unsuccessfully (exit code: 1)   in sub MAIN at bootstrap.pl line 68   in block <unit> at bootstrap.pl line 9  Makefile:60: recipe for target 'modules-install-j' failed make: *** [modules-install-j] Error 1
17:46 elohmrow at least it is consistent - i've gotten exactly this under java 7, 8 and 4 different machines on 3 OSs
17:52 harmil_wk Is there a module of common mathematical constants in the works? I know we define a few globally, but there's a pretty big list including those at https://en.wikipedia.org/wiki/Mathematical_constant#Table_of_selected_mathematical_constants that I could throw into a module...
17:53 pierre_ joined #perl6
17:55 Wiertek joined #perl6
17:58 MasterDuke joined #perl6
17:59 Piotr joined #perl6
18:05 timotimo s: Array, permutations
18:05 SourceBaby timotimo, Something's wrong: ␤ERR: Too few positionals passed; expected 1 argument but got 0␤  in block <unit> at -e line 6␤␤
18:06 timotimo will i ever learn this?
18:06 timotimo s: Array, &permutations
18:06 SourceBaby timotimo, Something's wrong: ␤ERR: Cannot resolve caller sourcery(Array, Sub); none of these signatures match:␤    ($thing, Str:D $method, Capture $c)␤    ($thing, Str:D $method)␤    (&code)␤    (&code, Capture $c)␤  in block <unit> at -e line 6␤␤
18:06 timotimo %)
18:06 timotimo s: permutations
18:06 SourceBaby timotimo, Something's wrong: ␤ERR: Too few positionals passed; expected 1 argument but got 0␤  in block <unit> at -e line 6␤␤
18:06 timotimo s: &permutations
18:06 SourceBaby timotimo, Sauce is at https://github.com/rakudo/rakudo/blob/f2df2c5/src/core/operators.pm#L663
18:07 [Coke] bartolin++ running the java stuff.
18:08 masak today's autopun spotting (actually 2 of them): https://twitter.com/methode/status/768337146780475392 https://twitter.com/RuthanneReid/status/770049388764889092
18:10 stmuk_ zef errors with "===SORRY!=== Serialization Error: could not locate static code ref for closure" on JVM
18:10 stmuk_ ufo can be hacked up to work though :)
18:13 cyphase joined #perl6
18:14 grondilu a more elaborate example than above:  http://paste.debian.net/794867/
18:15 grondilu interestingly enough, we can actually just define C<class CStruct is repr('CStruct') {}> and use it for any opaque type defined as a pointer to a structure.
18:16 grondilu (or rather as Pointer[CStruct])
18:16 timotimo i find it a bit muddy to have CStruct be a pointer, but Pointer[CStruct] also .. or is that a pointe-to-pointer?
18:17 grondilu no CStruct is a struct, not a pointer to a struct.  I may have expressed it poorly above.
18:18 timotimo ah
18:18 grondilu see lines 48 and 55 in above code.
18:18 timotimo the only difference it makes if you define the structure properly or not is when you .new it
18:18 timotimo oh i didn't notice the link
18:18 timotimo did you know about Inline::C?
18:18 timotimo it'll automate the compiling step for you
18:19 timotimo and you can then have the C code in-line in your perl6 code as sub bodies
18:19 grondilu I knew it existed, but is it really working?
18:19 grondilu I mean that would look too good to be true.
18:19 grondilu oh wait, I misunderstood.
18:19 timotimo it worked at one point
18:19 timotimo haven't tested in a logn time
18:20 grondilu it creates the Perl 6 bindings?
18:21 timotimo my sub a_plus_b( Int $a, Int $b ) is inline('C') returns Int {'
18:21 timotimo DLLEXPORT int a_plus_b (int a, int b) {
18:21 timotimo this is how you use it. that should explain everything, hopefully
18:22 grondilu I'm more interested in something that takes a header file and creates the Perl 6 bindings.
18:22 timotimo that's gptrixie
18:22 timotimo find it on modules.perl6.org and give it a shot
18:23 CptnK joined #perl6
18:24 CptnK Is it possible from within sub EXPORT {} to get the file of where I'm exporting to? I'm tring to die() with a helpful error
18:24 CptnK And I've tried callframe().file with a bunch of values to callframe, but I can either get the file where the sub EXPORT is or Rakudo's guts...
18:25 timotimo right, the importation happens at compile time, so all you'll find on the stack is the compiler
18:25 CptnK Ahh... ok
18:27 elohmrow stmuk_: correction - i did not pay enough attention.  we do get a successful make install; what fails is the bootstrapping panda step.  i may or not need panda right now.  so i *do* have perl6 on jvm right now.  oops.  sorry for the false alarm.
18:28 setty1 joined #perl6
18:29 stmuk_ elohmrow: I guessed that! in short the JVM "mostly" works (with fudged tests) but not functional enough yet to install either panda or zef
18:30 elohmrow exactly.
18:33 nine $*W.current_file?
18:33 nine CptnK: ^^^
18:33 nine CptnK: note that I'm not sure if this is actually stable API
18:35 timotimo definitely not stable API
18:35 CptnK nine++ hah, yeah it worked  :)
18:36 gfldex m: class Str {}; say CORE::Str;
18:36 camelia rakudo-moar f2df2c: OUTPUT«===SORRY!===␤This type cannot box a native string: P6opaque, Str␤»
18:36 gfldex m: class Str {}; print CORE::Str;
18:36 camelia rakudo-moar f2df2c: OUTPUT«===SORRY!===␤This type cannot box a native string: P6opaque, Str␤»
18:36 gfldex m: class Str {}; print SETTING::Str;
18:36 camelia rakudo-moar f2df2c: OUTPUT«===SORRY!===␤This type cannot box a native string: P6opaque, Str␤»
18:41 elohmrow stmuk_: and for completeness, same here for zef:  ../rakudo-star-2016.07/perl6 -Ilib bin/zef install . ^@^@^@^@^@===SORRY!=== Serialization Error: could not locate static code ref for closure
18:42 elohmrow so we are all in the same place, i guess ;)
18:44 [Coke] bartolin: don't need to add [MOARVM] to tickets. tagging the VM is fine.
18:45 bartolin [Coke]: thanks, will (try to) remember :-)
18:45 Praise joined #perl6
18:46 [Coke] also, moarvm queue is mainly for stuff that is already identified as internal - anything that presents in the rakudo layer, it's fine to keep as an RT.
18:50 * grondilu discovered the `tabular` vim plugin.  https://github.com/godlygeek/tabular  Neat.
18:52 TEttinger joined #perl6
18:54 nine nadim_: http://irclog.perlgeek.de/perl6-toolchain/2016-08-29#i_13112051
19:00 CptnK m: say $*SPEC.splitdir: 'foo\bar\ber';
19:00 camelia rakudo-moar f2df2c: OUTPUT«(foo\bar\ber)␤»
19:00 CptnK That kinda sucks
19:01 timotimo you can just use the spec that has \es
19:01 CptnK timotimo: what do you mean?
19:02 timotimo m: say IO::Spec::Win32.splitdir: 'foo\bar\ber'
19:02 camelia rakudo-moar f2df2c: OUTPUT«(foo bar ber)␤»
19:02 timotimo m: say IO::Spec::Win32.splitdir: 'C:\foo\bar\ber'
19:02 camelia rakudo-moar f2df2c: OUTPUT«(C: foo bar ber)␤»
19:02 CptnK m: say IO::Spec::Win32.splitdir: 'foo/bar/ber'
19:02 camelia rakudo-moar f2df2c: OUTPUT«(foo bar ber)␤»
19:02 timotimo hm, not sure how handling drive letters works, actually
19:13 dalek ecosystem: 2c47dd0 | (Zoffix Znet)++ | META.list:
19:13 dalek ecosystem: Add SPEC::Func to ecosystem
19:13 dalek ecosystem:
19:13 dalek ecosystem: Import $*SPEC methods as functions: https://github.com/zoffixznet/perl6-SPEC-Func
19:13 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/2c47dd0d7b
19:16 girafe joined #perl6
19:16 gfldex m: IO::Path::Win32.new('C:\a\b').volume.say
19:16 camelia rakudo-moar f2df2c: OUTPUT«C:␤»
19:17 ufobat joined #perl6
19:19 timotimo ah
19:19 timotimo thanks, gfldex :)
19:29 nadim_ joined #perl6
19:42 canopus joined #perl6
19:45 labster joined #perl6
19:52 zakharyas joined #perl6
19:55 moritz http://observer.com/2016/08/not-a-drill-seti-is-investigating-a-possible-extraterrestrial-signal-from-deep-space/ wohoo!
19:59 cdg joined #perl6
20:02 mspo moritz: all of those screen savers paid off?
20:02 * grondilu inserts "alien" meme
20:03 * lizmat starts on this week's Perl 6 Weekly
20:04 vcv lizmat++ love that these are on a monday, an otherwise dreadful day.
20:05 timotimo derp space!
20:05 timotimo grondilu: "alien meme"?
20:06 timotimo i've seen a project where you'd name branches "timo/foobar" and when a branch is named that, "timo" would be allowed to force-push
20:06 timotimo but i find code ownership slightly problematic
20:08 grondilu timotimo: rather "aliens"
20:08 MasterDuke joined #perl6
20:10 sufrostico joined #perl6
20:12 El_Che lwp only has timeslots of 60, 120 and 240 minutes (or do I read it wrong)? http://act.yapc.eu/lpw2016/
20:13 timotimo the aliens meme is alien to me .. oh never mind, i've seen it! it has that bad-ass female protagonist in it!
20:19 cdg joined #perl6
20:37 grondilu enum (Foo => 1, Bar => Foo); can't be done apparently.  Yet it exists in C.
20:38 timotimo :D :D
20:38 timotimo could be done with a bit of parsing trickery, but ... bleeehhh :)
20:39 timotimo if you can't do it with the meatmodel, there's always the potatomodel!
20:40 leont joined #perl6
20:51 r_i_d joined #perl6
20:51 grondilu currently I'm looking at the Vulkan API,  I saw this kind of enum there.
20:52 grondilu I think if it's possible and apparently done in C, it should also be done in Perl 6.
20:54 konobi vulkan?
20:54 grondilu a new 3D graphics API
20:54 zacts joined #perl6
20:55 grondilu it's weird because I vaguely recall it was possible to do something like that in Perl 6, but not with enums, rather with an other data structure.  Can't quite remember which.
20:56 canopus joined #perl6
20:56 konobi well, in C, doesn't Foo just become a pointer, so therefore an address which is just an Int at the end of the day?
20:56 * grondilu has no idea
20:57 konobi yeah... i think that basically how it works out
20:57 r_i_d joined #perl6
20:58 arnsholt An enum in C is an int, IIRC
20:59 grondilu Is it not quite the same as writing this:
20:59 grondilu m: my ($a = 1, $b = $a);
20:59 camelia rakudo-moar f2df2c: ( no output )
20:59 grondilu m: my ($a = 1, $b = $a); say $b
20:59 camelia rakudo-moar f2df2c: OUTPUT«(Any)␤»
20:59 grondilu hum
20:59 * grondilu did not expect that
20:59 konobi so more like enum (Foo => 1, Bar => \Foo)
21:00 grondilu m: enum (Foo => 1, Bar => \Foo); say Bar
21:00 camelia rakudo-moar f2df2c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared name:␤    Foo used at line 1␤␤»
21:00 konobi (in concept, rather than as syntax ^_^)
21:01 grondilu it's killing me that I can't remember where I've seen something like that.
21:01 konobi \self.Foo might be more appropriate
21:01 grondilu maybe it was in constant definition.  Is it possible to define several constants in a single statement?
21:02 grondilu oh wait, it might have been in Perl 5
21:02 r_i_d joined #perl6
21:03 grondilu like:  use constant { Foo => 1, Bar => Foo }
21:03 grondilu ^that's apparently valid Perl 5 code.
21:04 grondilu ahh no, it does not bode with 'use strict;'
21:04 timotimo so at least we don't regress in that regard :)
21:04 konobi is there a way to access the current enum from it's expression?
21:05 konobi (it's own expression)
21:05 konobi =0)
21:06 * grondilu doubts it
21:07 konobi timotimo?
21:08 konobi well, expressions should be able to use reflection on themselves, iirc
21:11 grondilu they do in signatures, don't they?
21:11 grondilu m: say :($a, $b where $a == $b)
21:11 camelia rakudo-moar f2df2c: OUTPUT«($a, $b where { ... })␤»
21:11 grondilu thought that's definitely not the case I had in mind
21:13 konobi well, nested expression =0)
21:14 konobi m: say enum (Foo => 1, Bar => :Foo)
21:14 camelia rakudo-moar f2df2c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Type error in enum. Got 'Pair' Expected: 'Int'␤at <tmp>:1␤------> 3say enum (Foo => 1, Bar => :Foo)7⏏5<EOL>␤»
21:14 grondilu I'm sure it was a bare word.  I was using one in a statement while it was defined earlier in the same statement.
21:14 grondilu maybe it was an enum and there was a regression
21:15 sufrostico joined #perl6
21:17 * grondilu looks in some old code of his
21:18 * grondilu finds an example and it was indeed with constants in Perl 5
21:18 kyclark_ joined #perl6
21:18 kyclark_ left #perl6
21:19 espadrine joined #perl6
21:19 konobi m: say enum (Foo => 1, Bar => $:Foo)
21:19 camelia rakudo-moar f2df2c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Cannot use placeholder parameter $:Foo in the mainline␤at <tmp>:1␤------> 3say enum (Foo => 1, Bar => $:Foo7⏏5)␤»
21:19 konobi huh, i'd have thought that should have worked
21:20 konobi m: say enum (Foo => 1, Bar => \$:Foo)
21:20 camelia rakudo-moar f2df2c: OUTPUT«5===SORRY!5===␤Cannot use placeholder parameter $:Foo in the mainline␤at <tmp>:1␤------> 3say enum (Foo => 1, Bar => \$:Foo7⏏5)␤Other potential difficulties:␤    To pass an array, hash or sub to a function in Perl 6, just pass it as is.…»
21:20 timotimo i expect the actual enum object is only composed when we reach the end of the parsing
21:20 grondilu I had no idea this code I had written was not "strict" compliant.
21:20 timotimo i'd assume it won't even be stubbed after we've reached the name of the enum
21:21 konobi but twigils should setting that to be somewhat lazily evaluated, no?
21:21 kyclark joined #perl6
21:21 zacts_pi joined #perl6
21:21 pmurias konobi: hi
21:21 kyclark Given a list of pairs/lists, how can I convert to a hash?
21:22 konobi m: say enum (Foo => 1, Bar => $*Foo)
21:22 camelia rakudo-moar f2df2c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Type error in enum. Got 'Failure' Expected: 'Int'␤at <tmp>:1␤------> 3say enum (Foo => 1, Bar => $*Foo)7⏏5<EOL>␤»
21:22 kyclark my @list = (("name", "George"), ("age", 23))
21:22 pmurias konobi: I'm working on packaging up nqp-js into proper npm-style packages
21:22 konobi pmurias: oh, nice
21:22 kyclark I thought about something like ".map((=>))" but that doesn't work
21:22 konobi kyclark: check the list class
21:23 pmurias konobi: my current plan is it have seperate nqp-js-runtime and nqp-js-compiled-to-js packages
21:23 timotimo konobi: no, twigils will not make that happen for you
21:23 konobi yeah... makes sense
21:23 konobi timotimo: ah
21:24 mcmillhj joined #perl6
21:24 konobi m: say enum (Foo => 1, Bar => $.Foo)
21:24 camelia rakudo-moar f2df2c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable $.Foo used where no 'self' is available␤at <tmp>:1␤------> 3say enum (Foo => 1, Bar => $.Foo7⏏5)␤    expecting any of:␤        term␤»
21:24 konobi =0)
21:25 konobi yup
21:25 timotimo kyclark: mapping &[=>] onto a list of pairs like that is problematic because => expects two arguments, but it'll get a single list as its argument
21:26 timotimo kyclark: what you can do, however, is flatten the list first to get its inner lists as a long list of pairs
21:26 konobi pmurias: yeah, having the js-runtime separately helps focus an improving the JS implementation by itself outside of work that changes from NQP bring
21:26 timotimo otherwise i think we do have some method that does what you want. i could be wrong, of course
21:26 timotimo m: my @list = (("name", "George"), ("age", 23)); say @list>>.&[=>]; # i wonder
21:26 camelia rakudo-moar f2df2c: OUTPUT«Too few positionals passed; expected 2 arguments but got 1␤  in block <unit> at <tmp> line 1␤␤»
21:27 timotimo m: my @list = (("name", "George"), ("age", 23)); say @list.map(*.[0] => *.[1]).perl
21:27 camelia rakudo-moar f2df2c: OUTPUT«(:name(23),).Seq␤»
21:27 timotimo huh?
21:27 timotimo hah
21:27 timotimo m: my @list = (("name", "George"), ("age", 23)); say @list.perl; say @list.map(*.[0] => *.[1]).perl
21:27 camelia rakudo-moar f2df2c: OUTPUT«[("name", "George"), ("age", 23)]␤(:name(23),).Seq␤»
21:28 timotimo the star is a new argument each time, of course
21:28 timotimo m: my @list = (("name", "George"), ("age", 23)); say @list.map({ $^a.[0] => $^a.[1] }).perl
21:28 camelia rakudo-moar f2df2c: OUTPUT«(:name("George"), :age(23)).Seq␤»
21:28 timotimo there we go.
21:28 Actualeyes joined #perl6
21:28 timotimo m: my @list = (("name", "George"), ("age", 23)); say @%list
21:28 camelia rakudo-moar f2df2c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '%list' is not declared. Did you mean any of these?␤    &list␤    @list␤    &last␤    List␤␤at <tmp>:1␤------> 3(("name", "George"), ("age", 23)); say @7⏏5%list␤»
21:28 timotimo m: my @list = (("name", "George"), ("age", 23)); say %@list # typod
21:28 camelia rakudo-moar f2df2c: OUTPUT«{name George => (age 23)}␤»
21:28 timotimo that's definitely not it :D
21:29 timotimo m: my @list = (("name", "George"), ("age", 23)); say @list.pairup
21:29 camelia rakudo-moar f2df2c: OUTPUT«((name George) => (age 23))␤»
21:29 timotimo also not it
21:29 kyclark Well, that will do for now.  Seems like it should be more elegant.  Thanks!
21:31 konobi m: my @list = (("name", "George"), ("age", 23)); say %@list.antiparis
21:31 camelia rakudo-moar f2df2c: OUTPUT«Method 'antiparis' not found for invocant of class 'Hash'␤  in block <unit> at <tmp> line 1␤␤»
21:31 konobi m: my @list = (("name", "George"), ("age", 23)); say %@list.antipairs
21:31 camelia rakudo-moar f2df2c: OUTPUT«((age 23) => name George)␤»
21:31 konobi m: my @list = (("name", "George"), ("age", 23)); say %@list.kv
21:31 camelia rakudo-moar f2df2c: OUTPUT«(name George (age 23))␤»
21:31 konobi m: my @list = (("name", "George"), ("age", 23)); say @list.kv
21:31 camelia rakudo-moar f2df2c: OUTPUT«(0 (name George) 1 (age 23))␤»
21:31 konobi heh
21:32 kyclark gotta jet, but will reconnect at home.  let me know if you find something cooler.
21:32 konobi m: my @list = (("name", "George"), ("age", 23)); say @list.flat.kv
21:32 camelia rakudo-moar f2df2c: OUTPUT«(0 (name George) 1 (age 23))␤»
21:32 konobi m: my @list = (("name", "George"), ("age", 23)); say %@list.flat
21:32 camelia rakudo-moar f2df2c: OUTPUT«(name George => (age 23))␤»
21:33 zacts joined #perl6
21:33 konobi k... time to recompile rakudo it seesm
21:33 avuserow m: my @list = (("name", "George"), ("age", 23)); say @list.>>pairup
21:33 camelia rakudo-moar f2df2c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing dot on method call␤at <tmp>:1␤------> 3", "George"), ("age", 23)); say @list.>>7⏏5pairup␤    expecting any of:␤        postfix␤»
21:33 avuserow m: my @list = (("name", "George"), ("age", 23)); say @list>>.pairup
21:33 camelia rakudo-moar f2df2c: OUTPUT«((name => George) (age => 23))␤»
21:37 timotimo avuserow: hah! short and sweet. very good
21:37 timotimo m: my @list = (("name", "George"), ("age", 23)); say @list.flat.pairup
21:37 camelia rakudo-moar f2df2c: OUTPUT«((name George) => (age 23))␤»
21:37 cdg joined #perl6
21:37 timotimo m: my @list = (("name", "George"), ("age", 23)); say @list>>.Slip.pairup
21:37 camelia rakudo-moar f2df2c: OUTPUT«((name George) => (age 23))␤»
21:37 timotimo hmm.
21:37 timotimo m: my @list = (("name", "George"), ("age", 23)); say @list>>.list.pairup
21:37 camelia rakudo-moar f2df2c: OUTPUT«((name George) => (age 23))␤»
21:38 avuserow I find myself using >> a fair bit in p6 when processing collections like this. it's great to have. :)
21:38 mvorg joined #perl6
21:38 timotimo yup, it really, really, really is
21:38 gfldex m: my @list = (("name", "George"), ("age", 23)); my @pairs = do for @list -> [$k, $v] { $k => $v }; dd @pairs;
21:38 camelia rakudo-moar f2df2c: OUTPUT«Array @pairs = [:name("George"), :age(23)]␤»
21:38 timotimo to the point where i want every language to have that now
21:39 gfldex ». gets rid of lots of simple loops
21:41 tbrowder ugexe: I see the change you made, and what is needed to get the value into zef's guts.  I just tried a few changes and think, at least for build, we can test for the actual value of $DEBUG (maybe change its name) instead of True or not.  The ENV value tests as a Str and regex/match statements work well.  For example I'll show some code fragments in a gist in
21:41 tbrowder a few minutes.
21:41 lizmat and a new Perl 6 Weekly hits the Net: https://p6weekly.wordpress.com/2016/08/29/2016-35-a-quick-one-from-zagreb/
21:42 leont joined #perl6
21:47 tbrowder ugexe: here are the changed lines in this gist "https://gist.github.com/tbrowder/9ea0d5acd20967fa9f56b5c781939fdb"
21:47 timotimo lizmat: one of the links says "how to parse CSS" but the post is actually about RSS
21:47 timotimo imagine my confusion when people were recommending using libxml2
21:48 timotimo i thought "um, that won't work" :D
21:48 lizmat timotimo++   # fixed
21:48 timotimo thanks :)
21:48 tbrowder ugexe: notice the value of $DEBUG is tested two different ways, as needed: truth or value
21:49 ugexe tbrowder: those aren't neccesary. it will output with either --verbose or --debug, because INFO/VERBOSE/DEBUG/etc is part of the VERBOSITY enum
21:50 tbrowder I know, but I don't want all the info from DEBUG for VERBOSE type items from user space, thus I have the option to test for values instead of truth.
21:51 tbrowder Maybe I don't understand, but the ZEF_BUILDPM_DEBUG env var is treated as a string (which can be '') so it all just works in my short test.
21:53 ugexe m: %*ENV<foo> = True; %*ENV<bar> = False; say %*ENV<foo>; say %*ENV<bar>
21:53 camelia rakudo-moar f2df2c: OUTPUT«True␤False␤»
21:53 timotimo mst: Opan GangnaMSTyle!
21:55 tbrowder I know I'm not explaining this clearly, but the $verbosity takes on a value of the enum, and when it is placed in an environment variable, it can take on many values, not just true or false.  The original statement assigned truth where my change assigned a value to $verbosity.
21:56 canopus joined #perl6
21:56 ugexe the ::Service namespace doesn't get to work with the logger verbosity levels, that the job of the adapter. the fact $DEBUG is even there is just an artifact from when it was in Zef::Client
21:58 ugexe i.e. verbosity output should be handled in Zef::Build, not Zef::Service::Shell::Build
21:59 ugexe Zef::Build will have access to the actual verbosity enum/types
22:02 tbrowder I couldn't see how to get the verbosity value in Buid.pm other than the DEBUG env var, but that would be the proper way to do it.
22:03 ugexe you need to clarify between Zef::Build and Zef::Service::Shell::Build
22:03 ugexe because your gist says its for Zef::Build but its for Zef::SErvice::Shell::Build
22:04 ugexe what i'm saying is the $DEBUG bit can probably be moved into Zef::Build from Zef::Service::Shell::Build. Zef::Build will have access to the actual verbosity type, no need to stringify anything
22:04 tbrowder Oh, I was a bit sloppy ref the name--let me look closer.
22:05 mcmillhj joined #perl6
22:06 canopus joined #perl6
22:09 tbrowder The actual file is "Zef::Service:🐚:Build.pm", I've corrected the gist.
22:09 leont joined #perl6
22:10 tbrowder Argh, this unicode stuff is getting out of hand!  Anyone else see a shell picture instead of "::Shel"?
22:10 tbrowder s/Shel/Shell/
22:12 kyclark joined #perl6
22:14 Sgeo joined #perl6
22:16 ugexe yes, i knew thats what you meant. but what needs to happen is to remove $DEBUG from ::Service::Build all together and filter the output in Zef::Build based on the verbosity level
22:17 cyphase joined #perl6
22:17 ugexe ::Service::* are all dumb and essentially stand alone. Zef::Build/Test/whatever is the adapter for the various services, and what Zef::Client actually uses
22:18 skids joined #perl6
22:20 ugexe in fact it might Just Work if the $DEBUG conditions are all removed / assumed true
22:27 tbrowder ugexe: so how can i help you to scratch my itch?
22:27 buggable joined #perl6
22:30 tbrowder Any Canadian p6 meetings during the period 16-22 Sep?
22:30 _slade_ joined #perl6
22:32 canopus joined #perl6
22:32 zjlin joined #perl6
22:33 tbrowder Specifically from Quebec City, Prince Edward Island, Sydney, and Halifax. Yes, a cruise with wife and friends--p6 meeting would be better than being dragged on a shopping tour!
22:35 El_Che I saw zoffix posting about the next toronto meeting, but later: 29 sept
22:36 kyclark What would be the most efficient way to find all overlapping sequences from something like this?
22:36 kyclark my @pos = [9..11], [1..5], [3..6], [7..10]
22:37 dalek doc: 71df199 | gfldex++ | doc/Language/typesystem.pod6:
22:37 dalek doc: show how to get hold of type object for enum keys
22:37 dalek doc: review: https://github.com/perl6/doc/commit/71df1991f8
22:37 grondilu there is a known algorithm.
22:37 grondilu kyclark: it'd be tough to figure it out yourself.  Look it up.
22:38 grondilu oh you want *all* overlapping sequences?  Might even be harder.
22:38 kyclark It’s an n-squared thing, isn’t it?
22:38 grondilu the algorithm I was talking about is for the longuest overlapping sequence.
22:38 grondilu IIRC
22:39 grondilu https://en.wikipedia.org/wiki/Longest_common_subsequence_problem
22:39 kyclark for 0..@list.elems -> $i { for 1..@list.elems -> $j { if $i in $j { … }}
22:47 mcmillhj joined #perl6
22:48 canopus joined #perl6
22:51 bjz joined #perl6
22:51 timotimo we don't have an "in" operator :)
22:51 NeuralAnomaly joined #perl6
22:52 timotimo and i think it's actually n^3?
22:52 timotimo hmm
22:53 timotimo i'm recognizing my brain is getting tireder than recommended for thinking
22:54 konobi grondilu: you can use a set operation with a sort for that
22:56 NeuralAnomaly joined #perl6
22:57 timotimo it looks like we only have an iterated version of permutations, at least the sub version
22:59 grondilu timotimo: iterated as opposed to what?
23:00 grondilu I mean how else would you implement it?
23:00 timotimo all-at-once
23:00 * grondilu is confused
23:00 timotimo i.e. an implementation for the push-all method in the iterator
23:00 leont joined #perl6
23:01 ugexe tbrowder: it should do what you were looking for now
23:02 mcmillhj joined #perl6
23:06 gfldex Hash with fixed set of keys with the caveat of polluting the local scope: https://gist.github.com/gfldex/af2a861fc216b732d4eab5a944146c62
23:11 kyclark m: my %things = dogs => [{:name("Bowzer")}, {:name("Patch")}], people => [{:name("George")}, {:name("Fred”)}]; put %things<dogs>.elems; for %things<dogs> -> $thing { put $thing<name> }
23:11 camelia rakudo-moar f2df2c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$thing' is not declared. Did you mean '%things'?␤at <tmp>:1␤------> 3hings<dogs>.elems; for %things<dogs> -> 7⏏5$thing { put $thing<name> }␤»
23:13 canopus joined #perl6
23:13 kyclark Hmm, I’m not able to show my problem.
23:13 kyclark Given a hash that has an array for values, how do I iterate over the values?
23:13 kyclark my %things = dogs => [{:name("Bowzer")}, {:name("Patch")}], people => [{:name("George")}, {:name("Fred")}]
23:13 kyclark for %things<dogs> -> $thing { put $thing<name> }
23:13 kyclark That gives me:
23:13 kyclark Type Array does not support associative indexing.
23:15 timotimo m: my %things = dogs => [{:name("Bowzer")}, {:name("Patch")}], people => [{:name("George")}, {:name("Fred”)}]; put %things<dogs>.elems; for (%things<dogs>) -> $thing { put $thing<name> }
23:15 camelia rakudo-moar f2df2c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$thing' is not declared. Did you mean '%things'?␤at <tmp>:1␤------> 3ngs<dogs>.elems; for (%things<dogs>) -> 7⏏5$thing { put $thing<name> }␤»
23:15 * timotimo looks for non-closed double-quotes
23:16 timotimo m: my %things = dogs => [{:name("Bowzer")}, {:name("Patch")}], people => [{:name("George")}, {:name("Fred”)}]; put %things<dogs>.elems; for (%things<dogs>) { put $_<name> }
23:16 camelia rakudo-moar f2df2c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in double quotes; couldn't find final '"' ␤at <tmp>:1␤------> 3ms; for (%things<dogs>) { put $_<name> }7⏏5<EOL>␤»
23:16 timotimo haha
23:16 timotimo do you see that?
23:17 timotimo m: ':name("Fred”)'.substr(*-3).comb.>>.uniname.say
23:17 camelia rakudo-moar f2df2c: OUTPUT«(LATIN SMALL LETTER D RIGHT DOUBLE QUOTATION MARK RIGHT PARENTHESIS)␤»
23:17 avuserow m: my %things = dogs => [{:name("Bowzer")}, {:name("Patch")}], people => [{:name("George")}, {:name("Fred")}]; put %things<dogs>.elems; for %things<dogs>.list -> $thing { put $thing<name> }
23:17 camelia rakudo-moar f2df2c: OUTPUT«2␤Bowzer␤Patch␤»
23:17 timotimo perl6 does a lot of different combos of smart quotes, but not a regular ("dumb") one and a right "smart" one
23:17 avuserow not sure if there's a more graceful way of doing that
23:17 timotimo avuserow: @ in front is short for ".list" at the end
23:18 avuserow m: my %things = dogs => [{:name("Bowzer")}, {:name("Patch")}], people => [{:name("George")}, {:name("Fred")}]; put %things<dogs>.elems; for @%things<dogs> -> $thing { put $thing<name> }
23:18 camelia rakudo-moar f2df2c: OUTPUT«2␤Type List does not support associative indexing.␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
23:18 avuserow m: my %things = dogs => [{:name("Bowzer")}, {:name("Patch")}], people => [{:name("George")}, {:name("Fred")}]; put %things<dogs>.elems; for @(%things<dogs>) -> $thing { put $thing<name> }
23:18 camelia rakudo-moar f2df2c: OUTPUT«2␤Bowzer␤Patch␤»
23:18 timotimo well, i'll be damned.
23:18 timotimo m: my %things = dogs => ({:name("Bowzer")}, {:name("Patch")}), people => ({:name("George")}, {:name("Fred")}); put %things<dogs>.elems; for (%things<dogs>) { put $_<name> }
23:18 camelia rakudo-moar f2df2c: OUTPUT«2␤Type List does not support associative indexing.␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
23:18 timotimo m: my %things = dogs => ({:name("Bowzer")}, {:name("Patch")}), people => ({:name("George")}, {:name("Fred")}); put %things<dogs>.elems; for @(%things<dogs>) { put $_<name> }
23:18 camelia rakudo-moar f2df2c: OUTPUT«2␤Bowzer␤Patch␤»
23:18 timotimo that doesn't change much, it seems
23:19 avuserow I prefer a postfix method call to circumfix here...
23:19 timotimo that's fair
23:22 avuserow m: my %things = dogs => [{:name("Bowzer")}, {:name("Patch")}], people => [{:name("George")}, {:name("Fred")}]; put %things<dogs>.elems; my @thing-container = %things<dogs>; for @thing-container -> $thing { put $thing<name> }
23:22 camelia rakudo-moar f2df2c: OUTPUT«2␤Type Array does not support associative indexing.␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
23:23 adu joined #perl6
23:24 timotimo [Coke]: got any cool war stories to tell about angular 2 yet? :)
23:24 gfldex m: my %things = (dogs => (:name<Bowzer>, :name<Patch>)), (people => (:name<George>, :name<Fred>)); put %things<dogs>.elems; for %things<dogs>.flat -> %h { dd %h<name> }
23:24 camelia rakudo-moar f2df2c: OUTPUT«2␤"Bowzer"␤"Patch"␤»
23:25 gfldex m: my %things = (dogs => (:name<Bowzer>, :name<Patch>)), (people => (:name<George>, :name<Fred>)); put %things<dogs>.elems; for %things<dogs> -> \i { dd i }
23:25 camelia rakudo-moar f2df2c: OUTPUT«2␤List %things = $(:name("Bowzer"), :name("Patch"))␤»
23:25 gfldex m: my %things = (dogs => (:name<Bowzer>, :name<Patch>)), (people => (:name<George>, :name<Fred>)); put %things<dogs>.elems; for %things<dogs> -> \i { dd i.flat }
23:25 camelia rakudo-moar f2df2c: OUTPUT«2␤(:name("Bowzer"), :name("Patch")).Seq␤»
23:27 canopus joined #perl6
23:28 mcmillhj joined #perl6
23:30 gfldex m: my %things = dogs => [:name<Bowzer>, :name<Patch>], people => [:name<George>, :name<Fred>]; dd %things; for %things<dogs>.Seq -> %h { dd %h }
23:30 camelia rakudo-moar f2df2c: OUTPUT«Hash %things = {:dogs($[:name("Bowzer"), :name("Patch")]), :people($[:name("George"), :name("Fred")])}␤:name("Bowzer")␤:name("Patch")␤»
23:31 gfldex m: my %things = dogs => [:name<Bowzer>, :name<Patch>], people => [:name<George>, :name<Fred>]; dd %things; for %things<dogs> -> [%h] { dd %h }
23:31 camelia rakudo-moar f2df2c: OUTPUT«Hash %things = {:dogs($[:name("Bowzer"), :name("Patch")]), :people($[:name("George"), :name("Fred")])}␤Too few positionals passed; expected 1 argument but got 0 in sub-signature␤  in block <unit> at <tmp> line 1␤␤»
23:31 gfldex i'm confused that the destructuring doesn't work
23:32 timotimo because there isn't a single hash in that list
23:32 xinming joined #perl6
23:32 timotimo wait ... what ...
23:32 timotimo can we have this with a shorter literal please? my eyes cross over when trying to read all that :)
23:33 timotimo oh, you just have a list of Pair objects in your hash there
23:33 timotimo that surely won't destructure with [%h]
23:37 skids m: my %things = dogs => [:name<Bowzer>, :name<Patch>], people => [:name<George>, :name<Fred>]; dd %things; for %things<dogs> -> [*%h] { dd %h } # :/
23:37 camelia rakudo-moar f2df2c: OUTPUT«Hash %things = {:dogs($[:name("Bowzer"), :name("Patch")]), :people($[:name("George"), :name("Fred")])}␤{:name("Patch")}␤»
23:38 skids m: my %things = dogs => [:name<Bowzer>, :name2<Patch>], people => [:name<George>, :name<Fred>]; dd %things; for %things<dogs> -> [*%h] { dd %h } # :/
23:38 camelia rakudo-moar f2df2c: OUTPUT«Hash %things = {:dogs($[:name("Bowzer"), :name2("Patch")]), :people($[:name("George"), :name("Fred")])}␤{:name("Bowzer"), :name2("Patch")}␤»
23:38 skids Ah.  Yes that does work.
23:53 zoosha joined #perl6
23:54 canopus joined #perl6

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

Perl 6 | Reference Documentation | Rakudo