»ö« 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.
00:20 Jesmaybe joined 00:22 itaipu left 00:24 raiph left, raiph joined 00:25 Jesmaybe left 00:31 raiph left, raiph joined 00:34 nadim left 00:41 Actualeyes joined 00:51 telex left 00:52 telex joined 01:04 dataf4l left 01:05 pierre_ joined 01:06 Derperperd joined 01:22 Jesmaybe joined 01:27 Jesmaybe left
iBakeCake is_approx spotted in github.com/rakudo-p5/v5/blob/maste...est.pl#L14 01:29
iBakeCake was gonna create an Issue but I see that code is a rotting carcas
(to add context: is_approx is deprecated and will be removed entirely soon) 01:31
01:33 dataf4l joined
iBakeCake .tell rindolf the code's at github.com/rakudo/rakudo/blob/eb69...ol.pm#L319 You want to profile stuff with --profile argument to perl6; perl6.party's articles with "Hacking" in their title may or may not prove helpful vis-a-vis getting and building source 01:37
yoleaux iBakeCake: I'll pass your message to rindolf.
iBakeCake .tell rindolf the stuff that starts with nqp:: is nqp ops and generally would be in github.com/perl6/nqp (see docs/) 01:38
yoleaux iBakeCake: I'll pass your message to rindolf.
01:41 pierre_ left 01:43 Jesmaybe joined 01:44 eliasr left 01:48 pierre_ joined 02:01 aborazmeh joined, aborazmeh left, aborazmeh joined 02:04 aries_liuxueyang left 02:05 aries_liuxueyang joined 02:07 msanderson joined
msanderson Hello there. I'm new to perl6, and I'm running into something basic I can't seem to get my head around. I have an array of hashes that I'm trying to sort. I'm guessing it's something super simple and straightforward, but I've not figured it out so far. 02:08
If I do something like this: To exit type 'exit' or '^D' > my %nameHash = ( firstName => 'Bob' , secondName => 'Smith'); {firstName => Bob, secondName => Smith} > my @nameList [] > @nameList.push(%nameHash); [{firstName => Bob, secondName => Smith}] > my %nameHash = ( firstName => 'Sally' , secondName => 'Smith'); {firstName => Sally, secondName => Smith} > @nameList.push(%nameHash); [{firstName => Bob, secondName => Smith} {firstName => 02:09
geekosaur your client truncated the message 02:10
02:10 snowman_ left
msanderson doing something simple like @nameList.sort doesn't work. I get that, since the array contains hashes, but I can't figure out what I need to do to get the sort to work on one of the hash items 02:10
Ah, and I'm new to IRD as well, so I probably put too much into a biffer 02:11
er, buffer
my %nameHash = ( firstName => 'Bob' , secondName => 'Smith');
geekosaur also it's generally a good idea to use a pastebin of some kind (gist.github.com or dpaste.de or ...)
02:11 aries_liuxueyang left
geekosaur irc has a rather short message length. some clients know to chop messages up, others don't 02:11
some can be taught (there are scripts for irssi, for example)
geekosaur uses hexchat and it autosplits 02:12
msanderson ah, I see ... probably going to sound bad, but I'm just using the CIRC app in chrome. Total amatuer hour here.
I was looking for tips on the perl6 six site, and it indicated that I should look here. So I figured, what the heck 02:13
02:13 snowman__ joined
msanderson If I have an array of hashes like: 02:13
say @nameList [{firstName => Bob, secondName => Smith} {firstName => Sally, secondName => Smith}] 02:14
The array of hashes is coming from an sqlite3 database I populated and accessed using DBIish and allrows(:array-of-hash) 02:15
I want to be be able to sort the array based on the values of one of the hashes. 02:16
I suspect that the answer is so simple, I'm missing it ... but then sometimes I get stuck on th simple things. 02:17
iBakeCake m: my @nameList = [{firstName => 'Bob', secondName => 'Smith'}, {firstName => 'Sally', secondName => 'Smith'}]; say @nameList.sort: { $^b<firstName> cmp $^a<firstName> }
camelia rakudo-moar eb6907: OUTPUT«({firstName => Sally, secondName => Smith} {firstName => Bob, secondName => Smith})␤»
iBakeCake m: my @nameList = [{firstName => 'Bob', secondName => 'Smith'}, {firstName => 'Sally', secondName => 'Smith'}]; say @nameList.sort: { $^a<firstName> cmp $^b<firstName> }
camelia rakudo-moar eb6907: OUTPUT«({firstName => Bob, secondName => Smith} {firstName => Sally, secondName => Smith})␤»
iBakeCake docs.perl6.org/routine/sort 02:18
iBakeCake boos camelCase
kebab-case or no case :P
msanderson ;-) Fair enough re: case ...
iBakeCake m: my @name-list = [{:first-name<Bob>, :second-name<Smith>}, {:first-name<Sally>, :second-name<Smith>}]; say @name-list.sort: { $^b<first-name> cmp $^a<first-name> } 02:19
camelia rakudo-moar eb6907: OUTPUT«({first-name => Sally, second-name => Smith} {first-name => Bob, second-name => Smith})␤»
iBakeCake m: my @name-list = [{:first-name<Bob>, :second-name<Smith>}, {:first-name<Sally>, :second-name<Smith>}]; say @name-list.sort: *.<first-name> 02:20
camelia rakudo-moar eb6907: OUTPUT«({first-name => Bob, second-name => Smith} {first-name => Sally, second-name => Smith})␤»
iBakeCake This works too, I guess
msanderson To me, that last one makes sense in my head. I'm still thinking about the cmp version. 02:22
The cmp version worlks because it pulls first one hash from the list as $a and then a second one into $b and does the compare, and then iterates over the list?
iBakeCake msanderson: the $^a and $^b create an implicit signature on the block, based on their alphabetical order, so $^a gets one argument and $^b the other. cmp returns Order::Less, Order::Same, and Order::More, which controls how .sort will arrange the two values against each other. 02:23
msanderson And call me crazy, but did I just realize that your nickname is camel case? ;-)
iBakeCake haha 02:24
I actually did code in camelCase nearly a decade ago. Can't believe it.
msanderson Thanks for the very succinct explanation. I've a lot to learn. 02:25
Since I'm asking questions, maybe you could answer another.
Once I've finished this little application, how are they generally "distributed" with respect to modules.
I'm probably able to get the folks to download Rakudo, but I'm not certain I can get them to install git to download modules. 02:26
Can I bundle a module up so that's it's available with my code?
iBakeCake Yeah
msanderson For things like DBIIsh and Text::Table::Simple, etc.?
iBakeCake And I think zef ( modules.perl6.org/repo/zef ) can install from a .tar or a .zip 02:27
Oh, you mean someone else's module? Well, sure, you can bundle, but it'd make more sense to get it installed from the right place, I think
msanderson That's what I kinda thought ... since I'll have folks on all kinds of platforms using the little application (Windows, MacOS, Linux) I was hoping to make something without a lot of instructions. 02:28
02:28 cdg joined
msanderson Since the Windows guys won't git installed, they won't be able to use panda to get the module 02:29
For that matter, I'm guessing zef uses git to fetch the module's code too
iBakeCake Yeah 02:30
FWIW, it's a temporary system we got. Eventually, we'll move to CPAN and then one won't need git. It's a work in progress though... perhaps a bit short on volunteers too. 02:31
iBakeCake & # bed
msanderson Well, if I ever get through the basics and learn enough to assist, I'll help out. For now, I'm awfully wet behind the ears.
02:32 skids left
msanderson Bed is good. Thanks for the help, I really appreciate it. Cheers, Mike 02:32
02:36 mls joined 02:41 pierre_ left 02:48 pierre_ joined 02:52 pierre_ left 02:57 Actualeyes left 02:58 Actualeyes joined, noganex joined 03:01 noganex_ left 03:09 cdg left, msanderson left 03:28 aborazmeh left, stevieb joined 03:31 pierre_ joined 03:46 Jesmaybe left 04:03 khw left 04:05 perl6817 joined 04:11 perl6817 left 04:16 cpage_ left 04:19 brillenfux joined 04:20 cpage_ joined 04:38 Cabanossi left 04:39 Cabanossi joined 04:43 pierre_ left 04:45 perlawhirl joined 04:47 snowman__ left 04:48 xinming joined 04:50 perlawhirl left, pierre_ joined 04:51 zrr joined 04:54 geekosaur left 04:55 pierre_ left 04:56 geekosaur joined 05:08 BenGoldberg left 05:11 xtreak joined 05:12 xtreak left 05:13 _28_ria joined 05:23 domidumont joined 05:28 domidumont left 05:29 domidumont joined 05:34 ufobat joined 05:40 domidumont left 05:56 domidumont joined 05:59 geekosaur left 06:00 geekosaur joined 06:06 geekosaur left 06:08 geekosaur joined 06:10 pierre__ joined 06:12 khisanth__ left 06:15 nadim joined, geekosaur left, geekosaur joined 06:16 andrzejku left, andrzejku joined
Woodi_ hi today :) 06:18
06:20 geekosaur left 06:21 geekosaur joined, RabidGravy joined, CIAvash joined
Woodi_ geekosaur: nice explanation about wantarray vs perl6. finally I got to the point of accepting single arg rule needs to be learned and why :) geekosaur++ 06:21
06:22 abraxxa joined
Woodi_ btw found small gem in "Multics Emacs implementation history" article :) www.multicians.org/mepap.html 06:22
06:23 firstdayonthejob joined
andrzejku hello :) 06:23
06:23 cpage_ left
Woodi_ cze andrzejku :) 06:23
andrzejku Woodi_: Poland? 06:24
06:24 neuraload joined 06:26 khisanth__ joined
Woodi_ "the command that switches buffers does so by saving up the values of all of the relevant Lisp variables and placing a saved image..."; "The alternate approach to multiple buffers would have been to have the buffer state variables referenced indirectly through some pointer... This approach is less desirable than the current approach, for it distributes cost at variable reference time, not buffer-switching 06:26
time, and the former is much more common."
andrzejku: yes :)
06:28 geekosaur left, geekosaur joined 06:30 abraxxa left, abraxxa joined 06:34 geekosaur left 06:36 geekosaur joined, wamba joined 06:38 pierre__ left, darutoko joined, geekosaur left 06:40 geekosaur joined, andrzejku left, geekosaur left 06:41 andrzejku joined, firstdayonthejob left 06:43 geekosaur joined 06:44 pierre_ joined 06:49 pierre_ left 06:56 brrt joined 06:57 pierre_ joined 06:59 cpage_ joined 07:18 TEttinger left 07:22 seatek left 07:27 ocbtec joined 07:30 pdcawley joined 07:32 canopus left 07:33 zakharyas joined 07:35 lizmat_ left 07:41 canopus joined, pierre_ left 07:50 pierre_ joined 07:52 Actualeyes left, Actualeyes1 joined, lizmat joined 07:53 rindolf joined 07:55 pierre_ left 08:14 pierre_ joined 08:15 FROGGS joined 08:16 vendethiel left 08:20 jonas3 joined 08:25 dakkar joined 08:27 dataf4l left 08:35 brrt left 08:45 enick_966 left, ilmari[m] left, M-Illandan left, tadzik left, Matthew[m] left, Matias[m] left 08:51 eliasr joined 08:58 ilmari[m] joined 08:59 ctp joined 09:05 Guest46334 joined, M-Illandan joined, tadzik joined, Matthew[m] joined, Matias[m] joined 09:09 rindolf left 09:15 pierre_ left 09:24 pierre_ joined, bjz joined 09:28 pierre_ left 09:33 rindolf joined, lizmat left 09:35 labster left 09:40 dataf4l joined 09:45 dataf4l left, bjz left 09:46 Actualeyes1 left, Actualeyes joined 09:51 skids joined 09:56 Derperperd left 10:03 bjz joined 10:33 bjz_ joined 10:34 bjz left 10:38 bioduds joined
bioduds Hello, friends 10:38
I'd like to know from your experience if a blockchain build solely using Perl6 would be a good idea 10:39
moritz probably not yet 10:40
reading and writing binary data isn't very mature in rakudo 10:41
and iirc blockchain implementations need to keep much in memory, so there the memory overhead might hurt
10:43 pierre_ joined 10:44 pierre_ left
bioduds moritz : thanks. I've bitcoin code, it is written in cpp so I wondered 10:46
*I've seen... 10:47
10:52 pierre_ joined, itaipu joined 10:54 pierre_ left, pierre_ joined 10:56 pierre_ left
grondilu bioduds: IMHO it'd make much more sense to wrap a C library around it. 10:57
with NativeCall, that is.
btw bitcoin was one of the first thing I've used Perl 6 for. I still have an old repo: github.com/grondilu/libbitcoin-perl6 10:58
it does not do much and it's probably too old to run straight away, though. 10:59
the Perl 5 version used to do a bit more: github.com/grondilu/libbitcoin-perl 11:00
it's still very old and mostly useless, but it has historical merits, imho.
(for me, that is) 11:01
being frustrated writing this Perl 5 project was the main reason I looked into Perl 6 then. 11:02
11:11 CIAvash left
DrForr waves from work. 11:34
timotimo o/ DrForr 11:35
masak .oO( wave-work duality )
DrForr Mmhmm. 11:36
Made it back from OSCON; the crowd was practically nonexistent. vmbrasseur got 30 people, I got ~20 *but* there was a group of 3 people in front row pointing at the screen and typing on their laptops. I assume they weren't tweeting "Ha ha p6 sucks". Or at least I hope they weren't :) 11:38
11:39 AlexDaniel left
DrForr How's the C++ NativeCall stuff coming along? 11:42
moritz I don't think much has happened to C++ NC 11:44
timotimo i wonder what'd be missing for it to be better?
moritz sorry to hear it was so empty at OSCON 11:45
timotimo oh? :(
DrForr The convention hall was empty. The big problem is that FOSDEM sucks all the air out of the proverbial room.
timotimo oh, those are at the same time? 11:46
DrForr No, but it's the only explanation that makes sense.
timotimo maybe oscon was packed to the brim, but nobody wanted to go into the perl room? 11:47
DrForr They had maybe 500 people total. 11:49
timotimo what.
that's smaller than the gulaschprogrammiernacht
DrForr It may have been ~800, but certainly nowhere near the 4000+ at Austin. 11:50
El_Che hi DrForr
DrForr Afternoon.
El_Che no a lot of attendees? 11:51
hopefully 20 good ones
11:52 ctp left
DrForr Well, there were a few people I'd not seen before sitting in the front row pointing at the screen and typing like "Does that example actually *work*?" 11:52
El_Che DrForr: what do you about Fosdem?
DrForr Well, Evozon will probably pay my way there, and since nobody else from the office went I'll probably talk at the conference and kick around for a few days s last time. 11:54
timotimo thank you for doing outreach, DrForr :) 11:55
11:55 grondilu left
El_Che I mean, I don't get "The big problem is that FOSDEM sucks all the air out of the proverbial room" 11:55
11:56 itaipu left
DrForr Why pay for some huge terribly-overpriced corporate affair when you've got the largest open source convention coming up in just a few months, and in a much *much* nicer city. 11:57
El_Che ah ok 11:58
I had the same thought today
11:58 canopus_ joined
El_Che about the oreilly security conference in Amsterdam 11:59
11:59 canopus left
El_Che too corporate, too expensive, not really handon 11:59
s
DrForr Well, it's in Amsterdam so they *might* get an uptick from geeks wanting to ... enjoy the pastimes that the city offers, but what I saw at OSCON was mostly suits. Hell, like Wendy pointed out very few people there knew who Cory Doctorow was. 12:01
El_Che I went to this one last year: www.secappdev.org/program.html and although expensive it a full week very hands on. Probably going again
Hashiconf EU this year was in Amsterdam. It was a nice location certainly 12:02
I'll try to make it this year to yapc, thus maybe cutting on conferences :)
DrForr I'm not saying the venue city will be a major uptick, but it'll be at least a factor. 12:03
12:05 brrt joined
El_Che I think it will 12:08
nice venue, good connections
12:08 CIAvash joined, CIAvash left
El_Che connectios to romania aren't on the same league 12:08
at least from .BE
DrForr Connections from *anywhere* to Romania aren't. At least from Cluj. Bucharest is better. 12:12
El_Che most flights took 6 hours at least (no direct connections) 12:14
DrForr Yep, most of 'em through Frankfurt. 12:17
*Munich
12:19 rindolf left
brrt in .nl, you can fly with Wizz air directly from Eindhoven to Cluj 12:28
12:29 rindolf joined
DrForr Yep. 12:29
El_Che brrt: yeah, I had a look at that. A lot cheaper as well. From Brussels it was long (6h+) and expensive 12:36
brrt Wizz is okay, I think, I've enjoyed it better than ... RyanAir or whichever it was
not very modern perhaps 12:37
El_Che going to Rome in a few weeks with Ryan Air. I hope it's OK
at least you have seat numbers nowadays
tadzik they have seats now? Dayum! 12:41
12:42 nadim left, mst left 12:43 nadim joined
DrForr Actually random seating was proved more efficient than assigned seating, at least in the Mythbusters trial. 12:43
12:44 apejens joined
moritz did they have kids in the mythbuster trial? :-) 12:44
DrForr Yep. 12:45
12:51 kent\n left 12:52 pierre_ joined 13:05 kent\n joined 13:07 aborazmeh joined, aborazmeh left, aborazmeh joined 13:08 andrzejku_ joined, cdg joined
[Coke] randomly assigned, or self-selected on boarding? 13:08
DrForr The latter. 13:09
13:10 andrzejku left
moritz did the folks know they were under observation? 13:12
13:14 mst joined 13:18 CIAvash joined 13:19 CIAvash left
[Coke] does the fight to install Pod::To::BigPage again. 13:24
13:27 aborazmeh left 13:32 cgfbee joined 13:36 snowman__ joined 13:41 ohmyfish joined, ptolemarch joined 13:43 ctp joined 13:46 optikalmouse joined 13:47 go|dfish left 13:54 eliasr left 13:59 BinGOs joined 14:01 go|dfish joined, pierre_ left 14:06 maybekoo2 joined, kurahaupo__ joined, kurahaupo__ left 14:07 kurahaupo__ joined, kurahaupo__ left, kurahaupo__ joined
iBakeCake [Coke]: what fight? I believe RabidGravy++ fixed the MAST::Frame thing 14:08
RabidGravy in 14:11
yeah it was in LWP::Simple I think 14:12
14:12 brillenfux left
RabidGravy so if it is still doing it, install a newer LWP::Simple 14:12
14:15 cpage_ left
[Coke] installingn lwp::simple is problematic behind a corporate firewall 14:15
14:15 optikalmouse left 14:18 Actualeyes left
dalek c: cf45bb8 | (Will Coleda)++ | doc/Language/rb-nutshell.pod6:
fix typo
14:20
14:22 Actualeyes joined, khw joined 14:24 itaipu joined 14:25 dataf4l joined 14:27 ctp left 14:28 andrzejku_ left 14:31 fumlead joined 14:32 bjz_ left 14:33 bjz joined 14:36 rindolf left
dalek c: 8897bc7 | (Will Coleda)++ | doc/Language/nativecall.pod6:
use full word
14:37
14:38 ohmyfish left
dalek c: 2c03626 | (Will Coleda)++ | doc/Language/operators.pod6:
expand

