»ö« 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 | ||