Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-10-15

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:03 HoboWithAShotgun m: multi sub infix:«𝄇»(Any \obj is copy, Callable \code)  { $_ = &(code)(obj); return $_.defined ?? ($_ 𝄇 code) !! obj; }; my $c = 10; say $c :| { $_+= 2; $++ > 10 ?? Any !! $_ }; say $c;
00:03 camelia rakudo-moar bb1df2cb0: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Confused␤at <tmp>:1␤------> 3 𝄇 code) !! obj; }; my $c = 10; say $c :7⏏5| { $_+= 2; $++ > 10 ?? Any !! $_ }; say␤    expecting any of:␤        colon pair␤»
00:03 HoboWithAShotgun multi sub infix:«𝄇»(Any \obj is copy, Callable \code)  { $_ = &(code)(obj); return $_.defined ?? ($_ 𝄇 code) !! obj; }; my $c = 10; say $c 𝄇  { $_+= 2; $++ > 10 ?? Any !! $_ }; say $c;
00:03 HoboWithAShotgun m: multi sub infix:«𝄇»(Any \obj is copy, Callable \code)  { $_ = &(code)(obj); return $_.defined ?? ($_ 𝄇 code) !! obj; }; my $c = 10; say $c 𝄇  { $_+= 2; $++ > 10 ?? Any !! $_ }; say $c;
00:03 camelia rakudo-moar bb1df2cb0: OUTPUT: «34␤12␤»
00:04 HoboWithAShotgun see that second value? the LHS changes
00:04 HoboWithAShotgun that's bad
00:04 ipatrol HoboWithAShotgun: 𝄇 is an operator?
00:05 HoboWithAShotgun yes, it's defined right there
00:05 ipatrol oh, I see
00:05 HoboWithAShotgun why doesn't it obey the is copy directive?
00:13 ryn1x joined #perl6
00:13 ipatrol HoboWithAShotgun: do you know what infix:<$?> actually is?
00:15 geekosaur ipatrol, re regex adverbs, I'm pretty sure they're just reused syntax. And the root syntax isn't even 'adverb', it's 'colonpair'
00:15 ipatrol geekosaur: I thought adverb was a nickname for colon pairs
00:16 darkmorph joined #perl6
00:16 geekosaur no, adverb is one semantic use of the syntax
00:16 geekosaur m: say :a(3)
00:16 camelia rakudo-moar bb1df2cb0: OUTPUT: «Unexpected named argument 'a' passed␤  in block <unit> at <tmp> line 1␤␤»
00:16 geekosaur hm, right, thats another use :)
00:16 geekosaur m: say (:a(3))
00:16 camelia rakudo-moar bb1df2cb0: OUTPUT: «a => 3␤»
00:17 geekosaur that;s not adverbial, it's just constructing a Pair
00:17 ipatrol m: sub ident:<a> () {say 'me!';}
00:17 camelia rakudo-moar bb1df2cb0: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Cannot add tokens of category 'ident'␤at <tmp>:1␤------> 3sub ident:<a>7⏏5 () {say 'me!';}␤»
00:17 ipatrol so something of the form `name:<string>` is a token
00:17 ipatrol of some kind
00:18 geekosaur the grammar sublanguage recognizes them as such, yes
00:19 ipatrol "Identifiers can contain colon pairs. The entire colon pair becomes part of the name of the identifier."
00:20 ipatrol m: my $ident:<foo> = 'me'; say $ident:<foo>;
00:20 camelia rakudo-moar bb1df2cb0: OUTPUT: «me␤»
00:20 geekosaur right. that just discusses what an identifier can be, though; "token" is a concept of the grammar sublanguage
00:20 ipatrol geekosaur: but attempting to create a sub with a colon pair identifier is automatically construed as a token?
00:20 geekosaur specifically, how grammars will interpret (say) <term> by trying every sub term:...
00:23 geekosaur and, while in theory you could define an arbitrary name like that, the perl 6 grammar specifically treats those as tokens so that it can make use of the <term> -> try every sub starting with 'term:' bit
00:24 geekosaur which gets you a kind of extra extensibility since you don't have to mutate the grammar directly in many cases, just add a new sub term:<whatever>
00:24 ipatrol geekosaur: but as far as I know, ident is not a Perl grammar rule
00:24 geekosaur but if you define them directly via the MOP I suspect it takes them and just can't use them (unless you again access them directly the same way)
00:24 ipatrol m: sub pastry:<a> () {say 'me!';}
00:24 camelia rakudo-moar bb1df2cb0: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Cannot add tokens of category 'pastry'␤at <tmp>:1␤------> 3sub pastry:<a>7⏏5 () {say 'me!';}␤»
00:26 ryn1x joined #perl6
00:26 ipatrol m: &pastry:<a> = sub () {say 'me!';}
00:26 camelia rakudo-moar bb1df2cb0: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    pastry:<a> used at line 1␤␤»
00:26 void1 joined #perl6
00:27 ipatrol m: my &pastry:<a> = sub () {say 'me!';}
00:27 camelia rakudo-moar bb1df2cb0: ( no output )
00:27 ipatrol m: my &pastry:<a> = sub () {say 'me!';} pastry:<a>;
00:27 camelia rakudo-moar bb1df2cb0: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Strange text after block (missing semicolon or comma?)␤at <tmp>:1␤------> 3my &pastry:<a> = sub () {say 'me!';}7⏏5 pastry:<a>;␤    expecting any of:␤        infix␤        infix stopper…»
00:27 ipatrol m: my &pastry:<a> = sub () {say 'me!';}; pastry:<a>;
00:27 camelia rakudo-moar bb1df2cb0: OUTPUT: «me!␤»
00:27 ipatrol ok, so it just doesn't like regular declarations using that syntax
00:29 geekosaur right, as I said, it special cases those so it can use the way grammars match them
00:30 HoboWithAShotgun joined #perl6
00:31 ipatrol geekosaur: can I possibly override that using the dispatch keyword for protos?
00:32 geekosaur I *think* you'd have to intervene in the actual implementation of the Grammar class
00:32 HoboWithAShotgun ipatrol: no i don't know what $? is but i am eager to learn
00:32 geekosaur or possibly the Match class, which is Grammar's superclass
00:32 ipatrol HoboWithAShotgun: oh, just my meta-syntax for a variable with an arbitrary name
00:33 Cabanossi joined #perl6
00:37 HoboWithAShotgun does it have to do with is copy?
00:38 ipatrol not at all
00:39 ipatrol if it means anything else, that's my mistake
00:45 ipatrol geekosaur: is dispatch a keyword the user can access, or is it internal only?
00:50 geekosaur it's not even a keyword
00:52 geekosaur Grammars can have Actions associated with them. the way you attach an Action to a token is to define a sub dispatch:<tokenname>
00:53 geekosaur 'dispatch' is not used by itself, only by looking up these subs given a token
00:54 ipatrol geekosaur: not what I was talking about. https://design.perl6.org/S06.html#Routine_modifiers
00:56 geekosaur I don't think that got implemented that way
00:57 ipatrol geekosaur: I would guess not
00:57 geekosaur more to the point, I did a grep over the rakudo source and 'dispatch' is never used or defined in a standalone wauy
00:57 geekosaur what did get implemented is what I described, using Actions instead.
00:57 ipatrol so it's an NYI?
00:58 geekosaur design.perl6.org was an early notion of how perl 6 might be implemented.
00:58 geekosaur er, it describes, not 'was'
00:58 geekosaur it's sometimes called the 'speculations'
00:59 geekosaur as opposed to specifications
01:00 ipatrol geekosaur: and it was never replaced with anything other than an inscrutable test suite
01:00 ipatrol and docs which are never prioritized
01:03 Cabanossi joined #perl6
01:16 mempko joined #perl6
01:17 ipatrol geekosaur: do protoregexes use longest match alternation, or first match alternation?
01:19 geekosaur I am not entirely sure what you are asking, but in general longest match is preferred unless you specifically ask for something else (for example, compare || to |)
01:21 ipatrol geekosaur: https://docs.perl6.org/language/grammars#Protoregexes
01:22 ipatrol which form of alternation does the protoregex create?
01:24 geekosaur if I read that example literally then it claims it's |
01:24 geekosaur but I don't know the implementation
01:24 * geekosaur is far from expert on the details of Grammars
01:33 Cabanossi joined #perl6
01:38 bitrauser joined #perl6
01:55 ilbot3 joined #perl6
01:55 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
01:55 BenGoldberg joined #perl6
02:02 ryn1x joined #perl6
02:03 Cabanossi joined #perl6
02:06 araraloren joined #perl6
02:13 pilne joined #perl6
02:17 ggoebel joined #perl6
02:32 noganex joined #perl6
02:33 Cabanossi joined #perl6
02:36 ufobat___ joined #perl6
02:37 ryn1x joined #perl6
03:03 bloatable6 joined #perl6
03:03 nativecallable6 joined #perl6
03:03 coverable6 joined #perl6
03:03 quotable6 joined #perl6
03:03 evalable6 joined #perl6
03:03 bisectable6 joined #perl6
03:03 greppable6 joined #perl6
03:03 benchable6 joined #perl6
03:03 releasable6 joined #perl6
03:03 unicodable6 joined #perl6
03:03 squashable6 joined #perl6
03:03 statisfiable6 joined #perl6
03:06 darkmorph joined #perl6
03:06 wamba joined #perl6
03:21 Bijju joined #perl6
03:22 Bijju How to create a JAR reqivalent in perl 6 for distribution ?
03:22 Bijju can i also embed the p6 interpreter ? so that the client machine does not need p6 installation ? standalone executable with built in lib files
03:22 Bijju ?
03:23 Bijju Any help would be gr8 .. even JAR equivalent should work
03:31 mr-foobar joined #perl6
03:33 Cabanossi joined #perl6
03:40 ipatrol too late, but, I doubt it'd be possible with the current implementation
03:41 strangemk2 joined #perl6
03:47 Cabanossi joined #perl6
03:54 wander joined #perl6
03:55 aborazmeh joined #perl6
03:55 aborazmeh joined #perl6
04:03 wander ipatrol, the first match, I think
04:06 wander https://gist.github.com/W4anD0eR96/db0d6d5d7b56c07c0375877237130385
04:06 mr-foobar joined #perl6
04:07 ipatrol ok, so doesn't do what I wanted
04:13 xinming joined #perl6
04:17 Cabanossi joined #perl6
04:21 wander I'm expecting Parsing with Perl 6 Regexes and Grammars, by moritz
04:26 jeek left #perl6
04:48 stux|RC joined #perl6
04:48 napo1eon joined #perl6
04:51 strangemk2 joined #perl6
04:51 preaction joined #perl6
04:57 ryn1x I am working on the "SixFix" learn perl6 challenges and have a question. I am supposed to join an array into a string and then "make a pattern from the string". What does this mean? Make a named regex or create a grammer maybe?
04:58 ryn1x I came up with this solution, skipping that part: https://pastebin.com/Qk342DSL . What was I "supposed" to do?
05:00 chakli joined #perl6
05:02 Cabanossi joined #perl6
05:07 mr-foobar joined #perl6
05:11 void1 joined #perl6
05:16 chakli Hi guys on "http://modules.perl6.org/"  i see a few duplicate tags, like FASTCGI and FCGI, RPI,RASPBERRY PI and RAPBERRY Pi etc..
05:26 ryn1x_ joined #perl6
05:31 mempko joined #perl6
05:33 mr-fooba_ joined #perl6
05:55 evalable6 joined #perl6
06:04 andrzejku joined #perl6
06:05 committable6 joined #perl6
06:05 committable6_ joined #perl6
06:07 committable6 joined #perl6
06:09 committable6 joined #perl6
06:17 Cabanossi joined #perl6
06:21 chakli joined #perl6
06:25 ryn1x joined #perl6
06:28 strangemk2 joined #perl6
06:45 traxex_ joined #perl6
06:52 BenGoldberg joined #perl6
07:01 ryn1x joined #perl6
07:08 thunktone joined #perl6
07:12 AlexDaniel- joined #perl6
07:12 darutoko joined #perl6
07:33 domidumont joined #perl6
07:35 rindolf joined #perl6
07:35 ryn1x joined #perl6
07:39 domidumont joined #perl6
07:43 strangemk2 joined #perl6
07:55 araraloren_ joined #perl6
07:57 Zoffix joined #perl6
07:58 Zoffix chakli: that can be fixed by adding those to aliases file: https://github.com/perl6/modules.perl6.org/blob/master/tag-aliases.json#L3
07:58 Zoffix with '[REBUILD]' as the first thing in commit title when committing it
08:00 thunktone joined #perl6
08:02 Cabanossi joined #perl6
08:04 Zoffix left #perl6
08:05 void1 joined #perl6
08:13 ryn1x joined #perl6
08:17 espadrine joined #perl6
08:39 araralonre__ joined #perl6
08:41 mson joined #perl6
08:49 ryn1x joined #perl6
08:51 ChoHag That patch (https://github.com/perl6/specs/commit/1c979ab5a5c85adda27e01c22258e9217219df98 adds confusion rather than clearing it up. When I saw "ASCII quotes" I assumed (erroneously) one of ' or ", but when I saw "Texas quotes" it made me go 'wtf' and look it up and the description was amusing enough to stick.
08:51 ChoHag Since when did perl 6 become boring?
08:52 gfldex the sad part is that an americanism was replaced with American Standard Code for Information Interchange
08:53 ChoHag And if it is turning boring, « and » should be called by their proper name of guillemot.
08:53 mr-foobar joined #perl6
08:53 ChoHag Guillemets, sorry.
08:54 gfldex „“ <- we call these Gänsefüßchen
08:54 ChoHag Not least because according to wackypedia they're used in 25 locations which aren't France.
08:55 TEttinger like #perl6
08:55 ChoHag 26.
08:56 TEttinger gfldex: is that a word made from multiple sub-words?
08:56 TEttinger like Zeitgeist
08:56 gfldex yes, in german we tend to glue words together
08:56 TEttinger "time ghost"
08:57 nadim joined #perl6
08:57 ChoHag You could even say they get gefüßed.
08:57 gfldex Straßenbahnfahrscheinabverkaufsstelle is a real word
08:57 TEttinger was
08:57 TEttinger what
08:57 TEttinger why is there one ß and one ss in the same word?
08:57 ChoHag German. The only language where camel case may actually be a good idea.
08:58 HoboWithAShotgun joined #perl6
08:58 gfldex good typesetting solves that problem because we add a little extra space inbetween word parts
08:59 gfldex works quite well actually
08:59 TEttinger No results found for Straßenbahnfahrscheinabverkaufsstelle
08:59 gfldex it's any place where you can buy tram tickets
08:59 gfldex before we got vending machines for them you could buy them at all sorts of places
09:00 ChoHag What was wrong with ticket office (suitably translated)?
09:00 ChoHag Or _is_ that the suitable translations?
09:00 gfldex you could buy them in many stores where you would not expect them
09:00 TEttinger google suggests that as two words, the word for tram ticket and the word for point of sale
09:01 ChoHag Well I was going to do some coding but that patch has made me sad so I'm going to cook something instead.
09:02 Cabanossi joined #perl6
09:05 rba_ joined #perl6
09:08 geekosaur TEttinger, if I parse that correctly it's because the two s-s come from different words whereas the ß is inside one word
09:08 gfldex geekosaur: you parsed right
09:09 TEttinger ah
09:12 TEttinger wow. I was going to install some updates. nope. https://www.computerworld.com/article/3232095/microsoft-windows/microsoft-patch-problems-persist-bad-release-sequences-crm-blocks-and-more.html
09:13 gfldex found it!
09:13 gfldex Rindfleischetikettierungsüberwachungsaufgabenübertragungsgesetz
09:14 gfldex that's the longest name of any law in germany
09:16 rba joined #perl6
09:22 ryn1x joined #perl6
09:26 mr-foobar joined #perl6
09:31 rba_ joined #perl6
09:47 rba joined #perl6
09:52 mr-foobar joined #perl6
09:57 Geth ¦ whateverable/master: 4 commits pushed by (Aleks-Daniel Jakimenko-Aleksejev)++
09:57 Geth ¦ whateverable/master: 1135da5168 | Add sandbox folder to .gitignore
09:57 Geth ¦ whateverable/master: cd8c07b2c9 | Markdownify quotable output
09:57 Geth ¦ whateverable/master: 0eba779258 | Subify subprocess-commit
09:57 Geth ¦ whateverable/master: 238f6abf90 | Add Regressionable
09:57 Geth ¦ whateverable/master: review: https://github.com/perl6/whateverable/compare/cce221c01f...238f6abf90
09:57 ryn1x joined #perl6
09:58 araraloren_ joined #perl6
10:01 rba_ joined #perl6
10:02 Cabanossi joined #perl6
10:16 rba joined #perl6
10:24 mr-foobar joined #perl6
10:25 wander joined #perl6
10:31 nadim joined #perl6
10:31 rba_ joined #perl6
10:33 thunktone joined #perl6
10:35 HoboWithAShotgun m: multi sub infix:«:|»(Any \obj, WhateverCode \code) { .say }; "1" |: *.chars
10:35 camelia rakudo-moar d23a9ba9d: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Missing required term after infix␤at <tmp>:1␤------> 3bj, WhateverCode \code) { .say }; "1" |:7⏏5 *.chars␤    expecting any of:␤        colon pair␤»
10:35 ryn1x joined #perl6
10:36 AlexDaniel- HoboWithAShotgun: makes sense?
10:36 AlexDaniel- HoboWithAShotgun: it's :| vs |:
10:38 wander m: multi sub infix:«:|»(Any \obj, WhateverCode \code) { .say }; "1" :| *.chars
10:38 camelia rakudo-moar d23a9ba9d: ( no output )
10:39 HoboWithAShotgun see? the op code doesnt execute
10:39 HoboWithAShotgun but if i do
10:40 HoboWithAShotgun m: 1 |: *.foo
10:40 camelia rakudo-moar d23a9ba9d: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Missing required term after infix␤at <tmp>:1␤------> 1 |:7⏏5 *.foo␤    expecting any of:␤        colon pair␤»
10:41 HoboWithAShotgun and it doesnt throw a signature error either
10:41 HoboWithAShotgun so, WTF?
10:45 notbenh joined #perl6
10:46 rba joined #perl6
10:47 wamba joined #perl6
11:02 rba_ joined #perl6
11:16 margeas joined #perl6
11:16 rba joined #perl6
11:17 Cabanossi joined #perl6
11:23 mr-foobar joined #perl6
11:31 rba_ joined #perl6
11:42 * AlexDaniel- looks at https://raw.githubusercontent.com/easysid/bitmap-fonts/master/screenshots/lemon-10.png
11:43 AlexDaniel- it feels like tiny fonts have bad long-term effects on eyes, but the convenience overweights potential blindness…
11:44 MasterDuke AlexDaniel-: do you have a high-dpi screen?
11:45 AlexDaniel- MasterDuke: no
11:46 AlexDaniel- which is why I like bitmap fonts, they're much more crips
11:46 AlexDaniel- crisp
11:46 rba joined #perl6
11:47 MasterDuke i feel like a bloods pun is in order, but it goes beyond my early morning ability to make one about fonts
11:53 mr-foobar joined #perl6
11:54 MasterDuke .tell ryn1x it probably means something like 'my $terms-regex = rx/$terms/;' and then 'my $matching-line-number = $contents.lines.first($terms-regex, :k) + 1;'
11:54 yoleaux MasterDuke: I'll pass your message to ryn1x.
11:56 AlexDaniel- .oO( this is great but what about emoji? :) https://raw.githubusercontent.com/josuah/miniwi/master/screenshot.png )
11:56 HoboWithAShotgun joined #perl6
11:57 Ulti /win 4
11:59 timotimo hey, why did that not trigger the lottery thing?
12:00 AlexDaniel- u: 
12:00 unicodable6 AlexDaniel-, U+007F <control-007F> [Cc] (control character)
12:00 AlexDaniel- it had these
12:01 timotimo that should still count, imo
12:01 AlexDaniel- sure
12:01 AlexDaniel- /win test
12:01 AlexDaniel- /win 4
12:01 buggable AlexDaniel-, Thank you for entering Accidental /win Lottery! The next draw will happen in 2 weeks, 2 days, 11 hours, 58 minutes, and 33 seconds
12:01 rba_ joined #perl6
12:01 AlexDaniel- buggable: source
12:01 buggable AlexDaniel-, See: https://github.com/zoffixznet/perl6-buggable
12:02 AlexDaniel- https://github.com/zoffixznet/perl6-buggable/issues/13
12:03 jeromelanteri joined #perl6
12:05 ryn1x joined #perl6
12:07 nadim joined #perl6
12:16 rba joined #perl6
12:22 phluks_ joined #perl6
12:23 ShalokShalom_ joined #perl6
12:31 rba_ joined #perl6
12:46 rba joined #perl6
12:46 telex joined #perl6
12:54 mr-foobar joined #perl6
13:01 rba_ joined #perl6
13:02 Cabanossi joined #perl6
13:10 kaare_ joined #perl6
13:16 rba joined #perl6
13:20 pilne joined #perl6
13:28 mr-foobar joined #perl6
13:31 rba_ joined #perl6
13:32 Cabanossi joined #perl6
13:40 ryn1x joined #perl6
13:40 cdg joined #perl6
13:46 darkmorph joined #perl6
13:46 rba joined #perl6
13:54 mr-foobar joined #perl6
14:02 rba_ joined #perl6
14:02 Cabanossi joined #perl6
14:08 cdg joined #perl6
14:17 rba joined #perl6
14:19 mr-fooba_ joined #perl6
14:20 mingdao joined #perl6
14:31 rba_ joined #perl6
14:42 eliasr joined #perl6
14:47 rba joined #perl6
14:48 setty1 joined #perl6
14:58 zakharyas joined #perl6
15:01 rba_ joined #perl6
15:03 ryn1x joined #perl6
15:14 andrzejku joined #perl6
15:15 andrzejku joined #perl6
15:16 mingdao joined #perl6
15:17 andrzejku joined #perl6
15:17 Cabanossi joined #perl6
15:20 rindolf joined #perl6
15:22 ryn1x joined #perl6
15:27 ChoHag joined #perl6
15:47 quotable6 joined #perl6
15:47 coverable6 joined #perl6
15:47 nativecallable6 joined #perl6
15:47 evalable6 joined #perl6
15:47 bloatable6 joined #perl6
15:47 greppable6 joined #perl6
15:47 committable6 joined #perl6
15:47 unicodable6 joined #perl6
15:47 benchable6 joined #perl6
15:47 releasable6 joined #perl6
15:47 bisectable6 joined #perl6
15:47 squashable6 joined #perl6
15:48 darkmorph joined #perl6
15:58 skids joined #perl6
16:01 buggable joined #perl6
16:08 Zoffix joined #perl6
16:09 Zoffix .tell HoboWithAShotgun your WhateverCode is closing over your op. So you're not calling it ever. You're just making one WhateverCode in sink context. If you want just .chars to be the WhateverCode use parens: sub infix:«:|»(Any \obj, WhateverCode \code) { dd 423 }; "1" :| ((*.chars))
16:09 yoleaux Zoffix: I'll pass your message to HoboWithAShotgun.
16:11 Zoffix .tell HoboWithAShotgun also awhile back you said `\foo is copy` was copying something... `\foo` means "is raw". Not sure `is copy` even makes sense on it (so compiler might wanna be made to throw there). Use `$foo is copy` or whatever if you want a copied container.
16:11 yoleaux Zoffix: I'll pass your message to HoboWithAShotgun.
16:14 thunktone joined #perl6
16:15 cdg joined #perl6
16:15 Zoffix ChoHag: we changed "Texas" to "ASCII" not to have "perl6 turning boring" but to avoid ingraining language terminology that is based on cultural stereotypes. This happened after people extended the "Texas" naming to call Unicode ops "Mexico" ops because it's opposite Texas: RT#132179
16:15 synopsebot RT#132179 [resolved]: https://rt.perl.org/Ticket/Display.html?id=132179 Don't put Mexico and Texas in opposition in Perl 6 jargon
16:16 Zoffix Control chars now accepted in lottery strings
16:16 Zoffix left #perl6
16:17 Cabanossi joined #perl6
16:19 pmurias joined #perl6
16:21 HoboWithAShotgun joined #perl6
16:22 domidumont joined #perl6
16:22 rba joined #perl6
16:23 thunktone joined #perl6
16:25 andrzejku joined #perl6
16:30 ryn1x joined #perl6
16:32 rba_ joined #perl6
16:39 ChoHag That sounds rather boring to me.
16:46 mempko joined #perl6
16:48 ryn1x .tz
16:48 yoleaux 11:54Z <MasterDuke> ryn1x: it probably means something like 'my $terms-regex = rx/$terms/;' and then 'my $matching-line-number = $contents.lines.first($terms-regex, :k) + 1;'
16:48 yoleaux ryn1x: I don't currently have a timezone preference set for you.
16:53 ryn1x .tz America/Denver
16:53 yoleaux ryn1x: Changed your timezone to America/Denver. (Current date and time: 2017-10-15 10:53:26)
16:59 ugexe is there a proper way to get specific elements (like subscript `[2,3,4]`) with a pipe operator? e.g. `(1..10) ==> grep { .so } ==> grep { 2 <= $++ <= 4 }` but safe if pipe operators happen to parallelize in the future
17:06 ugexe feed operator^
17:07 timotimo m: <foo bar baz quux> ==> .[2,3] ==> say
17:07 camelia rakudo-moar d23a9ba9d: OUTPUT: «5===SORRY!5===␤Argument to "say" seems to be malformed␤at <tmp>:1␤------> 3<foo bar baz quux> ==> .[2,3] ==> say7⏏5<EOL>␤Only routine calls or variables that can '.push' may appear on either side of feed operators.␤at <tmp>:1␤---…»
17:07 timotimo m: <foo bar baz quux> ==> .[2,3] ==> say()
17:07 camelia rakudo-moar d23a9ba9d: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Only routine calls or variables that can '.push' may appear on either side of feed operators.␤at <tmp>:1␤------> 3<foo bar baz quux> ==> 7⏏5.[2,3] ==> say()␤»
17:07 ugexe or even something like ^10 ==> grep { $_ > 5 } ==> head(2)
17:09 timotimo m: ((^10) ==> grep * > 5)[2,3] ==> say()
17:09 camelia rakudo-moar d23a9ba9d: OUTPUT: «(8 9)␤»
17:09 timotimo :P
17:11 ugexe yeah but the entire reason i'm even using feed operator is to line things up nicely!
17:11 timotimo aye
17:12 timotimo m: (^10) ==> &postcircumfix:<[ ]>(2, 3) ==> say()
17:12 camelia rakudo-moar d23a9ba9d: OUTPUT: «WARNINGS for <tmp>:␤Useless use of constant value [ ] in sink context (lines 1, 1)␤Index out of range. Is: 3, should be in 0..0␤  in any  at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
17:12 timotimo yeah, it'd put the array in the wrong spot in the args
17:12 timotimo or maybe it's wrong in a different way
17:13 ugexe m: ^10 ==> grep { $_ > 5 } ==> splice(2) ==> my @a; say @a.perl
17:13 camelia rakudo-moar d23a9ba9d: OUTPUT: «Type check failed in binding to parameter '@arr'; expected Positional but got Int (2)␤  in any  at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
17:14 timotimo yeah, having the data put in as a slurpy at the end doesn't make this much easier
17:14 timotimo you can define you rown sub, that'll give you the line-up stuff at least
17:16 timotimo m: sub takethese(@indices, *@values) { @values.[@indices] }; ^10 ==> takethese [2, 4] ==> say()
17:16 camelia rakudo-moar d23a9ba9d: OUTPUT: «(2 4)␤»
17:16 timotimo m: sub takethese(@indices, *@values) { @values.[@indices] }; <foo bar baz quux blorp> ==> takethese [3, 1, 4, 1] ==> say()
17:16 camelia rakudo-moar d23a9ba9d: OUTPUT: «(quux bar blorp bar)␤»
17:16 ugexe another observation is it might be nice to have something like |==> or some such to reifiy/eager the list up until that point and cache, instead of having to do the ==> my @foo; @foo ==> ...
17:17 okl joined #perl6
17:17 Cabanossi joined #perl6
17:18 timotimo kind of the opposite of ==>>
17:18 ugexe yeah
17:19 timotimo this is what was called "silo" at one point during the GLR
17:19 Cabanossi joined #perl6
17:19 ugexe the feed operators?
17:20 ugexe or the concept of that refification point
17:20 timotimo no, the "gather all data, then continue"
17:20 timotimo fwiw, the "takethese" sub will silo up the data by virtue of postcircumfix:<[ ]> doing that
17:21 ugexe hmmm couldnt I inline a sub/block in the pipeline itself?
17:22 timotimo oh, hm, that sounds like something you should be able to do
17:23 timotimo will have to have the signature right, of course
17:24 ugexe m: ^10 ==> grep { $_ > 1 } ==> (sub (@indices, *@values) { @values.[@indices] })([2,3,4]) ==> my @a; say @a.perl
17:24 camelia rakudo-moar d23a9ba9d: OUTPUT: «[4, 5, 6]␤»
17:25 BenGoldberg joined #perl6
17:25 kyan joined #perl6
17:25 ugexe of course i still wonder if this fits with the idealistic implementation of feeds
17:26 timotimo right
17:27 ugexe if i understand it correctly though it seems like ==> could be like hyper/race
17:28 timotimo a little bit; it's supposed to run each block in its own worker thread and have them communicate with channels
17:28 timotimo m: ^10 ==> grep { $ > 1 } ==> -> *@v { @v[2,3,4] } ==> my @a; say @a.perl
17:28 camelia rakudo-moar d23a9ba9d: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Only routine calls or variables that can '.push' may appear on either side of feed operators.␤at <tmp>:1␤------> 3^10 ==> grep { $ > 1 } ==> 7⏏5-> *@v { @v[2,3,4] } ==> my @a; say @a.p␤»
17:28 timotimo m: ^10 ==> grep { $ > 1 } ==> (-> *@v { @v[2,3,4] }) ==> my @a; say @a.perl
17:28 camelia rakudo-moar d23a9ba9d: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Only routine calls or variables that can '.push' may appear on either side of feed operators.␤at <tmp>:1␤------> 3^10 ==> grep { $ > 1 } ==> 7⏏5(-> *@v { @v[2,3,4] }) ==> my @a; say @a␤»
17:28 timotimo :(
17:28 timotimo m: ^10 ==> grep { $ > 1 } ==> (-> *@v { @v[2,3,4] })() ==> my @a; say @a.perl
17:28 camelia rakudo-moar d23a9ba9d: OUTPUT: «Use of uninitialized value of type Any in numeric context␤[Any, Any, Any]␤  in block  at <tmp> line 1␤Use of uninitialized value of type Any in numeric context␤  in block  at <tmp> line 1␤Use of uninitialized value of type Any in numeric con…»
17:29 timotimo m: ^10 ==> grep { $ > 1 } ==> (-> $, *@v { @v[2,3,4] })(1) ==> my @a; say @a.perl
17:29 camelia rakudo-moar d23a9ba9d: OUTPUT: «Use of uninitialized value of type Any in numeric context␤[Any, Any, Any]␤  in block  at <tmp> line 1␤Use of uninitialized value of type Any in numeric context␤  in block  at <tmp> line 1␤Use of uninitialized value of type Any in numeric con…»
17:32 ugexe m: ^10 ==> grep { $_ > 1 } ==> (-> $i, *@v { @v[|$i] })([1,2,3]) ==> my @a; say @a.perl
17:32 camelia rakudo-moar d23a9ba9d: OUTPUT: «[3, 4, 5]␤»
17:33 ugexe s/$/$_/
17:33 timotimo but why?
17:34 ugexe m: (1,2,3).grep: { say $ }
17:34 camelia rakudo-moar d23a9ba9d: OUTPUT: «(Any)␤(Any)␤(Any)␤»
17:34 timotimo but i didn't use $ in there at all?
17:34 timotimo only in the signature?
17:34 ugexe the grep
17:34 timotimo oh!
17:34 timotimo i was looking in the absolute wrong spot
17:45 evalable6 joined #perl6
17:45 statisfiable6 joined #perl6
17:50 Geth ¦ ecosystem: holli-holzer++ created pull request #375: Add Operator::grandpa
17:50 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/pull/375
18:02 Cabanossi joined #perl6
18:04 Geth ¦ ecosystem: ff4c543b89 | holli-holzer++ (committed by Zoffix Znet) | META.list
18:04 Geth ¦ ecosystem: Add Operator::grandpa (#375)
18:04 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/ff4c543b89
18:18 Morfent joined #perl6
18:26 cdg joined #perl6
18:28 ufobat i am just playing around with IO::Socket::Async::SSL, and i am wondering how error handling works. I've written a server similar to the one in the example amd whenever the client does something wrong regarding TLS for example, the server crashes with "Tried to get the result of a broken Promise" reported in the "react {" line
18:28 mempko joined #perl6
18:29 timotimo you can have a QUIT { } block inside a whenever that gets called when the thing you're whenevering has an exception
18:29 timotimo if i'm not mistaken
18:30 HoboWithAShotgun or you catch the error and emit something special to the consumer if neccessary
18:30 yoleaux 16:09Z <Zoffix> HoboWithAShotgun: your WhateverCode is closing over your op. So you're not calling it ever. You're just making one WhateverCode in sink context. If you want just .chars to be the WhateverCode use parens: sub infix:«:|»(Any \obj, WhateverCode \code) { dd 423 }; "1" :| ((*.chars))
18:30 yoleaux 16:11Z <Zoffix> HoboWithAShotgun: also awhile back you said `\foo is copy` was copying something... `\foo` means "is raw". Not sure `is copy` even makes sense on it (so compiler might wanna be made to throw there). Use `$foo is copy` or whatever if you want a copied container.
18:30 timotimo if you catch it with a CATCH outside, the whole react will be torn down, whereas you can do fine-grained per-whenever stuff with QUIT
18:31 timotimo i'm fuzzy on the details
18:31 ufobat the QUIT didnt work :(
18:31 timotimo then i'm wrong! :)
18:31 ufobat CATCH outside? with try?
18:31 timotimo have you looked at jnthn's supplies talk?
18:31 Aaronepower joined #perl6
18:32 ufobat try {CATCH { ... }  react { ... }} like that?
18:32 ufobat no not right now
18:32 Cabanossi joined #perl6
18:32 timotimo the one that introduced cro was quite good, from the SPW
18:34 ufobat I viewed this one half, then i got sick for 2 days :( (not because of the talk of course)
18:34 timotimo yeah, that would be a pretty strong impact for a talk to have
18:34 spider-mario joined #perl6
18:36 ufobat i am having no clue but, one thing confuses me.  if the error handling is supposed to be outside of the react block and a react block can hat several whenever's in it, doing completly different stuff..
18:36 ufobat how can you easily know which one caused the troubles
18:38 ufobat well the try catch outside caught the error but the react block is terminated as well. :/
18:38 * ufobat is going to watch the talk now
18:42 rindolf joined #perl6
18:42 gfldex ufobat: I had the same problem with the golfed httpd and adding loads of `try` until the error went away help to narrow down the cause.
18:42 nebuchadnezzar joined #perl6
18:43 Geth ¦ DBIish: ecdf870494 | (Jonathan Stowe)++ | lib/DBDish/mysql.pm6
18:43 Geth ¦ DBIish: Make the arguments to MySQL connect explicitly typed
18:43 Geth ¦ DBIish:
18:43 Geth ¦ DBIish: This makes the message more obvious when the user makes a mistake
18:43 Geth ¦ DBIish: with the arguments.
18:43 Geth ¦ DBIish:
18:43 Geth ¦ DBIish: Closes #105
18:43 Geth ¦ DBIish: review: https://github.com/perl6/DBIish/commit/ecdf870494
18:43 Geth ¦ DBIish: c9fb7dde55 | (Jonathan Stowe)++ | 2 files
18:43 Geth ¦ DBIish: Up version
18:43 Geth ¦ DBIish: review: https://github.com/perl6/DBIish/commit/c9fb7dde55
18:47 ufobat gfldex, the error went went away?
18:51 Rawriful joined #perl6
19:01 gfldex ufobat: I actually had a bug in my code that was hard to spot. So it didn't went away by itself.
19:01 HoboWithAShotgun zoffix: I merged your fixes. Thanks for taking the time.
19:04 ufobat ah :-) but for your example it works as expected if you http onto a https server?
19:05 u-ou joined #perl6
19:05 ryn1x joined #perl6
19:06 gfldex ufobat: this may be helpful https://gist.github.com/gfldex/044cdfa4e6bdf680c9a22e39e7b95e23
19:07 gfldex ufobat: I sticked `try` in from of the lines that start with `@msg.push:` to try and error my way to the root cause.
19:14 ufobat thanks :)
19:17 ryn1x joined #perl6
19:24 mr-foobar joined #perl6
19:40 wander joined #perl6
19:43 wander_ joined #perl6
19:49 ufobat only the try outside of the react {} is catching it.. i am doing something wrong :-(
19:50 gfldex ufobat: maybe you want to put the source on the intarwebs so you can laugh … err … help you
19:51 gfldex :->
19:51 ufobat okay :D
19:51 ufobat i am afraid ;)
19:52 wander joined #perl6
19:53 wander doc of functions says `Introspection on subroutines is provided via Routine.'
19:53 wander whlie
19:53 wander m: sub f { }; &f.^name.say
19:53 camelia rakudo-moar 1706194c7: OUTPUT: «Sub␤»
19:53 gfldex m: say Sub ~~ Routine;
19:53 camelia rakudo-moar 1706194c7: OUTPUT: «True␤»
19:54 gfldex m: say Method ~~ Routine;
19:54 camelia rakudo-moar 1706194c7: OUTPUT: «True␤»
19:54 wander m: Routine ~~ Sub
19:54 camelia rakudo-moar 1706194c7: ( no output )
19:54 ufobat gfldex,  https://github.com/ufobat/HTTP-Server-Ogre/blob/http2/lib/HTTP/Server/Ogre.pm6#L86
19:54 wander m: say Routine ~~ Sub
19:54 camelia rakudo-moar 1706194c7: OUTPUT: «False␤»
19:55 wander or i'm misunderstanding what `introspection' means
19:56 kurahaupo left #perl6
20:01 gfldex ufobat: what is the error message you get?
20:02 ufobat just a warning 1 error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number
20:02 ufobat in block  at /home/martin/.workspace/p6/Bailador/examples/https/../../../HTTP-Server-Ogre/lib/HTTP/Server/Ogre.pm6 (HTTP::Server::Ogre) line 85
20:02 ryn1x joined #perl6
20:02 ufobat i am doing http on the https server
20:02 ufobat without that try catch i am getting ..
20:03 ufobat Tried to get the result of a broken Promise in method run ... line 84
20:04 gfldex ufobat: try to output `.backtrace`
20:06 ugexe are you sure you dont mean to use QUIT { } instead of CATCH { }
20:07 ufobat i dont know?
20:08 gfldex ufobat: a CATCH block with a default will handle the exception and the program will just contine. That's why the promise is reported as broken.
20:09 TEttinger joined #perl6
20:11 ufobat i dont understand :(
20:17 ufobat shoudn't the `whenever $listener -> $conn` throw the exception so i should be able to catch it around this one?
20:19 gfldex ufobat: very unlikely, there Failure will come from lines that call Routines outside the react block
20:19 timotimo no, CATCH is for handling "local" problems whereas QUIT is for handling "remote" problems
20:21 ufobat the error itself is from here  (IO::Socket::Async::SSL) line 525
20:22 timotimo m: sub setup-some-listenable() { die "oh no, it didn't work" }; react { whenever setup-some-listenable { QUIT { say "quit inside whenever" }; CATCH { "catch inside whenever" } }; QUIT { say "quit outside whenever" }; CATCH { say "catch outside whenever" } }
20:22 camelia rakudo-moar 1706194c7: OUTPUT: «5===SORRY!5===␤Function 'setup-some-listenable' needs parens to avoid gobbling block␤at <tmp>:1␤------> 3" }; CATCH { "catch inside whenever" } }7⏏5; QUIT { say "quit outside whenever" }; ␤Missing block (apparently claimed by 'setup-…»
20:23 timotimo m: sub setup-some-listenable() { die "oh no, it didn't work" }; react { whenever setup-some-listenable() { QUIT { say "quit inside whenever" }; CATCH { "catch inside whenever" } }; QUIT { say "quit outside whenever" }; CATCH { say "catch outside whenever" } }
20:23 camelia rakudo-moar 1706194c7: OUTPUT: «catch outside whenever␤An operation first awaited:␤  in block <unit> at <tmp> line 1␤␤Died with the exception:␤    oh no, it didn't work␤      in sub setup-some-listenable at <tmp> line 1␤      in block <unit> at <tmp> line 1␤␤»
20:23 ufobat the QUIT within the whenever $listener -> $conn gets called with that error
20:23 timotimo m: sub setup-some-listenable() { supply { die "oh no, it didn't work" } }; react { whenever setup-some-listenable() { QUIT { say "quit inside whenever" }; CATCH { "catch inside whenever" } }; QUIT { say "quit outside whenever" }; CATCH { say "catch outside whenever" } }
20:23 camelia rakudo-moar 1706194c7: OUTPUT: «quit inside whenever␤An operation first awaited:␤  in block <unit> at <tmp> line 1␤␤Died with the exception:␤    oh no, it didn't work␤      in block <unit> at <tmp> line 1␤␤»
20:23 timotimo ufobat: maybe these two examples clarify things a tiny bit?
20:25 mr-foobar joined #perl6
20:26 ufobat ah
20:27 ufobat then my last stupid question maybe, the $_ in QUIT is failure and i just need to handle it in order to keep my program up and running?
20:33 ufobat nope :(
20:33 darkmorph joined #perl6
20:34 MasterDuke joined #perl6
20:39 wander joined #perl6
20:39 gigavinyl joined #perl6
20:39 |oLa| joined #perl6
20:40 wander how about macro in perl6?
20:40 timotimo wander: we have experimental "old-style" macros that aren't feature-complete and will be replaced completely, and you can define a slang to change parsing however you want
20:40 ryn1x joined #perl6
20:40 gigavinyl left #perl6
20:41 wander m: constant aname = 'foo'; sub ::(aname) { say 'bar' }; foo.say;
20:41 camelia rakudo-moar 1706194c7: OUTPUT: «bar␤True␤»
20:44 wander any usage of macro?
20:48 MasterDuke greppable6: macro
20:48 greppable6 MasterDuke, https://gist.github.com/6d3e24427e9d2749b35c041dfcc56200
20:49 MasterDuke greppable6: ' macro '
20:49 greppable6 MasterDuke, Found nothing!
20:52 mr-foobar joined #perl6
20:55 timotimo wander: on github you can find "007" which is the project in which masak is figuring out exactly how perl6 macros should work and be implemented
20:56 timotimo https://github.com/masak/007 i believe
20:56 wander k
21:01 timotimo it's its own language and compiler, though
21:01 timotimo i don't think there's a way to mix 007 and perl6 code
21:01 tyil yet
21:01 buggable New CPAN upload: App-Bob-0.5.1.tar.gz by TYIL https://cpan.metacpan.org/authors/id/T/TY/TYIL/Perl6/App-Bob-0.5.1.tar.gz
21:02 tyil aww yis
21:03 timotimo what does bob do?
21:03 timotimo ugh, modules.perl6.org/repo/App::Bob gives me the cpan zip file, not the repo
21:05 tyil timotimo: its intended to help making new modules, set up the directories, create a META6.json, make dists and upload them
21:05 tyil add dependencies to the META6 without having to manually edit, or add new files without having to edit the META6
21:06 tyil I'm looking for the best module to send a http form encoded post request with http credentials to PAUSE
21:06 tyil https://github.com/scriptkitties/perl6-App-Bob is the source repo
21:07 tyil (I didn't like mi6, since upload never worked for me, so I'm trying to make my own alternative for it with some additions to make my life easier)
21:08 tyil once I get a v1.0.0 I'll add a tutorial on my site, guiding a new user through the entire process of making a new module, adding some files, depending on something else, packaging it up and possibly releasing it on CPAN
21:09 gfldex tyil: you want to look at META6::bin for features to steal
21:09 tyil nice
21:10 tyil yours basically does most of the local stuff I want bob to do
21:11 tyil fork and pr commands might be a nice bonus after 1.0.0
21:12 AlexDaniel- MasterDuke: fwiw I think you wanted \bmacro\b
21:13 ryn1x joined #perl6
21:14 MasterDuke AlexDaniel-: yeah, i couldn't remember whether it is Perl 5 or 6 style (and then i got distracted)
21:15 konsolebox joined #perl6
21:18 gfldex tyil: github tends to timeout. You may want to handle that early on or you get really odd errors.
21:19 tyil gfldex: I'll focus on getting the features I wanted and make a tutorial available
21:19 tyil partly because I want to be able to use it to deal with all my module building needs
21:19 tyil partly because its good for my ego to see my name appear in the p6 weekly all the time :p
21:28 cdg joined #perl6
21:32 bitrauser joined #perl6
21:42 mson joined #perl6
21:47 cdg joined #perl6
21:50 BenGoldberg joined #perl6
21:51 ryn1x joined #perl6
21:55 mr-foobar joined #perl6
21:57 MasterDuke_ joined #perl6
21:59 tyil http://modules.perl6.org/dist/App::Bob:cpan:TYIL, this shows there's two dists, both by me, both from cpan, is this because I have multiple versions available on cpan right now?
22:01 timotimo i see it show up twice in the "from:cpan" search, too
22:02 Cabanossi joined #perl6
22:03 tyil it is technically correct, since v0.2.2 and v0.5.1 are both available on CPAN atm
22:03 tyil but I'm not sure this is the intended effect
22:15 ufobat could anyone send me PR with a fix that dosn't shut down the hole server as soon as HTTP traffice arives for https://github.com/ufobat/HTTP-Server-Ogre/blob/http2/https/certs/simple-server.pl6
22:15 ufobat i am to stupid :( i cant get it work
22:16 ufobat sorry and thankyou and good night :(
22:17 Mrofnet joined #perl6
22:18 kurahaupo_ joined #perl6
22:18 HoboWithAShotgun what is the correct way to write a getter/setter pair properly by hand?
22:19 kurahaupo_ joined #perl6
22:20 HoboWithAShotgun most importantly, how do i do actually what  the docs say is possible: Methods can return mutable containers, in which case you can assign to the
22:20 HoboWithAShotgun return value of a method call.
22:20 Zoffix joined #perl6
22:21 * HoboWithAShotgun hands cate to zoffix++
22:21 HoboWithAShotgun *cake
22:21 Geth ¦ modules.perl6.org: 6e90124ead | (Zoffix Znet)++ (committed using GitHub Web editor) | use-me-for-commit-triggers
22:21 Geth ¦ modules.perl6.org: [REBUILD] to clear buggy CPAN cache
22:21 Geth ¦ modules.perl6.org: review: https://github.com/perl6/modules.perl6.org/commit/6e90124ead
22:22 AlexDaniel- HoboWithAShotgun: maybe this is what you need? https://docs.perl6.org/type/Proxy
22:22 AlexDaniel- just guessing, I don't really know
22:22 Zoffix tyil: yeah, it's due to second version. The bug is due to cache clearer clearing by meta URL and I think CPAN metas still have version in them. Gonna take a look on Tuesday, unless I forget or someone beats me to it
22:23 tyil Zoffix: alright, awesome!
22:23 HoboWithAShotgun boy, that's ugly
22:24 Zoffix m: class Foo { has $!bar; method bar is rw { $!bar } }; with Foo.new { .bar = 42; say .bar; .bar = 70; say .bar }
22:24 camelia rakudo-moar e52c8affa: OUTPUT: «42␤70␤»
22:24 Zoffix HoboWithAShotgun: ^ that's another way
22:24 Zoffix left #perl6
22:25 mr-foobar joined #perl6
22:25 HoboWithAShotgun ^^
22:27 HoboWithAShotgun m: class Foo { has $!bar; method bar is rw { return $!bar } }; with Foo.new { .bar = 42; say .bar; .bar = 70; say .bar }
22:27 camelia rakudo-moar e52c8affa: OUTPUT: «Cannot assign to a readonly variable or a value␤  in block <unit> at <tmp> line 1␤␤»
22:27 ryn1x joined #perl6
22:27 HoboWithAShotgun ?? why does "return" break it?
22:30 Zoffix joined #perl6
22:30 Zoffix HoboWithAShotgun: you're meant to use return-rw to return writable containers
22:30 HoboWithAShotgun uh, right
22:30 Zoffix left #perl6
22:31 MasterDuke joined #perl6
22:35 HoboWithAShotgun can you have mutable sigil-less variables?
22:39 AlexDaniel- not really, that's the whole point of sigilless vars
22:39 AlexDaniel- at least that's what I thought
22:41 HoboWithAShotgun yes, they "do not create containers"
22:42 Miller joined #perl6
22:43 Miller Hello
22:44 HoboWithAShotgun Miller! You here??
22:45 AlexDaniel- o/
22:45 HoboWithAShotgun How ya been dude? How's Danielle and the kids? All good?
22:48 kurahaupo joined #perl6
22:50 cdg joined #perl6
22:54 mr-foobar joined #perl6
23:00 BenGoldberg m: say 0 ** 0
23:00 camelia rakudo-moar e52c8affa: OUTPUT: «1␤»
23:01 AlexDaniel- hmmm…
23:02 Cabanossi joined #perl6
23:03 AlexDaniel- BenGoldberg: same behavior in other languages so I guess it's ok, but it's still weird
23:03 BenGoldberg m: say one(0, 1, NaN)
23:03 camelia rakudo-moar e52c8affa: OUTPUT: «one(0, 1, NaN)␤»
23:04 mmcclimon joined #perl6
23:04 BenGoldberg m: say 0/0
23:04 camelia rakudo-moar e52c8affa: OUTPUT: «Attempt to divide by zero using div␤  in block <unit> at <tmp> line 1␤␤»
23:05 BenGoldberg m: say <0/0>
23:05 camelia rakudo-moar e52c8affa: OUTPUT: «Attempt to divide by zero using div␤  in block <unit> at <tmp> line 1␤␤»
23:05 BenGoldberg m: say 0e0/0e0
23:05 camelia rakudo-moar e52c8affa: OUTPUT: «Attempt to divide by zero using /␤  in block <unit> at <tmp> line 1␤␤»
23:06 kurahaupo_ joined #perl6
23:06 * BenGoldberg wonders why those don't produce NaN
23:06 kurahaupo_ joined #perl6
23:07 kurahaupo_ joined #perl6
23:09 kurahaupo joined #perl6
23:12 geekosaur the first two don't because NaN is specific to IEEE floating point, but those are Rats. the third looks to me like a bug
23:16 geekosaur 0 ** 0 behavior: https://www.math.hmc.edu/funfacts/ffiles/10005.3-5.shtml http://mathforum.org/dr.math/faq/faq.0.to.0.power.html
23:20 geekosaur ...and since you are often dealing with numerical methods / approximate results via application of limits when you run into it, 1 is the most useful value because it agrees with the expected result per theory of limits
23:21 cdg joined #perl6
23:27 kurahaupo joined #perl6
23:27 mr-foobar joined #perl6
23:29 cdg joined #perl6
23:32 tyil I'm trying to upload a file to PAUSE using a HTTP POST request, code https://cry.nu/p/778z/ (around the bottom, denoted with "# this thing here")
23:32 tyil but I'm getting an error in the module I'm using to do the request (HTTP::Client), giving the following error
23:33 tyil Cannot use a Buf as a string, but you called the Stringy method on it
23:33 tyil the offending line in the module would be https://github.com/supernovus/perl6-http-client/blob/master/lib/HTTP/Client/Request.pm6#L218
23:33 tyil could I fix this in my module somehow by altering the input I give to the module, or is this a bug in the module
23:38 geekosaur you would have to work around it by encoding the file to a string representation and adding a header indicating which encoding. HTTP::Client claims to support binary and tries to, but it's doing it wrong
23:40 geekosaur (and its developer is going to have to think a bit hrder if they intend to do binary support properly, since they seem to have assumed that Strs are perfectly fine containers for binary data.)
23:41 ugexe fine for headers at least
23:41 geekosaur tl;dr: if it hadn't crashed there, it would likely have produced garbage)
23:42 geekosaur right, but it's concatenating the supplied binary data (the POST's content)  and a final CRLF into a Str. which will treat it as Unicode in NFG and do things like trying to normalize it
23:45 ugexe ah i thought it was only concating 2 bufs or 2 strings, not one of each
23:47 geekosaur yeh, it's building an http request in a Str. I'd argue that's wrong from the very start; it should be using a buf8, any Str-s put into it should be encoded *as specified by encoding headers* or otherwise .. pedantically ought to reject but practically likely needs to use iso8859-1
23:48 geekosaur more programmers who think encodings magically deal with themselves :(
23:51 geekosaur tyil, anyway you should probably file a bug including what the above about using a buf8 against HTTP::Client. but that won't help you now; if you have to use that client the only safe way to do so with binary data is to base64-encode or otherwise make the data text-safe, and specify a Content-Transfer-Encoding header with the encoding
23:51 tyil geekosaur: can I do that by simply using :utf8 instead of :bin?
23:52 geekosaur NO
23:52 tyil thats a big no
23:52 geekosaur you're making exactluy the same mistake the author of HTTP::Client did
23:52 geekosaur that will CORRUPT binary data
23:52 tyil Iwas considering using base64 first
23:52 tyil but The Internet convinced me that was bad too
23:52 b2gills .tell lizmat I recommend just indenting code blocks by 4 spaces on StackOverflow (along with one 「<!-- language-all: lang-perl6 -->」 at the top of Perl 6 posts) https://stackoverflow.com/posts/46742643/revisions
23:52 b2gills .tell lizmat Also it might be a good idea to add one or more OpenID logins to maintain control over your answers.
23:52 yoleaux b2gills: I'll pass your message to lizmat.
23:52 yoleaux b2gills: I'll pass your message to lizmat.
23:53 geekosaur it's not great, but when the library you are using is going to corrupt binaru data you either need to find a non-broken library or base64 to work around the brokenness
23:53 evalable6 joined #perl6
23:53 geekosaur or accept that binary data will sometimes get trashed
23:54 tyil I've looked at other libs, but documentation is either lacking or they really dont implement the things I want (setting headers, adding a tarbal to the request)
23:55 tyil I could depend on curl being available and let that handle the upload :'D
23:57 geekosaur that might be your best bet. I'd still file the bug; this is a trap that's going to bite someone eventually
23:58 geekosaur sadly, encodings are a sewer and, while it might be possible to design a language that helps work with them, it will always require programmer support because current OSes do not carry an encoding description along with data automatically
23:58 geekosaur And programmers always think they can just slap data with different encodings together without even talking about encoding, and somehow the right thing will happen.
23:59 tyil I mean
23:59 tyil usually in perl the right thing happens
23:59 geekosaur And... maybe 90% of the time the binary data won't have anything that happens to look like a unicode combining sequence or etc. and it will work
23:59 geekosaur then you hit that 10% and the file gets trashed

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

Perl 6 | Reference Documentation | Rakudo