use 'curly braces' (not brackets) to match other parts of the docs
14:40
[Coke] operators.pod6 says "lists are replaced by the value from applying the meta'ed operator to the" ... can anyone suggest a better scanning word than "meta'ed" ? 14:41
kurahaupo__ metafied? metaized? 14:42
profan 4/win 12
ehh, wops
iBakeCake metaed
[Coke]: I'd just drop meta'ed
dalek c: 5335de9 | (Will Coleda)++ | doc/Language/rb-nutshell.pod6:
fix typo
14:43
kurahaupo__ "... applying the corresponding meta operator" 14:46
14:47 dataf4l left 14:48 kurahaupo__ is now known as kurahaupo 14:49 bjz left, rindolf joined, ale1ster joined
dalek c: 547ed3f | (Will Coleda)++ | doc/Language/operators.pod6:
simplify, avoid odd word

  iBakeCake++
14:51
[Coke] iBakeCake: danke.
14:54 dataf4l joined 14:56 abraxxa left 14:59 neuraload left, sufrostico left
dalek c: abb5a5c | (Will Coleda)++ | doc/Type/X/Does/TypeObject.pod6:
fix typo

class name didn't match
15:05
15:07 amalia__ joined
dalek c: efbe733 | (Will Coleda)++ | doc/Language/exceptions.pod6:
fix typo

