Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-08-07

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 timotimo do it like me; stay around when smarter people talk and grab all the smarts for yourself using osmosis
00:00 timotimo that's the only way i got any smart at all :)
00:02 lambd0x timotimo: it's sure a good tip ;)
00:02 lambd0x Later guys o/
00:02 timotimo there's already a much simpler way to write all this
00:03 timotimo m: $*IN.words.Bag.list.sort(-*.value).say
00:03 camelia rakudo-moar 0de139: OUTPUT«(mo => 9 a => 8 le => 5 is => 5 ag => 4 an => 4 Ghaoth => 4 gan => 3 na => 3 ghlas’ => 3 slán => 3 Dhún => 3 i => 3 Dobhair. => 3 go => 3 gach => 3 do => 2 dom => 2 bhí => 2 ina => 2 nGall => 2 nár => 2 mé => 2 gleanntáin => 2 ar => 2 beag => 2 fá…»
00:04 sena_kun timotimo, I did it since my childhood, to be honest, so jk. That's why I learned haskell, for example, and did other strange things in my life. And you know, it's not always a best way to spend a night(putting haskell aside, it was great).
00:04 AlexDaniel m: ‘🚱’.uniname.say
00:04 camelia rakudo-moar 0de139: OUTPUT«NON-POTABLE WATER SYMBOL␤»
00:05 timotimo non-portable?
00:06 AlexDaniel that's what I read the first time too
00:06 gfldex timotimo: http://www.qsafesps.com.au/images/P/P205.jpg
00:07 timotimo ah
00:07 AlexDaniel .oO( non-portable program. Do not drink )
00:08 timotimo %)
00:08 timotimo also, i believe the .list in my m: was superfluous
00:08 timotimo as .sort will already call .list for you
00:08 sena_kun Ah, I've understand the '-' sign meaning. Seems like a golf. Thanks for a trick, timotimo.
00:09 timotimo gfldex already showed it a bit earlier
00:10 kaare_ joined #perl6
00:10 sena_kun timotimo, he did, but I catched it up a bit later. (:
00:10 timotimo OK :)
00:10 AlexDaniel 👶🚽 – looks great here
00:10 mcmillhj joined #perl6
00:11 AlexDaniel but incorrect semantically
00:20 timotimo hm?
00:24 AlexDaniel timotimo: well, here is the screenshot: https://files.progarm.org/2016-08-07-032335_434x50_scrot.png
00:25 timotimo oh, i didn't see the icons at all
00:25 timotimo i thought it was spaces :)
00:25 AlexDaniel it's a followup to “Do not drink” thingy :)
00:26 timotimo ah, i missed that connection
00:26 timotimo good one :)
00:26 sno joined #perl6
00:28 gfldex AlexDaniel: using fonts for picrograms is a bad idea: http://imgur.com/a/Yk1Jg
00:28 AlexDaniel gfldex: yes
00:28 timotimo baby on the back of a toilet
00:29 cyphase joined #perl6
00:31 kurahaupo joined #perl6
00:57 lambd0x joined #perl6
00:59 lambd0x timotimo: I think I finally got what you meant earlier, my code: http://bpaste.net/show/0e9df598ffed
00:59 pierre_ joined #perl6
01:00 timotimo do you know yo udon't have to pull the value out, change it, then put it back in? :)
01:01 lambd0x timotimo: actually I didn't...
01:01 lambd0x timotimo: hahah, how?
01:02 mcmillhj joined #perl6
01:03 timotimo just %myhash{$thekey}++
01:03 timotimo i still have no idea why you were using :kv :)
01:03 lambd0x timotimo: whahhhh...
01:04 lambd0x timotimo: you know what...neither do I
01:04 lambd0x hahah
01:04 timotimo and "my $tmp++" is the same as "my $tmp = 1", and i see no reason why you have $tmp at all
01:05 lambd0x timotimo: ah, that was just because I initially was unsure about how to insert in a hash variable, afterward I did forget about it there...
01:06 lambd0x thanks for tips :)
01:06 timotimo ah
01:07 lambd0x timotimo: wow the code got a lot shorter now
01:08 lambd0x timotimo: about the %myhash{$thekey}++, does it work with arrays too?
01:08 lambd0x m:
01:09 lambd0x m: my @array <1>; @array[0]++;
01:09 camelia rakudo-moar 77724b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing required term after infix␤at <tmp>:1␤------> 3my @array <1>7⏏5; @array[0]++;␤    expecting any of:␤        prefix␤        term␤»
01:09 lambd0x m: my @array =  <1>; @array[0]++;
01:09 camelia rakudo-moar 77724b: ( no output )
01:10 lambd0x m: my @array =  <1>; say @array[0]++;
01:10 camelia rakudo-moar 77724b: OUTPUT«1␤»
01:11 timotimo don't forget it's returning the value that it was before incrementing
01:11 timotimo that's why it's 1 and not 2
01:15 aries_liuxueyang joined #perl6
01:17 mcmillhj joined #perl6
01:17 lambd0x timotimo: yes :)
01:19 kid51 joined #perl6
01:20 lambd0x timotimo: is this kinda of variable that is subjected to collision?
01:30 b2gills lambd0x: You can remove all of the conditional logic from your code. ( hint %h{'a'}++ will leave %h{'a'} == 1 the first time that 'a' is seen )
01:30 timotimo collision?
01:30 timotimo b2g is correct
01:31 timotimo the magic behind that is quite impressive, though :)
01:31 timotimo auto-vivification is black voodoo
01:35 mcmillhj joined #perl6
01:36 lambd0x b2gills: :)
01:39 lambd0x timotimo: yes collision of values in the same key.. a large set of values for the same key that gets much bigger than the actual number of keys in the hash function.
01:42 b2gills lambd0x: If there is a collision the runtime hides it for you
01:46 lambd0x b2gills: even if the input is huge?
01:46 Ben_Goldberg joined #perl6
01:46 b2gills It can store more than one key-value in the same bucket. There have been CVEs against Perl5 because it didn't split the buckets up in a few cases
01:46 lambd0x b2gills: That's so nice \o/
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:47 lambd0x b2gills: how that for a code? http://bpaste.net/show/006f17d9c1aa
01:47 b2gills In fact I would expect that if you have more than ten or twenty key-values in a hash that it will almost always have some of them sharing buckets
01:48 lambd0x b2gills: true.
01:48 b2gills lambd0x:  the unless could have 「%hash{$word}++」 in it and it would still work.
01:50 AlexDaniel lambd0x: by the way, can you paste your snippets without “$ cat cal_001.pl6” thingy?
01:50 AlexDaniel so that we can ask one of the bots to eval it
01:51 lambd0x yes I can :P
01:51 mcmillhj joined #perl6
01:52 lambd0x here: http://pastebin.com/qXvcT9VP
01:54 lambd0x Thanks everyone :)
01:54 AlexDaniel committable: HEAD http://pastebin.com/raw/qXvcT9VP
01:54 committable AlexDaniel: Successfully fetched the code from the provided URL.
01:54 committable AlexDaniel: https://gist.github.com/d89e8d6b6cf0a4d367e76bfe8422f13d
02:04 b2gills .tell lambd0x I was trying to get you to realize it could be written as 「my %h; for $*IN.words -> $word { %h{$word}++ }」 then I was going to tell you about 「my %h := $*IN.words.BagHash」 http://irclog.perlgeek.de/perl6/2016-08-06#i_12978231
02:04 yoleaux b2gills: I'll pass your message to lambd0x.
02:05 mcmillhj joined #perl6
02:05 AlexDaniel b2gills++ # 「」
02:09 timotimo i'd advise for Bag instead of BagHash, as you probably don't have to modify it afterwards
02:11 b2gills That would have been immediately after BagHash
02:25 mcmillhj joined #perl6
02:27 noganex_ joined #perl6
02:40 timotimo fair enough
02:43 * awwaiid uses tau constant with joy
02:44 timotimo someone found out on stackoverflow, that the "sum" method ought to be marked "is nodal"
02:44 timotimo not sure if it's been reported to RT, though.
02:46 killbill joined #perl6
02:52 killbill expression s/(<:No+:Nd+:Nl>)$0$0/{($0+1) x 3}/ works with 666 but don't work with ⁶ ⁶ ⁶ ( Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏⁶)
02:52 yoleaux 11 Jul 2016 06:31Z <TimToady> killbill: It's <:super>, not <:superscript>.
03:00 AlexDaniel m: 'my $x = ‘❸❸❸’; $x ~~ s/(<:No+:Nd+:Nl>)$0$0/{($0.Str.unival+1) x 3}/; say $x
03:00 camelia rakudo-moar 77724b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in single quotes; couldn't find final "'" ␤at <tmp>:1␤------> 3l>)$0$0/{($0.Str.unival+1) x 3}/; say $x7⏏5<EOL>␤    expecting any of:␤        single quotes␤        …»
03:00 AlexDaniel m: my $x = ‘❸❸❸’; $x ~~ s/(<:No+:Nd+:Nl>)$0$0/{($0.Str.unival+1) x 3}/; say $x
03:00 camelia rakudo-moar 77724b: OUTPUT«444␤»
03:03 AlexDaniel by the way why not **3 ?
03:03 AlexDaniel ah, I see now
03:08 killbill AlexDaniel: it was just synthetic test
03:08 b2gills m: my $x = ‘❸❸❸’; $x ~~ s/(<:N>)$0$0/{($0.Str.unival+1) x 3}/; say $x
03:08 camelia rakudo-moar 77724b: OUTPUT«444␤»
03:09 bjz joined #perl6
03:09 timotimo aye, we allow you to get "exotic" numbers as numbers in perl6 source code, but not in Intifying strings with a + or .Numeric or anything like that
03:32 Ben_Goldberg m: <❸❸❸>.perl.say
03:32 camelia rakudo-moar 77724b: OUTPUT«"❸❸❸"␤»
03:32 Ben_Goldberg m: < ❸❸❸ >.perl.say
03:32 camelia rakudo-moar 77724b: OUTPUT«"❸❸❸"␤»
03:32 Ben_Goldberg m: ❸❸❸.perl.say
03:32 camelia rakudo-moar 77724b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Bogus postfix␤at <tmp>:1␤------> 3❸7⏏5❸❸.perl.say␤    expecting any of:␤        infix␤        infix stopper␤        statement end␤        statement modifier␤        statement modi…»
03:32 Ben_Goldberg m: (❸❸❸ + 1).perl.say
03:32 camelia rakudo-moar 77724b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Bogus postfix␤at <tmp>:1␤------> 3(❸7⏏5❸❸ + 1).perl.say␤    expecting any of:␤        infix␤        infix stopper␤        statement end␤        statement modifier␤        statemen…»
03:33 zacts joined #perl6
03:33 TimToady you can't use non-digits as if they were digits
03:43 AlexDaniel it's kinda funny
03:43 AlexDaniel m: ‘❸’.uniname.say
03:43 camelia rakudo-moar 77724b: OUTPUT«DINGBAT NEGATIVE CIRCLED DIGIT THREE␤»
03:43 AlexDaniel … calls it a digit!
03:43 AlexDaniel m: ‘❸’.uniprop.say
03:43 camelia rakudo-moar 77724b: OUTPUT«No␤»
03:44 AlexDaniel m: ‘⓭’.uniname.say
03:44 camelia rakudo-moar 77724b: OUTPUT«NEGATIVE CIRCLED NUMBER THIRTEEN␤»
03:44 Ben_Goldberg m: 'a'.uniprop.say;
03:44 camelia rakudo-moar 77724b: OUTPUT«Ll␤»
03:44 Ben_Goldberg m: '42'.uniprop.say;
03:44 camelia rakudo-moar 77724b: OUTPUT«Nd␤»
03:45 AlexDaniel by the way
03:45 AlexDaniel m: ‘4a’.uniprop.say
03:45 camelia rakudo-moar 77724b: OUTPUT«Nd␤»
03:45 AlexDaniel ↑ shouldn't this warn or something?
03:46 TimToady it's a feature, if ord is a feature
03:46 AlexDaniel m: ‘a4’.uniname.say
03:46 camelia rakudo-moar 77724b: OUTPUT«LATIN SMALL LETTER A␤»
03:46 AlexDaniel OK then
03:47 Ben_Goldberg m: .chr.say for first { *.chr.uniprop eq 'No' }, ^Inf;
03:47 camelia rakudo-moar 77724b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed double closure; WhateverCode is already a closure without curlies, so either remove the curlies or use valid parameter syntax instead of *␤at <tmp>:1␤------> 3.say for first { *.chr.uniprop eq…»
03:47 TimToady m: ‘a4’.uninames.say
03:47 camelia rakudo-moar 77724b: OUTPUT«(LATIN SMALL LETTER A DIGIT FOUR)␤»
03:47 Ben_Goldberg m: .chr.say for first { $_.chr.uniprop eq 'No' }, ^Inf;
03:47 camelia rakudo-moar 77724b: OUTPUT«²␤»
03:48 Ben_Goldberg m: .chr.print for grep { $_.chr.uniprop eq 'No' }, ^Inf;
03:48 AlexDaniel and we still have no uniprops
03:48 camelia rakudo-moar 77724b: OUTPUT«(timeout)²³¹¼½¾৴৵৶৷৸৹୲୳୴୵୶୷௰௱௲౸౹౺౻౼౽౾൰൱൲൳൴൵༪༫༬༭༮༯༰༱༲༳፩፪፫፬፭፮፯፰፱፲፳፴፵፶፷፸፹፺፻፼៰៱៲៳៴៵៶៷៸៹᧚⁰⁴⁵⁶⁷⁸⁹₀₁…»
03:48 Ben_Goldberg No means "number, other"
03:48 AlexDaniel haha
03:49 Ben_Goldberg m: '৴'.uniname.say;
03:49 camelia rakudo-moar 77724b: OUTPUT«BENGALI CURRENCY NUMERATOR ONE␤»
03:49 Ben_Goldberg m: '᧚'.uniname.say;
03:49 camelia rakudo-moar 77724b: OUTPUT«NEW TAI LUE THAM DIGIT ONE␤»
03:49 webstrand left #perl6
03:54 Ben_Goldberg m: .chr.print for grep { $_.chr.uniname ~~ /TURNED/ }, gather { take $++ while time < ((INIT time) + 1) };
03:54 camelia rakudo-moar 77724b: OUTPUT«ƍƜǝɅɐɒɥɯɰɹɺɻʇʌʍʎʞʮʯʴʵʻࣣ̒ჹᴂᴈᴉᴔᴚᴟᵄᵆᵌᵎᵚᵷᶛᶣᶭᶺ℩Ⅎ⅁⅂⅄⅋ⅎ↊↋⌙⛉⛊❛❝⦢⯂ⱯⱰⱹⱻ⸲⸵⸸ꝾꝿꞀꞁꞍꞰꞱꟺ꧍ꭁꭂꭃꭄꭑ»
04:08 Ben_Goldberg m: .chr.print for grep { $_.chr.uniname ~~ m/FRAKTUR/ }, gather { my $c = 100000; take $c++ while time < (INIT {2 + time}) };
04:08 camelia rakudo-moar 77724b: OUTPUT«𝔄𝔅𝔇𝔈𝔉𝔊𝔍𝔎𝔏𝔐𝔑𝔒𝔓𝔔𝔖𝔗𝔘𝔙𝔚𝔛𝔜𝔞𝔟𝔠𝔡𝔢𝔣𝔤𝔥𝔦𝔧𝔨𝔩𝔪𝔫𝔬𝔭𝔮𝔯𝔰𝔱𝔲𝔳𝔴𝔵𝔶𝔷𝕬𝕭𝕮𝕯𝕰𝕱𝕲𝕳𝕴𝕵𝕶𝕷𝕸𝕹𝕺𝕻𝕼…»
04:35 Cabanossi joined #perl6
04:46 bjz joined #perl6
05:18 kurahaupo joined #perl6
05:19 AlexDaniel “Goo” is actually not a bad name for a programming language ( https://github.com/golang/go/issues/9 )
05:20 AlexDaniel ah, already taken? Just use “Gooo” then…
05:23 bjz joined #perl6
05:25 wamba joined #perl6
05:35 pierre_ joined #perl6
05:38 labster joined #perl6
05:51 zacts joined #perl6
06:08 doublec AlexDaniel: goo was a lisp/dylan hybrid
06:09 andrzejku joined #perl6
06:09 andrzejku hello
06:13 smls joined #perl6
06:16 Celelibi joined #perl6
06:38 CIAvash joined #perl6
07:11 andrzejku hi
07:31 setty1 joined #perl6
07:38 firstdayonthejob joined #perl6
07:40 brrt joined #perl6
07:40 flaviusb joined #perl6
07:45 andrzejku joined #perl6
07:48 smls Hi
07:49 dalek ecosystem: 7d2ff14 | (Shoichi Kaji)++ | META.list:
07:49 dalek ecosystem: Add MetaCPAN::Favorite to ecosystem
07:49 dalek ecosystem:
07:49 dalek ecosystem: See https://github.com/skaji/perl6-MetaCPAN-Favorite
07:49 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/7d2ff143c5
07:56 RabidGravy joined #perl6
07:59 Tonik joined #perl6
08:19 rindolf joined #perl6
08:23 darutoko joined #perl6
08:37 zacts joined #perl6
08:45 RabidGravy boom
08:50 spider-mario joined #perl6
09:14 andrzejku joined #perl6
09:44 skaji hi
09:44 skaji m: my $*D; my $i = Supply.interval(1); $i.tap: { say $*D }; $i.wait;
09:44 camelia rakudo-moar 77724b: OUTPUT«Unhandled exception in code scheduled on thread 4␤Dynamic variable $*D not found␤  in block  at <tmp> line 1␤␤»
09:45 skaji is this expected?
09:50 wamba joined #perl6
09:58 vimal2012 joined #perl6
10:05 pierre_ joined #perl6
10:09 vimal2012 Is there a function to convert first letter of every word of a string to upper case? For example my $string="The quick brown fox" should be converted to "The Quick Brown Fox"
10:12 llfourn m: vimal2012 try .wordcase
10:12 camelia rakudo-moar 77724b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    vimal2012 used at line 1␤␤»
10:12 llfourn m: "the quick brown fox".wordcase.say
10:12 camelia rakudo-moar 77724b: OUTPUT«The Quick Brown Fox␤»
10:12 llfourn vimal2012: ^
10:25 sena_kun joined #perl6
10:25 sena_kun .
10:25 canopus joined #perl6
10:29 vimal2012 left #perl6
10:33 llfourn skaji: That's a bug. see RT #127033.
10:33 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=127033
10:35 skaji llfourn: thanks!
10:36 llfourn you're welcome :)
10:36 pmurias joined #perl6
10:37 sno joined #perl6
11:01 brrt joined #perl6
11:10 KotH joined #perl6
11:13 felher_ joined #perl6
11:13 pierre_ joined #perl6
11:28 cyphase joined #perl6
11:31 edehont joined #perl6
11:34 rindolf joined #perl6
12:09 timotimo .seen skarsnik
12:09 yoleaux I saw Skarsnik 6 Jul 2016 13:58Z in #perl6: <Skarsnik> RabidGravy, do you have an example of using it async? I'd like to have a Discord module that use the websocket api x)
12:09 timotimo :(
12:10 RabidGravy boom
12:17 masak how do I mark an exception as handled in a CATCH?
12:17 timotimo you successfully smartmatch against it, for example
12:19 masak what's the idiomatic way to say "if we get to this point, mark it as handled"
12:19 masak ?
12:19 pierre_ joined #perl6
12:19 timotimo hm, i don't know of an idiomatic way yet
12:20 masak m: class X::Custom is Exception { method message { "OH NOES" } }; { die X::Custom.new; CATCH { say "in catch" } }
12:20 camelia rakudo-moar 77724b: OUTPUT«in catch␤OH NOES␤  in block <unit> at <tmp> line 1␤␤»
12:20 masak m: class X::Custom is Exception { method message { "OH NOES" } }; { die X::Custom.new; CATCH { say "in catch"; $_ ~~ Any } }
12:20 camelia rakudo-moar 77724b: OUTPUT«in catch␤OH NOES␤  in block <unit> at <tmp> line 1␤␤»
12:20 masak "successfully smartmatch" doesn't seem to be enough
12:20 timotimo hm. how does default { ... } do it, then?
12:20 masak m: class X::Custom is Exception { method message { "OH NOES" } }; { die X::Custom.new; CATCH { say "in catch"; default {} } }
12:20 camelia rakudo-moar 77724b: OUTPUT«in catch␤»
12:20 masak gonna go with `default {}` for now
12:22 timotimo oh
12:22 timotimo m: class X::Custom is Exception { method message { "OH NOES" } }; { die X::Custom.new; CATCH { say "in catch"; succeed } }
12:22 camelia rakudo-moar 77724b: OUTPUT«in catch␤succeed without when clause␤  in block  at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
12:22 timotimo m: class X::Custom is Exception { method message { "OH NOES" } }; { die X::Custom.new; CATCH { say "in catch"; proceed } }
12:22 camelia rakudo-moar 77724b: OUTPUT«in catch␤proceed without when clause␤  in block  at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
12:22 timotimo hmm.
12:23 masak yeah; those only make sense inside a `when` clause, I guess
12:23 timotimo the default { } does a succeed at the end, i expect that just skips over the rethrow we code-gen for the CATCH block
12:24 masak aye
12:24 kid51 joined #perl6
12:34 skaji_ joined #perl6
12:45 lichtkind_ joined #perl6
12:46 timotimo neat, pypy got a flag for giving you a traceback for when the GC closes a file for you
12:46 timotimo so you can properly put "with" statements or close method calls where they need to go
12:46 timotimo i think we could easily build something similar
13:00 araujo__ joined #perl6
13:01 andrzejku joined #perl6
13:06 ovibos joined #perl6
13:27 andrzejku joined #perl6
13:36 andrzejku joined #perl6
13:40 dalek whateverable: 10eee4e | (Daniel Green)++ | / (2 files):
13:40 dalek whateverable: Perl 6 rewrite of benchable
13:40 dalek whateverable: review: https://github.com/perl6/whateverable/commit/10eee4e79c
13:43 brrt joined #perl6
13:46 freezerburnv_ joined #perl6
13:50 zakharyas joined #perl6
13:50 brrt hmmm, how? do you want to record the code locations at every file open?
13:51 holyghost joined #perl6
13:59 dalek doc/revert-814-signature-test-option: 753a50d | Altai-man++ | / (18 files):
13:59 dalek doc/revert-814-signature-test-option: Revert "New pod config option: 'signature'"
13:59 dalek doc/revert-814-signature-test-option: review: https://github.com/perl6/doc/commit/753a50d41d
14:19 travis-ci joined #perl6
14:19 travis-ci Doc build passed. Altai-man 'Revert "New pod config option: 'signature'"'
14:19 travis-ci https://travis-ci.org/perl6/doc/builds/150421053 https://github.com/perl6/doc/commit/753a50d41da0
14:19 travis-ci left #perl6
14:21 dalek doc: 753a50d | Altai-man++ | / (18 files):
14:21 dalek doc: Revert "New pod config option: 'signature'"
14:21 dalek doc: review: https://github.com/perl6/doc/commit/753a50d41d
14:21 dalek doc: 69198a3 | Altai-man++ | / (18 files):
14:21 dalek doc: Merge pull request #815 from perl6/revert-814-signature-test-option
14:21 dalek doc:
14:21 dalek doc: Revert "New pod config option: 'signature'"
14:21 dalek doc: review: https://github.com/perl6/doc/commit/69198a3b02
14:22 araujo__ joined #perl6
14:27 dalek doc: ce5b9d9 | Altai-man++ | util/extract-examples.p6:
14:27 dalek doc: The examples extractor was updated to complete signatures without config option
14:27 dalek doc: review: https://github.com/perl6/doc/commit/ce5b9d9ad0
14:29 kurahaupo joined #perl6
14:35 andrzejku joined #perl6
14:35 dalek doc: 55b76fc | Altai-man++ | doc/Type/ (16 files):
14:35 dalek doc: We don't need `{}` after signature to make it correct anymore
14:35 dalek doc: review: https://github.com/perl6/doc/commit/55b76fc76c
14:37 skids joined #perl6
14:44 telex joined #perl6
14:44 travis-ci joined #perl6
14:45 travis-ci Doc build failed. Altai-man 'We don't need `{}` after signature to make it correct anymore'
14:45 travis-ci https://travis-ci.org/perl6/doc/builds/150425166 https://github.com/perl6/doc/compare/ce5b9d9ad082...55b76fc76cff
14:45 travis-ci left #perl6
14:46 zacts joined #perl6
14:48 edehont joined #perl6
15:06 khw joined #perl6
15:08 itaipu joined #perl6
15:13 xinming joined #perl6
15:13 andrzejku joined #perl6
15:26 sena_kun m: floor(1.1) := 42; CATCH { default { put .^name, ': ', .Str } };
15:26 camelia rakudo-moar 77724b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Cannot use bind operator with this left-hand side␤at <tmp>:1␤------> 3floor(1.1) := 427⏏5; CATCH { default { put .^name, ': ', .S␤»
15:38 zakharyas joined #perl6
15:48 nicq20 joined #perl6
15:51 ribasushi joined #perl6
15:53 dalek doc: 653b91c | Altai-man++ | doc/Language/functions.pod6:
15:53 dalek doc: Index "is assoc", closes https://github.com/perl6/doc/issues/817
15:53 dalek doc: review: https://github.com/perl6/doc/commit/653b91ce36
15:56 andrzejku joined #perl6
15:58 dalek doc: 62e617f | Altai-man++ | doc/Type/ (9 files):
15:58 dalek doc: Now Backtrace, Bag, BagHash, Baggy, Blob, Block, Bind and two exceptions are compilable
15:58 dalek doc: review: https://github.com/perl6/doc/commit/62e617f4c2
16:02 bob777 joined #perl6
16:16 kid51 joined #perl6
16:16 travis-ci joined #perl6
16:16 travis-ci Doc build passed. Altai-man 'Index "is assoc", closes https://github.com/perl6/doc/issues/817'
16:16 travis-ci https://travis-ci.org/perl6/doc/builds/150435939 https://github.com/perl6/doc/compare/55b76fc76cff...653b91ce3611
16:16 travis-ci left #perl6
16:19 travis-ci joined #perl6
16:19 travis-ci Doc build passed. Altai-man 'Now Backtrace, Bag, BagHash, Baggy, Blob, Block, Bind and two exceptions are compilable'
16:19 travis-ci https://travis-ci.org/perl6/doc/builds/150436431 https://github.com/perl6/doc/compare/653b91ce3611...62e617f4c2d7
16:19 travis-ci left #perl6
16:22 captain-adequate joined #perl6
16:32 itaipu joined #perl6
16:32 pierre_ joined #perl6
16:35 araujo_ joined #perl6
16:37 Khisanth joined #perl6
16:37 araujo_ joined #perl6
16:38 kid51 joined #perl6
16:41 andrzejku joined #perl6
16:50 kid51 joined #perl6
17:28 rindolf joined #perl6
17:36 dalek doc: 56acfc8 | (Wenzel P. P. Peppmeyer)++ | doc/Language/typesystem.pod6:
17:36 dalek doc: close C<>
17:36 dalek doc: review: https://github.com/perl6/doc/commit/56acfc854e
17:36 dalek doc: 2cc567c | (Wenzel P. P. Peppmeyer)++ | doc/Language/typesystem.pod6:
17:36 dalek doc: doc role arguments
17:36 dalek doc: review: https://github.com/perl6/doc/commit/2cc567ca7b
17:36 dalek doc: 612cdb5 | (Wenzel P. P. Peppmeyer)++ | doc/ (2 files):
17:36 dalek doc: index type capture
17:36 dalek doc: review: https://github.com/perl6/doc/commit/612cdb52bb
17:47 dalek whateverable: 3c2feb5 | (Daniel Green)++ | Benchable.p6:
17:47 dalek whateverable: Fixed a typo and such
17:47 dalek whateverable: review: https://github.com/perl6/whateverable/commit/3c2feb5076
17:52 cognominal joined #perl6
18:01 grondilu was thinking of a way to test if an integer is a power of an other.  Turns out log($a) %% log($b) works.  Nice.
18:01 grondilu m: say log(9) %% log(3)
18:01 camelia rakudo-moar 77724b: OUTPUT«True␤»
18:01 grondilu m: say log(9) %% log(2)
18:01 camelia rakudo-moar 77724b: OUTPUT«False␤»
18:10 dalek doc: 52cb8a5 | (Wenzel P. P. Peppmeyer)++ | doc/Language/typesystem.pod6:
18:10 dalek doc: close C<>
18:10 dalek doc: review: https://github.com/perl6/doc/commit/52cb8a5075
18:10 dalek doc: 804011a | (Wenzel P. P. Peppmeyer)++ | doc/Language/typesystem.pod6:
18:10 dalek doc: remove left behind heading
18:10 dalek doc: review: https://github.com/perl6/doc/commit/804011af4b
18:10 dalek doc: 3e40128 | (Wenzel P. P. Peppmeyer)++ | doc/Language/typesystem.pod6:
18:10 dalek doc: add missing heading
18:10 dalek doc: review: https://github.com/perl6/doc/commit/3e4012837d
18:10 dalek doc: 3624102 | (Wenzel P. P. Peppmeyer)++ | doc/Language/typesystem.pod6:
18:10 dalek doc: fix example
18:10 dalek doc: review: https://github.com/perl6/doc/commit/3624102839
18:16 ribasushi joined #perl6
18:23 pmurias joined #perl6
18:44 labster joined #perl6
18:48 zakharyas joined #perl6
19:00 andrzejku joined #perl6
19:05 andrzejku Perl is friend, Perl is love
19:05 andrzejku x)
19:20 edehont joined #perl6
19:24 itaipu joined #perl6
19:37 ovibos joined #perl6
19:37 AlexDaniel joined #perl6
19:38 labster joined #perl6
19:40 rpburkholder joined #perl6
19:48 LLamaRider joined #perl6
19:50 labster m: say "\x[0e53]".succ eq "\x[0e53]"
19:50 camelia rakudo-moar 77724b: OUTPUT«True␤»
19:51 labster m: say "\x[0e53] ", uniname("\x[0e53]");
19:51 camelia rakudo-moar 77724b: OUTPUT«๓ THAI DIGIT THREE␤»
19:52 masak labster: ...so three follows on three?
19:52 labster m: say "\x[0e54] ", uniname("\x[0e54]"); # Usually four follows three
19:52 camelia rakudo-moar 77724b: OUTPUT«๔ THAI DIGIT FOUR␤»
19:54 labster Also hi masak!
19:55 masak ahoj
19:59 moritz aloha!
20:01 labster Is moritz coming or going?
20:01 moritz or is he here to stay? who knows?
20:02 timotimo gekommen um zu bleiben.
20:02 bartolin joined #perl6
20:05 moritz three weeks of vacation ahead \o/
20:05 moritz including some travel to Denmark
20:07 labster sounds great
20:07 awwaiid niec!
20:07 awwaiid er, nice!
20:08 labster Nice isn't in Denmark, though.
20:09 awwaiid give or take
20:09 DrForr But Billund is :)
20:10 * labster files thai digits rakudobug
20:14 moritz DrForr: indeed, we'll visit there as well
20:15 itaipu joined #perl6
20:17 DrForr moritz: I don't know if they're still available, but you might want to follow the sculpture path into town; the first restaurant you find sells (or at least did sell) a LEGO rarity - The model of the LEGO museum is only available in Billund.
20:18 pmurias DrForr: is the model of the LEGO museum made of LEGOs?
20:19 DrForr Of course. I have 3 :)
20:19 * grondilu was writing |@somearray and was wandering if we could create a sigil for "flat" arrays.
20:20 * grondilu also wondered if it is possible to create sigils at runtime.
20:20 grondilu s/create/define/
20:20 timotimo with slangs, everything is possible
20:20 moritz though not at runtime
20:20 moritz syntactic features can only be added at compile time
20:20 timotimo one man's run time is another's compile time
20:21 grondilu ok runtime was not the correct expression.  How would you call a modification that is made by the program and not by the core?
20:22 grondilu "user code" or something?
20:22 sena_kun grondilu, you mean reflection?
20:22 moritz use-space code, yes
20:22 moritz *user
20:22 grondilu "user space" indeed
20:24 killbill joined #perl6
20:24 BenGoldberg joined #perl6
20:26 brrt joined #perl6
20:28 brrt i've been thinking of macros for a bit again
20:28 brrt guess that means i should try out 007
20:29 timotimo probably :)
20:30 killbill what I should change in the regex in  /𝐀𝐁𝐂/ === /ABC/ to get True? ( former is Mathematical Alphanumeric Symbols block, latter is Latin one)
20:36 pmurias brrt: re finding unclosed filehandles, wouldn't recording the locations where they are opened be a resonable implementation?
20:37 brrt pmurias: reasonable, yes
20:37 brrt timotiom's suggestion was that pypy gave full tracebacks
20:37 brrt which means you have to maintain and keep alive full stack traces every time you open a file
20:37 brrt just for debugging
20:38 brrt seems... expensive
20:38 timotimo yeah, for pypy the flag is optional
20:38 timotimo we can have this as a module that wraps the constructor of IO::File :P
20:39 timotimo we don't need support in the core or backend or anything
20:39 timotimo user code can do that
20:40 brrt hmm
20:40 brrt that
20:40 brrt makes sense
20:40 brrt actually, do we have destructors?
20:40 timotimo yes, we do have submethod DESTROY
20:40 brrt aha
20:40 timotimo we have that in Failure already to warn when Failure objects get destroyed before they get handled
20:40 timotimo which usually means a .sink is missing or something
20:41 brrt but i suppose IO::File already has a DESTROY? can we augment that and still call the original implementation?
20:41 brrt i recall not having destructors some eons ago
20:42 timotimo we can probably wrap it
20:42 timotimo yeah, we used to not have them
20:42 timotimo and now they're sot guaranteed to run, even
20:45 Sgeo joined #perl6
20:46 moritz ok, weird idea
20:46 moritz have a separate memory pool for objects of classes with DESTROY methods
20:46 moritz then, before interpreter exit, iterate over them all, and call of their DESTROY methods (without doing a full GC run)
20:48 yqt joined #perl6
20:49 brrt hmmm
20:49 brrt don't we already have a full-clean exit?
20:50 brrt mode
20:50 brrt also, why a separate pool? that means you have to know at memory allocation time
20:51 brrt meaning you have a problem if a DESTROY role is ever mixed in
20:51 brrt i'm not 100% sure that is true, though
20:52 gfldex m: class B {...}; class A { trusts B; has $!foo }; class B { submethod BUILD { my $an_A = A.new(); $an_A!A::foo = 42 } }; dd B.new;
20:52 camelia rakudo-moar 77724b: OUTPUT«No such private method '!foo' for invocant of type 'A'␤  in submethod BUILD at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
20:53 TEttinger joined #perl6
20:56 timotimo i don't think trusts allows you to get at private attributes, only methods?
20:57 gfldex running S12-attributes/trusts.t fails, so that may NYI
20:57 timotimo mhh
20:59 gfldex m: class B {...}; class A { trusts B; has $!foo = 42; method !foo { return-rw $!foo }; method perl { "A.new(foo => $!foo)" } }; class B { has A $!a .= new; method change { dd $!a; my $an_A = $!a; $an_A!A::foo } }; dd B.new.change;
20:59 camelia rakudo-moar 77724b: OUTPUT«A $!a = A.new(foo => 42)␤42␤»
21:00 timotimo try method !foo is rw { $!foo } instead
21:00 timotimo i think return-rw without "is rw" is trouble
21:00 timotimo (and we should probably do something about that)
21:02 El_Che I am looking into porting a perl5 module I use often (5 minutes here, 5 minutes there), and all the perl6 enhancements make it impossible toeven try a 1:1 port
21:02 El_Che that bad and great at the same time :)
21:02 timotimo aaw
21:03 lichtkind__ joined #perl6
21:03 DrForr What module?
21:03 El_Che perl-ldap if you keep it quiet. I have new method and some attributes :)
21:04 DrForr Oh, right, should've guessed.
21:04 El_Che eg., one of the modules accepts potitional parameters for new, but that pretty non-perl6 style
21:05 El_Che DrForr: yeah, I wrote the program I needed using the perl5 modules :)
21:05 timotimo i don't have a problem with positional arguments to .new
21:05 timotimo i've biult a few things with that kind of interface (optionally, usually)
21:05 DrForr Incidentally Perl6::Tidy roundtrips all basic operators and declarations (epsilon whitespace)
21:06 El_Che timotimo: I am very fond of the 'has' way of doing thing of Moose and p6
21:06 dalek doc: f96ce35 | (Wenzel P. P. Peppmeyer)++ | doc/Language/typesystem.pod6:
21:06 dalek doc: doc trusts
21:06 dalek doc: review: https://github.com/perl6/doc/commit/f96ce35f3f
21:06 timotimo fair enough
21:09 El_Che an other example, there is a method that accepts one parameter as the subject (dn) and the second as a values (str) or values (arrayref). Could be done with a multimethod, but varargs seems also a good alternative
21:13 DrForr You can override creation with a custom new() method if you need to, but ... Is the first 'values' a string with a comma or otherwise delimited list, vs. an aray of single items?
21:17 trnh joined #perl6
21:18 El_Che the first is "$entry->add ( 'sn' => 'Barr' )", the second " $entry->add ( 'street' => [ '1 some road','nowhere' ] );"
21:18 El_Che the fat comma is justa comma ofcourse, so I was thinking of "method add (Str $attribute, *@values) {...}"
21:18 DrForr Oh, I wouldn't separate them in that case.
21:19 El_Che indeed
21:20 MorayJ joined #perl6
21:22 grondilu joined #perl6
21:30 dalek doc: 8e4234a | (Wenzel P. P. Peppmeyer)++ | util/extract-examples.p6:
21:30 dalek doc: shield better against redeclarations
21:30 dalek doc: review: https://github.com/perl6/doc/commit/8e4234aff0
21:30 dalek doc: 8cac1b2 | (Wenzel P. P. Peppmeyer)++ | doc/Language/typesystem.pod6:
21:30 dalek doc: make examples compile
21:30 dalek doc: review: https://github.com/perl6/doc/commit/8cac1b2f43
21:31 timotimo $entry{'street'} = [ '1 some road', 'nowhere' ]; # how about this? :)
21:33 El_Che timotimo: that's why I had at first. I am looking how it's used in the rest of the codebase
21:47 El_Che I am correcting this (https://docs.perl6.org/language/5to6-nutshell#index-entry-constant-constant) to align it with this (https://docs.perl6.org/language/terms#index-entry-constant_%28Terms%29). I am removing the sigil of the perl6 constant in the perl5to6 doc. Question: The perl5to6 doc uses all capitals like in perl5 while the Term doc capitalizes only the first letter. What's common practive for
21:47 El_Che constants in perl6. I'll like the doc to be consistent
21:47 DarthGandalf joined #perl6
21:50 dalek doc: a79f40d | (Wenzel P. P. Peppmeyer)++ | doc/Language/typesystem.pod6:
21:50 dalek doc: remove TODO
21:50 dalek doc: review: https://github.com/perl6/doc/commit/a79f40d076
21:50 lizmat El_Che: not sure: internally both ALLCAPS as well as CamelCase is used  (e.g. IterationEnd vs REQUIRE_DYNAMIC)
21:51 dalek doc: 3c165ca | (Claudio Ramirez)++ | doc/Language/5to6-nutshell.pod6:
21:51 dalek doc: Remove sigil from perl6 constant in accordance with the Term doc
21:51 dalek doc: review: https://github.com/perl6/doc/commit/3c165ca316
21:51 dalek doc: 8ed43c4 | nxadm++ | doc/Language/5to6-nutshell.pod6:
21:51 dalek doc: Merge pull request #820 from nxadm/master
21:51 dalek doc:
21:51 dalek doc: Remove sigil from perl6 constant in accordance with the Term doc
21:51 dalek doc: review: https://github.com/perl6/doc/commit/8ed43c4db5
21:55 El_Che lizmat: I'll replace the example of https://docs.perl6.org/language/terms#Constants as it a confusing one. It defines a Pi constant while there is one in core
21:55 lizmat El_Che++
21:56 BenGoldberg joined #perl6
22:02 gfldex sena_kun: counting the examples that still fail: time find examples/ -type f -exec nohup perl6 '{}' '2>/dev/null 1>/dev/null' ';' -or -print 2>/dev/null | wc -l
22:02 dalek doc: 0397c1f | (Claudio Ramirez)++ | doc/Language/terms.pod6:
22:02 dalek doc: Choose beter constant examples (pi is alreay a builtin term)
22:02 dalek doc: review: https://github.com/perl6/doc/commit/0397c1f788
22:02 dalek doc: 2e26deb | nxadm++ | doc/Language/terms.pod6:
22:02 dalek doc: Merge pull request #821 from nxadm/master
22:02 dalek doc:
22:02 dalek doc: Choose beter constant examples (pi is alreay a builtin term)
22:02 dalek doc: review: https://github.com/perl6/doc/commit/2e26deb5d1
22:06 BenGoldberg m: (1+sqrt 5)/2.say
22:06 camelia rakudo-moar 77724b: OUTPUT«WARNINGS for <tmp>:␤Useless use of "/" in expression "(1+sqrt 5)/2.say" in sink context (line 1)␤2␤»
22:06 BenGoldberg m: ((1+sqrt 5)/2).say
22:06 camelia rakudo-moar 77724b: OUTPUT«1.61803398874989␤»
22:07 BenGoldberg m: ((1+sqrt 5)/2).Rat.say
22:07 camelia rakudo-moar 77724b: OUTPUT«1.618034␤»
22:07 BenGoldberg m: ((1+sqrt 5)/2).Rat.perl.say
22:07 camelia rakudo-moar 77724b: OUTPUT«<1597/987>␤»
22:07 BenGoldberg m: my $phi = ((1+sqrt 5)/2); ($phi - $phi.Rat).say
22:07 camelia rakudo-moar 77724b: OUTPUT«-4.59071787028975e-07␤»
22:11 BenGoldberg m: my $phi = ((1+sqrt 5)/2); ($phi - 8944394323791464/5527939700884757).say
22:11 camelia rakudo-moar c8c27e: OUTPUT«0␤»
22:12 * BenGoldberg wonders how we presently convert Num to Rat.
22:16 BenGoldberg Surely it can't be that hard, to make .Rat.Num round trip precisely.
22:19 lizmat BenGoldberg: feels to me that would require mixing in the original Rat into the Num
22:20 sena_kun gfldex, I'm fixing it in an alphabet fashion, but thanks. Much of them were fixed by signature detection, by the way.
22:27 canopus joined #perl6
22:30 BenGoldberg m: sub ratify(Num $n is copy) { my $s = sign($n) or return 0.Rat; $n .= abs; my $denom = 2**(53-log( $n, 2 ).Int); $s * ($n*$denom).Int / $denom }; say ratify(pi) - pi;
22:30 camelia rakudo-moar c8c27e: OUTPUT«0␤»
22:30 BenGoldberg m: sub ratify(Num $n is copy) { my $s = sign($n) or return 0.Rat; $n .= abs; my $denom = 2**(53-log( $n, 2 ).Int); $s * ($n*$denom).Int / $denom }; say ratify(pi).perl;
22:30 camelia rakudo-moar c8c27e: OUTPUT«3.141592653589793115997963468544185161590576171875␤»
22:30 BenGoldberg m: sub ratify(Num $n is copy) { my $s = sign($n) or return 0.Rat; $n .= abs; my $denom = 2**(53-log( $n, 2 ).Int); $s * ($n*$denom).Int / $denom }; say ratify(pi).nude;
22:30 camelia rakudo-moar c8c27e: OUTPUT«(884279719003555 281474976710656)␤»
22:35 dalek doc: fca225c | (Wenzel P. P. Peppmeyer)++ | doc/Language/containers.pod6:
22:35 dalek doc: make examples compile
22:35 dalek doc: review: https://github.com/perl6/doc/commit/fca225cb34
22:36 BenGoldberg m: sub ratify(Num $n is copy) { my $s = sign($n) or return 0.Rat; $n .= abs; my $denom = 2**(53-log( $n, 2 ).Int); $s * ($n*$denom).Int / $denom }; say ratify(pi) - pi.Rat;;
22:36 camelia rakudo-moar c8c27e: OUTPUT«-0.000000266764189185␤»
22:37 BenGoldberg m: pi.perl.say;
22:37 camelia rakudo-moar c8c27e: OUTPUT«3.14159265358979e0␤»
22:48 dalek doc: c4e3f84 | (Wenzel P. P. Peppmeyer)++ | doc/Language/contributors.pod6:
22:48 dalek doc: make examples compile
22:48 dalek doc: review: https://github.com/perl6/doc/commit/c4e3f84224
22:51 itaipu joined #perl6
23:00 skids What do we use to pass a NULL to a nativecall "int32 $foo is rw"?  "int32" does not work.
23:01 skids "Native call expected argument that references a native integer, but got P6int"
23:04 geekosaur Pointer[int32]?
23:05 sena_kun skids, I haven't used nativecall for a while, but maybe "Pointer[Int32]"? Since NULL is just a pointer. It works in my code, at least. See https://github.com/Altai-man/perl6-Compress-Bzip2-Raw/blob/master/lib/Compress/Bzip2/Raw.pm6#L7
23:06 timotimo can't have Int32, just int32
23:06 sena_kun timotimo, ah, yes, it's a typo.
23:07 skids I did already try Pointer[int32] but that gives same error message, just s/P6int/CPointer/
23:07 sena_kun And "uint32" to be precise.
23:08 sena_kun skids, do you use it as a constant or what? Can you give a piece of the actual code, please?
23:08 * skids tries to find a C stdlib with an int *
23:09 timotimo it's no longer CPointer
23:09 timotimo i think instead of Pointer.new(0) you should just pass the type object
23:09 skids right I use "Pointer[int32]", rakudo error message is "but got CPointer"
23:10 sena_kun skids, perl6 -v?
23:10 skids This is Rakudo version 2016.07.1-74-g4be4609 built on MoarVM version 2016.07-6-gfd7fe64
23:11 timotimo what's the "wanted" part before "but got CPointer"?
23:11 skids "Native call expected argument that references a native integer, but got CPointer'
23:11 timotimo oh
23:11 timotimo in that case it may be enough to use "int32 $foo is rw" in your method declaration
23:12 sena_kun skids, ah, okay. You can try to do what timotimo said then. He was too quick for me. (:
23:13 timotimo and when you have that, you just pass a "my int $foo" directly
23:13 timotimo i'm going to bed, i'm really tired
23:13 timotimo have a good one!
23:13 skids that's what I have:
23:13 skids sub xcb_connect (str $display, int32 $screen is rw --> xcb_connection_t)
23:13 sena_kun timotimo, good night!
23:19 sena_kun skids, in a repl it seems good. Without return type. Something like `sub xcb_connect(Str $dpn, int32 $screen is rw) is native("xcb", v1) { * };`. Was your problem solved?
23:21 skids no, the problem happens durin the call.
23:21 sena_kun Ah, it was expected.
23:22 sena_kun Can you provide a minimal example gist to reproduce?
23:23 skids m: sub xcb_connect(Str $dpn, int32 $screen is rw) is native("xcb", v1) { * }; xcb_connect(Str, Pointer[int32);
23:23 camelia rakudo-moar c8c27e: 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␤   …»
23:24 skids m: use NativeCall; sub xcb_connect(Str $dpn, int32 $screen is rw) is native("xcb", v1) { * }; xcb_connect(Str, Pointer[int32);
23:24 camelia rakudo-moar c8c27e: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in type parameter; couldn't find final ']' ␤at <tmp>:1␤------> 1) { * }; xcb_connect(Str, Pointer[int327⏏5);␤»
23:24 skids m: use NativeCall; sub xcb_connect(Str $dpn, int32 $screen is rw) is native("xcb", v1) { * }; xcb_connect(Str, Pointer[int32]);
23:24 camelia rakudo-moar c8c27e: OUTPUT«Native call expected argument that references a native integer, but got CPointer␤  in method CALL-ME at /home/camelia/rakudo-m-inst-1/share/perl6/sources/24DD121B5B4774C04A7084827BFAD92199756E03 (NativeCall) line 328␤  in block <unit> at <tmp> line 1…»
23:24 skids there we go
23:24 * skids builds fresh rakodu JIC.
23:27 sena_kun m: use NativeCall; sub xcb_connect(Str $dpn, int32 $screen is rw) is native("xcb", v1) { * }; my int32 $n = 0; xcb_connect("name", $n);
23:27 camelia rakudo-moar c8c27e: ( no output )
23:27 sena_kun m: use NativeCall; sub xcb_connect(Str $dpn, int32 $screen is rw) is native("xcb", v1) { * }; my int32 $n = 0; say xcb_connect("name", $n);
23:27 camelia rakudo-moar c8c27e: OUTPUT«(Mu)␤»
23:28 skids star: use NativeCall; sub xcb_connect(Str $dpn, int32 $screen is rw --> Pointer) is native("xcb") { * }; xcb_connect("0:0",uint32);
23:28 camelia star-m 2016.04: OUTPUT«Native call expected argument that references a native integer, but got P6int␤  in method CALL-ME at sources/24DD121B5B4774C04A7084827BFAD92199756E03 (NativeCall) line 301␤  in block <unit> at <tmp> line 1␤␤»
23:28 skids star: use NativeCall; sub xcb_connect(Str $dpn, int32 $screen is rw --> Pointer) is native("xcb") { * }; xcb_connect("0:0",Pointer[int32]);
23:28 camelia star-m 2016.04: OUTPUT«Native call expected argument that references a native integer, but got CPointer␤  in method CALL-ME at sources/24DD121B5B4774C04A7084827BFAD92199756E03 (NativeCall) line 301␤  in block <unit> at <tmp> line 1␤␤»
23:28 sena_kun In the examples here - https://xcb.freedesktop.org/tutorial/ they used null in both arguments, but C rules of types are loose.
23:28 geekosaur I think this si a known shortcoming of NativeCall
23:29 skids is it RTd?
23:31 sena_kun Am I the only one who didn't get it? You can't pass a type instead of a value, can you? Or I misunderstood something.
23:31 skids Passing the type is how you get a C NULL.
23:32 sena_kun skids, ah.
23:32 geekosaur I don't see it in RT. I'm sure I've seen this discussed before
23:32 sena_kun It seems I need to refresh my own knowledge of how current nativecall works before helping someone. (:
23:39 TimToady .tell killbill Try something like this: say '𝐀𝐁𝐂'.NFKD.Str === 'ABC'
23:39 yoleaux TimToady: I'll pass your message to killbill.
23:42 TEttinger joined #perl6
23:43 Actualeyes joined #perl6
23:44 johnchalekson joined #perl6
23:57 _28_ria joined #perl6

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

Perl 6 | Reference Documentation | Rakudo