»ö« 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:02 sufrostico left 00:14 mcmillhj joined 00:16 cyphase joined 00:18 mcmillhj left 00:20 _28_ria left 00:21 _28_ria joined 00:24 Cabanossi left 00:28 Cabanossi joined 00:33 m0ltar joined 00:45 Ven joined, Ven is now known as Guest48040 00:50 Guest48040 left 00:55 Cabanossi left
timotimo many modules in the ecosystem are using abspath ... 00:56
00:56 Cabanossi joined
AlexDaniel ^_^ 01:01
01:05 Actualeyes joined 01:06 titsuki left 01:45 ilbot3 left 01:47 ilbot3 joined, ChanServ sets mode: +v ilbot3 01:57 leego left 02:00 _28_ria left, leego joined
samcv i think i may have used it once myself 02:02
02:02 _28_ria joined
samcv not in an eco module though 02:02
AlexDaniel I thought whateverable used abspath, but no, it is using .absolute method 02:05
and also only chdir sub, not method
feels like I won't need to change any code because of IO grant work 02:06
Zoffix++
02:15 mcmillhj joined 02:19 samcv joined, mcmillhj left 02:25 Cabanossi left, noganex_ joined 02:28 Cabanossi joined, noganex left 02:35 geekosaur left 02:36 geekosaur joined 02:45 jmiven joined 03:08 xtreak joined 03:09 khw left
samcv i think i've almost gotten travis ci to make commits to my repo of appimage builds 03:16
crossing my fingers. it works the next time
03:26 Cabanossi left, Cabanossi joined 03:32 emdashcomma left 03:36 xtreak left 03:37 xtreak joined 03:38 Cabanossi left, xtreak left 03:39 xtreak joined 03:41 Cabanossi joined 03:56 mcmillhj joined 04:02 xinming left, jdmmmmm joined 04:03 xinming joined 04:10 AlexDaniel left 04:16 xtreak left 04:17 xtreak joined 04:21 xtreak left, wamba joined 04:23 Cabanossi left, xiaomiao left 04:25 jdmmmmm left, Cabanossi joined 04:29 xiaomiao joined 04:31 Actualeyes left 04:33 xtreak joined 04:41 skids left 04:43 mcmillhj left, Actualeyes joined 04:46 mcmillhj joined 04:48 BenGoldberg left 04:51 mcmillhj left 04:53 Cabanossi left 04:55 curan joined 04:56 Cabanossi joined 05:23 Cabanossi left 05:25 ufobat joined
samcv \o/ 05:25
05:25 Cabanossi joined
samcv i got it! 05:25
sweet github.com/samcv/rakudo-appimage/tree/gh-pages 05:29
my matrix of 4 commited appimages for each one 05:30
05:30 lowbro joined, lowbro left, lowbro joined 05:36 wamba left 05:37 domidumont joined 05:43 domidumont left 05:44 domidumont joined 05:52 RabidGravy joined 06:11 wamba joined 06:15 _28_ria left 06:17 _28_ria joined 06:24 domidumont left 06:27 kurahaupo joined 06:28 simcop2387 left 06:29 geekosaur left 06:31 geekosaur joined 06:32 simcop2387 joined 06:33 kurahaupo_ joined 06:34 kurahaupo_ left 06:35 kurahaupo left 06:39 Cabanossi left 06:41 Cabanossi joined 06:43 ChoHag joined 06:51 kyan left 06:58 Actualeyes left 07:01 avalenn left 07:02 curan left 07:08 Actualeyes joined, Cabanossi left 07:10 Cabanossi joined
lizmat sjn++ # good catch, fixed 07:10
moritz what's an appimage? something for macos? 07:12
samcv no, linux 07:15
you download the binary, and run it. standalone
moritz so statically compiled? or some kind of package manager?
samcv uh.
not a package manager
moritz or like an .exe installer for windows?
samcv no 07:16
moritz a thick today
samcv you +x it
then run it
and it starts perl6 prompt
that's it.
07:16 curan joined
samcv no install 07:16
and you can put it in whatever path you want 07:17
moritz wow, that's *way* cool
samcv yeah
u-ou is it like docker
moritz relocatable!
samcv dl github.com/samcv/rakudo-appimage/tree/gh-pages one of these
the stable is uh. things work fine
the testing you can give it relative paths and it will find things
and that works mostly fine but there's some hackage of the command line args in the perl6 shell script 07:18
not really u-ou
it's like those linux iso's
same format. like an executable tmp disk image
thing...
u-ou ahh
samcv idk it's great. lots of hacks to get it to work though, including patching all the binaries 07:19
to have relative paths ;)
it builds in /rsu folder. and then my build script i made patches the binaries into ././
and many other assorted things
and i just an hour or so ago, got travis commiting to the repo with appimages that travis builds itself 07:20
which is amazing 07:21
i could put it on a cron and have it do nightly builds of rakudo blead
07:22 parv joined
samcv heh nice. just pushed changes to the build script. and now a new appimage build is in the repo built 07:23
so sweet
07:28 xtreak left 07:29 xtreak joined 07:30 xtreak left, xtreak joined 07:34 robertle left 07:36 xtreak left, dakkar joined 07:37 abraxxa joined 07:38 domidumont joined 07:39 jonas1 joined, CIAvash joined 07:45 avalenn joined, imcsk8 left, wamba left 07:46 imcsk8 joined 07:52 rindolf joined 07:56 Ulti left 07:57 Ulti joined 07:58 Damianz joined, Damianz left, Damianz joined 08:00 spebern joined
Geth Inline-Python: 90cea00249 | (Stefan Seifert)++ | 4 files
Fix "Representation must be composed before it can be serialized"