no dash needed
15:07
15:08 amalia_ left, amalia__ is now known as amalia_, canopus_ is now known as canopus 15:11 grondilu joined, dataf4l left 15:15 ale1ster left
dalek c: 3fe2698 | (Will Coleda)++ | doc/Language/unicode_entry.pod6:
fix typo
15:16
15:20 ocbtec left
TimToady hmm, to me, brackets are a general category, so "braces" means the same as "curly brackets", while in some dialects, "parens" and "round brackets" are interchangeable 15:35
I don't know of any short version of "square brackets" though
except that sometimes those are just "brackets", which doesn't help :) 15:37
15:39 domidumont left
dalek c: 1f144fe | (Will Coleda)++ | doc/Language/operators.pod6:
simplify language
15:41
c: f7607ce | (Will Coleda)++ | doc/Language/packages.pod6:
ok to use this as an adjective here
15:42
c: 3be0d36 | (Will Coleda)++ | doc/Language/performance.pod6:
use a fake version here

  (avoid spellchecking issues)
15:44
15:45 cschwenz joined 15:46 tokomer joined
dalek c: 8685200 | (Will Coleda)++ | doc/Type/CurrentThreadScheduler.pod6:
use standard word
15:46
15:47 jonas3 left
[Coke] square brackets are "braces" according to unicode. 15:49
iBakeCake m: '['.uniname.say
camelia rakudo-moar 7a456f: OUTPUT«LEFT SQUARE BRACKET␤»
iBakeCake m: '{'.uniname.say
[Coke] we probably could use a style guid about what to call what there; my only concern at this point is to get the spellchecker to be quiet.
camelia rakudo-moar 7a456f: OUTPUT«LEFT CURLY BRACKET␤»
[Coke] Whoops, I thought that said brace the last time I checked. :) 15:50
ilmari [Coke]: guid is a microsoftism, the proper name is uuid ;-P
[Coke] ilmari: ? 15:51
ilmari [Coke]: you said "a style guid"
[Coke] *facepalm*
cschwenz anyone here able to help with a problem building rakudo via `rakudobrew build moar 2016.10`? (full output: pastebin.com/SKZWuy8m ) 15:52
dalek c: 5f2c1fe | (Will Coleda)++ | doc/Language/operators.pod6:
better word form, maybe.

  (avoids spellcheck issue, also)
