Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-09-12

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:21 BenGoldberg joined #perl6
00:28 Cabanossi joined #perl6
00:29 committable6 joined #perl6
00:30 coverable6 joined #perl6
00:30 bloatable6 joined #perl6
00:30 releasable6 joined #perl6
00:30 bisectable6 joined #perl6
00:30 nativecallable6 joined #perl6
00:35 cdg joined #perl6
00:43 luis joined #perl6
00:56 raiph joined #perl6
01:10 bloatable6 joined #perl6
01:10 unicodable6 joined #perl6
01:10 quotable6 joined #perl6
01:10 evalable6 joined #perl6
01:10 committable6 joined #perl6
01:10 benchable6 joined #perl6
01:10 bisectable6 joined #perl6
01:10 releasable6 joined #perl6
01:10 greppable6 joined #perl6
01:10 nativecallable6 joined #perl6
01:10 squashable6 joined #perl6
01:10 statisfiable6 joined #perl6
01:11 coverable6 joined #perl6
01:13 Cabanossi joined #perl6
01:17 rouking joined #perl6
01:19 rouking How do I pass each element in an array as a separate argument to a subroutine? e.g. `my @args = 'arg1', 'arg2'; my-sub(???)`
01:20 rouking (the arity of the subroutine is unknown at compile time)
01:20 ugexe my-sub(|@args)
01:21 rouking Aha
01:21 rouking I knew I had seen some easy way somewhere
01:21 rouking thanks
01:36 zakame joined #perl6
01:38 er2 joined #perl6
01:40 cdg joined #perl6
01:53 llfourn joined #perl6
01:55 ilbot3 joined #perl6
01:55 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
01:57 Cabanossi joined #perl6
02:12 noganex_ joined #perl6
02:19 rouking joined #perl6
02:20 huajie-hu joined #perl6
02:22 nexi joined #perl6
02:25 nexi left #perl6
02:26 Geth ¦ doc: 5282c57cfb | (Will "Coke" Coleda)++ | xt/code.pws
02:26 Geth ¦ doc: learn new code
02:26 Geth ¦ doc: review: https://github.com/perl6/doc/commit/5282c57cfb
02:27 Cabanossi joined #perl6
02:28 jeek joined #perl6
02:34 cdg joined #perl6
02:57 Cabanossi joined #perl6
03:02 huajie-hu joined #perl6
03:20 huajie-hu joined #perl6
03:27 AlexDaniel joined #perl6
03:27 Cabanossi joined #perl6
03:41 Cabanossi joined #perl6
04:21 Khisanth joined #perl6
04:26 Cabanossi joined #perl6
04:56 Cabanossi joined #perl6
05:03 xtreak joined #perl6
05:15 Kyo91 joined #perl6
05:39 domidumont joined #perl6
05:46 domidumont joined #perl6
05:56 Cabanossi joined #perl6
06:07 cuonglm joined #perl6
06:11 espadrine joined #perl6
06:26 Cabanossi joined #perl6
06:33 wamba joined #perl6
06:37 piojo joined #perl6
06:37 domidumont joined #perl6
06:38 piojo Did the way the REPL interacts with the terminal change recently? Some time in the past month, the REPL stopped working in cygwin and msys
06:38 piojo it's still fine in cmd.exe, and cygwin/msys can still run "perl6 -e ..."
06:39 piojo And using rlwrap doesn't help.
06:41 tinita joined #perl6
06:56 Cabanossi joined #perl6
07:00 jonas1 joined #perl6
07:01 HTTP_____GK1wmSU joined #perl6
07:04 HTTP_____GK1wmSU left #perl6
07:09 pyrimidine joined #perl6
07:16 darutoko joined #perl6
07:16 piojo joined #perl6
07:17 HTTP_____GK1wmSU joined #perl6
07:18 zakharyas joined #perl6
07:20 HTTP_____GK1wmSU left #perl6
07:26 Cabanossi joined #perl6
07:30 pecastro joined #perl6
07:30 perlpilot_ joined #perl6
07:31 * lizmat clickbaits https://p6weekly.wordpress.com/2017/09/11/2017-37-collating-sorted/
07:31 jast nice title
07:35 jeek joined #perl6
07:41 dakkar joined #perl6
07:52 ChoHag joined #perl6
07:53 leont joined #perl6
07:57 Cabanossi joined #perl6
07:59 zakharyas joined #perl6
08:00 xtreak joined #perl6
08:05 margeas joined #perl6
08:07 _28_ria joined #perl6
08:13 pyrimidi_ joined #perl6
08:20 zakharyas1 joined #perl6
08:23 piojo When compiling rakudo, is there any automatic way to choose a correct revision of NQP to build against?
08:24 xtreak joined #perl6
08:25 xtreak_ joined #perl6
08:27 _28_ria joined #perl6
08:28 zakharyas joined #perl6
08:40 pmurias joined #perl6
08:41 wamba joined #perl6
08:41 llfourn joined #perl6
08:42 pmurias samcv: I think I'll just implement how I want to nqp::unipropcode to work on the js backend and once stuff works there we can think how that stuff should work on MoarVM
08:42 yoleaux 11 Sep 2017 13:40Z <samcv> pmurias: i am going to sleep now. i'll talk with you more about this tomorrow. looks like you got disconnected, but check the log for my full response
08:50 cdg joined #perl6
08:55 nowan joined #perl6
08:56 cdg joined #perl6
08:56 aborazmeh joined #perl6
08:56 aborazmeh joined #perl6
08:56 Cabanossi joined #perl6
08:56 domidumont joined #perl6
09:12 xtreak joined #perl6
09:12 xtreak joined #perl6
09:13 zakharyas joined #perl6
09:13 daxim I am sad that I got ignored and my hopes were disappointed  https://irclog.perlgeek.de/perl6/2017-04-04#i_14372592
09:42 HTTP_____GK1wmSU joined #perl6
09:45 HTTP_____GK1wmSU left #perl6
09:49 mr-foobar joined #perl6
09:58 eliasr joined #perl6
10:05 second_ joined #perl6
10:07 second_ left #perl6
10:21 samcv ok pmurias. so is it going to work for Property names themselves + General Category + Script values?
10:22 samcv plus unions like Letter for Ll and Lo and Lu
10:22 zakharyas joined #perl6
10:22 samcv that is what I think it should do at least
10:26 ShalokShalom_ joined #perl6
10:45 pmurias samcv: nope, we need one for property names only
10:46 pmurias Even for unimatch do we want to allow unimatch('A', 'Latin', 'English') as a way to match Latin?
10:48 Ptolemarch joined #perl6
10:48 samcv that wouldn't match since there is no english property
10:49 nadim joined #perl6
10:49 samcv pmurias, but that is fine by me if you do that. :) totally fine with there being an op which specifically only does properties
10:55 lizmat daxim: would you care to elaborate ?
10:58 daxim I hoped to be able to do <http://paste.debian.net/925841/> after the grant in perl6
11:06 lizmat isn't that more what :ignoremark is supposed to do ?
11:08 timotimo joined #perl6
11:08 timotimo #moarvm
11:08 timotimo er
11:10 daxim not quite
11:10 daxim p6: 'Ə' ~~ m:ignoremark/E/
11:10 camelia rakudo-moar 760530: ( no output )
11:11 daxim the magic is in the amended table
11:12 Skarsnik joined #perl6
11:26 samcv it's not an E though
11:26 samcv it's classified as a different distinct letter than E is
11:26 samcv in unicode collation algorithm
11:26 Cabanossi joined #perl6
11:26 * Skarsnik let watch my vps die as I update 2 version of debian stable
11:27 samcv m: for <PRIMARY SECONDARY TERTIARY> { for <E Ə> -> $e { say $e, ' ', $e.uniprop("MVM_COLLATION_$_") }
11:27 camelia rakudo-moar 760530: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> 3e, ' ', $e.uniprop("MVM_COLLATION_$_") }7⏏5<EOL>␤»
11:27 lizmat http://blogs.perl.org/users/lichtkind/2017/09/the-hugest-feature-of-perl-6.html
11:27 samcv m: for <PRIMARY SECONDARY TERTIARY> { for <E Ə> -> $e { say $e, ' ', $e.uniprop("MVM_COLLATION_$_")} }
11:27 camelia rakudo-moar 760530: OUTPUT: «E 7441␤Ə 7460␤E 33␤Ə 33␤E 9␤Ə 9␤»
11:28 Skarsnik what is collation btw? x)
11:29 samcv string sorting
11:29 samcv with the unicode collation algorithm you can sort things in a basically codepoint number agnostic way
11:30 Skarsnik fun ^^
11:30 Skarsnik I am curious what kind of people use the unicode stuff x)
11:30 samcv m: use experimental :collation; dd <æ a ae af fi fi fe fn ff>.collate
11:30 camelia rakudo-moar 760530: OUTPUT: «("a", "ae", "æ", "af", "fe", "ff", "fi", "fi", "fn").Seq␤»
11:30 samcv m: use experimental :collation; dd <æ a ae af fi fi fe fn ff>.sort
11:30 camelia rakudo-moar 760530: OUTPUT: «("a", "ae", "af", "fe", "fi", "fn", "æ", "ff", "fi").Seq␤»
11:30 samcv compare
11:31 samcv m: use experimental :collation; dd <æ a á ā A Á Z r t u v>.collate
11:31 camelia rakudo-moar 760530: OUTPUT: «("a", "A", "á", "Á", "ā", "æ", "r", "t", "u", "v", "Z").Seq␤»
11:31 samcv diacritics sort properly too
11:31 samcv and it can also assinn multiple collation values to single codepoints, or assign single collation values to multiple codeponits
11:32 samcv so æ sorts right after 'ae'
11:32 samcv because it has two collation array elements
11:32 samcv and ff has two as well, so sorts with ff
11:33 samcv ① will sort after 1 as well. and punctuation will sort together. so instead of sorting by codepoint it sorts in human ways
11:33 samcv and i also allow you to configure each level
11:34 samcv Skarsnik, read https://docs.perl6.org/language/experimental#Collation_Levels the last section #Collation Levels
11:35 scovit joined #perl6
11:36 scovit please correct me if I am wrong: it is a well known fact that multi-dispatch don't work with native types?
11:36 samcv which native types?
11:37 samcv but it should work
11:37 samcv i've used separate ones for int and Int before
11:37 samcv though i haven't tried every one. str and int work at least
11:38 lizmat m: multi sub a(int $a) { "int" }; multi sub a(Int $a) { say "Int" }; say a 42  # counter-intuitive maybe ?
11:38 camelia rakudo-moar 760530: OUTPUT: «int␤»
11:38 lizmat hmmm... I seem to recall that would call the Int candidate
11:38 timotimo right, we had a change for that a month or three ago
11:39 timotimo the case you have there is where the optimizer is able to figure it out
11:39 timotimo and the optimizer knows the difference between a literal and "just" a value
11:39 samcv releasable6, status
11:39 releasable6 samcv, Next release in 4 days and ≈7 hours. 1 blocker. Changelog for this release was not started yet
11:39 releasable6 samcv, Details: https://gist.github.com/206158483d98fc98be5eabc3390364d5
11:39 scovit m: multi a(int \m, int \n) { say m }; multi a(Str $uno) { say $uno }; say a 3, 1; # is it expected?
11:39 camelia rakudo-moar 760530: OUTPUT: «Cannot resolve caller a(Int, Int); none of these signatures match:␤    (int \m, int \n)␤    (Str $uno)␤  in block <unit> at <tmp> line 1␤␤»
11:39 scovit m: multi a(Int \m, Int \n) { say m }; multi a(Str $uno) { say $uno }; say a 3, 1; # is it expected?
11:39 camelia rakudo-moar 760530: OUTPUT: «3␤True␤»
11:39 samcv cool will be able to get the collation stuff, and get in fixing case changes and ignoremark when there's prepend characters to the release
11:40 jnthn scovit: Yes
11:40 samcv plus all the huge string speed improvements :)
11:41 jnthn scovit: A native multi can only be reliably called when the operands are stored in natively typed variables
11:41 scovit jnthn good, thanks
11:42 jnthn scovit: As a convenience, for multi subs only (because that's the only case we can analyze statically), when one argument is a literal and the other is declared as natively typed, we'll turn the literal into a native also
11:42 jnthn Otherwise you'd not be able to write $native-int + 1
11:42 jnthn So we allow the literal to be allomorphic, but only if there's a known native
11:43 jnthn lunch &
11:46 timotimo joined #perl6
11:51 pmurias joined #perl6
11:51 S007 joined #perl6
11:56 Cabanossi joined #perl6
11:58 xtreak joined #perl6
12:01 xtreak joined #perl6
12:02 samcv oh wow rakudo has no ordbaseat op. we need an op that does the same thing
12:02 samcv to find the base codepoint or character in a certain string. or converts the whole string to base characters
12:02 samcv both maybe hm
12:03 samcv like substr but with returning the base codepoint
12:03 timotimo you can turn "the whole string" that you get from substr($foo, $n, 1) into base characters and grab the first one
12:07 MrWhistler joined #perl6
12:10 [Coke] .tell piojo - if you use rakudo's Configure.pl --gen-nqp it will automatically insure you have the appropriate version of nqp available. (it won't update if it finds a version that is new enough)
12:10 yoleaux [Coke]: I'll pass your message to piojo.
12:26 Cabanossi joined #perl6
12:35 scovit trait 'is pure' is for compile-time execution. What would be the opposite, e.g. enforcing runtime execution at least in module compilations?
12:35 scovit where runtime execution is delayed execution
12:36 scovit problem is with a nativecall which get executed at compiletime, but whish I do not wish that it does so because of the untrackable side effects
12:38 jnthn How are you ending up with it called at BEGIN time anyway?
12:38 jnthn It'd have to appear in a constant or BEGIN or trait argument or similar for that to happen
12:39 jnthn So the answer would be "don't do that"
12:39 scovit ok, it is in a constant.. right
12:40 scovit basically I was forcing it to do so
12:40 jnthn constant means "at BEGIN time"
12:40 jnthn If you don't want something to happen then, don't use constant.
12:40 Skarsnik hm constant are compile time for module?
12:41 jnthn Yes
12:41 jnthn So once it's precompiled, that compuation doesn't have to happen again
12:41 Skarsnik but BEGIN in a module is run evertime you load the module?
12:41 jnthn No
12:41 jnthn It's ran when the module is compiled
12:41 b2gills If you want something that seems like it is a constant textually, you could use `sub term:<foo> () { (42,'bar').pick }`
12:41 jnthn INIT is run every time you load the module
12:53 scovit jnthn it is a defect of the module I uploaded last week (NativeHelpers::CBuffer). If you assign it to a constant in a module is gonna be SEGFAULT. Is there a way to detect this condition?
12:53 scovit in order to bailout
12:53 jnthn Hmm
12:54 jnthn What that really means I guess is "check if the compiler is in dynamic scope"
12:55 jnthn I can't off-hand thing of a standard way to do that
12:55 jnthn A total cheat way is probably
12:55 scovit the module is a cheat already
12:55 mcmillhj joined #perl6
12:55 jnthn m: say defined $*W;
12:55 camelia rakudo-moar 760530: OUTPUT: «False␤»
12:55 jnthn m: BEGIN say defined $*W;
12:55 camelia rakudo-moar 760530: OUTPUT: «1␤»
12:56 jnthn So you can use truth of defined($*W) to know the compiler is running. It's Rakudo specific, but at least if someting changes it'd degrade into the same situation as without it
12:56 scovit I think it is ok for now
12:57 Geth ¦ doc: 592c43b7ff | MasterDuke17++ (committed using GitHub Web editor) | doc/Language/performance.pod6
12:57 Geth ¦ doc: Add column name to SQL profile example
12:57 Geth ¦ doc: review: https://github.com/perl6/doc/commit/592c43b7ff
12:57 [Coke] jnthn: should I be annoyed that it's False and 1? :)
12:59 jnthn No
12:59 jnthn sub defined delegates to .defined and $*W is an NQP object, not a Perl 6 one
12:59 jnthn And NQP doesn't have real booleans
13:06 pyrimidine joined #perl6
13:15 pmurias what font should I use in my terminal that can display weird unicode charaters
13:16 brimonk_ joined #perl6
13:17 pmurias ?
13:19 ilmari[m] Install Symbola, and it should fall back to that for characters not in your main font
13:20 cdg joined #perl6
13:23 MasterDuke i think Noto has a lot of the unicode symbols
13:26 Cabanossi joined #perl6
13:28 virtualsue joined #perl6
13:34 John joined #perl6
13:34 nightfro- joined #perl6
13:46 xtreak joined #perl6
13:53 bdmatatu joined #perl6
13:54 kubrat_ left #perl6
14:01 pyrimidine joined #perl6
14:06 rindolf joined #perl6
14:11 Cabanossi joined #perl6
14:20 stmuk joined #perl6
14:20 scovit jnthn $*W seems to be always there during module loading
14:20 scovit m: class ore { method new(Int $a) { if ($*W) { my $block := { self.new($a + 1); }; $*W.add_object($block); $*W.add_phaser(Mu, "INIT", $block, class :: { method cuid { (^2**128).pick }}); } else { say $a; return $a; }; } }; constant b = ore.new(1);
14:20 camelia rakudo-moar 760530: OUTPUT: «2␤»
14:21 scovit would be possible to bind the output of the INIT phaser to b?
14:21 scovit m: class ore { method new(Int $a) { if ($*W) { my $block := { self.new($a + 1); }; $*W.add_object($block); $*W.add_phaser(Mu, "INIT", $block, class :: { method cuid { (^2**128).pick }}); } else { say $a; return $a; }; } }; constant b = ore.new(1); say b
14:21 camelia rakudo-moar 760530: OUTPUT: «2␤No such method 'gist' for invocant of type 'QAST::Op'. Did you mean any of these?␤    isa␤    list␤␤  in block <unit> at <tmp> line 1␤␤»
14:24 jnthn scovit: Yeah, it will be
14:25 jnthn Since the compiler is loading the module as a result of compiling the script that uses it
14:25 scovit yea, I was guessing so
14:26 mr-foobar joined #perl6
14:27 rindolf joined #perl6
14:35 piojo joined #perl6
14:38 Kyo91 joined #perl6
14:48 skids joined #perl6
14:53 ruoso___ So, in my quest to write a fortran parser, I need to be able to parse statement labels... https://gist.github.com/anonymous/45bc04526d710ea40f836b572968e895 is what I have come up with, but I wonder if there's a less terrible way of writing it...
14:56 ruoso___ oh, shoot... that's actually wrong... statement labels can also have spaces in the middle of the number...
14:56 mr-foobar joined #perl6
14:56 Cabanossi joined #perl6
14:57 ruoso___ so, that means the rule can actually be simpler...
14:58 moritz ruoso___: if it weren't for the rule change, you could have implemented that as .**6 & [' '* \d+ ' '*]
14:58 moritz so a sequence of spaces, digits, spaces that is also 6 characters long
14:58 ruoso___ oh, neato
14:59 ruoso___ Didn't know about that feature
14:59 moritz or of course use an assertion, <?{ $<somecapture>.chars == 6 }>
14:59 moritz & is very useful on some cases
14:59 moritz another use case is "a quoted string that doesn't contain an x"
15:00 moritz <quoted_string> & <-[x]>*
15:00 ruoso___ nice
15:05 scovit m: use nqp; class ore { method new(Int $a) { if ($*W) { my $block := { nqp::bindkey(CALLER::, "b", self.new($a + 1)); }; $*W.add_object($block); $*W.add_phaser($/, "INIT", $block, class :: { method cuid { (^2**128).pick }}); } else { say $a; return $a; }; }; }; constant b = ore.new(1); say ::<b>  # Might be just utterly broken code, dont know enough of this language
15:05 camelia rakudo-moar 760530: OUTPUT: «2␤2␤»
15:05 scovit # but what is missing is a way to invalidate the lexical cache and to retireve the symbol "b" from $*W, any help?
15:06 pyrimidine joined #perl6
15:07 someuser joined #perl6
15:08 moritz scovit: werm, what do you want to achieve?
15:10 scovit moritz it's an hack. I want to achieve to postpone the assignment of the constant b to after compilation
15:11 scovit there are two problems: 1. how does ore know about the symbol "b" (e.g. the name of the constant)
15:12 scovit 2. m: use nqp; class ore { method new(Int $a) { if ($*W) { my $block := { nqp::bindkey(CALLER::, "b", self.new($a + 1)); }; $*W.add_object($block); $*W.add_phaser($/, "INIT", $block, class :: { method cuid { (^2**128).pick }}); } else { say $a; return $a; }; }; }; constant b = ore.new(1); say b # this, b for some reason is not the same as ::<b> I suspect a chaching issue
15:12 scovit m: use nqp; class ore { method new(Int $a) { if ($*W) { my $block := { nqp::bindkey(CALLER::, "b", self.new($a + 1)); }; $*W.add_object($block); $*W.add_phaser($/, "INIT", $block, class :: { method cuid { (^2**128).pick }}); } else { say $a; return $a; }; }; }; constant b = ore.new(1); say b #
15:12 camelia rakudo-moar 760530: OUTPUT: «2␤No such method 'gist' for invocant of type 'QAST::Op'. Did you mean any of these?␤    isa␤    list␤␤  in block <unit> at <tmp> line 1␤␤»
15:13 pyrimidine joined #perl6
15:13 moritz scovit: re 1, it doesn't. That's what encapsulation and separation of concerns etc. is all about
15:14 jnthn 12:40 < jnthn> constant means "at BEGIN time"
15:14 jnthn 12:40 < jnthn> If you don't want something to happen then, don't use constant.
15:14 jnthn Further, every time the constant is mentioned in code, it will be resolved to the constant value it was set to at BEGIN time
15:14 jnthn As part of the compilation
15:16 scovit ok, was just crazy for 1/2 an hour, sorry
15:17 cdg joined #perl6
15:17 kyan joined #perl6
15:17 scovit I realize the practical impossibility jnthn
15:19 jnthn Yeah, to be fair sometimes "don't do X" means "IMO it's a really bad idea", but in this case it was really one of the "it's actually impossible" cases :-)
15:26 scovit .oO(installing a random number in b, and using NativeCall to find and scan the bytecode and substitute all references to this number to the actual object created later at INIT time :) .. let the idea flow and goes back to more productive works)
15:34 lizmat dinner&
15:34 geekosaur something horrid like BEGIN my $b = 0; INIT $b := whatever; ?
15:35 geekosaur although that likely does not accomplish whatever optimization hack you were after. really, just don't do that, it sounds like a trainwreck looking for any possible chance to happen
15:36 smls joined #perl6
15:37 scovit geekosaur there was a practical problem which I wanted to address
15:37 scovit geekosaur my module segfaults if used in a certain way
15:38 scovit even worst: while it can be used in a correct way it feels totally natural to use it in the wrong one
15:39 raschipi joined #perl6
15:39 scovit constant ERROR_MSG_BAD = CBuffer.new("File not found"); # Segmentation fault
15:40 troys joined #perl6
15:40 Skarsnik_ joined #perl6
15:40 scovit our $ERROR_MSG_BAD is export = CBuffer.new("File not found"); # Totally fine
15:41 geekosaur if CBuffer is via NativeCall then your expectations are violated by expecting your dynamic FFI context to exist at compile time
15:47 ntinos joined #perl6
15:57 Cabanossi joined #perl6
15:58 khw joined #perl6
15:58 mr-foobar joined #perl6
15:59 Kyo91_ joined #perl6
16:00 dogbert17 joined #perl6
16:07 mcmillhj joined #perl6
16:08 wamba joined #perl6
16:09 Zoffix .
16:09 yoleaux 7 Sep 2017 18:42Z <lizmat> Zoffix: I feel that tests 3/4 of S24-testing/8-die_on_fail.t are bogus
16:09 yoleaux 11 Sep 2017 03:29Z <AlexDaniel> Zoffix: toaster plz
16:09 xtreak joined #perl6
16:09 smls ..
16:09 yoleaux 11 Sep 2017 22:11Z <TimToady> smls: no, that wasn't intended
16:10 Zoffix .tell AlexDaniel no toaster from me this month. I'm away on vacation.
16:10 yoleaux Zoffix: I'll pass your message to AlexDaniel.
16:13 buggable joined #perl6
16:13 huggable joined #perl6
16:13 Geth_ joined #perl6
16:13 NeuralAnomaly joined #perl6
16:13 ZofBot joined #perl6
16:14 SourceBaby joined #perl6
16:24 mcmillhj joined #perl6
16:32 setty1 joined #perl6
16:40 mcmillhj joined #perl6
16:41 scovit geekosaur: FFI is working fine, the segfault is at runtime since the Buffers were allocated once at compilation and are not there anymore
16:41 geekosaur well, same point really. it may be "natural" to you to confuse runtime and compile time. not natural to me
16:43 raschipi scovit: Perl6 isn't C++
16:43 scovit it is expectable from the user point of view to see CBuffer.new("File not found") as something opaque
16:44 scovit ok, I feel that we are turning the direction of the conversation of "what is the use of a CBuffer" object. right?
16:44 raschipi Nope.
16:45 raschipi "Doctor, it hurts when I do this."
16:46 Xliff {...} # DunDoDat
16:46 Xliff Sorry. I couldn't resist.
16:51 raschipi scovit: Just don't try to use C++ idioms in Perl6.
16:51 scovit raschipi what do you mean? Which idiom struck you?
16:52 raschipi "constant ERROR_MSG_BAD = CBuffer.new("File not found");"
16:52 raschipi Even the underlines are there.
16:55 scovit it is because this is a C++ api, right. At some point I need a C buffer with that string inside. And using Str in nativecall does not work since sometime the Buffer are used for writing and should be caller allocated
16:55 scovit it is a strange C api
16:55 Xliff So why does it need to be a constant?
16:56 geekosaur ... right, so when you said FFI was fdine you missed my point entirely
16:56 geekosaur do you also think a file opened at compile time is still open at runtime?
16:56 scovit geekosaur I get your point
16:56 scovit constant in Perl means compile time
16:57 scovit there is no need for it to be constant.
16:57 scovit it is in fact an error.. such a pity that you get "only" data corruption and segfault
16:58 mcmillhj joined #perl6
16:59 raschipi It's like jumping to the void pointer in C, it will segfault.
17:00 smls scovit: I think `constant` in Perl 6 is not meant for the compiler to give you any guarantees that the object will remain constant, but rather as a way for *you* to tell the *compiler* that it may assume it remains constant.
17:00 geekosaur that was kinda what I was getting at with the variant using :=, it is closer to how the const modifier works in C/C++
17:00 scovit it was a #define in C/C++ eheh
17:01 geekosaur oh, that's even worse
17:01 geekosaur because it's not a "constant" at all. it's a textual substitution during compilation
17:01 Xliff scovit: Is this for NativeHelpers::CBuffer?
17:02 geekosaur in fact, use it the wrong way and you are allocating and throwing away a bunch of things you might otherwise think are shared
17:02 scovit Xliff yes
17:03 Xliff Ahh
17:05 nohuhu joined #perl6
17:21 leont joined #perl6
17:24 HoboWithAShotgun joined #perl6
17:25 HoboWithAShotgun good localtime() you lovely people. is it possible to access a subs named arguments in form of a hash?
17:25 HoboWithAShotgun with in the sub
17:26 pyrimidine joined #perl6
17:27 smls m: sub hi (*%args) { say %args};  hi :foo, :bar(42);
17:27 camelia rakudo-moar 5f3350: OUTPUT: «{bar => 42, foo => True}␤»
17:27 smls HoboWithAShotgun: ^^
17:27 smls you can use any name you want in place of `args`.
17:28 smls The *% makes it slurp up all named arguments into a Hash.
17:29 smls All *remaining* named arguments, more precisely. You can have normal named parameters before it.
17:29 ugexe m: sub foo(*%args [:$name1!, :$name2]) { say %args<name1>; say $name1; }; foo(:name1<xxx>)
17:29 camelia rakudo-moar 5f3350: OUTPUT: «xxx␤xxx␤»
17:30 HoboWithAShotgun ah, ok. i was hoping for something like "sub foo( :$a, :$b ) { say %_{a}; }
17:30 pyrimidine joined #perl6
17:32 ugexe m: sub foo(*%_ [:$a, :$b, *%rest]) { say %_<a> }; foo(:a<xxx>)
17:32 camelia rakudo-moar 5f3350: OUTPUT: «xxx␤»
17:32 HoboWithAShotgun amazinh
17:32 HoboWithAShotgun ty
17:37 xtreak joined #perl6
17:37 andrzejku joined #perl6
17:41 Cabanossi joined #perl6
17:42 andrzejku joined #perl6
17:43 HoboWithAShotgun m:  sub foo(*%_[:$a, :$b, *%rest]) { say %_<a> }; foo(:a<xxx>)
17:43 camelia rakudo-moar 5f3350: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Variable '$a' is not declared␤at <tmp>:1␤------> 3sub foo(*%_[:7⏏5$a, :$b, *%rest]) { say %_<a> }; foo(:a<␤»
17:43 HoboWithAShotgun significant whitespace?
17:45 smls Yes, subsignatures have to be separated from the parent parameter with whitespace.
17:45 cdg joined #perl6
17:57 rje joined #perl6
17:58 HoboWithAShotgun is there a more idiomatic way to express " my $sides  = ['a', 'b', 'c'].grep({ $_ ~~ %_ }).elems; "
17:58 scovit joined #perl6
17:59 scovit geekosaur: you wouldn't believe, macro a is export { quasi { CBuffer.new("Ciao"); } }; works perfectly for the purpouse
17:59 scovit going to advise people to use that; is the only sane way
18:00 scovit to keep the C semantics
18:00 geekosaur actually I would believe, if the C macro works. just be advised macros in p6 are still experimental and pieces are missing (but what you are doing is likely fine)
18:04 Xliff joined #perl6
18:06 |oLa| joined #perl6
18:10 smls HoboWithAShotgun: What do you mean for the `.grep({ $_ ~~ %_ })` to do?
18:11 cdg joined #perl6
18:13 smls m: sub foo { say <a b c>.grep(%_).elems };  foo :c, :d, :e;
18:13 camelia rakudo-moar 5f3350: OUTPUT: «1␤»
18:13 smls HoboWithAShotgun: This ^^ ?
18:16 cdg_ joined #perl6
18:26 Cabanossi joined #perl6
18:33 Kyo91_ joined #perl6
18:40 domidumont joined #perl6
18:47 gfldex .tell HoboWithAShotgun you can get hold of named params at runtime: https://gist.github.com/gfldex/44eeaceb7d021c82e63b11214d0cccfc
18:47 yoleaux gfldex: I'll pass your message to HoboWithAShotgun.
18:51 domidumont joined #perl6
18:54 Kyo91_ joined #perl6
18:54 gfldex do we got a module for unix domain sockets?
18:56 Cabanossi joined #perl6
19:04 dogbert17 joined #perl6
19:12 jnthn gfldex: Not that I know of, but there's a PR in MoarVM that, with a little tweaking, will provide that built-in once merged (well, plus merging some NQP/Rakudo patches)
19:12 pecastro joined #perl6
19:22 Zoffix m: 「/o\ /o\ /o\ D: D: D:」.flip.say
19:22 camelia rakudo-moar 5f3350: OUTPUT: «:D :D :D \o/ \o/ \o/␤»
19:27 teatime what, lol
19:28 teatime m: 'test'.flip.say
19:28 camelia rakudo-moar 5f3350: OUTPUT: «tset␤»
19:33 espadrine joined #perl6
19:35 rindolf Zoffix: heh, nice
19:38 Skarsnik_ joined #perl6
19:42 Zoffix :)
19:48 Averna joined #perl6
20:01 dwarring joined #perl6
20:07 imcsk8 joined #perl6
20:19 domidumont joined #perl6
20:26 Cabanossi joined #perl6
20:33 cpage_ joined #perl6
21:03 TEttinger joined #perl6
21:09 pyrimidine joined #perl6
21:11 pyrimidi_ joined #perl6
21:16 pyrimidine joined #perl6
21:21 zakharyas joined #perl6
21:23 pyrimidine joined #perl6
21:32 mr-foobar joined #perl6
21:35 pyrimidine joined #perl6
21:42 pyrimidine joined #perl6
21:45 pyrimidi_ joined #perl6
21:48 dogbert17 joined #perl6
21:50 spider-mario joined #perl6
21:54 pyrimidine joined #perl6
21:56 Cabanossi joined #perl6
21:59 pyrimidine joined #perl6
22:00 mr-foobar joined #perl6
22:04 pyrimidine joined #perl6
22:09 mcmillhj joined #perl6
22:10 pyrimidine joined #perl6
22:16 pyrimidine joined #perl6
22:19 pyrimidi_ joined #perl6
22:22 pyrimidine joined #perl6
22:26 pyrimidi_ joined #perl6
22:26 Cabanossi joined #perl6
22:30 mr-foobar joined #perl6
22:34 cdg joined #perl6
22:34 pyrimidine joined #perl6
22:35 cdg joined #perl6
22:37 skids joined #perl6
22:38 pyrimidine joined #perl6
22:39 Sgeo joined #perl6
22:41 pyrimidi_ joined #perl6
22:46 pyrimidine joined #perl6
22:49 kyan joined #perl6
22:56 pyrimidine joined #perl6
22:57 Cabanossi joined #perl6
23:01 mr-foobar joined #perl6
23:03 bisectable6 joined #perl6
23:11 pyrimidine joined #perl6
23:20 pyrimidine joined #perl6
23:27 Cabanossi joined #perl6
23:29 pyrimidine joined #perl6
23:32 mr-foobar joined #perl6
23:32 pyrimidi_ joined #perl6
23:36 pyrimidine joined #perl6
23:37 MasterDuke joined #perl6
23:41 pyrimidine joined #perl6
23:48 bhm_ joined #perl6
23:48 pyrimidine joined #perl6
23:48 SCHAPiE joined #perl6
23:49 imcsk8_ joined #perl6
23:49 incredible joined #perl6
23:49 shadoxx joined #perl6
23:50 Xal joined #perl6
23:51 charsbar joined #perl6
23:51 timotimo ack has a --nosql option
23:53 obra joined #perl6
23:54 pyrimidine joined #perl6
23:55 Levex joined #perl6
23:55 BenGoldberg joined #perl6

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

Perl 6 | Reference Documentation | Rakudo