Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-09-06

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 TimToady otoh, saying .comb(10) is really just .comb( / . ** 10 / ) has something to be said, teachingwise
00:01 TimToady or . ** 1..10
00:01 TimToady m: say ("x" x 15).comb(10)
00:01 camelia rakudo-moar e5d7a1: OUTPUT«(xxxxxxxxxx xxxxx)␤»
00:02 TimToady m: say ("x" x 10).comb(10)
00:02 camelia rakudo-moar e5d7a1: OUTPUT«(xxxxxxxxxx)␤»
00:02 BenGoldberg m: while( $*IN.read(16) ) -> $blob { dd $blob }
00:02 camelia rakudo-moar e5d7a1: OUTPUT«5===SORRY!5===␤Word 'while' interpreted as 'while()' function call; please use whitespace instead of parens␤at <tmp>:1␤------> 3while7⏏5( $*IN.read(16) ) -> $blob { dd $blob }␤Unexpected block in infix position (two terms in a row)␤at <…»
00:02 BenGoldberg m: while ( $*IN.read(16) ) -> $blob { dd $blob }
00:02 camelia rakudo-moar e5d7a1: OUTPUT«Buf[uint8] $blob = Buf[uint8].new(67,195,169,97,100,32,115,10​8,195,161,110,32,97,103,32,115)␤Buf[uint8] $blob = Buf[uint8].new(108,195,169,105,98,104,116,1​01,32,109,97,111,114,103,97,32)␤Buf[uint8] $blob = Buf[uint8].new(67,104,111,110,116,97,101,32,68…»
00:04 TimToady well, that's okay if you want to read 16 bytes, but the convo was about "characters", so I assumed they didn't mean bytes :)
00:05 TimToady but reading N characters from a file actually requires reading past the last character to make sure you have all the combiners, so if you're depending on the file pos to be right after the char, it might not be
00:08 BenGoldberg m: say so ""
00:08 camelia rakudo-moar e5d7a1: OUTPUT«False␤»
00:10 BenGoldberg m: while ( $*IN.read(16) ) -> $blob { say $blob.decode("utf8") }
00:10 camelia rakudo-moar e5d7a1: OUTPUT«Céad slán ag s␤léibhte maorga ␤Chontae Dhún na␤ nGall␤Agus dhá␤ chéad slán ag␤ an Eireagal ard␤ ina stua os cio␤nn caor is coll;␤␤Nuair a ghluais␤ mise thart le L␤och Dhún Lúich␤’ go ciúin sa␤Malformed termination of…»
00:11 BenGoldberg m: my $all = ""; while ( $*IN.read(16) ) -> $blob { $all ~= $blob.decode("utf8") }
00:11 camelia rakudo-moar e5d7a1: OUTPUT«Malformed termination of UTF-8 string␤  in block <unit> at <tmp> line 1␤␤»
00:12 TimToady you split a character
00:12 BenGoldberg I realize that ;)
00:13 BenGoldberg I think that .decode should take an optional argument, :trailing-garbage, which causes it to return a two-element list, a Str and a Blob, where the Blob is everything from the first bad byte onwards.
00:14 BenGoldberg Or something like that.
00:18 canopus joined #perl6
00:27 tushar joined #perl6
00:28 tushar left #perl6
00:31 heatsink left #perl6
00:35 cyphase joined #perl6
00:36 osdfuhsui joined #perl6
00:47 pierre_ joined #perl6
00:52 canopus joined #perl6
01:12 kaare_ joined #perl6
01:15 dalek ecosystem: 4671360 | ugexe++ | META.list:
01:15 dalek ecosystem: Add distribution with same name, different auth
01:15 dalek ecosystem:
01:15 dalek ecosystem: For Perl6 tool chain testing purposes
01:15 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/467136057a
01:24 ShimmerFairy joined #perl6
01:25 Actualeyes joined #perl6
01:25 canopus joined #perl6
01:27 bjz joined #perl6
01:32 pierre_ joined #perl6
01:38 buharin joined #perl6
01:46 poohman_ joined #perl6
01:47 ilbot3 joined #perl6
01:47 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
01:51 osdfuhsui in a short way
01:52 itaipu joined #perl6
01:56 djbkd joined #perl6
01:56 osdfuhsui nevermind I've figured it out
01:56 osdfuhsui by using .fmt
01:58 itaipu joined #perl6
01:58 BenGoldberg m: printf '%05d', $_ for 1..5;
01:58 camelia rakudo-moar e5d7a1: OUTPUT«0000100002000030000400005»
01:58 BenGoldberg m: printf "%05d\n", $_ for 1..5;
01:58 camelia rakudo-moar e5d7a1: OUTPUT«00001␤00002␤00003␤00004␤00005␤»
01:58 BenGoldberg osdfuhsui, ^
02:04 osdfuhsui How would I go about reading from a file that isn't utf-8
02:04 osdfuhsui like a binary file
02:07 canopus joined #perl6
02:07 osdfuhsui I see you can use :bin
02:07 osdfuhsui I don't understand how though
02:10 osdfuhsui After I open the binary file with the :bin option, how would I read 16 bytes at a time
02:11 MasterDuke you might be able to use unpack https://docs.perl6.org/type/Buf#(Blob)_method_unpack
02:14 MasterDuke or 'my $b = slurp "file", :bin; my @bytes = $b[0..3]'
02:14 TimToady you can read a binary file with .read(16)
02:14 TimToady it'll return a 16-byte buf
02:16 itaipu joined #perl6
02:17 osdfuhsui thank both of you
02:18 osdfuhsui How would I see how many bytes there is before doing that masterduke?
02:19 osdfuhsui or would I just use .elems
02:20 osdfuhsui okay I've got it, thanks
02:26 canopus joined #perl6
02:28 Shantanu01 joined #perl6
02:33 wamba joined #perl6
02:33 noganex_ joined #perl6
02:40 Shantanu1 joined #perl6
02:44 AlexDaniel m: my $foo = ‘hell’; say ‘hello world’ ~~ / {$foo ~ ‘o’} ‘ world’ /
02:44 camelia rakudo-moar e5d7a1: OUTPUT«「 world」␤»
02:45 AlexDaniel m: my $foo = ‘hell’; say ‘hello world’ ~~ /^ {$foo ~ ‘o’} ‘ world’ /
02:45 camelia rakudo-moar e5d7a1: OUTPUT«Nil␤»
02:45 AlexDaniel what was the right way to do it?
02:45 TimToady add <>
02:45 AlexDaniel m: my $foo = ‘hell’; say ‘hello world’ ~~ /^ <{$foo ~ ‘o’}> ‘ world’ /
02:45 camelia rakudo-moar e5d7a1: OUTPUT«「hello world」␤»
02:45 AlexDaniel right
02:46 AlexDaniel TimToady: thank you
02:46 TimToady actually watching olympics, but have laptop sitting on the TV tray :)
02:49 buharin joined #perl6
02:54 itaipu joined #perl6
03:01 pierre_ joined #perl6
03:04 pierre_ joined #perl6
03:08 kshannon joined #perl6
03:16 poohman joined #perl6
03:18 zacts joined #perl6
03:27 ugexe .tell TheLemonMan the issues you've brought up with zef have been addressed
03:27 yoleaux ugexe: I'll pass your message to TheLemonMan.
03:28 canopus joined #perl6
03:32 _28_ria joined #perl6
03:44 pierre_ joined #perl6
03:47 vapace joined #perl6
03:50 vapace p6: say Int.HOW; say Array.HOW; say Hash.HOW;
03:50 camelia rakudo-moar e5d7a1: OUTPUT«Perl6::Metamodel::ClassHOW.new␤Method 'gist' not found for invocant of class 'Perl6::Metamodel::ClassHOW+{<anon>}'␤  in block <unit> at <tmp> line 1␤␤»
04:08 nige1 joined #perl6
04:09 melezhik joined #perl6
04:12 Cabanossi joined #perl6
04:13 TEttinger joined #perl6
04:14 pierre_ joined #perl6
04:16 labster joined #perl6
04:20 wamba joined #perl6
04:21 bjz joined #perl6
04:36 apostoffice joined #perl6
04:53 cpage_ joined #perl6
05:10 doublec joined #perl6
05:32 Shantanu01 joined #perl6
05:36 buharin joined #perl6
06:10 domidumont joined #perl6
06:15 domidumont joined #perl6
06:17 pierre_ joined #perl6
06:21 TEttinger joined #perl6
06:22 firstdayonthejob joined #perl6
06:25 CIAvash joined #perl6
06:34 jonas1 joined #perl6
06:42 TEttinger joined #perl6
06:54 rindolf joined #perl6
07:00 labster joined #perl6
07:04 pierre_ joined #perl6
07:17 matt_ joined #perl6
07:23 zakharyas joined #perl6
07:23 wamba joined #perl6
07:31 darutoko joined #perl6
07:39 isacloud joined #perl6
07:43 leont joined #perl6
07:47 g4 joined #perl6
07:50 bjz joined #perl6
07:52 dakkar joined #perl6
07:57 RabidGravy joined #perl6
08:00 pierre_ joined #perl6
08:17 * nine wonders why App::Ack is most wanted when there's already a perfectly useful one written in Perl 5
08:18 DrForr Because everything's better in perl 6? :)
08:19 timotimo well, perl6 regexes would require either Inline::Perl5/6 work for Ack itself, or a re-implementation
08:20 DrForr m: "foo" ~~ m:p5{[f]}
08:20 camelia rakudo-moar f648d3: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Adverb p5 not allowed on m␤at <tmp>:1␤------> 3"foo" ~~ m:p5{[f]}7⏏5<EOL>␤»
08:21 timotimo need a capital P
08:21 DrForr Thought there was a p5 adverb for that.
08:21 DrForr m: "foo" ~~ m:P5{[f]}
08:21 camelia rakudo-moar f648d3: ( no output )
08:22 DrForr Oh, you're talking the other direction. Too much blood in my caffeine supply.
08:23 timotimo :)
08:27 user9 joined #perl6
08:36 DrForr O gawd, I'm now thinking about an App::Ack6 that lets you do something like: ack --Perl6 'has <variable> where * > 0'.
08:38 timotimo how is that supposed to work :)
08:39 DrForr Add an option to load a grammar library for your RE.
08:43 timotimo oh, were you meaning 'has ' and ' where * > 0' to be literals?
08:44 nine Reminds me of semantic patching
08:45 DrForr Yes, literal terms. Though allowances woudl have to be made for the metachar rule in p6.
08:46 timotimo well, regexes are slangable :P
08:46 DrForr I know, I know. Too many ideas, so little time.
08:48 pierre_ joined #perl6
08:49 DrForr Might at least make people less frightened of p6 regular expressions :)
08:49 DrForr (not that I've really seen that in talks; I tread on it lightly though.)
08:52 rudolfochrist joined #perl6
08:53 wamba joined #perl6
08:55 El_Che lo
08:55 El_Che regular expressions
08:56 DrForr Afternoon... almost.
08:56 El_Che the name is already a lie, so how do you explain it to people in 1 hour? :)
08:56 DrForr I usually spring that on people halfway in :)
08:56 El_Che you close the door and windows before
08:57 timotimo i thought you have to open windows in order to protect the glass during explosions?
08:58 labster joined #perl6
08:58 DrForr timotimo: I just leave the transoms at the top unlocked, that's enough to dissipate the blast.
09:00 zengargoyle \quit
09:01 * lizmat clickbaits https://p6weekly.wordpress.com/2016/​09/05/2016-36-introducao-ao-perl-6/
09:01 lizmat afk&
09:02 timotimo "transoms", now there's a word i've learned
09:02 DrForr The little windows over doors, usually in the bathroom for venting.
09:03 timotimo mhm
09:03 timotimo okay, gotta go afk, else i might end up missing my train
09:03 DrForr Wiping down the glass afterwards is a problem thoguh, I usually tip the maids extra.
09:06 Ulti m: my $junction = ((set 0,1,2,3) (&) (set 0,1,2)).any; say $junction; say (1 => True) ~~ $junction; say 1 ~~ $junction;
09:06 camelia rakudo-moar f648d3: OUTPUT«any(0 => True, 1 => True, 2 => True)␤True␤Method '0' not found for invocant of class 'Int'␤  in block <unit> at <tmp> line 1␤␤»
09:07 Ulti can anyone help me understand the behaviour of the .any on the Set type
09:07 Ulti is this just a result of Set being bag like?
09:07 timotimo i expect .any to call .list on things
09:07 pierre_ joined #perl6
09:07 Ulti well that is what .list gives you
09:08 Ulti a list of pairs where the values point to boolean
09:08 Ulti I find it odd that a set is associative in some deep way in Perl 6
09:08 Ulti it doesn't work very naturally
09:08 Ulti if I have a set of Int I expect to get back a list of the Int I put in not Ints mapping to always True Bools
09:09 Ulti is there some reason for this I'm missing?
09:09 Ulti is it specced this way?
09:11 Ulti I was going to respond to a reddit comment asking about junction intersection and was going to suggest you would use set intersection and then just wrangle to a junction but it turns out thats kind of broken
09:12 woolfy left #perl6
09:12 zengargoyle joined #perl6
09:12 elohmrow joined #perl6
09:19 [ptc] DrForr: they're also called "louvres", aren't they?  "transoms" is new to me...
09:23 DrForr Well, I usually think of louvres as kind of round steam vents, with flappy blinds over them. I think a transom is usually a full-length window across the top of a door that you can crack open if the steam buildup is too much. It could very well just be a British thing.
09:25 DrForr (not that I'm British, but I have lived intehir houses :)
09:28 [ptc] could be a British (and derivatives thereof) thing; what you call a transom is definitely what I'd call a louvre :-)
09:29 wamba joined #perl6
09:31 zengargoyle joined #perl6
09:32 stmuk I'm British and have never heard of either louvres or transoms
09:32 DrForr Too many ye..months living among denizens of the Isle :)
09:33 stmuk some googling suggests there isn't an English word but the closest is fanlight (over a door)
09:34 stmuk a louvre is blind like
09:34 TEttinger joined #perl6
09:37 DrForr Looks like I was confusing the actual transom with what I've seen above it. Something new every day.
09:38 [ptc] stmuk: hrm, maybe it's a Kiwi thing then...
09:41 stmuk the German definition at https://en.wikipedia.org/wi​ki/Transom_(architectural) is amusing
09:51 elohmrow even though it could get me hurt for saying so, i am originally an american, and i know what a louvre is; we have them - Bob Vila told us about them many times ;)
09:52 DrForr o/' Woah-oh let's build a patio / Go call Bob Vila o/'
09:53 arnsholt Only louvre I know is in Paris =p
09:53 arnsholt And generally capitalized
09:54 zengargoyle american louvre is pronounced louver. (at least where i'm from)
09:55 zengargoyle while louvre is the Paris thing.
09:57 zengargoyle which `dict` informs me is a valid spelling..
10:05 ShimmerFairy joined #perl6
10:06 elohmrow I don't know the history, but why is this guy 'resolved': https://rt.perl.org/Ticket/Display.html?id=127408 please? I guess I can use $myThing.^methods and compare, but it's not a super-helpful error message, and I just got it because of a method signature mismatch on 2016.07.1
10:06 elohmrow I guess rather than 'CALL_ME', i'd like to see the $real_method_name with sig.  maybe this is possible another way
10:07 nine elohmrow: what is the $real_method_name in *(42)?
10:08 elohmrow nine: point
10:11 Zoffix left #perl6
10:11 timotimo Ulti: if you're trying to use junctions as sets, you're going to have a bad time. don't do that. they aren't meant to be used as sets.
10:12 elohmrow nine: i think i didn't say what i meant to: i'd like the error to tell me "you tried to call non-existent method '*' with argument '42'."  then i at least know where to look
10:13 timotimo damn. i had hoped to mirror the libsdl wiki, but 1) i only got a few pages in every language imaginable, 2) its surge protection triggered and kicked me out
10:14 * zengargoyle wonders if any distros (other than Debian) are planning on patching Perl5 to remove '.' from @INC
10:16 nine elohmrow: *(32) or just foo(32) is no method call but looks more like a function call. Anyway to arrive at your desired error message, rakudo would have to guess what you actually meant which it cannot. Think about e.g. $callable(42); It may well be that you forgot to add the CALL-ME method to the supposedly callable object.
10:17 nine elohmrow: and having made exactly that mistake, I'm actually quite glad that rakudo tells me that it exepcted to find a CALL-ME method, so I could just add it.
10:28 user9 joined #perl6
10:43 grondilu how do I prevent :$var to be interpreted as a named argument?
10:43 grondilu m: my $var = pi; say :$var
10:43 camelia rakudo-moar f648d3: OUTPUT«Unexpected named argument 'var' passed␤  in block <unit> at <tmp> line 1␤␤»
10:43 ilmari grondilu: what would you like it to be interpreted as?
10:43 jnthn Put parens around it
10:43 grondilu m: my $var = pi; say (:$var)
10:43 camelia rakudo-moar f648d3: OUTPUT«var => 3.14159265358979␤»
10:43 grondilu of course
10:43 grondilu thanks
10:45 aries_liuxueyang joined #perl6
10:46 zakharyas1 joined #perl6
10:46 grondilu I miss P5's dummy + operator, though.
10:46 grondilu m: my $var = pi; say +:$var
10:46 camelia rakudo-moar f648d3: OUTPUT«Cannot resolve caller Numeric(Pair: ); none of these signatures match:␤    (Mu:U \v: *%_)␤  in block <unit> at <tmp> line 1␤␤»
10:46 stmuk https://www.youtube.com/chan​nel/UCLsVz9vprzs6U6PmcI4tnqA
10:50 grondilu or bash's --
10:51 TheLemonMan joined #perl6
10:56 grondilu I have a database made of a bunch of YAML files in a directory tree.  The whole tree branch is 769Mo.  I'd like to put it all in a big Perl6 hash that I could easily load later.  Is it reasonable to parse it all, store it in a single hash variable and create a module file like:  'unit module MyData;\nour %hash = $here-I'd-put-the-output-of-.perl'  ?
10:57 * grondilu tries
11:07 Xliff grondilu, I've done something on a way smaller scale with Color::Names;
11:08 Xliff Also did it with an unreleased module for Eve::Online.
11:08 Xliff With the latter I discovered it was easier to keep that stuff in an sqlite3 database and use that.
11:09 stmuk the youtube autotranslate on liz's P6 module APW talk is amusing
11:09 grondilu Xliff: it's for EVE Online too
11:09 Xliff Question for the P6 devs in here: sub EXPORT(+@a) { ... require SomeModule; ... } <- Is that supposed to crash rakaudo at stage parse?
11:10 Xliff grondilu: Ooh! What you writing?
11:10 Xliff https://github.com/Xliff/p6-webservice-eveonline
11:10 Xliff grondilu: ^^
11:10 grondilu I'd like to write a webgl interface to look at New Eden.
11:10 grondilu so I'm parsing https://cdn1.eveonline.com/data/sde/tr​anquility/sde-20160809-TRANQUILITY.zip
11:12 grondilu I'll do something similar to what I did for a dna visualisation here: http://grondilu.github.io/dna.html
11:12 Xliff grondilu: YOW!
11:14 Xliff Grondilu: If all you are looking for are the x,y,z tuples for the star systems, you could always load that data into mysql and then extract into something sane.
11:15 Xliff I update local mysql every time Eve patches.
11:15 Xliff That reminds me. I haven't played in a while.
11:16 Xliff ...Aaand they've updated the launcher.
11:18 Xliff ....aaaand CCP flubbed the launcher update. At least here.
11:18 grondilu I don't like SQL.  I was hoping I wouldn't have to use it.
11:19 xinming_ joined #perl6
11:19 grondilu If the database is too big even after restricting to position values, I'll limit the visualisation for a few regions.
11:20 Xliff Yeah. Well, parsing the YAML is a valid strategy then.
11:20 zakharyas1 joined #perl6
11:20 Xliff I did look at Eve's YAML for my project, but couldn't get it to parse using P6 modules as of April.
11:21 grondilu I'm currently parsing with YAMLish.  Seems to work fine.
11:23 grondilu here's the code I'm using: http://paste.debian.net/811318/
11:23 Xliff Cool. I think I tried YAMLish back then, too.
11:25 arnsholt Right. That's the program that generates function defs from header declarations more or less done. Now for the program that extracts stuff from
11:25 arnsholt ... #define directivess
11:25 aries_liuxueyang joined #perl6
11:25 arnsholt Not for NativeCall, sadly, but the knowledge should be transferrable \o/
11:26 Xliff Eve Launcher finally patched after 16 attempts.
11:26 Xliff arnsholt, Are you talking about gptrixie?
11:26 grondilu I had to kill the job.  It was eating all memory I guess.
11:27 grondilu so that's definitely not the way to go.  I do need a database, I guess.
11:28 timotimo one bottle of beer for whoever builds a slang that gives me a "nsub" keyword that is exactly like "sub" + "is native($lib)" + "{*}"
11:28 moritz take it down, pass it around, ...
11:29 timotimo b "is export", please
11:29 timotimo "+", not "b".
11:30 Xliff timotimo: Ooh! I'd use that slang.
11:30 Xliff Of course, the whole Slang mechanism looks overly complex to me.
11:30 Xliff (not the parsing, but the getting it active)
11:30 DrForr Xliff: It's kind of "there" waiting for macro support.
11:30 arnsholt Xliff: Using pycparser actually, since I need to generate SmallTalk (yes, really!)
11:31 timotimo yes, macros will make that a lot easier
11:31 dalek doc: 772b297 | (Tom Browder)++ | doc/Type/Signature.pod6:
11:31 dalek doc: Fix typo
11:31 dalek doc: review: https://github.com/perl6/doc/commit/772b297687
11:31 Xliff arnsholt++   # For writing the Python I may need but would never do myself
11:32 Xliff grondilu: I could probably churn out a module with that data if you want.
11:32 arnsholt Xliff: If you ever need to do this kind of thing, pycparser is pretty damn good
11:33 arnsholt It doesn't support preprocessor stuff at all, so it only parses preprocessed C which is somewhat limiting, but apart from that, it's awesome
11:33 aries_liuxueyang joined #perl6
11:34 arnsholt A bit less than a day of work gave me a program that generates some 350 API entry points from OpenSSL directly from the headers
11:34 arnsholt And that's only the libssl ones. There's another 1150 or something like that in libcrypto
11:35 Xliff arnsholt: gptrixie will do that, but there is an inherent limit in the size it will allow.
11:35 timotimo don't forget, everyone, we do have gptrixie that automatically creates a nativecall binding from a c header file
11:35 timotimo yeah :)
11:35 Xliff For example, I can get it to work with liboggvorbis.
11:35 Xliff But I don't think it would survive if I threw libssl at it.
11:36 Xliff Same with libcryto.
11:37 arnsholt Heh
11:37 arnsholt gptrixie parses GCC's XML output or something like that, no?
11:37 Xliff Yeah.
11:37 Xliff Which, if I remember, has been deprecated for something else.
11:38 Xliff But that support hasn't come yet.
11:38 arnsholt The neat thing about pycparser is that it's a full C parser library, which is pretty cool
11:38 Xliff Finding gccxml was a bit of a chore.
11:38 arnsholt I'm tempted to look into porting it to Perl 6, TBH
11:43 konobi libressl?
11:43 moritz that's a thing, yes
11:44 konobi i had heard that it had a much constrained api
11:46 Xliff arnsholt: Ooooo! That would be niiice!
11:46 Xliff If you start that project and want coder flunkies... count me in!
11:47 arnsholt konobi: Yeah, I considered it
11:48 arnsholt But since this is for $work, it was a bit too early-adoptery to go for OpenSSL
11:48 arnsholt But we have discussed it as an option, actually
11:48 arnsholt Er, too early adopter to go for *Libre*SSL I mean (obviously)
11:49 nadim joined #perl6
11:55 stmuk_ joined #perl6
11:57 timotimo we can also use pycparser through Inline::Python ;)
12:02 arnsholt For the time being, yeah =)
12:04 timotimo oh the joy of scancodes
12:04 timotimo "\" (Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and
12:04 timotimo POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout.)
12:04 timotimo "`" (Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE
12:04 timotimo SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards.)
12:04 timotimo how fun!
12:05 arnsholt When you plug in a new keyboard on OS X, it asks you to press the bottom-leftmost non-modifier key, to autodetect what kind of KB it is
12:05 hahainternet the worst are the hybrid layouts
12:05 hahainternet on crap laptops
12:05 arnsholt Le sigh. "Nordic" kb layouts can piss right off
12:06 arnsholt Especially since Danish and Norwegian, which both have æ and ø, have deigned to place them on *different* keys
12:06 arnsholt So you have to keys right next to each other, both of which are labelled æ and ø >_<
12:06 josred joined #perl6
12:06 arnsholt s/to/two/
12:06 moritz wtf.
12:06 timotimo "" (no name, empty string; This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout.)
12:06 timotimo SDL_SCANCODE_NONUSBACKSLASH
12:06 arnsholt moritz: YA RLY!
12:16 ItayAlmog joined #perl6
12:18 smls joined #perl6
12:19 smls m: class A { has A @.children is default(A.new) }
12:19 camelia rakudo-moar f648d3: OUTPUT«===SORRY!===␤Method 'new' not found for invocant of class 'A'␤»
12:19 smls ^^ Is it possible to somehow delay the evaluation of an `is default` value, so that it can be used in a tree-like class like this?
12:20 rudolfochrist joined #perl6
12:21 jnthn smls: No
12:21 smls ok
12:22 jnthn (And due to the way `is default` works, it's really not easy to make that happen either)
12:23 canopus joined #perl6
12:28 timotimo shouldn't it work with = instead?
12:28 timotimo or is that for "assigning an empty element into the array will give an A.new?
12:28 timotimo oh, that'll also create an A when A gets created
12:30 smls timotimo: the `is default` is what you get when you index a nonexistent element of the array
12:30 smls not what the array itself is initialized with
12:30 timotimo right
12:31 pierre__ joined #perl6
12:33 smls m: class A {has $.n = 42};  my A:D @a;  say @a[1];  say say @a[1].n;
12:33 camelia rakudo-moar f648d3: OUTPUT«(A:D)␤Cannot look up attributes in a type object␤  in block <unit> at <tmp> line 1␤␤»
12:34 smls jnthn: Is this also working as expected? ^^
12:41 jnthn That should probably be disallowed
12:41 timotimo yeah, that's slightly problematic
12:45 [Coke] .msg
12:45 yoleaux [Coke]: Sorry, this command is admin-only.
12:45 [Coke] .seen supernovus
12:45 yoleaux I saw supernovus 22 Apr 2016 23:27Z in #perl6: <supernovus> Well, I'm going to have to run. Have a great day/night everyone. I hope to fix up some of my long neglected libraries at some point when I'm not completely overloaded with work! :-)
12:59 mcmillhj joined #perl6
13:02 canopus joined #perl6
13:04 ItayAlmog2805 joined #perl6
13:18 cdg joined #perl6
13:18 cdg joined #perl6
13:33 Ulti timotimo: the other way around turn a set into a junction in the same way you would do .any on a list
13:46 pierre__ HI
13:46 Khisanth joined #perl6
13:47 pierre__ except the conciseness, is there any difference between
13:47 pierre__ m: sub closure() { my $i = 0; return -> { ++$i } } ; my $a = closure(); say $a(); say $a();
13:47 camelia rakudo-moar f648d3: OUTPUT«1␤2␤»
13:47 pierre__ and
13:47 pierre__ m: sub closure() { my $i = 0; return sub () { return ++$i } } ; my $a = closure(); say $a(); say $a();
13:47 camelia rakudo-moar f648d3: OUTPUT«1␤2␤»
13:48 pierre__ i know that with the pointy block notation, i cna't use a return, but as the last element is returned by default, i do not see any difference
13:48 masak pierre__: only that with `sub`, you should use `return`, and with blocks, you should use (unimplemented) `leave` (which is also implicit)
13:48 masak pierre__: that is the difference. `return` binds to innermost enclosing *sub*, not block
13:49 pierre__ ok
13:49 masak so it mostly comes down to, do you want `return` or not
13:49 masak much of the time with small blocks (sent to `map` etc), you don't
13:49 pierre__ make sense,
13:50 pierre__ so in the case of a closure, the sub construction make more sense i guess
13:50 pierre__ to explicitely return the value
13:50 masak both the block and the sub close over their respective environment
13:51 masak so it's only about whether you need to explicitly return
13:51 masak for example if you need to return early
13:51 pierre__ indeed
13:52 masak with explicit `leave`, even that would be a non-issue
13:52 masak but, alas,
13:52 masak m: { leave }; say "OH HAI"
13:52 camelia rakudo-moar f648d3: OUTPUT«leave not yet implemented. Sorry. ␤  in block <unit> at <tmp> line 1␤␤»
13:52 masak I don't know if there's an interesting technical blocker to having `leave`...
13:52 masak ...or if it just turns out no-one really cared enough.
13:54 moritz I haven't done it, because I'm scared of low-level stuff
13:57 pierre__ ok, in the same register, a routine seems to be a block, but the reverse is not true
13:58 pierre__ m: my $sub = sub { say &?ROUTINE }; $sub()
13:58 camelia rakudo-moar f648d3: OUTPUT«sub () { #`(Sub|76851984) ... }␤»
13:58 masak m: say Routine ~~ Block
13:58 camelia rakudo-moar f648d3: OUTPUT«True␤»
13:58 masak correct.
13:58 pierre__ m: my $sub = sub { say &?BLOCK }; $sub()
13:58 camelia rakudo-moar f648d3: OUTPUT«sub () { #`(Sub|68516576) ... }␤»
13:58 masak and both are Callable.
13:58 pierre__ m: my $block = { say &?BLOCK }; $block()
13:58 camelia rakudo-moar f648d3: OUTPUT«-> ;; $_? is raw { #`(Block|74998840) ... }␤»
13:58 pierre__ m: my $block = { say &?ROUTINE }; $block()
13:58 camelia rakudo-moar f648d3: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared name:␤    ?ROUTINE used at line 1. Did you mean 'Routine'?␤␤»
13:58 pierre__ make sense
13:58 masak man, block gists are ugly :P
13:59 pierre__ sorry :)
13:59 masak not really your fault
14:07 TheLemonMan ugexe, zef's working perfectly so far :)
14:07 yoleaux 03:27Z <ugexe> TheLemonMan: the issues you've brought up with zef have been addressed
14:17 rindolf joined #perl6
14:18 wamba joined #perl6
14:18 Woodi Zoffix: about "your lang don't have Junctions" - I think I do that in C when I read about automatic tail calls...
14:18 lizmat joined #perl6
14:19 buharin joined #perl6
14:23 ssm joined #perl6
14:34 chris2 joined #perl6
14:34 cyphase joined #perl6
14:37 mcmillhj joined #perl6
14:38 khw joined #perl6
15:05 yadongz joined #perl6
15:09 perlpilot_ joined #perl6
15:13 lichtkind__ joined #perl6
15:14 mcmillhj joined #perl6
15:18 ptolemarch joined #perl6
15:18 robertle joined #perl6
15:20 robertle hi folks, should using concurrency using start() and IO::Socket::INET work as expected in combination? in the sense that different threads working on different sockets do not block each other?
15:22 hoelzro robertle: if you create a socket in thread A, thread A is the only thread that can use it
15:22 moritz robertle: they don't block each other, but iirc you can't use an IO::Socket::INET from another thread
15:23 jnthn Indeed. IO::Socket::Async would be a better bet usually
15:23 jnthn Even when the "creating thread only" restriction is lifted, it'll typically still scale better.
15:24 Actualeyes joined #perl6
15:25 mcmillhj joined #perl6
15:25 * [Coke] boggles that this conversation is getting tractino here but not in perl6-dev.
15:26 [Coke] (ok, not exactly the same convo, but definitely related)
15:26 Ulti re: padding zeroes sprintf('%08d', $int) does the job
15:30 kurahaupo joined #perl6
15:31 rindolf joined #perl6
15:31 ugexe IO::Socket::Async has no IO::Socket::SSL yet though :(
15:32 ugexe i wrote a shim to make it work but it was super slow
15:32 canopus joined #perl6
15:36 literal joined #perl6
15:37 brrt joined #perl6
15:37 jnthn ugexe: I've been vaguely working on that but...OpenSSL's API makes it un-fun enough that it's hard to find motivation to do it in free time ;)
15:38 konobi nodejs probably has ideas to steal
15:38 arnsholt ssl.h is almost mappable to FFI defs programmatically (somewhat less than 200 #defines that need fixups by hand out of almost a thousand)
15:38 konobi iirc it's crypto interface is fairly slim
15:38 arnsholt crypto.h is a lot bigger
15:39 jnthn konobi: I found something to steal from, it's mostly just an annoying task to trudge though :)
15:39 ugexe https://gist.github.com/ugexe/71d82eb4bb5653125bd8 # this was the shim (IO::Socket::Async::SSLow)
15:39 konobi yar
15:40 ugexe jnthn: yeah the openssl api is not interesting or fun in any way :/
15:40 * [Coke] updates https://gist.github.com/coke/84​389edf917a1a65b9f0e930f1c86848 to highlight his bailador(socket) vs. async issue.
15:42 skids joined #perl6
15:47 cyphase joined #perl6
15:49 elohmrow_ joined #perl6
15:49 Woodi hey, guys, OpenSSL is just under funded! - from 2daysago on HN TLS history link :)
15:52 AlexDaniel joined #perl6
15:52 xinming joined #perl6
15:53 mtj_ joined #perl6
15:58 domidumont joined #perl6
15:58 rindolf joined #perl6
15:59 AlexDaniel timotimo: wait, so… you are saying that keyboard layouts are different. Alright, makes sense. So what? Isn't it the point?
16:00 AlexDaniel I'm actually happy that even layouts with the same name are different everywhere
16:00 AlexDaniel this way people won't assume stupid things
16:01 robertle hoelzro, moritz, jnthn: ok, good to know that it should work. I'll do some more digging, but what I see is that I start n threads and each of them loops x/n times, creating a socket, writing, reading, closing. if n == 1, this takes some amount of time. I would expect that to drop with increasing n (right). what happens is that it increases sharply at n==2, and then stays at that time for n==3, n==4
16:02 imcsk8 joined #perl6
16:02 dogbert17 joined #perl6
16:04 canopus joined #perl6
16:06 mcmillhj joined #perl6
16:07 cdg joined #perl6
16:10 cyphase joined #perl6
16:11 ugexe maybe related to overhead?
16:11 ugexe m: say $*THREAD.id; for 1..4 { start { say $*THREAD.id }; };
16:11 camelia rakudo-moar f648d3: OUTPUT«1␤3␤3␤3␤4␤»
16:16 AlexDaniel in fact, keyboard layouts are so easily configurable. “`” key can as well produce 🖕, and that should not bother you at all. Sometimes I see stuff like “ok, here is my game, controls are: WASD, you can't change it” and it makes me sad.
16:17 mst btw
16:17 mst https://docs.perl6.org/language.html
16:17 mst so I skimmed to the first 'about perl6' link, which was https://docs.perl6.org/language/classtut
16:18 mst then it says
16:18 mst > This type object is an "empty instance" of the class. You've already seen these in previous chapters.
16:18 mst is there a list of the 'standard' chapter ordering?
16:20 robertle if each thread just does sleeps, then the runtime behavior is as expected: http://pastebin.com/YgnnJH3V
16:21 robertle so *something* in there needs to block the multiple threads. CPU load is low, so that's not it
16:21 robertle also note that the runtime goes up by more than a factor of two, rather than stay roughly the same which is what I would expect for some resource starvation
16:22 perlpilot mst: I *think* that bit was copied verbatim from the "Using Perl 6" book.
16:23 perlpilot Aye, https://cloud.github.com/downloa​ds/perl6/book/2012.05.23.a4.pdf  page 54, section 5.1
16:24 petercommand joined #perl6
16:24 AlexDaniel mst: https://github.com/perl6/doc/issues/889
16:24 petercommand joined #perl6
16:24 robertle and what's the best way to go about understanding this? my next step would have been to remove http::client and doing IO::Socket::INET directly to check whether it's http::client
16:24 mst AlexDaniel: ah, so it's a doc bug, rather than me picking the wrong reading order
16:24 mst that's fine
16:25 mst just I've decided to go through the doc.perl6.org pages ignroing the 5to6 stuff and just reading through all of the 'reference to perl6' parts
16:25 wamba joined #perl6
16:25 mst in order to be able to ask more imaginatively stupid questions in here ;)
16:26 pierre_ joined #perl6
16:26 AlexDaniel mst: I always dislike references that assume you would be reading docs in some particular order. However, the consensus seems to be that it's OK to refer to something above on the same page. In this case, however, it is a bug indeed.
16:27 ugexe robertle: see my previous message in this channel; add a debug statement with $*THREAD.id then see what the difference is when you add the sleep.
16:27 ugexe that might give a clue. might not
16:27 cyphase joined #perl6
16:29 AlexDaniel mst: also, it's such a pity that you are ignoring 5to6 docs. These need more eyes :)
16:29 mst I don't want to learn how to write perl5 in perl6 though
16:30 mst also, they almost certainly don't cover the real perl5 anymore
16:30 mst the classes doc talks about perl5 doing DFS for MI
16:30 mst whereas the best practice for ~10 years has been C3
16:30 ilmari[m] joined #perl6
16:30 mst (ok, they say 'by default', but ignoring how e.g. DBIx::Class does it makes it seem kinda dated)
16:31 ugexe i like writing perl6 in perl5 >:)
16:31 ugexe always get screwed by lazy map/grep though
16:31 AlexDaniel mst: great! Right. Indeed. It would be great if you could write your notes here: https://github.com/perl6/doc/issues/new ;)
16:31 mst every time I read perl6 OO code I think "I could write this with Moo and have less boilerplate"
16:32 mst but I've already grumbled about the specific reasons for that
16:32 ilmari mst: neither Moo nor Moose impose C3, though?
16:32 mst ilmari: no, but they also basically say "don't use MI"
16:32 mcmillhj joined #perl6
16:32 ilmari true
16:32 iH2O joined #perl6
16:32 robertle ugexe: fascinating! with one thread, each block of 100 http::client requests/responses takes roughlyu the same time. with more threads, each block seems to take the same amount of time, but one somewhere in the middle just sits there for quite some time...
16:34 robertle also segfaults every now and then :)
16:35 iH2O how is that :) instead of :(
16:35 dante73 joined #perl6
16:35 mst because eventually, you have to find this stuff funny
16:35 kurgan_ joined #perl6
16:35 iH2O i wont find hillary funny once elected
16:36 iH2O im already practicing :( :( :(
16:36 robertle I do say $i++ ~ ' ' ~ now ~ ': " ' ~ $*THREAD.id; now
16:36 mst iH2O: hey, I'm english
16:36 robertle and I get:
16:36 robertle 16 Instant:1473179786.850537: " 4
16:36 robertle 17 Instant:1473179786.979291: " 4
16:36 robertle 18 Instant:1473179791.823523: " 3
16:36 robertle 19 Instant:1473179791.946529: " 3
16:36 mst iH2O: you focus on laughing at our political disasters
16:36 mst iH2O: and in exchange we can laugh at yours :D
16:37 robertle the first 15 lines are also very quick, note the lag from 17 to 18
16:37 iH2O im Canadian, and we'll be both affected (without representation) by hillarys policies
16:37 iH2O affected a lot
16:37 robertle I have no idea how I would go about debugging this...
16:37 ugexe robertle: your time isn't going to go down though if you are creating the socket, connecting, reading, writing, etc every time
16:37 Actualeyes1 joined #perl6
16:38 robertle note that I do x/n cycles in each thread. if the numebr of threads goes up, the loop cycles in each thread go down
16:38 robertle plus I am of course not saying that this is a good way to do anything, just that the behavior is puzzling
16:38 robertle potentially puzzling in interesting ways
16:40 TomLeg joined #perl6
16:44 robertle this time I even got a core dump...
16:44 iH2O left #perl6
16:44 robertle #0  0x00007fca6e3cf844 in bind_key ()
16:44 robertle from //home/rlemmen/perl6env/rakudobre​w/moar-nom/install/lib/libmoar.so
16:44 robertle (gdb) bt
16:44 robertle #0  0x00007fca6e3cf844 in bind_key ()
16:44 robertle from //home/rlemmen/perl6env/rakudobre​w/moar-nom/install/lib/libmoar.so
16:44 robertle #1  0x00007fca6e38c78b in MVM_interp_run ()
16:44 robertle from //home/rlemmen/perl6env/rakudobre​w/moar-nom/install/lib/libmoar.so
16:44 robertle #2  0x00007fca6e39e5ce in start_thread ()
16:45 robertle anyway, I need to get some dinner. will try to do more digging...
16:48 araujo_ joined #perl6
16:49 mcmillhj joined #perl6
16:51 araujo_ joined #perl6
16:59 harmil_wk Just responded to a p6l question with this snippet that I didn't realize would work until I tried it:
16:59 harmil_wk m: sub dueet(&op, *@list) { op @list }; say dueet &prefix:<[R-]>, 1..100
16:59 camelia rakudo-moar b3e442: OUTPUT«-4850␤»
17:01 cyphase joined #perl6
17:01 mcmillhj joined #perl6
17:02 tadzik joined #perl6
17:02 M-Illandan joined #perl6
17:02 Matthew[m] joined #perl6
17:03 pochi_ joined #perl6
17:05 woolfy joined #perl6
17:05 Xliff <Xliff> Question for the P6 devs in here: sub EXPORT(+@a) { ... require SomeModule; ... } <- Is that supposed to crash rakaudo at stage parse?
17:06 Xliff Or at all, for that matter.
17:06 harmil_wk m: sub EXPORT(+@a) { require Test }
17:06 camelia rakudo-moar b3e442: ( no output )
17:07 harmil_wk m: sub EXPORT(+@a) { require Test }; say "looks good";
17:07 camelia rakudo-moar b3e442: OUTPUT«looks good␤»
17:07 harmil_wk Xliff: what's your perl -v?
17:07 harmil_wk *perl6
17:08 poohman joined #perl6
17:09 mcmillhj joined #perl6
17:12 Xliff m: sub EXPORT(+@A) { require ::('Test') }; say "hey!"
17:12 camelia rakudo-moar b3e442: OUTPUT«hey!␤»
17:12 Xliff This is Rakudo version 2016.08.1-48-gf2df2c5 built on MoarVM version 2016.08
17:12 Xliff implementing Perl 6.c.
17:14 Xliff harmil_wk, this is occuring in a file-based module context.
17:15 Xliff harmil_wk: When run, I get the following: ===SORRY!===
17:15 Xliff Cannot find method 'merge-symbols': no method cache and no .^find_method
17:15 DrForr joined #perl6
17:16 Xliff See https://gist.github.com/Xliff/f​ceb9354193e3b2d1d9c1968b991d6ec for context.
17:21 cdg joined #perl6
17:21 cyphase joined #perl6
17:28 itaipu joined #perl6
17:28 rmmm joined #perl6
17:32 firstdayonthejob joined #perl6
17:34 zacts joined #perl6
17:36 dalek joined #perl6
17:36 cyphase joined #perl6
17:41 itaipu joined #perl6
17:44 spider-mario joined #perl6
17:45 yadongz joined #perl6
17:45 sunnavy joined #perl6
17:47 [Coke] I would recommend not having discussions about us politics in here.
17:49 [Coke] I am curious as to what policies in particular you think will negatively impact you, though, esp. in comparision with the (to be generous) 3 other options.
17:55 pierre_ joined #perl6
17:56 cyphase joined #perl6
17:56 itaipu joined #perl6
17:57 harmil_wk [Coke]: did you just say that you would recommend against politics and then ask for followup on politics?
17:57 [Coke] did I say one thing
17:58 [Coke] and then continue the thought?
17:58 [Coke] yes.
18:01 geekosaur perhaps that was an invitation to continue... elsewhere
18:03 * nine has even missed the first mention of politics that [Coke] responded to ;)
18:03 * [ptc] nods in agreement, still confused
18:06 mst it was a canadian practising for being upset by the US presidential election outcome
18:06 mst at this stage, it's kind of a national sport
18:06 labster joined #perl6
18:10 harmil_wk [Coke]: I was just uplifted to hear a voice of reason in suggesting that a language channel wasn't the place to introduce politics and then saddened to see the prod to continue.
18:11 nige1 joined #perl6
18:11 timotimo i also didn't notice anything about politics
18:11 timotimo from robertle's backtrace it looks like they're accessing a hash concurrently
18:13 robertle joined #perl6
18:14 mst #perl does ok with this, usually - when politics come up they get discussed politely for a bit, followed by us going back to perl
18:14 mst anybody who can't manage to be polite wins a free tempban until they cool off
18:14 cyphase joined #perl6
18:17 * [Coke] prepends a "However, " to avoid confusion.
18:19 mspo nerd politics?
18:21 [Coke] best kind?
18:28 labster joined #perl6
18:32 cyphase joined #perl6
18:44 nige1 joined #perl6
18:47 labster joined #perl6
18:47 cyphase joined #perl6
18:54 firstdayonthejob joined #perl6
18:58 itaipu joined #perl6
18:58 TheLemonMan joined #perl6
18:59 Ven_ joined #perl6
19:01 Unavowed joined #perl6
19:01 Woodi let's assume nerds are like scientists from Half-Life - weird, old gentelmens... so, requested by [Coke] list of facts can barely be what we call "political discusion"... agreeing on facts is almoust not-political discussion becouse politics base a lot on misunderstanding and some hidden gain, IMO
19:02 * Woodi as alway is too late for current topic... :)
19:07 cyphase joined #perl6
19:07 Woodi btw. DDD is great debugger :)
19:11 matiaslina joined #perl6
19:19 smls m: constant %a is default(42);
19:19 camelia rakudo-moar bd3d43: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing initializer on constant declaration␤at <tmp>:1␤------> 3constant %a is default(42)7⏏5;␤»
19:19 smls ^^ Is the `is default` trait not supposed to work on constants?
19:20 moritz m: constant %a is default(42) = ();
19:20 camelia rakudo-moar bd3d43: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Type check failed in constant declaration of %a; expected Associative but got List (List)␤at <tmp>:1␤------> 3constant %a is default(42) = ()7⏏5;␤»
19:20 moritz m: constant %a is default(42) = %();
19:20 camelia rakudo-moar bd3d43: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Cannot resolve caller trait_mod:<is>(Hash, Str, Int); none of these signatures match:␤    (Mu:U $child, Mu:U $parent)␤    (Mu:U $child, :$DEPRECATED!)␤    (Mu:U $type, :$rw!)␤    (Mu:U $type, :$nativ…»
19:20 cyphase joined #perl6
19:20 moritz smls: constant hashes are kinda weird in rakudo, because they don't do proper hash assignmnt
19:21 smls ok
19:21 moritz m: constant @a is default(42) = 1, 2; say @a[4]
19:21 camelia rakudo-moar bd3d43: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Cannot resolve caller trait_mod:<is>(List, Str, Int); none of these signatures match:␤    (Mu:U $child, Mu:U $parent)␤    (Mu:U $child, :$DEPRECATED!)␤    (Mu:U $type, :$rw!)␤    (Mu:U $type, :$nativ…»
19:22 smls m: BEGIN my %a is default(42) = a => 1;  say %a<b>;
19:23 camelia rakudo-moar bd3d43: OUTPUT«42␤»
19:23 smls Is there any downside to using `BEGIN my` instead of `constant`?
19:24 smls It'll still be pre-compiled when in a module, right?
19:24 moritz does it make %a immutable?
19:25 moritz m: BEGIN my %a is default(42) = a => 1;  %a<b> = 23; say %h
19:25 camelia rakudo-moar bd3d43: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '%h' is not declared␤at <tmp>:1␤------> 3 default(42) = a => 1;  %a<b> = 23; say 7⏏5%h␤»
19:25 moritz m: BEGIN my %a is default(42) = a => 1;  %a<b> = 23; say %a
19:25 camelia rakudo-moar bd3d43: OUTPUT«{a => 1, b => 23}␤»
19:25 moritz seems it doesn't
19:26 smls I can live with that :P
19:29 smls m: my %a is Map is default(42);  say %a<foo>
19:29 camelia rakudo-moar bd3d43: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤is default on shaped Map not yet implemented. Sorry. ␤at <tmp>:1␤------> 3my %a is Map is default(42)7⏏5;  say %a<foo>␤    expecting any of:␤        constraint␤»
19:29 smls heh
19:33 cyphase joined #perl6
19:35 Unavowed Quick question: In a signature you can do: Associative:D[Bool:D] $hash; If you want the equivalent for the %-sigil, can you do better than Bool:D %hash where .defined ?
19:39 moritz Unavowed: you mean except patching rakudo to make % implied :D ? :-)
19:40 Unavowed moritz: I take that as a no :D
19:41 Unavowed (where :D is just a smiley face)
19:44 rmmm joined #perl6
19:46 El_Che hi
19:48 cyphase joined #perl6
19:50 TEttinger joined #perl6
19:55 cdg joined #perl6
20:01 mprelude joined #perl6
20:07 Glitchy joined #perl6
20:12 cyphase joined #perl6
20:13 itaipu joined #perl6
20:16 Unavowed Is it possible to specify a type like Array[Int|Str] meaning an array which can contain ints or strings?
20:18 nine Unavowed: only as subset with a "where"
20:18 vcv isn't there already an IntStr type?
20:20 perlpilot m: my IntStr $x;
20:20 camelia rakudo-moar 72d3be: ( no output )
20:20 perlpilot Looks like there is.
20:20 perlpilot m: my Non-existent-type $x;
20:20 camelia rakudo-moar 72d3be: OUTPUT«5===SORRY!5===␤Type 'Non-existent-type' is not declared␤at <tmp>:1␤------> 3my Non-existent-type7⏏5 $x;␤Malformed my␤at <tmp>:1␤------> 3my7⏏5 Non-existent-type $x;␤␤»
20:22 leont joined #perl6
20:27 cyphase joined #perl6
20:28 Unavowed nine: thanks
20:29 Unavowed Int|Str was just an illustration, the question was really about a general "junction" type in an Array
20:31 perlpilot m: subset Int-or-Str of Any where { $_ ~~ Int|Str };  my Int-or-Str @a = (1,2,3, "foo", "bar"); say @a.perl;  @a[2] = 3.14;
20:31 camelia rakudo-moar 72d3be: OUTPUT«Array[Int-or-Str].new(1, 2, 3, "foo", "bar")␤Type check failed in assignment to @a; expected Int-or-Str but got Rat (3.14)␤  in block <unit> at <tmp> line 1␤␤»
20:31 dalek doc: ba1af07 | (Jan-Olof Hendig)++ | doc/Type/Setty.pod6:
20:31 dalek doc: Added docs for Setty.default
20:31 dalek doc: review: https://github.com/perl6/doc/commit/ba1af07e92
20:31 perlpilot Unavowed: there's a completish example for you
20:32 Unavowed perlpilot: nice, that's what I was after, thanks
20:36 masak perlpilot: IntStr is more like Int&Str than like Int|Str
20:38 perlpilot I kinda figured.  It felt errno-y
20:40 travis-ci joined #perl6
20:40 travis-ci Doc build failed. Jan-Olof Hendig 'Added docs for Setty.default'
20:40 travis-ci https://travis-ci.org/perl6/doc/builds/157995993 https://github.com/perl6/doc/com​pare/772b29768721...ba1af07e9294
20:40 travis-ci left #perl6
20:44 dogbert17 hmm, what is 'Type check failed in binding to $id; expected CompUnit::PrecompilationId but got Str ("4CDC84469EF12631D41D...) ..' in the Travis log supposed to mean
20:46 cyphase joined #perl6
20:48 geekosaur ummmm
20:48 perlpilot dogbert17: my guess would be someone put "49EF1CDC84462631D41D..." where they should have put CompUnit::PrecompilationId.ne​w("49EF1CDC84462631D41D...");
20:48 perlpilot dogbert17: or someone forgot a coercion
20:48 perlpilot or stuff  :)
20:48 geekosaur didn't nine just change this stuff?
20:48 geekosaur may have a version mismatch now
20:49 Glitchy Hey all, I'm just looking for a little advice on modules. Are there any established unit testing modules, and light web frameworks?
20:49 dogbert17 uh oh, my own changes, to the doc, look quite innocent
20:50 dogbert17 nine: you around?
20:52 nine dogbert17: for a couple more minutes
20:52 geekosaur if I read the commit message right, that string used to *be* the PrecompilationId, but now it is a class
20:52 dogbert17 nine: could you take a look at https://travis-ci.org/perl6/doc/builds/157995993
20:54 nine dogbert17: pass CompUnit::PrecompilationId.new($id) instead of just $id
20:54 dogbert17 nine: you mean change the src?
20:54 nine dogbert17: CompUnit::PrecompilationId used to be a subset of Str but now is a full class so rakudo doesn't run the "where" whenever we pass an $id around
20:55 nine dogbert17: yes
20:55 nine Using CompUnit::PrecompilationId.new($id) should work on old and new rakudos but I haven't tested that.
20:55 dogbert17 in pod2onepage I guess?
20:56 nine Oh, it doesn't :/
20:56 nine m: Str.new("test")
20:56 camelia rakudo-moar 72d3be: OUTPUT«Default constructor for 'Str' only takes named arguments␤  in block <unit> at <tmp> line 1␤␤»
20:56 moritz m: subset Foo of Str where /x/; say Foo.new('blex')
20:56 camelia rakudo-moar 72d3be: OUTPUT«Default constructor for 'Foo' only takes named arguments␤  in block <unit> at <tmp> line 1␤␤»
20:56 moritz m: subset Foo of Str where /x/; say Foo('blex')
20:56 camelia rakudo-moar 72d3be: OUTPUT«Cannot invoke this object (REPR: Uninstantiable; Foo)␤  in block <unit> at <tmp> line 1␤␤»
20:56 geekosaur sadness
20:56 devmikey joined #perl6
20:57 poohman joined #perl6
20:57 nine If anyone knows a better way to achieve this, I'm all ears...
20:58 moritz where does pod2onepage come from?
20:58 telex joined #perl6
20:59 dogbert17 I believe gfldex wrote it som time ago
20:59 lizmat nine: add a Str.new($str) candidate ?
20:59 moritz is it a from a separate module? or part of Pod::To::HTML?
21:00 nine lizmat: I'd have to do that in older rakudos
21:00 lizmat ah, eh oh, eh too bad  :-(
21:01 dogbert17 moritz: not sure to tell the truth
21:01 moritz ah, found https://github.com/gfldex/perl6-pod-to-bigpage
21:03 buharin joined #perl6
21:03 moritz nine: add a multi to precompile that does the coercion to the new type?
21:04 cyphase joined #perl6
21:04 moritz multi method precompile($io, Str $id where ...) { self.precompile($io, CompUnit::PrecompilationId.new($id)) }
21:05 moritz that way internal code can use the fast path, and old code should continue to work
21:05 Glitchy Is there any *Unit style testing suite for p6?
21:06 perlpilot Glitchy: if you can't find one on modules.perl6.org, I don't think there is one.
21:07 perlpilot Glitchy: I wrote a hacky thing similar to P5's Test::Class, but I don't know that I'd recommend it to anyone without a few caveats.
21:09 Glitchy perlpilot: Will take a look at it
21:09 Glitchy Do we still use cpanfile or is there a new way to list project dependencies?
21:10 moritz Glitchy: META6.info or something...
21:10 moritz Glitchy: https://docs.perl6.org/language/modules has more infos
21:10 Glitchy moritz: Thanks
21:11 Glitchy Are there any large web projects? Just looking for a 'base structure' (and maybe some help picking modules)
21:11 moritz nine: try https://gist.github.com/moritz/a​b4cf411bd9b42f8450a8a8439466e37
21:11 moritz nine: I'm still recompiling NQP, and need to go to bed very soon :-)
21:12 moritz if it works, feel free to push
21:16 nine moritz: makes sense. But I'm already in bed :)
21:17 nine .o(why am I holding my phone instead of my book?)
21:19 leont_ joined #perl6
21:24 itaipu joined #perl6
21:29 woolfy joined #perl6
21:36 cyphase joined #perl6
21:36 literal so, what is the idiomatic way of making failures fatal, e.g. for $file.copy() ?
21:37 jnthn use fatal; ?
21:37 literal oh
21:50 Unavowed m: say @(Set.new: 1, 2, 3)
21:50 camelia rakudo-moar f55e11: OUTPUT«(3 => True 1 => True 2 => True)␤»
21:50 Unavowed Wouldn't you expect this to return a list of elements rather than a list of pairs?
21:52 cyphase joined #perl6
22:02 lizmat Unavowed: a Set is considered to be a QuantHash of Bool
22:02 lizmat thus when you make it a list, it will show the key / value pairs
22:08 Sgeo joined #perl6
22:08 leont_ joined #perl6
22:21 grondilu joined #perl6
22:26 canopus joined #perl6
22:37 zacts joined #perl6
22:43 poohman joined #perl6
22:43 nige1 joined #perl6
22:44 cyphase joined #perl6
22:46 aries_liuxueyang joined #perl6
22:52 nige1 joined #perl6
22:57 cyphase joined #perl6
22:59 Actualeyes joined #perl6
23:13 poohman joined #perl6
23:17 sufrostico joined #perl6
23:18 yadongz joined #perl6
23:21 bjz joined #perl6
23:26 BenGoldberg joined #perl6
23:28 Gothmog_ joined #perl6
23:33 cyphase joined #perl6
23:43 poohman joined #perl6
23:44 zacts joined #perl6
23:52 yadongz joined #perl6

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

Perl 6 | Reference Documentation | Rakudo