Modules using Inline::Python may not be precompiled as the Python interpreter's state cannot be saved/restored.
08:01
nine .tell AlexDaniel re irclog.perlgeek.de/perl6/2017-03-30#i_14348415 fixed in Inline-Python commit 90cea00249
yoleaux nine: I'll pass your message to AlexDaniel.
08:05 ufobat left 08:07 Cabanossi left 08:11 darutoko joined, xtreak joined, Cabanossi joined 08:12 _28_ria left, spebern left, spebern joined, leont left 08:13 _28_ria joined 08:15 CIAvash left 08:17 xtreak left 08:20 ufobat joined 08:26 sven_123 joined, sven_123 left 08:34 robertle joined 08:35 parv left 08:39 Cabanossi left 08:40 Cabanossi joined
samcv moritz, the appimages will be seamless if I can figure out a way to make perl 6 change directory on being run 08:40
if we had a command line argument or something to do that, would solve the last main issue with the appimages, with them starting out with $*CWD in the ramdisk/whaever it is 08:41
mounted squash image
08:42 wamba joined 08:44 g4 joined, g4 left, g4 joined, bjz joined 08:45 bjz left 08:48 xtreak joined 08:54 bjz joined, wamba left 09:08 Cabanossi left 09:09 leont joined 09:11 Cabanossi joined 09:25 xtreak left 09:28 lowbro left 09:31 bjz left 09:32 spebern left 09:34 bjz joined 09:35 xtreak joined 09:41 rindolf left 09:42 zakharyas joined 09:50 kent\n left 09:51 mcmillhj joined 09:52 kent\n joined 09:54 rindolf joined 09:56 mcmillhj left 10:04 TEttinger left 10:07 leont left 10:18 xtreak left 10:19 xtreak joined 10:20 Zoffix joined
Zoffix PSA: Merge your PRs: 10:20
huggable: IO kills
huggable Zoffix, [XXXXX XXXXX XXXXX XXX]: See gist.github.com/zoffixznet/0ea1f4d...3f8dd11cc1
10:21 stmuk joined 10:22 xtreak left, xtreak joined 10:23 stmuk_ left 10:24 mcmillhj joined 10:25 xtreak left 10:28 mcmillhj left 10:31 Zoffix left 10:35 xtreak joined 10:39 Cabanossi left 10:40 Cabanossi joined 10:42 Cabanossi left 10:43 xtreak left, Cabanossi joined 10:44 xtreak joined 10:45 Cabanossi left
lizmat clickbaits p6weekly.wordpress.com/2017/04/10/...15-kaboom/ 10:45
10:46 Cabanossi joined 10:48 xtreak left
melezhik Hi Perl6 gurus! 10:50
I am struggling with main sub , passing options as array
perl6 -e 'sub MAIN ( Array :@a ){ }' -a=1
get this: usage: -e '...' [-a=<Positional[Array]>] 10:51
and none zero exit code
masak yes, because that `1` you're passing is not an array 10:52
melezhik so, how can I pass is as array?
masak I've never thought about it. not sure you can
ilmari perl6 -e 'sub MAIN (Int :@a){ say @a }' -a=1 # no worky either 10:53
Usage: -e '...' [-a=<Positional[Int]>]
Array :@a asks for an array of arrays 10:54
masak oh, right. forgot to mention that.
jnthn I think the only place an array makes sense in MAIN is a slurpy one
masak that's an eternal gotcha for newcomers; the `@` already encodes Array/Positional
melezhik well, let me reshape , how can I pass a list of values to MAIN sub? is it possible? 10:55
jnthn melezhik: I'm not aware of a way besides the slurpy 10:56
melezhik ok
jnthn sub MAIN(*@foo) { } # if you run it as script foo bar baz, then @foo has 3 elements
jnthn has used that somewhere 10:57
lizmat melezhik: perhaps -a=1,2,3 and then split on ',' ?
melezhik good, but I need to pass a named parameters
jnthn OK, then juist take a string and split it yourself
As lizmat suggested
melezhik yeah, I already have a "split" version
just looked more elegant way
but that's ok
lizmat melezhik: or perhaps .words
melezhik will go with "split", not a big deal ... 10:58
jnthn I don't think there is one... Also if there was then it might also mean that you could pass -a=1 -a=2 and so on and it should collect all of the a options into the array
So it's not clear an auto-split semantic is what's wanted either
melezhik yeah, not still clear why "-a=1 -a=2 -a=3" is bad idea? 10:59
jnthn melezhik: I didn't say it was a bad idea, just that it might be a more natural mapping for arrays in MAIN signatures 11:00
(Than splitting a single thing)
It can't mean both things, so we'd have to pick 11:01
11:01 kurahaupo joined
melezhik jnthn : Ok, I see 11:01
11:02 xtreak joined
melezhik as for me "-a=1 -a=2 -a-3" would be good )) 11:02
masak $ perl6 -e 'sub MAIN(:@a) { say @a }' -a=1 -a=2 11:05
[1 2]
seems to work
jnthn Oh...
jnthn had no idea :)
ilmari oh, I had an ancient rakudo, so my test was probably invalid 11:06
ilmari brews a new one
jnthn I note usage is like
[-a=<Positional>]
Which is a bit LTA
masak aye
m: sub foo(:$a) { say $a }; foo(a => 1, a => 2)
camelia 2
jnthn That's what I was going on when I figured it didn't know how to handle it.
masak some time in the distant past, this used to be spec'd to also make an array 11:07
but I think moritz and I killed off that bit, mebbe
semi-funnily, the "make an array" semantics makes some sense now that I consider it in light of MAIN, which I'm sure I didn't way back when
11:08 Cabanossi left, xtreak left, xfix_ joined 11:09 perlawhirl joined 11:10 xfix left, zakharyas left
ilmari masak: ah, it works without the type constraint on the array parameter 11:11
but only if you pass more than one -a
masak yes, type constraints on arrays are more or less useless in Perl 6
11:11 Cabanossi joined
masak yes, you need to pass more than one -a for it to *become* an array 11:11
heh. my several-years-down-the-line impression of Perl 6's efforts at being DWIMmy with types is... "don't" :P 11:12
I'd rather be explicit about what's an array/list/sequence than suffer the WATs of Perl 6 trying to figure it out 11:13
m: sub foo(:$x) { say $x.^name }; foo(<oh>); foo(<oh hai>)
camelia Too many positionals passed; expected 0 arguments but got 1
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
melezhik masak: good to know! thanks will try 11:14
masak m: sub foo(:$x) { say $x.^name }; foo(:x<oh>); foo(:x<oh hai>)
camelia Str
List
11:17 kurahaupo left, kurahaupo joined 11:20 stmuk_ joined 11:22 stmuk left 11:28 nadim_ joined 11:30 stmuk joined 11:31 mcmillhj joined 11:33 stmuk_ left 11:36 mcmillhj left 11:38 Cabanossi left 11:40 Cabanossi joined 11:41 Damianz left, mcmillhj joined 11:43 perlawhirl left
timotimo we can totally use the appimages to speed up all the travis builds. don't have to first compile moar, nqp, and rakudo. just download the appimage and go 11:44
11:46 mcmillhj left
melezhik masak: looks like :@a approach is limited 11:57
ahh, sorry, probably I am wrong ...
let me try another tests on this ... 11:58
12:01 rindolf left 12:03 perlawhirl joined
melezhik masak: your example works for me, thanks! 12:06
12:08 Cabanossi left 12:10 mcmillhj joined 12:11 Cabanossi joined, lowbro joined, lowbro left, lowbro joined 12:13 nadim_ left 12:15 mcmillhj left 12:25 mcmillhj joined 12:27 raschipi joined, sufrostico joined 12:30 mcmillhj left 12:52 Sound joined 12:53 mcmillhj joined, Sound is now known as Guest82682, Guest82682 left, Sound_ joined 12:54 Sound_ left 13:07 labster left 13:26 curan left 13:33 skids joined, sufrostico left 13:34 sufrostico joined 13:38 Cabanossi left 13:41 Cabanossi joined 13:57 Grauwolf left 14:03 Grauwolf joined
perlawhirl hi perlers 14:03
clickbaits: www.0racle.info/articles/matplotlib_in_p6_part7
last part of this series 14:04
masak perlawhirl++
14:04 spebern joined
perlpilot perlawhirl++ indeed. 14:04
timotimo oh cool 14:05
14:08 Cabanossi left 14:11 Cabanossi joined 14:12 wamba joined
perlpilot perlawhirl: Did you add Matplotlib to the ecosystem? If not, you should :) 14:12
timotimo "Taking a scene the from Part 6 script" has two words swapped
perlawhirl timotimo: fixed, thanks 14:13
timotimo perlawhirl: you could have also written "matplotlib.pyplot.cm.$name\($idx)"
14:13 spebern left
timotimo or "matplotlib.pyplot.cm.{$name}($idx)" should also work 14:14
perlawhirl perlpilot: I kind of don't wanna be in a position where people are asking me to fix issues, but I may throw the whole thing up in a gist.
timotimo: interesting... i might add a note mentioning that 14:15
14:15 alimon joined
timotimo m: my ($name, $index) = <foo 1>; say q:v"a.b.c$name($index)" 14:15
camelia a.b.c$name($index)
timotimo m: my ($name, $index) = <foo 1>; say q:s"a.b.c$name($index)"
camelia No such method 'CALL-ME' for invocant of type 'Str'
in block <unit> at <tmp> line 1
timotimo m: q:s"hi" 14:16
camelia WARNINGS for <tmp>:
Useless use of constant string "hi" in sink context (line 1)
timotimo ah, ok
so we have :s for scalar which "interpolates $ vars", but we don't have a way to turn off the method call detection? 14:19
14:19 khw joined 14:24 cog_ joined
robertle anyone got a tip for a url-en/decoding and splitting module? 14:25
http that is of course
14:26 stmuk_ joined, stmuk left 14:27 cognominal left
Ulti robertle: github.com/perl6-community-modules/uri looks like the main one 14:27
robertle: modules.perl6.org/ for finding them 14:28
perlawhirl perlpilot: gist is up... i'll add a note at the end of the blog post too: gist.github.com/0racle/db70e910a3e...f1b561e8d7 14:29
feel free to throw it on the ecosystem if you like :D 14:30
14:30 stmuk joined 14:31 jdmmmmm joined
robertle Ulti: thanks! I was aware of modules.p.o but was too stupid (URL vs URI...) 14:31
14:32 stmuk_ left
Ulti yeah URI is the generalisation 14:32
file:///root/ etc.
14:36 Khisanth left, rindolf joined 14:40 sufrostico left, stmuk_ joined 14:42 stmuk left 14:43 stmuk joined 14:45 perlawhirl left, stmuk_ left
raschipi URI is a bigger generalization than that. file:/// for example, is a URL too. 14:46
14:46 jonas1 left
raschipi URI is the union between URLs and URNs. 14:47
URNs of course, were abandoned.
ilmari ISBNs are examples of URNs
raschipi Yeah, they are. But I haven't seen them used in the internet. There's DOI, but there's not much use too. 14:49
14:49 Khisanth joined, cdg joined 14:50 Geth left, Geth joined, ChanServ sets mode: +v Geth, Geth left
raschipi There's only 5,000 DOI users in total, tiny. 14:50
14:51 Geth joined, ChanServ sets mode: +v Geth, Geth left
melezhik masak: universal way is perl6 -e 'sub MAIN( :$a) { say $a }' -a=1 -a=2 14:51
14:51 Geth joined, ChanServ sets mode: +v Geth
melezhik as it works for both -a=1 (scalar) and -a=1 -a=2 (array) 14:51
14:51 Geth left 14:52 Geth joined, ChanServ sets mode: +v Geth
moritz raschipi: how did you count that? 14:53
14:53 stmuk_ joined
raschipi DOI foundation numbers. 14:53
moritz I used DOIs when I was still in academia, but probably not in any way you could have counted 14:54
raschipi: those are probably just the institutions that generate new DOIs; many more users actually use them
raschipi It's the number of entities that can register them. Of course they're all big and register a lot of them for their affiliates.
moritz: Yes, I agree.
moritz much like there is a small number of institutions that allocate ISBNs, but everybody who buys or cites a book uses them 14:55
14:55 stmuk left
raschipi Well, it is growing. They recently creted a registration authority system, similar to what ICANN does for domain names. 14:57
timotimo or like domain names
raschipi Anyone can get a domain name, some people buy them for fun, like Zoffix with his perl6.party and perl6.vip 14:58
14:59 stmuk joined
timotimo yeah, but only few can issue them 14:59
15:00 stmuk_ left
raschipi Yeah, it's the same on both systems now that the foundation has accreditated companies. The difference is that few can buy DOI names. 15:00
15:02 raschipi left, stmuk_ joined 15:04 stmuk left 15:08 bjz left 15:12 g4 left 15:24 Cabanossi left 15:25 Cabanossi joined 15:32 abraxxa left 15:42 bjz joined 15:48 ChoHag left 15:49 TreyHarris joined 15:50 ChoHag joined 15:53 cdg_ joined 15:55 cdg left 16:00 domidumont left 16:01 cdg_ left, cdg joined 16:02 lowbro left
robertle or my own exceptions, do I really want to put them into X::MyApp rather then have MyApp as the top-level namespace? 16:02
16:02 ChoHag left 16:05 alimon left 16:06 mcmillhj left 16:07 mcmillhj joined 16:10 ChoHag joined 16:12 mcmillhj left 16:18 DarthGandalf left, setty1 joined 16:20 alimon joined 16:25 mcmillhj joined 16:26 alimon left, cdg left 16:27 cdg joined 16:30 mcmillhj left 16:31 mcmillhj joined
Geth specs: 9d446a48af | (Zoffix Znet)++ (committed by GitHub) | v6d.pod
Add reminder to deprecate IO::Handle.slurp-rest in 6.d
16:31
16:35 ilmari left, ilmari joined 16:36 mcmillhj left 16:38 ChoHag left 16:40 alimon joined 16:41 labster joined 16:43 drrho_ left 16:44 drrho_ joined
moritz DrForr: please merge github.com/drforr/perl6-Inline-Sch...ile/pull/6 soon 16:49
16:50 robertle left, mcmillhj joined 16:52 ufobat left 16:53 jdmmmmm left
Geth ecosystem: f07cf965cd | (Zoffix Znet)++ (committed by GitHub) | META.list
s/META.info/META6.json/ for drforr/perl6-ANTLR4
16:53
16:53 jdmmmmm joined 16:56 leont joined 16:58 dakkar left
TreyHarris Isn't there a 'use Very::Long::Name :as<Short>;' feature? I thought there was, but I can't find it 17:00
geekosaur no, in perl a module is always in its specified namespace. in perl 5 there's a glob-alias hack; dunno offhand how you'd translate it to perl 6 17:02
17:02 Geth left
TreyHarris And related question: how can I create a class named the same as one that's already been used and still refer to the old class? In this case, I want to use a native Perl 6 class that's named the same as a class that I got using Inline::Perl5 17:02
geekosaur (you may be thinking of haskell's import ... as ?)
17:03 Geth joined, ChanServ sets mode: +v Geth
TreyHarris geekosaur: I definitely am, but I thought Perl 6 had similar. 17:03
geekosaur problem being that perl has an actual gobal namespace
*global
so the module space you see is the module space everything sees
17:04 Geth left
TreyHarris Right. Can I do some lexical tricks to solve either problem? Make A::Very::Very::Long::And::Unwieldy::Module something I can refer to with a shorter variable, or to refer to the :from<Perl5> variant separately from the Perl 6 variant? 17:04
17:04 Geth joined, ChanServ sets mode: +v Geth
Geth ecosystem: f07cf965cd | (Zoffix Znet)++ (using GitHub Web editor) | META.list
s/META.info/META6.json/ for drforr/perl6-ANTLR4
17:05
17:06 stmuk joined 17:08 stmuk_ left, rindolf left
TreyHarris (To put into context: as part of my project, I will need to port a Perl 5 module, because using it directly via Inline::Perl5 is unwieldy and misses some very obvious features because it isn't Perl 6. Porting the module is going to be slightly painful, and for my POC I wanted to just write a bridge. I can do that--*have* done that--by slapping ::P6:: into the namespace of the Perl 6 bridge. But I _keep_ making 17:09
the mistake of referring to the Perl 5 name instead of the ...::P6::... name, and because it works 90% of the time, it ends up being a really annoying bug to squash. So just naming my bridge exactly the same as the Perl5 module would fix it, but it appears that is just not possible?)
17:12 rindolf joined
geekosaur no, you'd have to inject the p6 stuff into the p5 module's namespace... which might be difficult given it lives in perl 5 17:13
17:15 bjz left
TreyHarris Sigh. Maybe my best bet then is to rename my bridge into something very different from the P5 version and very short (instead of Proc::ProcessTable:from<Perl5> and Proc::ProcessTable::P6, maybe XBridge::ProcTable), then I can do a grep-replace once I've ported Proc::ProcessTable. 17:16
17:18 domidumont joined
TreyHarris Different subject: I'm finding in writing Inline::Perl5 bridges in general (which I do frequently for one-offs and POCs), there's a frequent need for something like this for "static methods": multi method foo (Klass:U $:) { self.new.foo } multi method foo (Klass:D $:) { ... } 17:24
Is there a shorter/idiomatic way for that?
b2gills constant AVVLAUM = A::Very::Very::Long::And::Unwieldy::Module; 17:25
17:30 ChoHag joined, domidumont left
TreyHarris b2gills: yes! Looking at my WIPs, I tried that, but when I had a different bug going on at the same time masking the issue. though I did binding to the const.... is there any reason to prefer "constant XYZ = X::Y::Z" over "constant XYZ := X::Y::Z"? 17:33
17:33 grondilu_ joined
TreyHarris they both seem to work interchangeably from quick REPL noodling 17:33
17:34 ufobat joined 17:36 grondilu left
MasterDuke TreyHarris: if you look at the --target=ast for both they're identical (except the places where it prints the input line), so seems to be interchangeable 17:36
17:37 ChoHag left 17:38 Cabanossi left
TreyHarris MasterDuke: yup, thanks 17:38
17:42 Cabanossi joined 17:46 raschipi joined 17:48 espadrine joined 17:54 ChoHag joined, raschipi left 17:57 AlexDaniel joined 18:02 cdg left, cdg joined, AlexDaniel left 18:03 AlexDaniel joined 18:11 leont left
AlexDaniel . 18:15
yoleaux 08:01Z <nine> AlexDaniel: re irclog.perlgeek.de/perl6/2017-03-30#i_14348415 fixed in Inline-Python commit 90cea00249
AlexDaniel nine: thanks!
18:19 mattp__ joined 18:20 mattp_ left 18:25 cdg left 18:27 alimon left 18:33 gdonald left 18:34 gdonald joined 18:35 wictory[m] left 18:38 Guest64639 joined 18:41 geekosaur left
unclechu what would be native equvalent to `run(Q:w <tput cuu 1>, :out).out.get` (i use it to get char that i can print to move cursor one line up)? 18:41
like `chr(8)` to get char to move cursor one column left
moritz qx/tput cuu 1/ 18:42
what do you mean by "native"?
18:42 geekosaur joined
unclechu moritz: like special char code for `chr` function 18:43
18:43 ChoHag left
moritz unclechu: you can reference characters by name, if that's what you're looking for 18:43
"\c[BACKSPACE]" 18:44
unclechu moritz: i'm not looking for backspace, i already have it (`chr(8)`), but for char that `tput cuu 1` command prints 18:45
if anyone know this char name
18:46 leont joined
MasterDuke unclechu: i added `.uniname.say` to your example and it reports `<control-001B>` 18:47
moritz $ perl6 -e 'say qx/tput cuu 1/.uninames.join: ","'
ESCAPE,LEFT SQUARE BRACKET,DIGIT ONE,LATIN CAPITAL LETTER A
unclechu or a code
MasterDuke unclechu: for `.ords.say` i get `(27 91 49 65)` 18:50
unclechu so, i guess it is sequence of symbols, i'll try
18:51 alimon joined
moritz "\c[ESCAPE][1A" 18:51
perlpilot unclechu: you could always do "tput cuu 1 | xxd" from the command line to see what it outputs. 18:52
unclechu: change xxd for your favorite hex dumper :)
moritz hexdump -C is also nice 18:53
18:54 AlexDaniel left, Cabanossi left
unclechu thanks a lot to all of you, that solved my issue and i got more useful ways to debug stuff 18:55
[Coke] perl6 -MApp::Uni -e 'say uni-gist $_ for qx/tput cuu 1/.comb' # should be able to make this awesomer.
18:55 Cabanossi joined
[Coke] uni -c $(tput cuu 1) # awesomer. 18:56
perlpilot [Coke]++ (Why isn't uni-gist built-in yet?) 18:58
[Coke] u: • 19:00
unicodable6 [Coke], U+2022 BULLET [Po] (•)
perlpilot [Coke]: I get test failures trying to install that module via zef. Looks like it's because bin/uni can't find App::Uni (i.e. when I "zef look App::Uni" and "export PERL6LIB=lib" the tests run fine) 19:05
unclechu am i only one person who have this issue: github.com/perl6/perl6-lwp-simple/issues/12 ? 19:07
[Coke] perlpilot: I think it's the same bug that ugexe pointed out to me, I have to make the tests smarter because it's exec'ing p6
unclechu it's sad because i can't install gtk::simple that depends on lwp::simple 19:08
can i ignore failing tests while install package using `zef`? 19:09
gfldex unclechu: run `zef install --force LWP::Simple`
if you use Perl 6 sometimes the force needs to be with you 19:10
19:15 andrzejku joined 19:19 darutoko left 19:23 AlexDaniel joined
alphah Does "_" has special meaning here or just key name: %hash<_> = $<toplevel>.ast.hash 19:24
gfldex no special meaning
alphah Thanks 19:25
unclechu gfldex: thanks, it helps
what does `c` in `use v6.c;` mean? 19:26
`ceil`?
alphah christmas!
gfldex from the standpoint of the compiler, it doens't have special meaning beyond 'b'.succ 19:27
m: dd (v6.c).succ
camelia No such method 'succ' for invocant of type 'Version'
in block <unit> at <tmp> line 1
TreyHarris Is there an idiom or something that will help with creating "static methods" that can be called on instances, or, when called on classes, call the method on a throwaway object? See gist.github.com/treyharris/9199028...b504d246bd 19:30
gfldex TreyHarris: you could use $?CLASS 19:36
El_Che don't you just want a sub for that?
gfldex m: class C { our sub s(){ dd $?CLASS::new } }; C::s 19:39
camelia Any $v = Any
gfldex m: class C { our sub s(){ dd $?CLASS.new } }; C::s
camelia C.new
TreyHarris gfldex: As in 'multi method hrm($?CLASS:U $: Int $n)' ? 19:40
jnthn Would need to be ::?CLASS:U
And the $ ain't needed
gfldex yes, that can help if you copypasta from methods between classes
TreyHarris That gives me en error: In signature parameter $?CLASS, it is illegal to use the ? twigil
jnthn Though this is optional; any method that doesn't access attributes can be called on the type object
So unless for some reason you want to *force* the user to only ever call it on the type object, and never on an instance, there's no particular need to mark it 19:41
TreyHarris yes, ::?CLASS:U works.
jnthn m: class C { method m() { say "look I'm static!" } }; C.m;
camelia look I'm static!
TreyHarris jnthn: but then I can't call it as a class method 19:42
gfldex m: class C { method m() { say "look I'm static!"; dd self } }; C.m;
camelia look I'm static!
C
gfldex please note that self in this case points to the type object, not an instance of C
TreyHarris jnthn: Your example isn't relevant because it doesn't use an instance attribute. The compiler catches that and complains.
My gist does that
Are you saying in my gist I can remove the multi from the ":D" version and remove the ":U" version completely and get the same behavior? Because I'm not... 19:43
jnthn Ah, no
You want more than just a static method, I see
So yeah, multi over :D and :U is the way to go 19:44
TreyHarris So ::?CLASS is my first fix. Can I avoid repeating "hrm"?
gfldex m: class C { method m() { self := self // C.new } }; C.m;
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot use bind operator with this left-hand side
at <tmp>:1
------> 3 C { method m() { self := self // C.new 7⏏5} }; C.m;
19:44 Guest64639 left
jnthn An alternative idiom for this might be 19:44
TreyHarris (Reload the gist for the ::?CLASS version.) 19:45
jnthn m: class C { has $.x = 0; method m($self is copy:) { .= new without $self; say $self.x } }; C.m
camelia 5===SORRY!5=== Error while compiling <tmp>
Preceding context expects a term, but found infix .= instead
at <tmp>:1
------> 3s $.x = 0; method m($self is copy:) { .=7⏏5 new without $self; say $self.x } }; C.m
gfldex callwith should work if you provide the invocant by hand
jnthn m: class C { has $.x = 0; method m($self is copy:) { .=new without $self; say $self.x } }; C.m 19:46
camelia 0
jnthn Though that'll only work if youuse the . forms, not the ! forms, of attributes
TreyHarris what's the correct callwith syntax then?
jnthn An alternative is to just to meta-programming and write a MOP module that wraps everything :) 19:47
*just go
gfldex TreyHarris: i wrote 'should' not 'will' to indicate a guess on my side 19:49
TreyHarris jnthn, this is not the correct syntax, can you tell me what is? callwith(self.new(): $n); 19:51
jnthn callwith iterates an existing candidate list, rather than re-dispatching
So that isn't useful in this case
19:51 TEttinger joined
jnthn I *think* samewith - which does redispatch - also latches onto the original invocant 19:53
19:54 ChoHag joined, AlexDaniel left
TreyHarris jnthn: I'd dealing with a whole mess of Perl5 modules that all have this issue where all methods must be called on a blessed reference even though that's only in order to get defaults. (Specifically, they all have "->fields" methods which tell you what fields are available for the given class, which is surely not something you need an instance for, but the way it was done in Perl 5 requires it.) I was trying 19:55
to write bridges to fix this behavior along with methods that used directly via Inline::Perl5 results in broken list-return behavior.
jnthn: samewith has exactly the same behavior as nextwith and callwith I wrote in my comment notes. 19:57
jnthn *nod*
So, MOP-y stuff is likely the best way 19:58
m: multi trait_mod:<is>(Method:D $m, :$auto-new!) { $m.wrap: -> \obj, |c { callwith(obj.DEFINITE ?? obj !! obj.new, |c) } }; class C { has $.x = 0; method m() is auto-new { say $!x } }; C.m; C.new.m
camelia 0
0
jnthn That's probably the minimal way
With a little more effort you can make it into a class trait
So you only have to put "is auto-new" on the class, not on each method 19:59
Though maybe that's too sweeping
But it gets away from having to to :U/:D stuff and re-mention the method name
m: multi trait_mod:<is>(Method:D $m, :$auto-new!) { $m.wrap: -> \obj, |c { callwith(obj.DEFINITE ?? obj !! obj.new, |c) } }; class C { has $.x = 0; method m() is auto-new { say $!x } }; C.m; C.new(x => 42).m # just checking :)
camelia 0
42
20:00
jnthn phew :)
TreyHarris but with that I'd write: use Whatever:from<Perl5>; class P6::Whatever is Whatever { method fields is auto-new { nextsame; } }
nine TreyHarris: feel free to ping me if there's anything I can do on the Inline::Perl5 side.
jnthn Do you need it to be a subclass?
And to respond correctly to .can? 20:01
If those don't matter than there's just wrapping it up and using FALLBACK
TreyHarris jnthn: "need"? Perl5 objects don't respond correctly to .can. But I would like to avoid rewriting the names of methods whose behavior I don't need to change 20:02
nine: my biggest issue has been with methods that return lists... the container they return is very odd. comparing 'my $t = FromP5.new.listy(); my @t = FromP5.new.listy();' is strange. Neither is directly iterable, but $t.elems is correct and $t can be indexed, while @t.elems is 1 and the single element is another list. I've dealt with this by wrapping such methods in 'method listy (--> Slip(Any)) { return 20:04
FromP5.new.listy(); }'
Also, oddly, 'my $obj = FromP5.new; $obj.listy() === $obj.listy() or die' dies, as does eqv and =:= 20:05
Oh! Sorry, only when something within the overall object is in XS. Hope you weren't writing your own test for this. (Proc::ProcessTable is a very simple thing to see this behavior.) 20:08
Proc::ProcessTable.new.table shows this behavior for instance. 20:09
Pure Perl5 seems to get translated okay. 20:10
nine TreyHarris: that sounds odd. Perl 5 arrays get wrapped in a Perl5Array object which does Iterable and Positional
20:11 cdg joined
TreyHarris nine: gist.github.com/69bac1c14bfd033de4...2830630288 20:16
(must go for ~1hr, sorry) 20:17
nine TreyHarris: if those wrappers misbehave, you can also just .list them 20:19
TreyHarris nine oops sorry on phone so briefly: yes positional and iterable but the @version only has single element, @var[0] is actual list. Is why I used a Slip(Annie) return type 20:22
*Any 20:23
nine my @t = Proc::ProcessTable.new.table.list
^^^ does what you need
Aaaand I may have a patch that fixes the issue altogether 20:26
Just have to sprinkle some "is raw" to avoid containerization of the Perl5Array return object.
Geth Inline-Perl5: 2b5d854575 | (Stefan Seifert)++ | 2 files
Support .can on Perl5Objects
20:29
20:30 _28_ria left, AlexDaniel joined
TreyHarris nine: I see. .fields does not exhibit this behavior because its structure is pure Perl. But I can do a trait that just puts ".list" at the end of everything; I do enough maps and greps and such in code that having to put .list in each place it should go will be annoying. Got to write an override either way; not sure if "method table (--> Slip(Any)) { $p5obj.table }" or "method table() { $p5obj.table.list }" is 20:30
better. First is a few chars shorter, so it wins? :-)
20:31 perlpilot left, _28_ria joined
nine TreyHarris: I already have a patch for making my @t = Proc::ProcessTable.new.table; do what you need. Just need to write a test for it. 20:31
Writing a test seems to be the harder part actually... 20:33
TreyHarris nine: Always is the case innit 20:34
20:40 andrzejku left 20:45 bjz joined 20:50 alimon left 20:53 gdonald left, Cabanossi left
nine Can't get the darned thing to fail :) And I also don't see why it should make a difference if a sub is in XS or pure Perl. They all just push onto the stack and Inline::Perl5 doesn't even know what exactly it is. 20:53
20:53 gdonald joined 20:56 Cabanossi joined 20:59 skids left
nine Ooooh...of course! Proc::ProcessTable::table returns an array ref, not just an array. 20:59
TreyHarris: I wonder if Inline::Perl5 is actually correct there. A Perl 5 array reference sounds like it's closer to an itemized Perl 6 array than a flat one. 21:00
21:09 RabidGravy left
TreyHarris nine: It's arguably "closer" but it's far, far more unwieldy (unless you know to just never use it until you use .list). In Perl5, the most you need do is add an @-sign to get it to work with built-ins, for, etc. In Perl 6, I was tearing my hair out trying to figure out if there was any way to assign it to an @array. Even '@a = ...table; @a = @a[0]; @a = @a[0]; say @a.elems' still gave you the same darn thing. 21:11
21:12 ufobat left 21:16 jdmmmmm left
TreyHarris nine: In fact, you can't delay the '.list'. "my @a = ...table; say @a.list.elems # 1" is just as unusable. You have to do ".list" at call-time or wrap it in a Slip(Any). Otherwise, you're stuck with something that's uniterable and un-flat()-enable and only indexable through @a[0][$n], though @a[0] itself isn't iterable. It really, really confused me for a long time 21:18
21:18 AlexDaniel left 21:20 raiph joined, kurahaupo left, kurahaupo joined 21:28 bjz left 21:32 mcmillhj left 21:35 bjz joined 21:37 AlexDaniel joined 21:38 Cabanossi left 21:40 Cabanossi joined 21:41 bjz left 21:51 bjz joined 21:58 raiph left 21:59 mcmillhj joined 22:04 setty1 left
Geth doc: a30fae6896 | (Zoffix Znet)++ | doc/Type/IO/Path.pod6
[io grant] Avoid potential confusion with use of word "object"

Where it does not refer to an OOP object
22:05
22:08 bjz left 22:09 bjz joined
unclechu can i mark an argument of subroutine to copy that i can mutate? 22:17
sammers "is copy"?
sub foo($i is copy) {...} 22:18
22:21 mcmillhj left 22:22 cpage_ left 22:24 rindolf left
unclechu sammers: thanks, that's it 22:26
sammers np 22:27
22:29 bjz left 22:31 Sgeo left, DarthGandalf joined 22:33 mcmillhj joined 22:36 DarthGandalf left 22:41 skids joined, mcmillhj left, bjz joined, Sgeo joined 22:42 Sgeo left, Sgeo joined 22:43 DarthGandalf joined 22:45 Geth left, Geth joined, ChanServ sets mode: +v Geth 22:46 Geth left, Geth joined, ChanServ sets mode: +v Geth 22:47 mcmillhj joined 22:49 jdmmmmm joined 22:51 bjz left 22:54 Cabanossi left 22:55 cpage_ joined, mcmillhj left 22:56 Cabanossi joined 23:01 khw left, jdmmmmm left 23:02 mcmillhj joined 23:07 mcmillhj left 23:11 mcmillhj joined, cdg left 23:12 DarthGandalf left 23:15 mcmillhj left 23:17 mcmillhj joined 23:22 mcmillhj left 23:24 ChoHag left
Geth doc: 2aa3c9f609 | (Zoffix Znet)++ | doc/Type/IO/Handle.pod6
[io grant] Document new behaviour of IO::Handle.Supply

  - Expand description
  - Add examples
23:25
23:28 mcmillhj joined 23:33 mcmillhj left 23:34 mcmillhj joined 23:35 mcmillhj left 23:37 mcmillhj joined 23:42 wamba left 23:56 kyan joined 23:57 mcmillhj left 23:58 mcmillhj joined