15:54
15:55 tokomer left, dataf4l joined
[Coke] we ok with "truthy" and "falsy" (or "falsey") ? 15:56
could probably be replaced with True and False in many cases.
... also found trueness 15:57
... and thruthiness
*truthiness
cschwenz my opinion is to go with True and False; and truthiness has the exact opposite connotation you're looking for 15:58
perlpilot I'm ok with "truthy" and "falsey" and "truthiness" where appropriate (though "falsy" makes me think of "palsy" and that's not quite right) 16:00
cschwenz from en.wiktionary.org/wiki/truthiness : "Even in the halls of Congress, economic arguments against immigration are losing their aura of truthiness, so pro-enforcement types are focusing on national security." 16:01
dalek c: 28c6488 | (Will Coleda)++ | doc/Type/Str.pod6:
fix typo
16:01 domidumont joined
dalek c: 8414910 | (Will Coleda)++ | doc/Type/Str.pod6:
avoid pluralizing with 's

  (also remove 'ss)
16:08
16:09 cschwenz left
[Coke] github.com/perl6/doc/blob/master/d....pod6#L235 - includes the word 'tock' which aspell doesn't like - i can add it, but tock there doesn't seem to refer to anything in particular, someone want to try to rewrite that? 16:10
TimToady one must be careful to distinguish the nouns True and False, which are values, from the predicates "evaluates to true" and "evaluates to false", which I tend to use "true" and "false" for 16:11
moritz [Coke]: I'd propose simply "starting from 0" 16:12
16:12 pecastro left
TimToady many things evaluate to true or false that are not True or False, so we should not use the capitalized forms for the verb 16:13
16:14 pecastro joined
dalek c: 567ffdf | coke++ | doc/Language/testing.pod6:
Avoid neologism

  (that isn't quite what we mean here anyway)
16:16
perlpilot [Coke], moritz: perhaps I read too much into it, but I would think "tock" was trying to imply synchronicity with the system clock. i.e., If started in the middle of a second, your 0 would be on the start of the next full second. 16:17
[Coke] TimToady: "Perl 6 makes a clear distinction between definedness and trueness."
perlpilot: we don't really guarantee that, though. 16:18
Suggestions on how/if to replace trueness there?
moritz truthiness
iBakeCake +1 16:19
[Coke] -1
iBakeCake :D
moritz truthness
veracity :-)
[Coke] moritz: ENOTAWORD
moritz [Coke]: *shrug* we make it one
gfldex there is truthless but not truthiless. Maybe that 's why truthiness sounds wrong to my ears.
[Coke] moritz: if you want to do that and add a glossary entry, sure. 16:20
[Coke] is going with just "truth" for now.
gfldex i strongly disagree on truth
perlpilot likes "trueness" as is. 16:21
[Coke] ok. leaving it as "trueness" which is apparently a word.
gfldex i picked^W made up that word because trueness relates to true as definedness relates to defined
not my fault that the fine english folk forgot to add that vital word to their language 16:22
moritz "Perl 6 makes a clear distincting between definedness, and whether it evaluates to True or False in a boolean context"
TimToady no, no, no
it never evaluates to True or False
well, sometime it might be 16:23
but no Bool has to be created
we should reserve True and False for actual Bool values
perlpilot indeed
TimToady or another way to say it is that boolean context is different from Bool context 16:24
moritz but the evaluation in a boolean context acctually produces True or False
m: .say for ?0, ?1
camelia rakudo-moar 8e9fd0: OUTPUT«False␤True␤»
TimToady no, that's conversion to Bool
m: say "I'm not Bool" if 1;
camelia rakudo-moar 8e9fd0: OUTPUT«I'm not Bool␤»
gfldex m: say 'zero' if 0; # <--- no bool 16:25
camelia ( no output )
TimToady it's a boolean evaluation without Bool conversion
moritz m: say "I'm so Bool" if 0 but role { method Bool { True } }
16:25 rgrinberg joined
camelia rakudo-moar 8e9fd0: OUTPUT«I'm so Bool␤» 16:25
16:25 rgrinberg left
moritz but even 'if' calls method Bool 16:25
gfldex Sir, please but that role down!
moritz so the distinction seems very artifical to me 16:26
a Bool conversion happens, the result is just discarded
[Coke] you can optimize your way out of it, of course.
moritz: QAST::Op(if) might know what to do when given a QAST::WVal(Int), e.g. 16:27
anyway, I added the words to our dictionary, I'm done. :)
gfldex if a Bool is created or not is besinde the point. The question is, if the reader understands what is meant by that word.
dalek c: df4f847 | (Will Coleda)++ | doc/Type/Supply.pod6:
remove reference to tock
16:28
gfldex i'm not writing for linguists, i'm writing for aspiring Perl 6 programmers. :) 16:29
16:29 grondilu left
[Coke] exactly, gfldex, and we were using 3 different ways to refer to it. 16:29
perlpilot moritz: I think of it kind of in terms of what the human needs to be responsible for. Does the human need to make a Bool? If so, we're talking about True and False. If we're talking about evaluating 1 as "true", then we're not talking about True or False, we're talking about true and false.
or something like that 16:30
moritz nice rule of thumb. I just have to suppress my impulse that says "I'm a contributor to the settings, I'm the human responsible for returning True and False here" :-)
anyway, afk, TTFN 16:31
16:32 harmil_wk joined
gfldex if it would be a book I would add a footnote to trueness to explain the difference between merely being Bool::* and implicit conversion by control structures. 16:33
16:33 Util joined
dalek Heuristic branch merge: pushed 30 commits to doc/spellcheck by coke 16:34
perlpilot DrForr: what gfldex just said would make a good side-bar in Learning Perl 6 ;)
gfldex Pod::To::BigPage does create marginals instead of footnotes, not sure if Pod::To::HTML does. Maybe worth adding if it doesn't. 16:35
16:36 dakkar left
gfldex i just checked /language/control#if and it's ... not very good 16:37
[Coke]: how much spelling do you guess is still ahead of you?
[Coke] with that, down to 5 files with spelling issues; 3 of those are due to N<> and E<> processing by p6doc, one is maybe an aspell issue, and the last is "nth's" which I think can be edited to be more clear anyway. 16:38
gfldex [Coke]: also, if you got the time, can you drop a few lines into CONTRIBUTING.md please?
[Coke] gfldex: sure, about what?
gfldex if you found common mistakes, it may be worthwile to avoid them in the future. 16:39
16:39 cognominal left
[Coke] oh, that's easy: "run the test". :) 16:39
gfldex .oO( They should teach that in school. )
[Coke] I don't think there is a common enough class of error that it's worth calling any of them out specifically. 16:40
dalek c: 30b9319 | coke++ | doc/Type/Str.pod6:
this is fine without possessive
16:41
[Coke] huh. can't hit alt-; here to get an ellipse; works fine in iterm. 16:43
4 files left.
16:43 user9 left 16:44 user9 joined 16:46 hchienjo joined
[Coke] ok, the N<> issue is a rakudo problem. N<> is getting dumped in place., so "BadN<things are happening>" through perl6 --doc prints "Badthings are happening" 16:50
I would be happy with "Bad (things are happening)" as a stopgap.
... although adding a single space before the N<> also works for my purposes. 16:52
gfldex [Coke]: if it's in some example I would remove the N<>. Markup in examples can collide with syntax highlighting, what is done automatically and as such may change without any author seeing the change.
[Coke] no, descriptive text. 16:53
gfldex and it tends to make the text noisy for little gain
16:57 go|dfish left
dalek c: 8b3d608 | coke++ | doc/Language/ (3 files):
space out N<> - problematic with perl6 --doc
16:57
c: 559a4e7 | coke++ | doc/Language/modules.pod6:
E<> doesn't work in perl6 --doc; use a comma
16:57 go|dfish joined
dalek c/spellcheck: 0e35582 | coke++ | doc/Type/Str.pod6:
this is fine without possessive
16:58
c/spellcheck: b3e0f89 | coke++ | doc/Language/ (3 files):
space out N<> - problematic with perl6 --doc
c/spellcheck: a3d41ee | coke++ | doc/Language/modules.pod6:
E<> doesn't work in perl6 --doc; use a comma
[Coke] down to 2 files... 16:59
16:59 skids left 17:01 Actualeyes left
iBakeCake m: my num $x = 3e0; dd $x.WHAT 17:01
camelia rakudo-moar 697a0a: OUTPUT«Num␤»
iBakeCake How can I check whether something is a native type? 17:02
17:02 hchienjo left
timotimo prim...something 17:02
github.com/perl6/nqp/blob/master/d...exprimspec 17:03
that's not how i remember that op
yeah, you want ojbprimspec instead
objprimspec
iBakeCake m: use nqp; my num $x = 3e0; dd nqp::objprimspec($x) 17:04
camelia rakudo-moar 697a0a: OUTPUT«0␤»
iBakeCake m: use nqp; my Num $x = 3e0; dd nqp::objprimspec($x)
camelia rakudo-moar 697a0a: OUTPUT«0␤»
timotimo may have to decont
most probably will have to decont, actually
iBakeCake m: use nqp; my num $x = 3e0; dd nqp::objprimspec(nqp::decont($x))
camelia rakudo-moar 697a0a: OUTPUT«0␤»
timotimo hmm
m: use nqp; dd nqp::objprimspec(num) 17:05
camelia rakudo-moar 697a0a: OUTPUT«2␤»
timotimo m: use nqp; dd nqp::objprimspec(0.05e0)
camelia rakudo-moar 697a0a: OUTPUT«0␤»
timotimo m: use nqp; dd nqp::objprimspec(my num $a = 0.05e0)
camelia rakudo-moar 697a0a: OUTPUT«0␤»
timotimo m: use nqp; dd nqp::objprimspec(my num \a = 0.05e0)
camelia rakudo-moar 697a0a: OUTPUT«Type check failed in binding; expected num but got Num (0.05e0)␤ in block <unit> at <tmp> line 1␤␤»
[Coke] so, this is a problem, for some reason: Aspell thinks this line: 17:06
say +DigitMatcher.subparse: '12', args => \(:full-unicode);
... dammit, my unicode is vanishing. :| 17:07
timotimo :o
[Coke] anyway, the \(:full- there shows up as a mispelled 'ull'
timotimo urgh 17:08
[Coke] trying to find something in the aspell docs that would explain it. in the meantime, I can add 'ull' and 'ffix' to the list to ignore, and that's it.
iBakeCake m: use nqp; my num $x = 3e0; dd nqp::lexprimspec(nqp::curlexpad(), '$x')
camelia rakudo-moar 697a0a: OUTPUT«2␤»
iBakeCake m: use nqp; my Num $x = 3e0; dd nqp::lexprimspec(nqp::curlexpad(), '$x')
camelia rakudo-moar 697a0a: OUTPUT«0␤»
iBakeCake timotimo++
m: use nqp; sub ($g) { dd nqp::lexprimspec(nqp::curlexpad(), '$g') }( my num $ = 3e0 ) 17:09
camelia rakudo-moar 697a0a: OUTPUT«0␤» 17:10
iBakeCake dammit :(
17:12 AlexDaniel joined 17:15 maybekoo2 left
dalek c: e934bc2 | coke++ | doc/Language/classtut.pod6:
remove trailing whitespace
17:15
c/spellcheck: 22bba5a | coke++ | xt/code.pws:
aspell is confused
17:16
c/spellcheck: ae026d1 | coke++ | doc/Language/classtut.pod6:
remove trailing whitespace
17:18 sufrostico joined
timotimo if the name dont match, the value wont be right. ibakecake 17:19
oh, oops
misread
dalek c/spellcheck: 56083d5 | coke++ | xt/aspell.t:
p6doc just uses this under the hood anyway
17:20
17:22 firstdayonthejob joined
[Coke] anyone mind if when I merge spellcheck branch, I squish it? 17:23
17:24 zakharyas left
japhb [Coke]: Why do you want to? 17:26
17:27 TEttinger joined
[Coke] \o/ All tests successful. 17:27
japhb (That's curiosity, not abject disagreement.)
mst I would suggest 'make it ff-clean but then merge it no-ff'
then you get a single commit in master
[Coke] japhb: because 99.% of the commits are small minor updates to the wordlist, or merges from master.'
mst but without swuashing away the history of the branch
also you should rebase it first to get rid of the merges
because ew 17:28
[Coke] ok. I don't mind changing the history if no one cares.
17:29 ocbtec joined
[Coke] any pointers on doing the rebase? 17:29
mst well you just proposed obliterating it entirely
I'm just suggesting we preserve the useful parts of it, while getting rid of the mistakes
ilmari [Coke]: git rebase master 17:30
(when you're on the branch you want to rebase)
[Coke] ilmari: thank you.
dalek c/spellcheck: 65367e4 | coke++ | xt/ (2 files):
more words
c/spellcheck: 808a063 | coke++ | xt/words.pws:
last word
17:31 seatek joined
dalek Heuristic branch merge: pushed 49 commits to doc/spellcheck by coke 17:31
[Coke] so, as long as I've rewritten history once, I can collapse a bunch of other commits as well 17:32
ilmari yeah, 'git rebase -i master', then you can shuffle them around and squash them 17:33
don't worry if you get confused or conflicts, you can always 'git rebase --abort'
[Coke] well, except I've already done the first rebase from master and pushed it. 17:35
(and, also, that rebase has commits I didn't make in this branch, but only merged from master) 17:36
17:36 aod_ joined
perigrin the latter part is what rebasing master was supposed to fix. 17:37
you can manually move them to the top of the list though and pretend that was the way it was always supposed tob e 17:38
[Coke] yup. and it apparently did not.
ilmari git should skip commits that are already on the branch you rebased onto
was your local master up-to-date?
[Coke] out of 100s of commits? seems like a waste of my time to dig through them.
ilmari: yes, that's how I was doing all the merges from master. :)
perigrin ilmari: if he has merge commits from master to his local branch the merge commits will be there still 17:39
since they're still commits in the tree.
ilmari perigrin: I thought it would drop the merge commits unless you said --preserve-merges? 17:40
[Coke] these aren't merge commits.
they're commits that were made to master after I branched.
e.g. d40da02
perigrin needs to go talk to a child's principal 17:41
keep him from getting suspended or worse ... and/or make sure he gets suspended or worse if that's what'll get through to him
iBakeCake gets flashbacks of his childhood 17:42
perigrin: what happened? :)
[Coke] grabs lunch. laters.
17:43 firstdayonthejob left 17:45 firstdayonthejob joined
aod_ good afternoon guys. I would like to ask a question about promises. Is it ok I post code here? 17:48
iBakeCake aod_: it's best to use a pastebin: fpaste.scsys.co.uk/ 17:49
This way we don't have to look at a scrolling piece of code on the screen (as people keep talking) 17:50
aod_ fpaste.scsys.co.uk/536818
I wrote a code launching promisses, and I watched the threads spawn using top
but the threads did not end, they remained there till the end of the program 17:51
I was expecting to see them close one at a time
can someone enlighten my why didnt the threads closed? werent they supposed to? 17:52
iBakeCake Have you tried seeing what happened if you await()ed them?
aod_ same
they remain open 17:53
till the end
harmil_wk If I have a variable, say, $x. And I want to know if that variable contains something that it's reasonable to treat as a single value or if I should iterate over it, what's the best way to do that?
gfldex aod_: Rakudo will reuse threads when possible.
harmil_wk: you can do $x ~~ Positional but that is likely a bad idea 17:54
harmil_wk I thought $x.^can("iterator") but that exists on Any, so even 1.^can("iterator") works.
iBakeCake harmil_wk: $x ~~ Positional # probably
harmil_wk gfldex: why is that a bad idea? 17:55
iBakeCake gfldex: why bad idea?
timotimo aod_: yes, the default ThreadPoolScheduler will not close threads. you can build your own scheduler that will, if you want to.
gfldex it's one of those cases where you may be missing a multi to make that decision early on
iBakeCake timotimo: will not close at all? Ever?
gfldex also, any single value will iterate just fine
timotimo iBakeCake: when the process ends, the threads will be closed 17:56
harmil_wk gfldex: it will, but I'll end up in an infinite loop that way, because on iterable things I want to recurse down and perform my operation on each element.
iBakeCake timotimo: well, that would explain why buggable is leaking then, I guess
gfldex harmil_wk: if you recurse, use a multi
timotimo iBakeCake: but the maximum number of threads from the TPS is fixed 17:57
dalek osystem: 8882872 | (Julien Simonet)++ | META.list:
Add DNS::Zone : DNS zone file parser.
timotimo it should max out at some point
iBakeCake timotimo: OK. I get it now
harmil_wk: we have duckmap that's likely what you're looking for.
harmil_wk iBakeCake: I'll look 17:58
iBakeCake harmil_wk: or deepmap.... Are you working on is-polysomething-deeply? You probably want to use one of those routines
s: &duckmap
SourceBaby iBakeCake, Sauce is at github.com/rakudo/rakudo/blob/697a...ps.pm#L643
iBakeCake s: &deepmap
SourceBaby iBakeCake, Sauce is at github.com/rakudo/rakudo/blob/697a...ps.pm#L513
18:04 AlexDaniel left 18:08 Derperperd joined 18:09 dwarring joined 18:10 dataf4l left 18:11 robot joined, robot left 18:27 ponpon is now known as ponbiki 18:28 girafe joined 18:36 cdg left 18:39 aod_ left 19:00 dataf4l joined 19:01 cognominal joined 19:02 labster joined 19:16 darutoko left
dalek c/spellcheck: de336e6 | coke++ | xt/.aspell.pws:
ignore more words
19:17
doc/spellcheck: 803b711 | coke++ | xt/aspell.t:
doc/spellcheck: add overview comment, search only docs
19:17 dalek left
[Coke] ... that's a wierd summary. 19:17
so, no more merge commits, and most of the "add more words" commits have been collapsed. 19:18
19:18 dalek joined, ChanServ sets mode: +v dalek
[Coke] so, safe to merge, will push it this evening, probably. 19:19
19:24 rudi_s joined 19:35 atweiden joined 19:38 andrzejku joined 19:39 domidumont left 19:41 briandfoy joined 19:47 dataf4l left 19:52 dataf4l joined 20:05 cdg joined 20:06 pyrimidi_ joined 20:07 pyrimidi_ left 20:08 pyrimidi_ joined, pyrimidine left 20:12 sjoshi joined 20:13 firstdayonthejob left
andrzejku is true that perl6 is lisp? 20:13
20:14 andrzejku left
timotimo it surprises me they were here for half an hour before they asked the question and then disappeared 2 minutes after :( 20:15
20:18 skids joined 20:20 wamba left 20:22 pdcawley left 20:27 sjoshi left
nine timotimo: IIRC you're into music. Are you also into Hi-Fi? 20:28
timotimo nah, don't have any money for that stuff 20:29
harmil_wk timotimo: The canonical answer to andrzejku's question should be "nil". Can we get that in a FAQ somewhere?
nine Well, I'm looking for someone to run an idea by (totally not Perl 6 related, sorry for that.) 20:30
timotimo well, we have #perl6-noise-gang :)
nine Aah...almost forgot about that. Will try there :)
timotimo :) 20:31
[Coke] ... /me wonders if 'perl6 --doc file' precompiles 20:32
dalek Heuristic branch merge: pushed 20 commits to doc by coke 20:34
20:35 rindolf left, wamba joined 20:36 sufrostico left
[Coke] merged spellcheck branc. 20:37
*h
harmil_wk I take that back, I'd say the correct answer is "(not (not Nil))" which is a boolean false in both CL and Perl 6.
20:38 nemo left
[Coke] 'make xtest' (along with aspell installed) will now complain about mispelled (or esoteric) words (or more likely, some literal string in a code example) 20:38
20:38 sufrostico joined
samcv are submethods not inherited? 20:41
[Coke] (xtest) you can also run perl6 xt/aspell.t <list of files> if you just want to test a few (because test is slooow) 20:43
samcv: nope.
20:44 kurahaupo left, kurahaupo__ joined
[Coke] er, "no, they are not." 20:44
samcv ok that's what i thought. wanted to make sure it was that clear cut. the perl 6 page on methods uses 'submethod' but doesn't explain what it does explicitly 20:45
[Coke] if you docsearch for 'submethod', the class you find says it first P. 20:46
samcv docsearch? on the perl6 site? 20:47
ooo nice :) 20:48
yes. it does
i will use the built in search from now on. :) very good
dalek c: 5fb819c | coke++ | doc/Language/faq.pod6:
Christmas has come and gone.

Be more definitive.
c: 2c64c21 | coke++ | doc/ (3 files):
use better preposition
c: e2cdc2b | coke++ | doc/Language/faq.pod6:
add slightly tongue-in-cheek lisp faq

  harmil_wk++
[Coke] harmil_wk: ^^ 20:49
harmil_wk [Coke]: oh God, what I have done?!
20:52 bjz joined 20:53 Derperperd left
geekosaur obviously that belongs in rakudo, similarly to 42 :p 20:55
samcv ok so submethods are not inherited. can you make $.var not inherited as well? 21:04
probably some other way than putting it in a submethod 21:05
21:07 RabidGravy left
timotimo just make it $!var and have a submethod accessor 21:08
21:09 kurahaupo__ left
samcv kk 21:10
that's what i was thinking
timotimo but $!var is always only available in the current class
so you can just as well leave out the submethod altogether and access the var directly by its "private" name
21:21 raiph left, decent left, wamba left
samcv so you can access $! variables outside of the class? by calling it by its private name? how is that done? 21:23
FROGGS samcv: $!var is only accessable from the inside 21:24
samcv yeah that's what i thought :P 21:25
FROGGS but you could a submethod yourself
add a*
21:25 sufrostico left 21:26 espadrine joined 21:27 itaipu left, sufrostico joined 21:28 nicq20 joined
nicq20 Hello o/ 21:29
21:31 fumlead left
skids samcv: there is also a "trusts" trait but (at least right now) it only pertains to private methods, not attributes 21:32
samcv ah ok
21:38 espadrine left 21:43 bjz left 21:45 pdcawley joined 21:46 bjz joined 21:48 pdcawley left, sufrostico left 21:49 bjz left 21:55 eliasr joined 21:56 MasterDuke joined 21:57 AlexDaniel joined 22:03 _28_ria left 22:07 lizmat joined
skids m: my Hash $h; $h.perl.say; $h{42}++; $h.say; my BagHash $b; $b.perl.say; $b{42}++; $b.say; 22:17
camelia rakudo-moar 74d0e3: OUTPUT«Hash␤{42 => 1}␤BagHash␤Type check failed in assignment to $b; expected BagHash but got Hash (${})␤ in block <unit> at <tmp> line 1␤␤»
22:17 woolfy joined
iBakeCake skids: that's cause you're calling it on a type object 22:18
skids In both cases. 22:19
iBakeCake m: my Hash $h; $h.perl.say; $h{42}++; $h.say; my BagHash $b = BagHash.new; $b.perl.say; $b{42}++; $b.say;
camelia rakudo-moar 74d0e3: OUTPUT«Hash␤{42 => 1}␤().BagHash␤BagHash.new(42)␤»
iBakeCake Yes, and by default type objects autovivify to a Hash
22:19 dataf4l left
iBakeCake m: my $x = Int; dd $x; $x{42}++; dd $x 22:19
camelia rakudo-moar 74d0e3: OUTPUT«Int $x = Int␤Hash $x = ${"42" => 1}␤»
22:19 dataf4l joined 22:20 FROGGS left
skids wonders if the autovivify stuff is together enough to supply BagHash with behavior to override that default 22:21
iBakeCake skids: I think it should be possible by defining AT-KEY for :U in Baggy. I actually recently stumbled onto this myself and kinda got distracted and never investigated further than all :U autovivify to Hash :) 22:22
s: Any, 'AT-KEY' 22:23
SourceBaby iBakeCake, Something's wrong: ␤ERR: Type check failed in binding to &code; expected Callable but got Method+{<anon|51469040>} (Method+{<anon|5146904...)␤ in sub do-sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 42␤ in sub sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 33␤ in block <unit> at -e lin
iBakeCake s: Any, 'AT-KEY', \(42)
SourceBaby iBakeCake, Sauce is at github.com/rakudo/rakudo/blob/74d0...ny.pm#L362
iBakeCake Here it does Hash.new, but for Baggies it't do self.new: github.com/rakudo/rakudo/blob/74d0...ny.pm#L364
skids Yeah I'm kinda 5 layers deep in what I'm working on right now so maybe a detour is ill advised.
iBakeCake And same should be done for Set/SetHash
:) 22:24
iBakeCake would do it but too tired from doing all the trig stuff the entire day.
I'll take a look into this tomorrow, if I still remember
skids iBakeCake++
22:28 girafe left 22:49 ufobat left 22:51 dataf4l left 22:52 dataf4l joined 22:54 dataf4l left 22:55 firstdayonthejob joined 22:58 nicq20 left 22:59 firstdayonthejob left 23:08 sufrostico joined 23:09 devmikey joined 23:11 dataf4l joined 23:13 dataf4l left, dataf4l joined 23:18 dataf4l left, sufrostico left, dataf4l joined 23:19 atweiden left 23:22 dataf4l left 23:23 dataf4l joined 23:25 sufrostico joined 23:27 dataf4l left
samcv ... or die "Error" is the same as die X::AdHoc.new(payload => "Error") ? 23:29
23:30 dataf4l joined 23:31 devmikey left 23:32 nadim left 23:35 bjz joined 23:38 bjz left 23:39 sufrostico left 23:40 sufrostico joined 23:42 ocbtec left
samcv also: open 'foo' or say "Error $!"; this doesn't work, but open 'foo'; say "$!"; does work. how do i access $! when using or? 23:43
23:46 dataf4l left 23:47 dataf4l joined 23:48 sufrostico left
Juerd samcv: I think you may be running into a bug in the REPL interface 23:48
samcv i get: Use of Nil in string context. when doing open 'foo' or die "Error: $!" 23:49
23:49 dataf4l left
Juerd In the REPL I get "Control flow commands not allowed in toplevel" 23:49
samcv oh
Juerd But it seems to work if you add "try open 'aoeu';" before it...
samcv yeah i get that in repl. running the program directly it shows the other error i said 23:50
ah.
23:50 cdg left
Juerd Either way, are you aware that you could also use a CATCH block to catch the exception? :) 23:51
samcv yes i know how to do that :)
Juerd I don't really understand why open or say "...$!" wouldn't work.
samcv me either
Juerd It feels like it should just work :)
samcv without the `or´, it works fine
like if they're on different lines 23:52
and try/CATCH works fine accessing the exception as $_
Juerd Or if a dummy "try open 'foo';" is added before it. Which should probably be golfed, but I can't think of what mechanism may be causing this.
I happened to notice that after that it did begin to work as expected 23:53
But don't ask me why :)
23:53 dataf4l joined
samcv it worked doing `try open 'foo' or die "Error $!"; ´ ? 23:53
Juerd juerd.nl/i/07e8cc73b885814f41ca09cfa1448c34.png 23:54
samcv which rakudo do you have?
i have 2016.10
23:55 sufrostico joined
Juerd This is Rakudo version 2016.08.1-113-g74f1edc built on MoarVM version 2016.08-32-ge52414d 23:55
samcv ah ok
maybe a regression? idk
m: open 'foo' or die "E: $!"
camelia rakudo-moar 74d0e3: OUTPUT«open is disallowed in restricted setting␤ in sub restricted at src/RESTRICTED.setting line 1␤ in sub open at src/RESTRICTED.setting line 9␤ in block <unit> at <tmp> line 1␤␤»
timotimo you probably want "orelse" instead of just "or" 23:56
and of course the restricted setting is Fing you over :)
samcv m: false or die "$!" 23:57
camelia rakudo-moar 74d0e3: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routines:␤ false used at line 1␤ or used at line 1␤␤»
timotimo does open actually die, or does it fail?
samcv m: False or die "$!"
camelia rakudo-moar 74d0e3: OUTPUT«Use of Nil in string context␤ in block <unit> at <tmp> line 1␤␤ in block <unit> at <tmp> line 1␤␤»
samcv timotimo, uh it throws the error you just saw
timotimo m: try 0 / 0 orelse die "test: $!"
camelia ( no output )
timotimo m: (try 0 / 0) orelse die "test: $!"
camelia ( no output )
timotimo m: (try 0 % 0) orelse die "test: $!"
camelia rakudo-moar 74d0e3: OUTPUT«test: Attempt to divide by zero using %␤ in block <unit> at <tmp> line 1␤␤»
timotimo m: try 0 % 0 orelse die "test: $!"
camelia ( no output )
geekosaur thought $! was obsolete at best... should be able to use the return value instead of a magic var
samcv obsolete? it's in the documentation tho. uhm so exceptions are returned? 23:58
timotimo no, failures are returned
geekosaur that's what Failure is
it's a suspended exception that will throw if used as a value
samcv ok how to access the full exception using the return then geekosaur
geekosaur but you can introspect it to see if it's a failure and what kind it is, without making it throw 23:59
timotimo m: +"hello" orelse say "oh no! $_"
camelia rakudo-moar 74d0e3: OUTPUT«oh no! (HANDLED) Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5hello' (indicated by ⏏)␤ in block <unit> at <tmp> line 1␤␤»
timotimo m: +"hello" or say "oh no! $_"
camelia rakudo-moar 74d0e3: OUTPUT«Use of uninitialized value $_ of type Any in string context.␤Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.␤ in block <unit> at <tmp> line 1␤oh no! ␤»
timotimo m: +"hello" or say "oh no! !_"
camelia rakudo-moar 74d0e3: OUTPUT«oh no! !_␤»
timotimo m: +"hello" or say "oh no! $!"
camelia rakudo-moar 74d0e3: OUTPUT«Use of Nil in string context␤ in block <unit> at <tmp> line 1␤oh no! ␤»
timotimo see the orelse?
the (HANDLED) comes from the fact that it's a Failure, not a regular exception
samcv yeah. so orelse is the right way to do it then
23:59 dataf4l left