»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
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 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
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;
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;
camelia 34
12
HoboWithAShotgun see that second value? the LHS changes 00:04
that's bad
ipatrol HoboWithAShotgun: 𝄇 is an operator?
HoboWithAShotgun yes, it's defined right there 00:05
ipatrol oh, I see
HoboWithAShotgun why doesn't it obey the is copy directive?
ipatrol HoboWithAShotgun: do you know what infix:<$?> actually is? 00:13
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
geekosaur no, adverb is one semantic use of the syntax 00:16
m: say :a(3)
camelia Unexpected named argument 'a' passed
in block <unit> at <tmp> line 1
geekosaur hm, right, thats another use :)
m: say (:a(3))
camelia a => 3
geekosaur that;s not adverbial, it's just constructing a Pair 00:17
ipatrol m: sub ident:<a> () {say 'me!';}
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot add tokens of category 'ident'
at <tmp>:1
------> 3sub ident:<a>7⏏5 () {say 'me!';}
ipatrol so something of the form `name:<string>` is a token
of some kind
geekosaur the grammar sublanguage recognizes them as such, yes 00:18
ipatrol "Identifiers can contain colon pairs. The entire colon pair becomes part of the name of the identifier." 00:19
m: my $ident:<foo> = 'me'; say $ident:<foo>; 00:20
camelia me
geekosaur right. that just discusses what an identifier can be, though; "token" is a concept of the grammar sublanguage
ipatrol geekosaur: but attempting to create a sub with a colon pair identifier is automatically construed as a token?
geekosaur specifically, how grammars will interpret (say) <term> by trying every sub term:...
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:23
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
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)
ipatrol m: sub pastry:<a> () {say 'me!';}
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot add tokens of category 'pastry'
at <tmp>:1
------> 3sub pastry:<a>7⏏5 () {say 'me!';}
ipatrol m: &pastry:<a> = sub () {say 'me!';} 00:26
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
pastry:<a> used at line 1
ipatrol m: my &pastry:<a> = sub () {say 'me!';} 00:27
camelia ( no output )
ipatrol m: my &pastry:<a> = sub () {say 'me!';} pastry:<a>; 00:27
camelia 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…
ipatrol m: my &pastry:<a> = sub () {say 'me!';}; pastry:<a>;
camelia me!
ipatrol ok, so it just doesn't like regular declarations using that syntax
geekosaur right, as I said, it special cases those so it can use the way grammars match them 00:29
ipatrol geekosaur: can I possibly override that using the dispatch keyword for protos? 00:31
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
geekosaur or possibly the Match class, which is Grammar's superclass
ipatrol HoboWithAShotgun: oh, just my meta-syntax for a variable with an arbitrary name
HoboWithAShotgun does it have to do with is copy? 00:37
ipatrol not at all 00:38
if it means anything else, that's my mistake 00:39
ipatrol geekosaur: is dispatch a keyword the user can access, or is it internal only? 00:45
geekosaur it's not even a keyword 00:50
Grammars can have Actions associated with them. the way you attach an Action to a token is to define a sub dispatch:<tokenname> 00:52
'dispatch' is not used by itself, only by looking up these subs given a token 00:53
ipatrol geekosaur: not what I was talking about. design.perl6.org/S06.html#Routine_modifiers 00:54
geekosaur I don't think that got implemented that way 00:56
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
what did get implemented is what I described, using Actions instead.
ipatrol so it's an NYI?
geekosaur design.perl6.org was an early notion of how perl 6 might be implemented. 00:58
er, it describes, not 'was'
it's sometimes called the 'speculations'
as opposed to specifications 00:59
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:00
ipatrol geekosaur: do protoregexes use longest match alternation, or first match alternation? 01:17
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:19
ipatrol geekosaur: docs.perl6.org/language/grammars#Protoregexes 01:21
which form of alternation does the protoregex create? 01:22
geekosaur if I read that example literally then it claims it's | 01:24
but I don't know the implementation
geekosaur is far from expert on the details of Grammars
Bijju How to create a JAR reqivalent in perl 6 for distribution ? 03:22
can i also embed the p6 interpreter ? so that the client machine does not need p6 installation ? standalone executable with built in lib files
?
Any help would be gr8 .. even JAR equivalent should work 03:23
ipatrol too late, but, I doubt it'd be possible with the current implementation 03:40
wander ipatrol, the first match, I think 04:03
gist.github.com/W4anD0eR96/db0d6d5...7237130385 04:06
ipatrol ok, so doesn't do what I wanted 04:07
wander I'm expecting Parsing with Perl 6 Regexes and Grammars, by moritz 04:21
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:57
I came up with this solution, skipping that part: pastebin.com/Qk342DSL . What was I "supposed" to do? 04:58
chakli Hi guys on "modules.perl6.org/" i see a few duplicate tags, like FASTCGI and FCGI, RPI,RASPBERRY PI and RAPBERRY Pi etc.. 05:16
Zoffix chakli: that can be fixed by adding those to aliases file: github.com/perl6/modules.perl6.org...es.json#L3 07:58
with '[REBUILD]' as the first thing in commit title when committing it
ChoHag That patch (github.com/perl6/specs/commit/1c97...217219df98 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
Since when did perl 6 become boring?
gfldex the sad part is that an americanism was replaced with American Standard Code for Information Interchange 08:52
ChoHag And if it is turning boring, « and » should be called by their proper name of guillemot. 08:53
ChoHag Guillemets, sorry. 08:53
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.
TEttinger like #perl6 08:55
ChoHag 26.
TEttinger gfldex: is that a word made from multiple sub-words? 08:56
like Zeitgeist
gfldex yes, in german we tend to glue words together
TEttinger "time ghost"
ChoHag You could even say they get gefüßed. 08:57
gfldex Straßenbahnfahrscheinabverkaufsstelle is a real word
TEttinger was
what
why is there one ß and one ss in the same word?
ChoHag German. The only language where camel case may actually be a good idea.
gfldex good typesetting solves that problem because we add a little extra space inbetween word parts 08:58
works quite well actually 08:59
TEttinger No results found for Straßenbahnfahrscheinabverkaufsstelle
gfldex it's any place where you can buy tram tickets
before we got vending machines for them you could buy them at all sorts of places
ChoHag What was wrong with ticket office (suitably translated)? 09:00
Or _is_ that the suitable translations?
gfldex you could buy them in many stores where you would not expect them
TEttinger google suggests that as two words, the word for tram ticket and the word for point of sale
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:01
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
TEttinger ah 09:09
wow. I was going to install some updates. nope. www.computerworld.com/article/3232...-more.html 09:12
gfldex found it! 09:13
Rindfleischetikettierungsüberwachungsaufgabenübertragungsgesetz
that's the longest name of any law in germany 09:14
Geth whateverable/master: 4 commits pushed by (Aleks-Daniel Jakimenko-Aleksejev)++ 09:57
HoboWithAShotgun m: multi sub infix:«:|»(Any \obj, WhateverCode \code) { .say }; "1" |: *.chars 10:35
camelia 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
AlexDaniel- HoboWithAShotgun: makes sense? 10:36
HoboWithAShotgun: it's :| vs |:
wander m: multi sub infix:«:|»(Any \obj, WhateverCode \code) { .say }; "1" :| *.chars 10:38
camelia ( no output )
HoboWithAShotgun see? the op code doesnt execute 10:39
but if i do
m: 1 |: *.foo 10:40
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing required term after infix
at <tmp>:1
------> 031 |:7⏏5 *.foo
expecting any of:
colon pair
HoboWithAShotgun and it doesnt throw a signature error either 10:41
so, WTF?
AlexDaniel- looks at raw.githubusercontent.com/easysid/...mon-10.png 11:42
it feels like tiny fonts have bad long-term effects on eyes, but the convenience overweights potential blindness… 11:43
MasterDuke AlexDaniel-: do you have a high-dpi screen? 11:44
AlexDaniel- MasterDuke: no 11:45
which is why I like bitmap fonts, they're much more crips 11:46
crisp
MasterDuke i feel like a bloods pun is in order, but it goes beyond my early morning ability to make one about fonts 11:47
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.
AlexDaniel-
.oO( this is great but what about emoji? :) raw.githubusercontent.com/josuah/m...enshot.png )
11:56
Ulti ^H^H/win 4 11:57
timotimo hey, why did that not trigger the lottery thing? 11:59
AlexDaniel- u: ^H 12:00
unicodable6 AlexDaniel-, U+007F <control-007F> [Cc] (control character)
AlexDaniel- it had these
timotimo that should still count, imo 12:01
AlexDaniel- sure
/win test
/win 4
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
AlexDaniel- buggable: source 12:01
buggable AlexDaniel-, See: github.com/zoffixznet/perl6-buggable
AlexDaniel- github.com/zoffixznet/perl6-buggable/issues/13 12:02
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.
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.
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]: rt.perl.org/Ticket/Display.html?id=132179 Don't put Mexico and Texas in opposition in Perl 6 jargon
Zoffix Control chars now accepted in lottery strings 16:16
ChoHag That sounds rather boring to me. 16:39
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;'
ryn1x: I don't currently have a timezone preference set for you.
ryn1x .tz America/Denver 16:53
yoleaux ryn1x: Changed your timezone to America/Denver. (Current date and time: 2017-10-15 10:53:26)
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 16:59
feed operator^ 17:06
timotimo m: <foo bar baz quux> ==> .[2,3] ==> say 17:07
camelia 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
---…
timotimo m: <foo bar baz quux> ==> .[2,3] ==> say()
camelia 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()
ugexe or even something like ^10 ==> grep { $_ > 5 } ==> head(2)
timotimo m: ((^10) ==> grep * > 5)[2,3] ==> say() 17:09
camelia (8 9)
timotimo :P
ugexe yeah but the entire reason i'm even using feed operator is to line things up nicely! 17:11
timotimo aye
m: (^10) ==> &postcircumfix:<[ ]>(2, 3) ==> say() 17:12
camelia 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
timotimo yeah, it'd put the array in the wrong spot in the args
or maybe it's wrong in a different way
ugexe m: ^10 ==> grep { $_ > 5 } ==> splice(2) ==> my @a; say @a.perl 17:13
camelia 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
timotimo yeah, having the data put in as a slurpy at the end doesn't make this much easier 17:14
you can define you rown sub, that'll give you the line-up stuff at least
timotimo m: sub takethese(@indices, *@values) { @values.[@indices] }; ^10 ==> takethese [2, 4] ==> say() 17:16
camelia (2 4)
timotimo m: sub takethese(@indices, *@values) { @values.[@indices] }; <foo bar baz quux blorp> ==> takethese [3, 1, 4, 1] ==> say()
camelia (quux bar blorp bar)
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 ==> ...
timotimo kind of the opposite of ==>> 17:18
ugexe yeah
timotimo this is what was called "silo" at one point during the GLR 17:19
ugexe the feed operators? 17:19
or the concept of that refification point 17:20
timotimo no, the "gather all data, then continue"
fwiw, the "takethese" sub will silo up the data by virtue of postcircumfix:<[ ]> doing that
ugexe hmmm couldnt I inline a sub/block in the pipeline itself? 17:21
timotimo oh, hm, that sounds like something you should be able to do 17:22
will have to have the signature right, of course 17:23
ugexe m: ^10 ==> grep { $_ > 1 } ==> (sub (@indices, *@values) { @values.[@indices] })([2,3,4]) ==> my @a; say @a.perl 17:24
camelia [4, 5, 6]
ugexe of course i still wonder if this fits with the idealistic implementation of feeds 17:25
timotimo right 17:26
ugexe if i understand it correctly though it seems like ==> could be like hyper/race 17:27
timotimo a little bit; it's supposed to run each block in its own worker thread and have them communicate with channels 17:28
m: ^10 ==> grep { $ > 1 } ==> -> *@v { @v[2,3,4] } ==> my @a; say @a.perl
camelia 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
timotimo m: ^10 ==> grep { $ > 1 } ==> (-> *@v { @v[2,3,4] }) ==> my @a; say @a.perl
camelia 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
timotimo :(
m: ^10 ==> grep { $ > 1 } ==> (-> *@v { @v[2,3,4] })() ==> my @a; say @a.perl
camelia 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…
timotimo m: ^10 ==> grep { $ > 1 } ==> (-> $, *@v { @v[2,3,4] })(1) ==> my @a; say @a.perl 17:29
camelia 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…
ugexe m: ^10 ==> grep { $_ > 1 } ==> (-> $i, *@v { @v[|$i] })([1,2,3]) ==> my @a; say @a.perl 17:32
camelia [3, 4, 5]
ugexe s/$/$_/ 17:33
timotimo but why?
ugexe m: (1,2,3).grep: { say $ } 17:34
camelia (Any)
(Any)
(Any)
timotimo but i didn't use $ in there at all?
only in the signature?
ugexe the grep
timotimo oh!
i was looking in the absolute wrong spot
Geth ecosystem: holli-holzer++ created pull request #375:
Add Operator::grandpa
17:50
Geth ecosystem: ff4c543b89 | holli-holzer++ (committed by Zoffix Znet) | META.list
Add Operator::grandpa (#375)
18:04
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
timotimo you can have a QUIT { } block inside a whenever that gets called when the thing you're whenevering has an exception 18:29
if i'm not mistaken
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))
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.
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
i'm fuzzy on the details 18:31
ufobat the QUIT didnt work :( 18:31
timotimo then i'm wrong! :)
ufobat CATCH outside? with try? 18:31
timotimo have you looked at jnthn's supplies talk?
ufobat try {CATCH { ... } react { ... }} like that? 18:32
no not right now
timotimo the one that introduced cro was quite good, from the SPW 18:32
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
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
how can you easily know which one caused the troubles
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
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
Geth DBIish: ecdf870494 | (Jonathan Stowe)++ | lib/DBDish/mysql.pm6
Make the arguments to MySQL connect explicitly typed

This makes the message more obvious when the user makes a mistake with the arguments.
Closes #105
18:43
DBIish: c9fb7dde55 | (Jonathan Stowe)++ | 2 files
Up version
ufobat gfldex, the error went went away? 18:47
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.
ufobat ah :-) but for your example it works as expected if you http onto a https server? 19:04
gfldex ufobat: this may be helpful gist.github.com/gfldex/044cdfa4e6b...39e7b95e23 19:06
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:07
ufobat thanks :) 19:14
ufobat only the try outside of the react {} is catching it.. i am doing something wrong :-( 19:49
gfldex ufobat: maybe you want to put the source on the intarwebs so you can laugh … err … help you 19:50
:-> 19:51
ufobat okay :D
i am afraid ;)
wander doc of functions says `Introspection on subroutines is provided via Routine.' 19:53
whlie
m: sub f { }; &f.^name.say
camelia Sub
gfldex m: say Sub ~~ Routine;
camelia True
gfldex m: say Method ~~ Routine; 19:54
camelia True
wander m: Routine ~~ Sub
camelia ( no output )
ufobat gfldex, github.com/ufobat/HTTP-Server-Ogre...re.pm6#L86
wander m: say Routine ~~ Sub
camelia False
wander or i'm misunderstanding what `introspection' means 19:55
gfldex ufobat: what is the error message you get? 20:01
ufobat just a warning 1 error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number 20:02
in block at /home/martin/.workspace/p6/Bailador/examples/https/../../../HTTP-Server-Ogre/lib/HTTP/Server/Ogre.pm6 (HTTP::Server::Ogre) line 85
ufobat i am doing http on the https server 20:02
without that try catch i am getting ..
Tried to get the result of a broken Promise in method run ... line 84 20:03
gfldex ufobat: try to output `.backtrace` 20:04
ugexe are you sure you dont mean to use QUIT { } instead of CATCH { } 20:06
ufobat i dont know? 20:07
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:08
ufobat i dont understand :( 20:11
ufobat shoudn't the `whenever $listener -> $conn` throw the exception so i should be able to catch it around this one? 20:17
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
ufobat the error itself is from here (IO::Socket::Async::SSL) line 525 20:21
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 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-…
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 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
ufobat the QUIT within the whenever $listener -> $conn gets called with that error
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" } }
camelia 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
timotimo ufobat: maybe these two examples clarify things a tiny bit?
ufobat ah 20:26
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:27
nope :( 20:33
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
wander m: constant aname = 'foo'; sub ::(aname) { say 'bar' }; foo.say; 20:41
camelia bar
True
wander any usage of macro? 20:44
MasterDuke greppable6: macro 20:48
greppable6 MasterDuke, gist.github.com/6d3e24427e9d2749b3...1dfcc56200
MasterDuke greppable6: ' macro ' 20:49
greppable6 MasterDuke, Found nothing!
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:55
github.com/masak/007 i believe 20:56
wander k
timotimo it's its own language and compiler, though 21:01
i don't think there's a way to mix 007 and perl6 code
tyil yet
buggable New CPAN upload: App-Bob-0.5.1.tar.gz by TYIL cpan.metacpan.org/authors/id/T/TY/...5.1.tar.gz
tyil aww yis 21:02
timotimo what does bob do? 21:03
ugh, modules.perl6.org/repo/App::Bob gives me the cpan zip file, not the repo
tyil timotimo: its intended to help making new modules, set up the directories, create a META6.json, make dists and upload them 21:05
add dependencies to the META6 without having to manually edit, or add new files without having to edit the META6
I'm looking for the best module to send a http form encoded post request with http credentials to PAUSE 21:06
github.com/scriptkitties/perl6-App-Bob is the source repo
(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:07
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:08
gfldex tyil: you want to look at META6::bin for features to steal 21:09
tyil nice 21:09
yours basically does most of the local stuff I want bob to do 21:10
fork and pr commands might be a nice bonus after 1.0.0 21:11
AlexDaniel- MasterDuke: fwiw I think you wanted \bmacro\b 21:12
MasterDuke AlexDaniel-: yeah, i couldn't remember whether it is Perl 5 or 6 style (and then i got distracted) 21:14
gfldex tyil: github tends to timeout. You may want to handle that early on or you get really odd errors. 21:18
tyil gfldex: I'll focus on getting the features I wanted and make a tutorial available 21:19
partly because I want to be able to use it to deal with all my module building needs
partly because its good for my ego to see my name appear in the p6 weekly all the time :p
tyil 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? 21:59
timotimo i see it show up twice in the "from:cpan" search, too 22:01
tyil it is technically correct, since v0.2.2 and v0.5.1 are both available on CPAN atm 22:03
but I'm not sure this is the intended effect
ufobat could anyone send me PR with a fix that dosn't shut down the hole server as soon as HTTP traffice arives for github.com/ufobat/HTTP-Server-Ogre...server.pl6 22:15
i am to stupid :( i cant get it work
sorry and thankyou and good night :( 22:16
HoboWithAShotgun what is the correct way to write a getter/setter pair properly by hand? 22:18
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
return value of a method call.
HoboWithAShotgun hands cate to zoffix++ 22:21
*cake
Geth modules.perl6.org: 6e90124ead | (Zoffix Znet)++ (committed using GitHub Web editor) | use-me-for-commit-triggers
[REBUILD] to clear buggy CPAN cache
AlexDaniel- HoboWithAShotgun: maybe this is what you need? docs.perl6.org/type/Proxy 22:22
just guessing, I don't really know
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
tyil Zoffix: alright, awesome! 22:23
HoboWithAShotgun boy, that's ugly
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 42
70
Zoffix HoboWithAShotgun: ^ that's another way
HoboWithAShotgun ^^ 22:25
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 Cannot assign to a readonly variable or a value
in block <unit> at <tmp> line 1
HoboWithAShotgun ?? why does "return" break it? 22:27
Zoffix HoboWithAShotgun: you're meant to use return-rw to return writable containers 22:30
HoboWithAShotgun uh, right
HoboWithAShotgun can you have mutable sigil-less variables? 22:35
AlexDaniel- not really, that's the whole point of sigilless vars 22:39
at least that's what I thought
HoboWithAShotgun yes, they "do not create containers" 22:41
Miller Hello 22:43
HoboWithAShotgun Miller! You here?? 22:44
AlexDaniel- o/ 22:45
HoboWithAShotgun How ya been dude? How's Danielle and the kids? All good?
BenGoldberg m: say 0 ** 0 23:00
camelia 1
AlexDaniel- hmmm… 23:01
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)
camelia one(0, 1, NaN)
BenGoldberg m: say 0/0 23:04
camelia Attempt to divide by zero using div
in block <unit> at <tmp> line 1
BenGoldberg m: say <0/0> 23:05
camelia Attempt to divide by zero using div
in block <unit> at <tmp> line 1
BenGoldberg m: say 0e0/0e0
camelia Attempt to divide by zero using /
in block <unit> at <tmp> line 1
BenGoldberg wonders why those don't produce NaN 23:06
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:12
geekosaur 0 ** 0 behavior: www.math.hmc.edu/funfacts/ffiles/1....3-5.shtml mathforum.org/dr.math/faq/faq.0.to.0.power.html 23:16
...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:20
tyil I'm trying to upload a file to PAUSE using a HTTP POST request, code cry.nu/p/778z/ (around the bottom, denoted with "# this thing here") 23:32
but I'm getting an error in the module I'm using to do the request (HTTP::Client), giving the following error
Cannot use a Buf as a string, but you called the Stringy method on it 23:33
the offending line in the module would be github.com/supernovus/perl6-http-c...t.pm6#L218
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:33
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:38
(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:40
ugexe fine for headers at least 23:41
geekosaur tl;dr: if it hadn't crashed there, it would likely have produced garbage)
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:42
ugexe ah i thought it was only concating 2 bufs or 2 strings, not one of each 23:45
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:47
more programmers who think encodings magically deal with themselves :( 23:48
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?
geekosaur NO 23:52
tyil thats a big no
geekosaur you're making exactluy the same mistake the author of HTTP::Client did
that will CORRUPT binary data
tyil Iwas considering using base64 first
but The Internet convinced me that was bad too
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) stackoverflow.com/posts/46742643/revisions
.tell lizmat Also it might be a good idea to add one or more OpenID logins to maintain control over your answers.
yoleaux b2gills: I'll pass your message to lizmat.
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
geekosaur or accept that binary data will sometimes get trashed 23:53
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:54
I could depend on curl being available and let that handle the upload :'D 23:55
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:57
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
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.
tyil I mean 23:59
usually in perl the right thing happens
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
then you hit that 10% and the file gets trashed