»ö« 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. |
|||
timotimo | Zoffix: the node attribute is to install the match object so that other pieces of the compiler chain know where the object came from. at the very least it gives line numbers | 00:01 | |
Zoffix | timotimo: thanks. | ||
timotimo | YW | ||
00:02
Cabanossi left
00:04
Cabanossi joined
00:06
thou is now known as softmoth
00:09
tardisx joined
00:10
Zoffix left,
sena_kun joined
00:13
sena_kun left
00:25
Ven`` left
00:45
Actualeyes left
00:46
Cabanossi left
|
|||
lookatme | o/ | 00:46 | |
00:49
Cabanossi joined,
cdg joined
00:52
cdg_ left
00:54
cdg left
|
|||
timotimo | so, is the perl 6 code in the "all the stars of perl 6" blog post supposed to be ".say for 1...**"? because i don't see a mention of HyperWhatever anywhere in the post | 00:57 | |
Geth | doc: 3bef31d57d | (Zoffix Znet)++ | doc/Type/Str.pod6 Clarify Str.trans: :d deletes only… …matches that don't got a replacement char for 'em |
01:07 | |
synopsebot | Link: doc.perl6.org/type/Str | ||
doc: 20f3aff032 | (Zoffix Znet)++ | doc/Type/Str.pod6 Clarify :d is ignored in Str.trans: :d, :c… If replacement chars are given. Closes github.com/rakudo/rakudo/issues/1309 |
01:09 | ||
timotimo | DrForr: in your test all the things post you refer to `empty call` as if it were being passed to ok at some point in the example, but that seems to have been edited out or somethin | 01:10 | |
01:11
manchicken joined
|
|||
manchicken | So, I'm thinking of doing a series on NativeCall tutorials. Has anybody ever done that? | 01:11 | |
01:12
kyan joined
|
|||
manchicken | I'm trying to teach myself this, and I figured a neat little documentation project would be the easiest way of doing so. | 01:12 | |
perlawhi1l | Hi people | 01:13 | |
kyan | Just a heads up about a problem on the Web site: the body text is written from Camelia's perspective, but in a narrow/zoomed-in display, Camelia is hidden (presumably by CSS media queries). | 01:14 | |
perlawhi1l | Can I check if a variable is contrained by a subset (without specifying the subset by name)... | 01:15 | |
m: subset Foo of Int where * > 0; my Foo $f = 5; say $f.WHAT; | |||
camelia | (Int) | ||
perlawhi1l | is there anything i can ask `$f` that will tell me it is contrained by subset Foo ? | ||
timotimo | ah yes, it's got the class img-responsile (also, center-block, not sure what that is for, exactly) | ||
perlawhi1l | besides $f ~~ Foo | ||
timotimo | $f.isa(Foo) perhaps, perlawhi1l | ||
perlawhi1l | ok, so unless I know the name of the subset in advance, I can ask. | 01:16 | |
can't | |||
timotimo | that's not true :) | ||
m: subset Foo of Str where / "hi" /; my $which-to-check = "Foo"; say "oh hi" ~~ ::($which-to-check) | 01:17 | ||
camelia | True | ||
timotimo | m: subset Foo of Str where / "hi" /; my $which-to-check = "Int"; say "oh hi" ~~ ::($which-to-check) | ||
camelia | False | ||
TimToady | m: subset Foo of Str where / "hi" /; my $which-to-check = "Foo"; say "oh hi" ~~ $which-to-check | ||
camelia | False | ||
TimToady | m: subset Foo of Str where / "hi" /; my $which-to-check = Foo; say "oh hi" ~~ $which-to-check | ||
camelia | True | ||
timotimo | kyan: oh, actually, there's a media query for #welcome-header which has display: none !important, that's what's making it go away | 01:18 | |
TimToady | still works even if the name is a .WHAT | ||
timotimo | greetings TimToady | ||
TimToady | granted you need ::() if you're only given a string | 01:19 | |
perlawhi1l | so given `subset Foo of Int; my Foo $f;`... without typing the letters 'Foo', is there anything I can ask $f that returns 'Foo' | ||
01:20
jeromelanteri joined
|
|||
timotimo | m: subset Foo of Int where 0 < * < 9; my Foo $var = 4; say $var.VAR.of | 01:20 | |
camelia | (Foo) | ||
TimToady | m: subset Foo of Int; my Foo $f; say 42 ~~ $f.VAR.of | ||
camelia | True | ||
timotimo | that gives you the type object you can directly typecheck against | ||
perlawhi1l | thanks! TimToady++ | 01:21 | |
MasterDuke | manchicken: i don't know of any | ||
timotimo | or you can .^name and get it as a string, and later get it from your lexical scope (important) with the ::() thing | ||
TimToady | but if $f is visible, why don' tyou know the type :) | ||
perlawhi1l | I do :D I just wanted to know how I can introspect it | ||
timotimo | well, it could have been passed in an "is raw" argument for example | ||
manchicken | MasterDuke, well then, I'll go ahead and do that. | 01:22 | |
I will likely also submit some pull requests. | |||
First: how to play with C structs. | |||
01:22
Slayerk joined
|
|||
Slayerk | Hi all! | 01:22 | |
manchicken | (all of this is me learning enough to implement librabbitmq-c) | ||
timotimo | manchicken: i believe perl6-intro.com has a short intro to nativecall, too | ||
TimToady | m: sub foo(::T \sumpthin) { say 42 ~~ T }; foo(42) | ||
camelia | True | ||
Slayerk | Does Perl 6 have something like the delay function in C? | ||
manchicken | I'm going to make a quick GitHub repo that has a bunch of different stuff. | 01:23 | |
01:23
pilne joined
|
|||
manchicken | Slayerk, is that a Windows function? | 01:23 | |
I don't think that's a POSIX routine. | |||
TimToady doesn't know what delay() does | |||
timotimo | Slayerk: if you're looking to actually block a thread, you'd use "sleep" (takes its argument in seconds, but allows fractions, of course) | ||
otherwise you can "await Promise.in($seconds)" and other tasks can be done on the thread if it's in a thread pool scheduler (and you have version 6.d.PREVIEW turned on) | 01:24 | ||
Slayerk | manchiken: Not sure, sorry :P | ||
TimToady | well, I guess the question is what *you* want to do :) | 01:25 | |
Slayerk | Well, I'm trying to make terminal animation :P | ||
timotimo | oh, have you considered looking at Terminal::Print, Slayerk? | 01:27 | |
TimToady | sleep will likely be adequate for that, and it's not difficult to switch to promises if you need to later | ||
Slayerk | TimToady: Thanks, will see how it goes and will report back the results :) timotimo: Thanks for you advice | ||
It works guys! | 01:30 | ||
timotimo | perl6advent.wordpress.com/2017/12/...th-perl-6/ - the newest post is live! | 01:31 | |
kyan | timotimo: mm, well, anyhow, it makes the "Hi, my name is Camelia." become somewhat disembodied ;P | 01:32 | |
timotimo | it's true | ||
Geth | doc: 7351392425 | (Zoffix Znet)++ | doc/Language/operators.pod6 Document tr/// |
||
synopsebot | Link: doc.perl6.org/language/operators | ||
timotimo | i don't have a good hunch for how to solve it elegantly | ||
01:33
eater left
01:34
eater joined
|
|||
kyan | perhaps put Camelia into the same div as the intro paragraph, and then float right? | 01:34 | |
Geth | doc: 023e4a7bc2 | (Zoffix Znet)++ | doc/Language/5to6-perlfunc.pod6 Clean up tr/// Perl 5 docs - Remove mentions of speculations - Just link to Str.trans for docs - Mention TR/// |
01:35 | |
synopsebot | Link: doc.perl6.org/language/5to6-perlfunc | ||
01:41
Slayerk left,
cdg joined
|
|||
Geth | doc: f45e36ce04 | (Zoffix Znet)++ | doc/Language/operators.pod6 Document TR/// pseudo op Rakudo impl: github.com/rakudo/rakudo/commit/f695862409 Spec: github.com/perl6/roast/commit/27cc9417fc RT#127824: rt.perl.org/Ticket/Display.html?id=127824 |
01:42 | |
synopsebot | RT#127824 [new]: rt.perl.org/Ticket/Display.html?id=127824 [RFC] TR/ / / is not implemented | ||
01:42
Zoffix joined
|
|||
Zoffix | kyan: it gets hidden because on mobile real estate is at a premium and there's already a camelia from the header a few lines above: i.imgur.com/ktg83b6.png | 01:43 | |
kyan: if you wanna tweak it, gimme your github username, and I'll give you a commit bit. | 01:44 | ||
01:44
piojo_ joined
|
|||
timotimo | Zoffix: that's not on the main page, though | 01:44 | |
or does it appear in tiny if the page is too narrow? | |||
Zoffix | timotimo: ah, I'm actually unsure which site we're talking about. Docs or main? :) | 01:45 | |
If it's main, yeah, I see on mobile there ain't none camelias | 01:46 | ||
01:46
cdg left,
ZzZombo left
|
|||
Zoffix | Which sucks 'cause para says "Hi, my name is Camelia" :) | 01:46 | |
kyan: wanna fix it? :) | |||
timotimo | that's exactly what kyan was complaining about | ||
the juxtaposition of "hi i'm camelia" and "no camelia to be seen" | |||
Zoffix | Ah, I misread. | ||
01:46
ZzZombo joined
|
|||
timotimo | that would explain the confusion | 01:47 | |
i'll go to bed | 01:48 | ||
have a good one! | |||
Geth | doc: 931506df60 | (Zoffix Znet)++ | doc/Language/operators.pod6 Add example of tr/// with adverbs up on it |
||
synopsebot | Link: doc.perl6.org/language/operators | ||
Zoffix | \o | ||
01:51
Actualeyes joined
01:52
raiph joined
|
|||
TimToady | Zoffix: the :node($/) is mostly used for current line number, but the match object is the only way to convey everything in the "current language" to subsequent compiler passes, since dynvars (the old way to do that) go out of scope too soon | 01:54 | |
Geth | perl6.org: a55a3d981f | (Zoffix Znet)++ | README.md Add tip about nuking source/archive while building |
||
timotimo | kyan: if you fix the page for mobile, maybe you can come up with something clever for the tabs above the examples box, too | ||
01:55
haxmeister joined
|
|||
TimToady | which is why all the pragmas, braids, etc. now can be found via match objct methods | 01:55 | |
Zoffix | TimToady: still unsure when it should be used though. Here I saw it passed to the callmethod op and then to the Var qast a few lines down as well: github.com/rakudo/rakudo/blob/mast...8131-L8134 | 01:56 | |
Are both needed? vOv | |||
kyan | I'll look at it after finals week :) | 01:59 | |
TimToady | in general we want every QAST node to know its line number, minimally, cuz we don't know who's gonna throw an error based on what | 02:00 | |
and there's already a node pointer in the QAST, so might as well fill it | |||
the redundancy is more perceived than real | |||
Zoffix | OK :) | ||
TimToady | otherwise you start getting error messages that don't know the line number, or pragma decisions that don't know the values of their pragma, etc. | 02:01 | |
and basically you're just gonna keep a heap of pointers into the original match structure, but that match structure itself is not duplicated | 02:03 | ||
Zoffix | Ah | ||
AndChat|688961 | Just out of curiosity, would Perl6 be faster if the procedural Paradigm was removed, if Perl6 was strictly OO? | ||
TimToady | um, OO is essentially procedural underneath anyway, you're just hiding the variables inside objects | 02:04 | |
AndChat|688961 | Oh, okay. | ||
timotimo | well, and you get method resolution order stuff. depending on whether you put multiple dispatch (or just overloaded methods) in there as well ... | ||
in procedural code, you'd probably always know what a given piece of code is calling? | |||
in fact, if you use subs or private methods nowadays, we're already selecting the right candidate up front where possible | 02:05 | ||
02:05
AndChat|688961 is now known as comborico
|
|||
TimToady | now, with purely functional programming (FP), you try to avoid side effects, so you treat the data as immutable, and that can occasionally have some benefits for the optimizer, and you could call that "removing procedural code", but it's sort of the opposite way of controlling state changes from OO | 02:07 | |
comborico | Oh. | 02:08 | |
TimToady | OO tries to hide state changes inside objects, while FP tries to hide state changes in the parameter bindings of the call stack | 02:09 | |
manchicken | Well poop. | 02:10 | |
NativeCall is giving me `image not found` issues. | |||
TimToady | which one is more efficient really depends on the nature of the problem you're trying to solve | ||
manchicken | The library is there, the symbols exist... but it's not loading. | ||
timotimo | "image"? | ||
ah, it could very well be it's missing the "blah.so" file, and doesn't look for "blah.so.1.2.3" | |||
TimToady | I think there's a faq about that | 02:11 | |
timotimo | you often have to install the corresponding -dev package to get those symlinks | ||
manchicken | The file is there. OSX. | ||
timotimo | oh, dylibs, then | ||
TimToady | I think the faq even mentions OSX | ||
manchicken | What's weird, I'm able to see it elsewhere. | ||
02:12
piojo_ left
|
|||
timotimo | manchicken: i hear dtruss can tell you info about what the program is doing underneath | 02:12 | |
lookatme | Is Perl6 support tail recursive ? | ||
comborico | Thank you for your time. Goodnight. | 02:13 | |
lookatme | night | ||
02:13
comborico left
|
|||
colomon started using NativeCall for his $work today | 02:14 | ||
lookatme | m: react { whenever supply { emit 123; (< 1 2 3 4 5 6 >.race.map(sub ($x) { emit $x; } ).list) } { .say } } | 02:15 | |
camelia | 123 | ||
Zoffix | manchicken: that'd be great. I'm unaware of any good tutorials like that. I tried writing it but gave up after first article 'cause I don't know C: rakudo.party/post/Perl-6-NativeCal...Programmer | 02:16 | |
02:16
Cabanossi left
|
|||
manchicken | I think that the `Build.pm` w/`ref build .` is putting the lib in `resources/lib`, but that for some reason when I run `perl6 ./t/data-transfer.t` it can't find the file. | 02:17 | |
I don't really understand how the pathing works. | |||
Zoffix, don't worry, I'm going to write something about it. | |||
Zoffix | \o/ | ||
manchicken | As soon as I get it working. | ||
02:18
Cabanossi joined
|
|||
Geth | perl6.org: 1db2d49ea9 | (Zoffix Znet)++ | 4 files Move nav items/fix nav on mobilish devices - Move "Compilers" and "Design" items into "Resources" - Seems a more appropriate place and than front-and-center - Cleans up valuable space in the nav - Reduce nav item padding a bit to make the nav show up on one line on iPad-sized devices (fixes unwanted hidage of stuff) - Gabor's book's funderaiser is closed, so I removed the link |
02:19 | |
manchicken | I can't get truss to work. | 02:20 | |
MasterDuke | manchicken: does strace work on OSX? | ||
manchicken | Naw, dtrace | ||
02:23
manchicken left
|
|||
MasterDuke | lookatme: short answer, not now, longer answer here irclog.perlgeek.de/perl6/2017-12-08#i_15551545 | 02:23 | |
lookatme | oh, thanks | 02:25 | |
MasterDuke | np | ||
Geth | perl6.org: b026f297da | (Zoffix Znet)++ | 3 files Fix homepage camelia; kyan++ for noticing issues |
02:29 | |
Zoffix | kyan: sorry :) Couldn't help but fix camelia. You can improve the examples tabs or whatever else you think needs improvement | 02:30 | |
Zoffix & | |||
02:30
Zoffix left
02:43
manchicken joined
|
|||
manchicken | OK... so this is cool. | 02:43 | |
Somehow it's magically working after a reboot... I'm thoroughly confused. | |||
But whatever. | |||
I have a SIGSEGV, though, so that's cool. It's progress. | |||
I suspect it's on account of my having not properly allocated a thing. | 02:44 | ||
02:46
ilbot3 left
02:48
MarkSenn joined
|
|||
lookatme | :) | 02:51 | |
Win: Have a problem ? -> try reboot :P | 02:52 | ||
02:59
ilbot3 joined,
ChanServ sets mode: +v ilbot3
|
|||
manchicken | Well, this is a POSIX system, so I kinda expect better :) | 03:04 | |
So, trying to figure out how to allocate strings for output params. | 03:05 | ||
BOOM! | 03:07 | ||
Gotta have a `TWEAK` or something to preset your Str property to `$!foo := Str.new` | |||
Geth | ecosystem: dmaestro++ created pull request #382: Add SQL::Lexer |
||
TimToady | lookatme: medium answer, TCO is not friendly toward parallelization in FP languages as pointed out by Guy Steele and others, see for instance xahlee.info/comp/Guy_Steele_paralle...uting.html | 03:08 | |
buggable | New CPAN upload: SQL-Lexer-0.1.1.tar.gz by DMAESTRO cpan.metacpan.org/authors/id/D/DM/...1.1.tar.gz | ||
TimToady | iteration vs parallel recursion should be (mostly) an implementation issue, not something the programmer should think about much | 03:10 | |
03:10
MarkSenn left
|
|||
TimToady | so p6 is biased toward making you think about lists without privileging the head over the tail | 03:11 | |
03:11
manchicken left
03:13
manchicken joined
03:23
Actualeyes left
03:26
zakame joined
|
|||
manchicken | Should I submit pull requests in small chunks? | 03:29 | |
I have a small blurb I added to the `NativeCall` about managing memory within your CStruct. | 03:30 | ||
TimToady | depends on how closely related the chunks are, such that they can be evaluated together | 03:40 | |
and certainly one can revise a pull request if parts of it are problematic | 03:41 | ||
AlexDaniel | .tell thou in my experience PRs are getting merged faster if they come with a corresponding roast PR with tests :) | ||
TimToady | so there's no need to be overly reductionistic about it | ||
yoleaux | AlexDaniel: I'll pass your message to thou. | ||
AlexDaniel | .tell thou which is something you can help with in this particular case, fwiw | 03:43 | |
yoleaux | AlexDaniel: I'll pass your message to thou. | ||
03:48
aborazmeh joined,
aborazmeh left,
aborazmeh joined,
Cabanossi left
03:49
Cabanossi joined
03:50
cdg joined
|
|||
manchicken | Weeee: github.com/manchicken/perl6-native...ple-struct | 03:51 | |
Super simple demo of how to pass structs around. | 03:52 | ||
I'm going to go to bed, please feel free to email me with feedback if you have it. | |||
I also have my diffs for the docs here: github.com/perl6/doc/compare/maste...2?expand=1 | 03:53 | ||
It's not a lot, but it's something. | |||
That stupid build issue cost me an hour tonight. :( | |||
Night. | |||
03:54
manchicken left
03:55
cdg left
04:07
colomon left
04:12
pilne left
04:13
colomon joined
04:16
Cabanossi left
04:19
Cabanossi joined
04:24
wamba joined
04:33
piojo left
04:36
raiph left
04:46
Cabanossi left
04:48
Cabanossi joined
04:51
eliasr left
04:59
konsolebox left,
Actualeyes joined
05:01
konsolebox joined
05:02
Cabanossi left
05:03
Cabanossi joined,
zakame left
05:12
committable6 left,
committable6 joined,
ChanServ sets mode: +v committable6
05:27
wamba left
05:34
aborazmeh left
05:35
aborazmeh joined,
aborazmeh left,
aborazmeh joined
05:37
aborazmeh left
05:42
sacomo left
05:44
char_var[buffer] left
|
|||
Geth | doc: d1c4c641b1 | (Tim Smith)++ | doc/Language/operators.pod6 Escape | and + in table cells |
05:48 | |
synopsebot | Link: doc.perl6.org/language/operators | ||
softmoth | Thanks, AlexDaniel ! | 05:52 | |
BTW, I'm `thou`, switched IRC nick to match github (thou has been an OLD name here on freenode) | 05:53 | ||
lookatme | :) | 05:55 | |
TEttinger | this is a good soft moth farm9.staticflickr.com/8433/7602638...9d85_z.jpg | 06:02 | |
06:04
releasable6 joined
06:09
konsolebox left
06:11
konsolebox joined
06:15
Cabanossi left
06:18
Cabanossi joined
06:24
khw left
06:41
char_var[buffer] joined
06:48
unicodable6 left
06:56
domidumont joined
06:57
char_var[buffer] left,
bhm_ is now known as bhm,
char_var[buffer] joined
07:02
domidumont left
07:03
domidumont joined
07:05
geospeck joined,
lowbro joined,
lowbro left,
lowbro joined
07:06
curan joined
07:11
shady0wl_ joined
07:13
char_var[buffer] left
07:20
geospeck left
07:31
sena_kun joined
07:38
wamba joined,
darutoko joined
07:50
cdg joined
07:55
cdg left
08:03
vike left,
Grauwolf_ left
08:04
Grauwolf joined
08:05
wamba left
|
|||
softmoth | TEttinger, hey, that is a very nice one! | 08:05 | |
08:07
Actualeyes left
08:09
vike joined
08:16
wamba joined
08:18
bisectable6 left,
benchable6 left,
squashable6 left,
committable6 left,
benchable6 joined,
committable6 joined,
ChanServ sets mode: +v benchable6,
bisectable6 joined,
ChanServ sets mode: +v bisectable6,
unicodable6 joined,
ChanServ sets mode: +v unicodable6,
squashable6 joined,
ChanServ sets mode: +v squashable6,
squashable6 left
08:19
squashable6 joined,
ChanServ sets mode: +v squashable6,
bisectable6 left,
bisectable6 joined
08:24
Guest67751 is now known as syntaxman
08:25
syntaxman left,
syntaxman joined
|
|||
lookatme | How can I get parent pid in Perl6 ? | 08:27 | |
08:28
wamba left
|
|||
moritz | with nativecall and getppid, if nobody has a better idea | 08:28 | |
lookatme | :) It's better if there is a $*PPID | 08:30 | |
DrForr | Also clutters the namespace. | 08:35 | |
moritz | I think we should have a POSIX module for that | 08:37 | |
pull request for github.com/cspencer/perl6-posix maybe? | 08:38 | ||
DrForr | More work for me to forget to finish. | 08:41 | |
lookatme | oh, maybe work :) | 08:44 | |
AlexDaniel | I think we should have $*PPID | 08:45 | |
08:45
Cabanossi left
|
|||
AlexDaniel | lookatme: hehe github.com/perl6/whateverable/blob...#L317-L320 | 08:46 | |
08:46
wamba joined
|
|||
AlexDaniel | or, otherwise, why do we have $*PID ? | 08:47 | |
lookatme | yeah, that's a solution, works fine | ||
Cause Perl 5 has a variable named $PID ? | |||
But no $PPID | |||
:) | |||
08:48
Cabanossi joined
|
|||
AlexDaniel | lookatme: mkay, although I dislike this line of reasoning :) | 08:48 | |
DrForr | %*PROCESS<PARENT> # etc? | 08:49 | |
lookatme | m:say %*PROCESS<PARENT>; # ? | 08:50 | |
evalable6 | (exit code 1) Dynamic variable %*PROCESS not found in block <unit> at /tmp/WuIS5fJp86 line 1 |
||
DrForr | Just a suggestion. | 08:51 | |
lookatme | use NativeCall; sub getppid(--> long) is native(Str) {*}; say getppid(); | ||
m: use NativeCall; sub getppid(--> long) is native(Str) {*}; say getppid(); | |||
camelia | 24129 | ||
08:51
softmoth left
08:52
eugene_barsky joined
|
|||
eugene_barsky | Hi | 08:52 | |
lookatme | But I think $*PPID is clear :) | ||
moritz | hi eugene_barsky | ||
lookatme | hi | ||
eugene_barsky | Seems that it's Linenoise that slows down my REPL startup. I added linenoise support to my small script and now it loads 5-7 seconds. | 08:54 | |
moritz | you could try readline instead | 08:55 | |
lookatme | I recommend Readline | ||
eugene_barsky | The GNU Readline Library? | ||
lookatme | grep: Readline | 08:56 | |
greppable6 | lookatme, gist.github.com/bf3802450f95f67df5...a6809caf5f | ||
moritz | eugene_barsky: the Perl 6 library that wraps GNU Readline | ||
lookatme | :) Though I can not access gist, but I can do a search for u :) | ||
eugene_barsky | Thanks!! I'll try it. | ||
DrForr keeps an ear to the channel :) | 08:57 | ||
lookatme | eugene_barsky, a little example github.com/araraloren/perl6-app-sn...t.pm6#L281 | 08:59 | |
09:00
scimon joined
|
|||
eugene_barsky | lookatme: Thanks, that's what I was looking for! | 09:00 | |
lookatme | YW | ||
eugene_barsky | moritz: thanks! | 09:02 | |
jast | hi guys, I need some help here... I just don't understand why Perl 6 is full of all these awesome things, can anyone explain? | ||
lookatme | What things ? | ||
DrForr | Because we've been packing as much syntax as we can get into a confined space? :) | ||
lookatme | :) | 09:03 | |
jast | that's a good thing, right? :) | ||
lookatme | Maybe good, for me :) | ||
teatime | lol, jast++ | 09:04 | |
09:06
eugene_barsky left
|
|||
moritz | jast: I could explain, but first you have to read two books, to give you some context... :-) | 09:07 | |
<rant>apress/springer still haven't fixed their bloody webshop</rant> | 09:08 | ||
jast | moritz: well, it sure is nice to get some input from someone neutral and unbiased :} | 09:09 | |
AlexDaniel | u: ♂ | ||
unicodable6 | AlexDaniel, U+2642 MALE SIGN [So] (♂) | ||
09:11
someuser left,
thunktone joined
09:13
zakharyas joined,
someuser joined
09:14
lookatme left
09:15
zakharyas left
09:16
zakharyas joined
09:17
zakharyas left,
zakharyas joined
|
|||
scimon | So. I can't remember who introduced me to adventofcode.com yesterday... thanks. I needed another distraction (like the proverbial hole in the head) but it's puzzles. Up to day 12. Many of the (terrible) solutions are now on github (github.com/Scimon/advent-of-code) a lot of the early ones were so simple in perl6 I command lined them. | 09:18 | |
yoleaux | 12 Dec 2017 21:04Z <timotimo> scimon: it might not be worth mutch, but (^9 X ^9).map(-> ($x, $y) { }) is noticably slower than (^9 X ^9).flat.map(-> $x, $y { }): gist.github.com/25788b01599b86f109...18f7f2a16d | ||
09:18
rindolf joined
09:19
zakharyas left
|
|||
scimon | timotimo: Hmmmm interesting. I may have to try that out. I do use it a bit. (^9 X ^9).map(-> ($x, $y) { }) feels more idomatic though.... speed it nice though.... | 09:20 | |
09:20
zakharyas joined
09:42
sacomo joined
09:44
konsolebox left
09:49
konsolebox joined
09:54
wamba left
10:00
AlexDaniel left
10:08
dakkar joined
10:09
TEttinger left
10:16
rindolf left
10:20
lowbro left
10:29
itaipu joined
10:43
zakharyas left
10:44
zakharyas joined
10:51
domidumont left,
domidumont joined
|
|||
AlexDaniel` | scimon: if you need more distractions: code-golf.io | 10:54 | |
scimon | I know... Xmas holiday. | ||
10:56
eliasr joined
10:57
llfourn left
11:06
konsolebox left
11:08
konsolebox joined
|
|||
Geth | doc: 8ae8e7ef8a | (Luca Ferrari)++ | doc/Language/containers.pod6 Add link to 'Scalar' class in containers documentation. |
11:09 | |
synopsebot | Link: doc.perl6.org/language/containers | ||
11:11
AlexDaniel joined
11:13
quotable6 joined
11:22
AlexDaniel left,
AlexDaniel joined
11:24
konsolebox left
11:26
konsolebox joined
11:40
char_var[buffer] joined
11:42
shady0wl_ left
11:46
Cabanossi left
11:48
Cabanossi joined
11:50
wdudz left
11:51
cdg joined,
mahafyi joined
11:55
cdg left
12:17
lowbro joined,
lowbro left,
lowbro joined
|
|||
buggable | New CPAN upload: Game-Sudoku-1.1.2.tar.gz by SCIMON cpan.metacpan.org/authors/id/S/SC/...1.2.tar.gz | 12:18 | |
Voldenet | is there any way to supress stderr in qqx-invoked commands? | ||
12:19
zakharyas left
|
|||
Voldenet | I could just 2>/dev/null in the command itself, but it doesn't look too great | 12:20 | |
moritz | you'd have to use run instead of qx | 12:21 | |
12:25
silug left
|
|||
Voldenet | > sub qx(*@cmd){ given Proc::Async.new: @cmd { .stderr.tap({$}); my @o; .stdout.tap({ @o.push($_) }); await .start; @o }}; | 12:33 | |
I'm unsure how to /silence/ stderr in that case too | |||
teatime | just don't call .stderr, according to the docs | 12:34 | |
you do have to read both streams tho or you risk a deadlock... presumable Proc::Async is smart enough to know that / do it for you | 12:35 | ||
Voldenet | actually, not doing anything to the .stderr just passes the stderr to the perl's stderr | 12:36 | |
which isn't what I want :) | |||
teatime | hrm | 12:38 | |
that doesn't sound right | |||
teatime has the sudden realization that can use Perl6 like an Expect that doesn't suck. | 12:40 | ||
timotimo | you just tap it and do nothing with the result, i believe | 12:43 | |
teatime | it's super weird to me it outputs it to the programs stderr | 12:44 | |
Voldenet | I guess it works as requested, I'm just overly pedantic about the readability | ||
teatime: it's okay - most applications don't write to stderr unless there's /an error/ ;) | 12:45 | ||
12:45
Cabanossi left
|
|||
teatime | well, it's ok to output various free-form debug information into stderr | 12:45 | |
that's what it's for | |||
because you can redirect it away and get just pure "output" when that's what you need | 12:46 | ||
jast | it kind of makes sense that stderr goes to stderr if not accessing it means no redirect is set up | ||
teatime | kindof, yeah. | ||
is there a null supply consumer / sink, or is {} basically that | 12:47 | ||
jast: yeah, I suppose so.. | |||
just a LTA in docs I guess | |||
Voldenet | teatime: {} is interpreted as hash by default, needs that little $ somewhere | ||
teatime | oh. is {$} really the best way to do that? | ||
Voldenet | My question exactly ;) | 12:48 | |
12:48
piojo_ joined,
Cabanossi joined,
cdg joined
12:54
cdg left
|
|||
teatime | like, it seems like {$} would trip the useless use of scalar value warning | 12:56 | |
you could do -> $ {}, though ? | 12:57 | ||
Voldenet | m: {$}(<nope, it wouldn't trip any warnings>) | 12:58 | |
camelia | ( no output ) | ||
13:06
philomath_ joined
13:09
piojo_ left
|
|||
teatime | moritz: if I were going to buy your Perl 6 book, is there a particular vendor that would be best for you for me to use? | 13:14 | |
oh nice, I didn't know about your grammars book either. sounds good. | 13:16 | ||
moritz | teatime: for me, it doesn't really matter. For you, it's about convenience | 13:18 | |
13:18
jeromelanteri left
|
|||
moritz | teatime: if you want an ebook, you get a watermarked (but DRM-free) ebook from apress.com | 13:18 | |
on amazon, you only get kindle | 13:19 | ||
scimon | moritz: you need to get you some referral links setup ;) | 13:21 | |
moritz | scimon: apress has a referral program, but it requires a US tax ID | ||
13:22
rindolf joined
|
|||
scimon | Awwww.... | 13:22 | |
teatime | hrm.. you may be able to get one? | ||
moritz | scimon: and I get neglible amounts from the amazon referal program, so I tend to send people to smile.amazon.com | ||
teatime: I may or may not, but so far, I simply don't think it's worth the effort | 13:23 | ||
rindolf | Hi all, sup? Happy Hanukkah | ||
13:27
robertle left
13:31
araraloren joined
|
|||
araraloren | |o/ | 13:31 | |
13:32
Cabanossi left
13:33
Cabanossi joined
13:34
raschipi joined
13:36
AlexDaniel left
|
|||
pochi | m: try { CATCH { default { say "hello"; } }; my @x = "4,foo".split(",").map: *.Int; } | 13:44 | |
camelia | ( no output ) | ||
pochi | shouldn't this say "hello"? | ||
timotimo | m: say ("foo".Int).WHAT | 13:49 | |
camelia | (Failure) | ||
timotimo | failures are "lazy" exceptions | ||
pochi | ah, so not until I use the result will an exception actually trigger my handler? | 13:50 | |
13:54
wamba joined
13:58
zakharyas joined
13:59
robertle joined
14:00
philomath_ left
14:01
cdg joined
|
|||
raschipi | pochi: You can force it to blow up, but if you don't touch it won't. | 14:01 | |
14:02
Cabanossi left
14:03
Cabanossi joined
|
|||
raschipi | docs.perl6.org/language/pragmas#in...atal-fatal | 14:05 | |
Well, isn't the try block supposed to turn Failures fatal anyway? | 14:06 | ||
14:08
curan left,
cdg left
14:09
cdg joined
|
|||
Voldenet | m: try { CATCH { default { say "hello"; } }; my @x = "4,foo".split(",").map: *.Int; } | 14:10 | |
camelia | ( no output ) | ||
pochi | I tried fatal, but it didn't trigger it. seems I have to use the result | ||
Voldenet | m: try { CATCH { default { say "hello"; } }; my @x = "4,foo".split(",").map({ .Int }); } | ||
camelia | hello | ||
pochi | why would using a block in map change things? | 14:11 | |
14:11
thunktone left
|
|||
teatime | I really liked the idea of failures, but every time they actually come up they confuse the crap out of me. | 14:12 | |
14:12
cdg_ joined
|
|||
raschipi | It's an undefined value that carries out-of-band information on what went wrong... | 14:12 | |
teatime | so what's the answer to pochi's latest question? | 14:14 | |
Voldenet | I'm not sure why using a block in map would change things, but I guess there's a difference between how WhateverCode and Block is treated | ||
pochi | m: my @x; try { CATCH { default { say "hello"; } }; @x = "4,foo".split(",").map: *.Int; }; say @x; | ||
camelia | Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5foo' (indicated by ⏏) in block at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
14:14
cdg left
|
|||
pochi | now I'm using @x, but it doesn't catch the exception | 14:15 | |
14:15
cdg_ left
14:16
cdg joined
14:18
robertle left
|
|||
raschipi | m: try { CATCH { default { say "hello"; } }; my @x = "4,foo".split(",").map: *.Int.sink-all; } | 14:19 | |
camelia | hello | ||
raschipi | m: try { CATCH { default { say "hello"; } }; my @x = "4,foo".split(",").map(*.Int).sink-all; } | 14:20 | |
camelia | hello | ||
Voldenet | m: try { CATCH { default { .say; } }; my @x = "4,foo".split(",").map(*.Int).sink-all; } | 14:21 | |
camelia | No such method 'sink-all' for invocant of type 'Seq' in block <unit> at <tmp> line 1 |
||
Voldenet | *cough* | ||
pochi | so, sink-all makes it non-lazy? | ||
teatime | what's weird to me is map(Whateverable) ends up lazy but map({block}) doesn't? | 14:22 | |
14:22
cdg left
|
|||
teatime | I thought about that for the answer to "why does whateverable not raise when block does", but thought nah, can't be that | 14:23 | |
14:23
cdg joined
|
|||
Voldenet | m: try { CATCH { default { .say; } }; my @x = "4,foo".split(",").map: *.Int.sink; } | 14:24 | |
camelia | Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5foo' (indicated by ⏏) in whatevercode at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
raschipi | m: try { CATCH { default { ; } }; my @x = "4,foo".split(",").map(*.Int).sink-all; say @x[0] } #Doesn't work | ||
camelia | ( no output ) | ||
Voldenet | that'd work too | ||
raschipi | I only know about a .sink method on Proc, that's all the docs talk about | ||
14:26
itaipu left,
piojo_ joined
|
|||
Voldenet | ah, right | 14:26 | |
...why does it work instead of giving `No such method 'sink' for invocant of type 'Int'` ಠ_ಠ | 14:27 | ||
moritz | m: Int.sink | 14:29 | |
camelia | ( no output ) | ||
moritz | m: say so Int.^can('sink') | ||
camelia | True | ||
moritz | m: say Int.^can('sink') | ||
camelia | (sink) | ||
14:29
comborico1611 joined
|
|||
moritz | m: say Int.^can('sink')[0].package | 14:29 | |
camelia | (Mu) | ||
raschipi | m: say Failure.^can('sink') | ||
camelia | (sink sink sink) | ||
moritz | it seems *everything* can sink | ||
pochi | is this the proverbial kitchen sink? :-) | 14:30 | |
raschipi | It's just not documented. | ||
lizmat | well, doesn't that go for any method that lives in Mu? | ||
Voldenet | m: say "baloon".^can('sink') | ||
camelia | (sink) | ||
lizmat | if Mu can, than anything else can as well ? | ||
moritz | yes | 14:31 | |
Voldenet | I bet it just doesn't do what I think it does and that's probably enough | ||
14:33
rindolf left,
itaipu joined
|
|||
raschipi | m: 4.sink.^name#The problem is that sink throws everything aways | 14:33 | |
camelia | ( no output ) | ||
raschipi | m: say 4.sink.^name | ||
camelia | Nil | ||
Voldenet | (the Failure docs say something about sink context causing a failure to throw, so I guessed it would just evaluate the item in sink context) | 14:34 | |
raschipi | Yeah, that's not what it does, it actually sinks it | 14:35 | |
14:35
rindolf joined
|
|||
Voldenet | m: my @u = ["a"].map(*.Int); @u.iterator.sink-all | 14:35 | |
camelia | ( no output ) | ||
Voldenet | m: my @u = ["a"].map(*.Int); @u.map(*.sink) | 14:36 | |
camelia | Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5a' (indicated by ⏏) in block <unit> at <tmp> line 1 |
||
14:36
silug joined
|
|||
Voldenet | Hmmm, I'm unsure if sink-all works correctly | 14:37 | |
14:38
AlexDaniel joined
|
|||
Voldenet | m: @x = "4,foo".split(",").map(*.say); say "end"; # on the other hand, you don't actually need to sink-all it, because it seems not lazy anyway | 14:39 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Variable '@x' is not declared at <tmp>:1 ------> 3<BOL>7⏏5@x = "4,foo".split(",").map(*.say); say |
||
Voldenet | m: my @x = "4,foo".split(",").map(*.say); say "end"; # on the other hand, you don't actually need to sink-all it, because it seems not lazy anyway | ||
camelia | 4 foo end |
||
Voldenet | I truly wonder how one should properly evaluate the Seq for failures though | 14:43 | |
14:45
Cabanossi left
14:46
natrys joined
14:47
quotable6 left
14:48
Cabanossi joined
14:50
piojo_ left
14:53
bisectable6 left,
committable6 left,
greppable6 left,
evalable6 left,
reportable6 left,
squashable6 left,
unicodable6 left,
benchable6 left,
releasable6 left
15:10
softmoth joined
15:14
wamba left
15:15
rindolf left
15:20
araraloren left
15:23
rindolf joined
15:32
Cabanossi left
15:33
Cabanossi joined
15:44
khw joined
15:48
lowbro left
15:49
Rawriful joined
15:50
someuser left
15:54
troys joined
16:05
Zoffix joined
|
|||
Zoffix | Voldenet: depends on how you want to handle them. If you want to just explode them, use `.self` method. It's just returns the self for all types, and for unhandled Failures it makes them blow up | 16:07 | |
m: my @u = ["a"].map: *.Int.self | |||
camelia | Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5a' (indicated by ⏏) in whatevercode at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
Zoffix | Though generally that's not needed, since you'd usually be using those values someplace. The few caveats are where you're treating the list as a thing and Failures get lost (e.g. `say @u.elems` would not explode Failures inside @u) | 16:09 | |
16:10
geospeck joined
|
|||
Zoffix | m: sub make-failures { (Failure.new,) }; use fatal; my $x = make-failures; say 42 | 16:12 | |
camelia | 42 | ||
16:13
AlexDaniel left
|
|||
Zoffix | m: sub make-failures { BEGIN $*LANG.pragma("fatal").say; (+"a",) }; use fatal; my $x = make-failures; say 42 | 16:16 | |
camelia | (Mu) 42 |
||
16:16
natrys left
|
|||
Zoffix | OK makes sense. the `use fatal`/`try` is lexically scoped and the Failure gets made where it's not in effect. By the time they arrive back into fatalized land, they're already packed inside a list. | 16:17 | |
Where's it deciding whether to blow it up? | 16:18 | ||
16:21
khisanth_ left
|
|||
raschipi | What we were most mistified about is the fact that a block will blow it up but whateverblock won't. | 16:22 | |
Zoffix | look like it sticks a p6fatalize op into places, which desugars to a sink | 16:24 | |
raschipi: a bug maybe? | 16:25 | ||
16:27
softmoth left
16:29
natrys joined
|
|||
Zoffix tries a hackety hack | 16:32 | ||
16:34
Actualeyes joined
16:39
domidumont left
16:43
khisanth_ joined
16:46
ZzZombo left
|
|||
Zoffix | s/makes sense.+//; # wrong, cause the block/whatevercode where failure is made are in lexical scope of fatalization, I think | 16:48 | |
16:49
geospeck left
|
|||
teatime | raschipi: they do both output a Seq also, forgot to mention checking that | 16:49 | |
maybe return value from block is considered "doing something" with the failure value? | |||
if so, perhaps whateverable needs to do that too? | 16:50 | ||
Zoffix | yeah. on it | 16:53 | |
raschipi | Right, but returning the failure shouldn't trigger it... | 16:55 | |
teatime | raschipi: it feels like more than undef+info, it feels like a variable that may live a long life-time before blowing up your program at some unexpected later place. but I imagine I just don't understand it yet / need to work with it more | 16:56 | |
is there a pragma to make failures insta-fatal? | |||
raschipi | Well, if it was just Nil, it would do the same thing, yet it wouldn't tell you what went wrong... | ||
scimon | Looking at code-golf.io/ .... There are obviously some tricks I do not know. | 16:57 | |
Zoffix | teatime: use fatal | 16:58 | |
16:59
zakharyas left
|
|||
Zoffix | teatime: or add a .self call on a value you want to explode if it's a failure | 17:00 | |
17:00
zakharyas joined
|
|||
teatime | is that what .self is for, or is that more of a "hack"? | 17:00 | |
Zoffix | teatime: .self returns the object itself. It deconts. It also blows up unhandled Failures | 17:01 | |
raschipi | From the docs: "calling this method is a handy way to explosively filter out Failures" | 17:02 | |
Zoffix | teatime: it's a "hack" only in a sense that calling most methods on Failures blows them up and here such a method is a no-op for regular objects, so unless it's a Failure, you just get your object as is | ||
teatime | k. | ||
pochi | is my understanding correct that a CATCH handler will only be called if the explosion happens inside a try? | ||
Zoffix | pochi: no. CATCH will be called even without any try. The try enabled fatal pragma | 17:03 | |
m: CATCH say 'meow'; die | |||
camelia | 5===SORRY!5=== Error while compiling <tmp> Missing block at <tmp>:1 ------> 3CATCH7⏏5 say 'meow'; die expecting any of: scoped block |
||
Zoffix | m: CATCH { say 'meow' }; die | ||
camelia | meow Died in block <unit> at <tmp> line 1 |
||
Zoffix | m: CATCH { default { say 'meow' } }; die # without `default` it sends the explosion further up | ||
camelia | meow | ||
Zoffix | well, without `default` or some other `when` thing | 17:04 | |
s/enabled/enables/; | |||
pochi | ok, but if the CATCH is inside a try, and the explosion happens outside? | ||
Zoffix | pochi: the outside won't have that CATCH applicable to it. | ||
just as here: { { CATCH { ... } }; die } | 17:05 | ||
pochi | hm, in my case I know where the Failure can be made, but I don't really know when it will blow up | ||
17:06
AlexDaniel joined
|
|||
Zoffix | `use fatal` should blow 'em up | 17:06 | |
17:06
fuzzy joined
|
|||
Zoffix | m: "a".map: {.Int}; say "meow"; | 17:07 | |
camelia | meow | ||
Zoffix | m: use fatal; "a".map: {.Int}; say "meow"; | ||
camelia | Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5a' (indicated by ⏏) in block <unit> at <tmp> line 1 |
||
Zoffix | Though I guess not in all cases | ||
m: sub make-failures { (Failure.new,) }; use fatal; my $x = make-failures; say 42 | |||
camelia | 42 | ||
raschipi | Or think of it as a function returning an error value and treat the failure right after getting the results. | 17:08 | |
Letting the failure just be is a possibility but it's not mandatory. | |||
17:09
rindolf left
|
|||
pochi | btw, I would like to catch only that one error "base-10 number must begin ...", but I can't figure out the exception type | 17:10 | |
Zoffix | m: try +"a"; say $!.^name | ||
camelia | X::Str::Numeric | ||
17:10
fuzzy left
|
|||
Zoffix | m: try { CATCH { when X::Str::Numeric { say "the num stuff" } }; +"a"; } | 17:11 | |
camelia | the num stuff | ||
Zoffix | m: try { CATCH { when X::Str::Numeric { say "the num stuff" } }; die "some other stuff" } | ||
camelia | some other stuff in block <unit> at <tmp> line 1 |
||
pochi | nice | 17:12 | |
Zoffix | m: (+"a").exception.^name.say # another way to get the name. Failure.exception contains the exception the Failure would explode with | 17:16 | |
camelia | X::Str::Numeric | ||
raschipi | m: (die "aaa").exception.^name.say | 17:17 | |
camelia | aaa in block <unit> at <tmp> line 1 |
||
Zoffix | that ain't a Failure | 17:18 | |
raschipi | right | ||
17:25
troys is now known as troys_
|
|||
Zoffix | w00t. success in hackety hacking \o/ | 17:26 | |
17:29
dakkar left
17:30
scimon left
17:31
Cabanossi left
17:33
Cabanossi joined
|
|||
ryn1x | . | 17:33 | |
Zoffix | : | 17:34 | |
17:35
troys_ is now known as troys
|
|||
Zoffix | AlexDaniel: BTW t/spec/MISC/bug-coverage-stress.t consistently fails all the time and has been for a while. I guess not many devs notice it cause it's a stresstest... | 17:35 | |
AlexDaniel` | yea I noticed that, but it felt weird because nobody else was complaining | 17:36 | |
now that you said it I see why… | |||
Zoffix | :) | ||
AlexDaniel` | ok: github.com/rakudo/rakudo/issues/1312 | 17:37 | |
geekosaur | I'd be surprised if there wasn't already a ticket | 17:38 | |
...but it'd be an old ticket because that flapper's been around since, uh, sometime before the GLR IIRC | 17:39 | ||
oh, no, wrong stresstest | |||
but yeh I'd bet all stresstests are ignored because they flap so much | |||
17:40
AlexDaniel left,
piojo_ joined
|
|||
El_Che | the on-off failures are pretty annoying when building on travis | 17:42 | |
Zoffix | cpan@perlbuild4~/CPANPRC/rakudo (master)$ ./perl6 -e 'use fatal; "a".map: *.Int' | 17:43 | |
Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏a' (indicated by ⏏) | |||
raschipi: ^ fix shipped | |||
Zoffix & | 17:44 | ||
17:44
Zoffix left,
AlexDaniel joined
|
|||
raschipi | m: try { CATCH { default { say "hello"; } }; my @x = "4,foo".split(",").map: *.Int; } | 17:45 | |
camelia | ( no output ) | ||
raschipi | m: try { CATCH { default { say "hello"; } }; my @x = "4,foo".split(",").map: *.Int.self; } | 17:46 | |
camelia | hello | ||
17:46
ryn1x left
|
|||
raschipi | pochi ↑ | 17:46 | |
17:56
ChoHag left
17:57
geospeck joined
18:02
Cabanossi left,
Cabanossi joined
18:03
zakharyas left,
piojo_ left
18:04
zakharyas joined
18:11
|oLa| joined
18:20
wamba joined
18:24
domidumont joined
18:25
orangebot joined
|
|||
orangebot | Hello! | 18:26 | |
AlexDaniel | hi! | ||
18:26
darutoko left
18:28
|oLa| left
18:31
someuser_ joined
|
|||
tbrowder | AlexDaniel: is there any way to hook up jnthn’s debuggers to use on rakudo? | 18:31 | |
AlexDaniel | tbrowder: I don't think so, but I don't really know | 18:32 | |
tbrowder: I've been doing printf debugging instead | |||
18:32
geospeck left
|
|||
tbrowder | same, but it gets tiresome when the structure of some match objects is so complex. | 18:33 | |
18:35
itaipu left
18:39
AlexDaniel left
18:40
AlexDaniel joined
|
|||
TimToady | Voldenet: we usually spell an empty block as {;}, which won't create a spurious state variable as {$} does | 18:44 | |
mahafyi | are there differences between the free and paid versions of thinkperl6 book? | 18:45 | |
teatime | aha | ||
pochi | raschipi: thanks | ||
stmuk | . o O ( isn't there supposed to be *another* Perl 6 coming? ) | 18:47 | |
teatime | every christmas? :) | ||
or select christmases, anyway. | 18:48 | ||
18:53
mahafyi left
|
|||
orangebot | Is there a way to introspect what can be passed to a class from something like `class Foo { has Int $.a }`? | 18:55 | |
19:00
geospeck joined,
Cabanossi left
19:01
Actualeyes left
|
|||
timotimo | m: class Foo { has Int $.a }; say Foo.^attributes | 19:02 | |
camelia | (Int $!a) | ||
raschipi | m: class Foo { has Int $.a }; Foo.new.^attributes | ||
camelia | ( no output ) | ||
19:03
philomath_ joined,
Cabanossi joined
19:04
zakharyas left
19:10
cdg left
|
|||
AlexDaniel | raschipi: say | 19:10 | |
raschipi | I know, but just above timo already did it. | 19:11 | |
19:11
cdg joined
|
|||
orangebot | Thanks! | 19:11 | |
19:15
cdg left
19:28
quotable6 joined,
ChanServ sets mode: +v quotable6,
quotable6 left
19:29
philomath_ left,
quotable6 joined
19:30
quotable6 left
19:38
raschipi left
19:44
domidumont left
19:53
orangebot left
20:06
zakharyas joined
20:07
quotable6 joined,
ChanServ sets mode: +v quotable6,
quotable6 left,
quotable6 joined,
quotable6 left
20:08
quotable6 joined,
bloatable6 joined,
nativecallable6 joined,
unicodable6 joined,
bisectable6 joined,
coverable6 joined,
greppable6 joined,
ChanServ sets mode: +v greppable6,
ChanServ sets mode: +v coverable6,
reportable6 joined,
benchable6 joined,
releasable6 joined,
committable6 joined,
evalable6 joined,
ChanServ sets mode: +v benchable6,
ChanServ sets mode: +v evalable6,
ChanServ sets mode: +v releasable6,
ChanServ sets mode: +v committable6,
squashable6 joined,
statisfiable6 joined,
ChanServ sets mode: +v statisfiable6
20:12
wamba left,
geospeck left,
geospeck joined,
rgrau joined
20:13
troys is now known as troys_,
geospeck left
20:14
comborico1611 left
20:15
comborico1611 joined,
troys_ is now known as troys
20:20
dmaestro_ joined
20:21
natrys left
20:29
wamba joined
20:38
virtualsue joined
|
|||
dmaestro_ | Here's another puzzler - what's happening here? (I really don't know) | 20:42 | |
m: my $v; { given 1 { $v = ++$ }; say ++$ } for ^5; say $v | |||
camelia | 1 2 3 4 5 1 |
||
dmaestro_ | m: my $v; { { $v = ++$ }; say ++$ } for ^5; say $v | ||
camelia | 1 2 3 4 5 1 |
||
dmaestro_ | m: my $v; { $v = ++$; say ++$ } for ^5; say $v | ||
camelia | 1 2 3 4 5 5 |
||
dmaestro_ | The last is what I expect. How does the enclosing block affect the first ++$? | 20:43 | |
20:43
arnsholt left,
joy left,
TeamBlast left,
afresh1 left,
tyil left,
DarthGandalf left,
nine left,
[ptc] left,
TeamBlast joined,
nine_ joined,
arnsholt joined,
tyil joined
|
|||
AlexDaniel | dmaestro_: maybe this? docs.perl6.org/language/traps#Usin...once_block | 20:43 | |
20:43
DarthGandalf joined
20:44
joy joined,
afresh1 joined,
[ptc] joined
|
|||
virtualsue | I've written my advent calendar post and scheduled it for Friday | 20:44 | |
moritz | thanks virtualsue! | ||
virtualsue | if there is anyone here who can check it that would be nice | ||
no problem | 20:45 | ||
20:45
cpage_ joined
|
|||
AlexDaniel | dmaestro_: tl;dr state variable goes out of scope, bye-bye state variable | 20:45 | |
virtualsue | I'll be going on holiday tomorrow and i might not have internet access | ||
moritz | will do | 20:46 | |
perlpilot looks at virtualsue's post | |||
20:46
eater left
|
|||
moritz | there seems to be something funny with the code example markup | 20:47 | |
virtualsue | oh - i'll double check it | ||
20:47
cpage left
20:48
cpage_ is now known as cpage
|
|||
moritz | it renders everything starting from :RECURSE as a link or anchor or so | 20:48 | |
perlpilot | and the very first line seems to be indented by one space too | ||
20:48
eater joined
|
|||
moritz | :TAG<a> | 20:49 | |
dmaestro_ | AlexDaniel: Thanks, that explains it. So the scope of $ is _just outside_ the block it is in ... | ||
moritz | probably needs some HTML escaping | ||
virtualsue | I can't figure out how to see that post again. I find WP quite a struggle to get on with. | 20:51 | |
moritz | fixed it | 20:52 | |
virtualsue: perl6advent.wordpress.com/wp-admin...ction=edit is the edit link | |||
AlexDaniel | dmaestro_: to be honest I never really understood it properly. My hopes to understand it were lost when we had to change the behavior in some cases | ||
dmaestro_: for example: | |||
virtualsue | thank you! | ||
AlexDaniel | c: 2015.12,2017.11 for ^5 { ‘hello’ ~~ /{say $++}/ } | ||
committable6 | AlexDaniel, ¦2015.12: «01234» ¦2017.11: «00000» | ||
AlexDaniel | dmaestro_: the current behavior is correct, but I see no way to feel it intuitively | 20:53 | |
perlpilot | virtualsue: is there more expository text or just "I wrote a spider, here it is, conclusion?" (just making sure I'm not missing something) | 20:54 | |
20:55
dmaestro_ left
|
|||
teatime | AlexDaniel: ugh, I do not understand what that does | 20:55 | |
virtualsue | you aren't missing anything. i may tweak it a bit more | ||
20:55
dmaestro_ joined,
dmaestro_ left
|
|||
perlpilot | ok, cool | 20:56 | |
teatime | not even the state variable weirdness you were demonstrating, just the (list) for (seq) {block} | ||
AlexDaniel | teatime: 2015.12,2017.11 is part of the command syntax for committable | 20:57 | |
teatime | oh lol | ||
sorry | |||
AlexDaniel | teatime: basically asks it to run the same code on two revisions | ||
yea I know it is confusing at times | |||
but it's a shorthand for this | |||
committable6: 2015.12,2017.11 for ^5 { ‘hello’ ~~ /{say $++}/ } | |||
committable6 | AlexDaniel, ¦2015.12: «01234» ¦2017.11: «00000» | ||
20:58
leah2 left
|
|||
AlexDaniel | so it *has* to read it that way if we want it to understand messages starting with its nickname :) | 20:58 | |
though it gets even more confusing if you decide to use whitespace after the comma… | |||
committable6: 2015.12, 2017.11 for ^5 { ‘hello’ ~~ /{say $++}/ } | |||
committable6 | AlexDaniel, ¦2015.12: «01234» ¦2017.11: «00000» | ||
AlexDaniel | teatime: and then, /{…}/ is just a code block in a regex | 20:59 | |
21:00
setty1 joined
21:01
japhb left,
Cabanossi left,
cdg joined
21:03
cono left,
Cabanossi joined,
cdg_ joined
|
|||
teatime | AlexDaniel: I was just trying to read it as perl6 code, is all | 21:03 | |
21:04
virtualsue left
|
|||
AlexDaniel | m: 2015.12,2017.11: for ^5 { ‘hello’ ~~ /{say $++}/ } | 21:04 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Confused at <tmp>:1 ------> 032015.12,2017.11:7⏏5 for ^5 { ‘hello’ ~~ /{say $++}/ } expecting any of: colon pair |
||
AlexDaniel | aww | ||
21:05
cdg left
21:10
cdg joined
21:13
leah2 joined,
geospeck joined
21:14
cdg_ left
21:33
ChoHag joined
21:41
someuser_ left
21:42
Slayerk joined
|
|||
Slayerk | Is there any way to specify how slurp works? | 21:42 | |
21:43
tamva joined
|
|||
teatime | can you be more specific? | 21:43 | |
21:45
zakharyas left
21:51
colomon_ joined
21:52
colomon left,
colomon_ is now known as colomon
|
|||
Slayerk | teatime: I'm trying to get spaces in the .txt file to mean new items in the array | 21:56 | |
21:56
eliasr left
|
|||
AlexDaniel | Slayerk: maybe then ‘myfile’.IO.words ? | 21:57 | |
teatime | yeah why not ^^, or more generally slurp → split | 21:58 | |
AlexDaniel | you don't have to slurp to use split | 21:59 | |
teatime | AlexDaniel: can you do something like, for .words in $blah.lines | ||
like what's a clean/idiomatic/short way to do that nested loop | |||
one per line and one per word | 22:00 | ||
22:00
Slyerk joined,
Cabanossi left
|
|||
Slyerk | Got disconnected and then while I was disconnected someone connected using my original name... | 22:00 | |
AlexDaniel | this is probably ok: for $blah.lines».words { … } | 22:01 | |
22:01
Slayerk left
|
|||
AlexDaniel | Slyerk: irclog.perlgeek.de/perl6/2017-12-13#i_15573939 | 22:01 | |
teatime | interesting | ||
does the race-y nature of » do anything weird there | |||
like trying to access lines out of order | |||
Slyerk | Ah, thanks | 22:02 | |
AlexDaniel | teatime: it has the right to do the splitting in parallel, but you'll be iterating it sequentially like normal | ||
22:03
Cabanossi joined
|
|||
tamva | Hallo | 22:03 | |
So, I'm wondering what the right way is to determine whether an "is default" attribute is set to it's default value | 22:05 | ||
Related to this, how does "is default" work with array containers? | |||
jnthn | m: my $x is default(42); say $x === $x.VAR.default; $x = 100; say $x === $x.VAR.default | 22:07 | |
yoleaux | 14:28Z <tbrowder> jnthn: inside rakudo/src/Perl6/Pod.nqp, sub make_config, is it possible to dump to QAST, reform the QAST as desired, and inject it back as a final, serialized %config hash? | ||
camelia | True False |
||
yoleaux | 14:52Z <tbrowder> jnthn: please disregard last question | ||
19:18Z <tbrowder> jnthn: is there any way to tie your grammar debuggers into the rakudo compiler? | |||
jnthn | .tell tbrowder No, though there is a --rxtrace option that you can pass to the compiler | ||
yoleaux | jnthn: I'll pass your message to tbrowder. | ||
jnthn | An Array is a collection of Scalar containers (unless you use binding), and all the Scalar containers in an Array share a descriptor, and thus share the default value. | 22:08 | |
tamva | Ah, OK... I think that clears up my confusion. | 22:11 | |
Thank you. | |||
22:13
geospeck left
|
|||
Ulti just did a chunk of the 16th post, some nice graphs! perl6advent.files.wordpress.com/20...ations.png | 22:16 | ||
delicious jit frames thanks to the work landing in the summer :D <3 | |||
I need to advocate a simple text output for --profile too :P | 22:17 | ||
I feel slightly norty using pandas and python for the plotting :Z but it was just a bit too much effort to improve SVG Plot enough to do all this nicely | 22:18 | ||
22:19
Slyerk left
22:35
rgrau left
22:39
tamva left
22:40
troys is now known as troys_
22:42
troys_ is now known as troys
22:53
wamba left
22:56
ilmari[m] left,
M-Illandan left
22:57
M-Illandan joined
22:58
ilmari[m] joined
23:03
setty1 left
23:09
comborico1611 left,
comborico1611 joined
23:13
troys is now known as troys_
|
|||
Morfent | i'm running into trouble with locales for a C library i'm creating binds for | 23:15 | |
specificaly functions that convert utf8 and the like to other formats | 23:16 | ||
s/formats/encodings | 23:17 | ||
has anyone written code dealing with encodings and nativecall? | 23:18 | ||
23:22
Zoffix joined
|
|||
Zoffix | Morfent: I haven't, but the nativecall doc mentions `is encoded` trait for strings. Maybe that is it? docs.perl6.org/language/nativecall | 23:23 | |
bottom of this section: docs.perl6.org/language/nativecall...ing_Values | |||
Morfent | that's not the problem i'm running into | 23:25 | |
gimme a minute | |||
Zoffix | I wouldn't know the answer :) There are a couple of NativeCall modules in ecosystem (NativeHelpers::Blob / NativeHelpers::CBuffer ); maybe they can help: modules.perl6.org/search/?q=nativecall | 23:30 | |
\o | |||
23:30
Zoffix left
23:34
SCHAPiE left
|
|||
Morfent | possibly | 23:36 | |
i'll take a look at thoes | |||
23:37
SCHAPiE joined
|
|||
geekosaur | you might be running into moarvm not actually doing locales currently | 23:45 | |
like you have to tell it latin-1 instead of e.g. en_US.ISO8859-1 | |||
Morfent | that sounds like my issue | ||
how come moarvm doesn't support locales? | 23:48 | ||
that sounds like a project i could work on so it can have that support | 23:50 | ||
lizmat | Morfent++ | 23:52 | |
++Morfent rather :-) | |||
23:53
comborico1611 left
|
|||
geekosaur | nobody's written it and there's probably "fun" involved in getting it to work on both unixlikes and native msvc | 23:53 | |
MasterDuke | m: say | ||
camelia | 5===SORRY!5=== Argument to "say" seems to be malformed at <tmp>:1 ------> 3say7⏏5<EOL> Other potential difficulties: Unsupported use of bare "say"; in Perl 6 please use .say if you meant to call it as a method on $_, or use an … |
||
tyil | say I want to install a p6 app through my package manager portage, which allows me to run code after installation finised, is there a way to generate all the precomp files the application would make on its first run, to speed up the first time the user would actually run the application | ||
MasterDuke | m: say() | ||
camelia | |||
tyil | m: say; | 23:54 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Unsupported use of bare "say"; in Perl 6 please use .say if you meant to call it as a method on $_, or use an explicit invocant or argument, or use &say to refer to the function as a noun at <tmp>:1… |
||
tyil | hmm | ||
23:54
rgrau joined
|
|||
geekosaur | (I wish you luck consistently mapping Unix locales to Windows code pages) | 23:55 | |
...and back | 23:56 | ||
23:56
rvhausen joined,
rvhausen left
|
|||
Morfent | this is the code that's driving me nuts hastebin.com/onacihomuz.rb | 23:57 | |
* hastebin.com/eralujucoj.rb | 23:58 | ||
i might need to learn lldm and deguf wtf's causing this |