00:01 rindolf left 00:05 mowcat joined
sena_kun hythm, do you need only pretty printing or something more to manipulate matrices nicely? 00:06
m: role Array::Matrix[:$col] { method gist { self.Str.split(' ').rotor($col) } }; my $a = (1, 2, 3, 4, 5, 6, 7); $a does Array::Matrix[col => 3]; say $a.gist; 00:07
camelia ((1 2 3) (4 5 6))
sena_kun if only pretty printing is necesary, I'd go with this.
hythm sena_kun I need to do a lot of transformation, like flip, rotate, transpose, swap rows with columns,... 00:08
sena_kun If you want to actually inject arrays to operate on those on matrices level, I'd go with a custom class.
just in case, did you see Math::Matrix? 00:09
hythm yes I did, but it only works on Numeric, not strings
and it's using a class, I can do the same thing as a class,,, but I think it's a little nicer, if I can apply a role as "my @a does Array::Matrix" 00:11
sena_kun I wonder if a patch can help. Work on strings as "1 2 3" or "a b c" with alphabet order or something like that?
hythm "a b c" 00:12
sena_kun it's your time, of course, just guessing if patching can be less workload.
m: 'a' > 'z'
camelia WARNINGS for <tmp>:
Useless use of ">" in expression "'a' > 'z'" in sink context (line 1)
Cannot convert string to number: base-10 number must begin with valid digits or '.' in 'a' (indicated by ⏏)
in block <unit> at <tmp> line 1
sena_kun m: say 'a' > 'z'
camelia Cannot convert string to number: base-10 number must begin with valid digits or '.' in 'a' (indicated by ⏏)
in block <unit> at <tmp> line 1
sena_kun m: say 'a' lt 'z'
camelia True
sena_kun m: say 'b' le 'a'
camelia False
sena_kun I wonder if one can factor out exact ops and types to operate on. 00:13
hythm Math::Matrix has many (Numeric) operation, and a little different than what I need. I basically want to implement these methods here as role, so the code gets more cleaner: github.com/hythm7/Z/blob/master/li...er.pm#L109 00:17
and instead of creating an object and access the array from within, I like the idea of applying a role to the an array, and then the array it self will behave accordingly 00:19
sena_kun hmm. I am by no means an experienced coder, but I'd see it as anti-pattern... Also, about values getting: 00:20
m: role A { method a { self.values } }; my @a does A = 1, 2, 3, 4; @a.a.say; 00:21
camelia (1 2 3 4)
sena_kun ^ combining this and a named arg to a role you likely can move logic as you want, I hope. :)
TreyHarris Interesting. Specifically for moritz/perl6-all-modules, and no other repos I can find, I get very weird behavior from git-clone, and hub seems to complicate it (but bypassing hub doesn't totally fix the behavior). gist.github.com/treyharris/49ab080...8866672f63 00:22
hythm that opened my mind a little, I will give that a try. thanks for the help sena_kun :)
00:28 dct_ left
MasterDuke TreyHarris: i just tried a `git clone [email@hidden.address] and it worked fine for me with git 2.19.1 on kubuntu 18.10 00:30
TreyHarris Hmm... 2.17.1 here. 00:31
MasterDuke: oh, but ssh always worked unless I misread one of my own outputs in that doc I pasted? 00:32
It seems to just be https and/or git protocol that messes up sometimes 00:33
MasterDuke odd
00:37 hythm left 00:40 jargan joined, jargan is now known as jast 00:41 jme` joined, zachk left
TreyHarris Oh, man... I missed the 'rotor' in those matrix role examples above, and I was _VERY_ bewildered at where the dwimmyness was coming from. rofl 00:45
timotimo ACME::Rofl - adds a .rofl method on list-likes that acts the same as .rotor 00:48
00:55 leont left 01:01 kurahaupo left 01:02 kurahaupo joined 01:24 Cabanossi left 01:36 Cabanossi joined 01:37 markoong left, markoong joined 01:38 zacts joined 01:42 markoong left 01:43 dominix joined 01:46 zacts left 01:49 schwaa joined 01:55 sena_kun left 02:01 schwaa left 02:04 aborazmeh left 02:13 aborazmeh joined, aborazmeh left, aborazmeh joined 02:20 sauvin_ joined 02:21 sauvin left 02:38 MasterDuke left 03:11 Kaypie left 03:20 zacts joined 03:27 cpan-p6 left, cpan-p6 joined 03:29 zacts left 03:45 sauvin_ is now known as Sauvin 03:50 _isomorphismes left 03:52 isomorphismes left 03:53 RaycatWhoDat joined
RaycatWhoDat Hello. 03:53
So long. 03:55
03:55 RaycatWhoDat left 04:04 isomorphismes joined 04:22 molaf joined 04:41 isomorphismes left 04:46 veesh joined 04:49 veesh left 05:07 Kaypie joined 05:17 molaf left 05:21 mowcat left 05:22 kurahaupo left, kurahaupo joined 05:28 aborazmeh left 05:45 Anonymus joined 05:47 Anonymus left 05:53 calyx joined 06:07 jeek joined 06:10 dct_ joined 06:44 schwaa joined 06:46 tomato_ joined 06:48 domidumont joined 06:52 lizmat left 06:56 random_yanek left 06:57 jmerelo joined
schwaa Hi, here is a question about trait: Do all user defined traits start with "is"? Can I define a trait like "capi" rather than "is capi"? 06:57
tyil `is` is a keyword to associate the trait with a class, no? 06:58
the trait is called "capi", and you associate it to a class with something like `class Foo is capi` 06:59
07:00 dct_ left
schwaa Here is an example: multi trait_mod:<is>(Routine $r, :$capi) { ... }. Why I need to write `is` in this definition??? 07:01
Since it's not a part of the trait 07:03
tyil oh
I was thinking of something else
moritz you can use a different trait than "is", but I don't think you can make up your own category
07:04 w17t joined
schwaa yeah, I just want a shorter form of the "is native(.....)" 07:04
I wote "multi trait_mod:<capi>(Routine $r)" in my code. the compiler said: Missing block --> sub py_none_check(PyRef --> int32)⏏ capi {} 07:06
07:08 random_yanek joined 07:11 robertle joined 07:12 tomato_ left 07:13 domidumont1 joined
jmerelo schwaa: that's weird. Some Python thing? 07:14
schwaa: there are several trait_mod in the source, other than is: does, handles... 07:15
07:16 domidumont left
jmerelo schwaa: apparently, "is" is dealt with in a special way by the compiler. If what you want to define is a trait, it's better if you use that. If it's something else, use whatever. 07:16
schwaa ok 07:18
07:36 jmerelo left 07:39 schwaa left 07:46 lizmat joined 08:03 aindilis` joined 08:04 aindilis left 08:15 ravenousmoose joined 08:18 reach_satori left 08:19 reach_satori joined 08:20 dct_ joined 08:31 reach_satori left 08:46 dct_ left 08:48 ravenousmoose left 09:05 rindolf joined 09:07 ravenous_ joined 09:12 zakharyas joined 09:21 ravenous_ left 09:22 ravenousmoose joined 09:26 calyx left 09:29 calyx joined 09:42 robertle left 09:45 ufobat joined
ufobat tyil: gist.github.com/ufobat/a3e56834226...bf1898b4d7 09:45
09:49 ufobat left 10:10 llfourn_ left 10:14 ravenousmoose left 10:17 llfourn joined 10:22 lizmat_ joined 10:23 woolfy1 joined 10:24 woolfy left, lizmat left 10:31 scimon joined 11:13 sena_kun joined 11:15 ravenousmoose joined 11:21 ravenous_ joined 11:22 leont joined 11:24 ravenousmoose left 11:25 lizmat_ is now known as lizmat
daxim m: sub multi-retval (--> Bool, Int) { return True, 42 } 11:29
camelia ===SORRY!=== Error while compiling <tmp>
Malformed return value (return constraints only allowed at the end of the signature)
at <tmp>:1
------> sub multi-retval (--> Bool, Int) { return True, 42 }
daxim do I really have to make up named types?
11:29 ravenousmoose joined 11:32 ravenous_ left
daxim m: subset Some::Multi::Retval of List where 2 == $_.elems && $_[0] ~~ Bool && $_[1] ~~ Int; sub multi-retval (--> Some::Multi::Retval) { return True, 42 }; dd multi-retval; 11:33
camelia (Bool::True, 42)
11:34 ravenous_ joined 11:36 ravenous_ left 11:38 ravenousmoose left 11:46 ravenousmoose joined 11:48 drolax joined 11:49 pecastro joined 11:52 drolax left 11:59 ravenousmoose left 12:02 ravenousmoose[aw joined, ravenousmoose[aw left 12:04 zakharyas left 12:06 saki joined, saki left
leont We don't really have tuple types, I fear 12:07
Though I guess one could make such a thing
Apparently not 12:08
m: subset Foo where (Bool, Int); sub multi-retval (--> Foo) { return True, 42 }; 12:09
camelia ( no output )
daxim that's shorter at least, good job 12:10
lizmat perhaps modules.perl6.org/dist/Tuple:cpan:ELIZABETH can be of service, daxim ? 12:15
daxim nope, I want anonymous types for retvals 12:16
cpan-p6 New module released to CPAN! DB (0.2) by 03CTILMES
12:16 saki joined
lizmat daxim: too bad 12:17
daxim m: sub multi-retval (--> List where (Bool, Int)) { return True, 42 }; 12:24
camelia ===SORRY!=== Error while compiling <tmp>
Cannot do non-typename cases of type_constraint yet
at <tmp>:1
------> multi-retval (--> List where (Bool, Int)) { return True, 42 };
daxim I hope that has a corresponding TODO test somewhere 12:25
tbrowder hi, #perl6 ! 12:27
can anyone give a good use case for $*ARGFILES vs @*ARGS 12:29
i can see its use iff it only contained cli args that are exiting files 12:30
otherwise, i have
moritz if you want to implement a simple tool like `wc` or `cat` or so without options, that's not a bad assumption
12:31 markoong joined
leont @*ARGS will contain options, $*ARGFILES only non-options 12:31
fo $*ARGFILES won't try to open your --foo 12:32
tbrowder yes, but that still sounds like, in your favorite expression, sugar for @*ARGS
leont Actually, what I said seems not quite accurate 12:33
tbrowder leont: ok, that’s a plus, but i didn’t see that in the docs
leont But $*ARGFILES is a file handle, and @*ARGS isn't 12:34
tbrowder actually, when i create scripts i often don’t use - in front of options anyway
ok, si 12:35
leont What I observed what a side-effect of v6.d that I had forgotten about despite having had to code around it before -_-
tbrowder can $*ARGFILES save some code in this example: 12:36
for @*ARGS { next if !$_.IO.f } 12:38
leont Think of it as: for $*ARGFILES.lines(:chomp) { .say if /foo/ } 12:39
It's the handle to do the equivalent of p5's <>
tbrowder hm, looks like i thought, so far i’m not convinced of its utility, but that’s the joy of p6, use what what works for you until someone t 12:41
*someone shows you a better way!
thanks, folks! 12:42
leont TBH, I've never needed it either 12:44
12:48 lizmat_ joined 12:51 lizmat left 12:52 domidumont joined 12:55 RubioTerra joined, domidumont1 left
tbrowder well, i think i see the use case (he says with the possibility of finding egg on his face), back in a while... 13:09
13:10 saki left 13:12 andrzejku joined 13:13 w17t left 13:17 w17t joined 13:22 zacts joined
leont For a moment I was like "why does «$file.r == $expected» give me an exception when the file doesn't exist, turns out it's the numification. 13:25
Using === does DWIM 13:26
13:26 isomorphismes joined
El_Che cough*JS*cough 13:26
13:28 rindolf left 13:35 rindolf joined
leont Failure objects are a bit dangerous like that :-/ 13:36
tbrowder well, no egg, thank goodness. turns out i just had to quit the @*ARGS processing loop when i detected my option requiring processing the rest of the CLI as possible input files. i did then have to loop through @*ARGS again, testing each for an existing file, but i don’t think using $*ARGFILES would have saved anything EXCEPT skipping suspected option args. that would 13:38
13:39 domidumont1 joined
tbrowder be useful in normal CLI practice, so i retract all my whining. however, i’ll look at the docs closer to see if that 13:40
option-skipping is explained.
leont I was mistaken, I think that's not happening. 13:42
13:43 domidumont left 13:48 smallick joined
leont Why is a failure to open a file (in this particular case) an X::AdHoc, and not a properly typed exception? 13:50
tbrowder ref $*ARGFILES: i’m very impressed, looks like it *does* pick only existing files out of the CLI args! 13:52
so it is a definite improvement over @*ARGS for detecting real files by not duplicating file tests. 13:54
13:54 zakharyas joined, ufobat joined, w17t left
tbrowder if you don’t learn someting every day, you’re not paying attention (even though you may have known it before and forgotten it :-D ) 13:56
13:56 shlomif joined 13:58 rindolf left, shlomif is now known as rindolf
ufobat hi 14:00
.tell tyil was my link of any use to you?
yoleaux ufobat: I'll pass your message to tyil.
14:05 RubioTerra left
woolfy1 woolfy1 and lizmat are going to FOSDEM in 15 minutes or so and set up the Perl-booth and tomorrow we're going to promote Perl like crazy woohoo 14:10
woolfy1 knows she is tiresome... sorry...
moritz woolfy1: you two are the biggest resalers of my books, so thanks for doing all that crazy stuff :) 14:11
leont leont is totally unorganized wrt FOSDEM, but will surely be around at least one day 14:14
woolfy1 moritz : really? And we didn't even sell that many, maybe a bit more than 150 in total for the two books 14:15
leont Nice if you show up anyway!
tbrowder arg, $*ARGFILES throws an error unless at least one real file exists. seems like it ought to be empty unless real files are found, since it obviously test for it. i guess i can use a try block but sounds like a bad design so far. 14:16
why would we set $ARGFILES to $*IN if there are no files in @*ARGS? 14:18
(er, $*ARGFILES) 14:19
leont Because <>
14:20 zacts left
leont Because that's a unix convention. Read from stdin if given no arguments 14:20
in v6.d $*ARGFILES is always $*IN equivalent inside MAIN 14:22
I haven't been able to find the reasoning for that. I guess the magic didn't work well with subcommands.
moritz woolfy1: yes, really. They are not really NYT bestsellers :D 14:24
14:26 rurban joined, rurban left
woolfy1 moritz I know. But all the Perl 6 I sell are selling better than the Perl 5 books. The only good-selling Perl 5 book I had was Beginning Perl by ovid 14:27
leont People already have Perl 5 books, and they're sold elsewhere as well 14:29
woolfy1 Leaving... going to Brussels... bye 14:30
14:30 woolfy1 left
leont 84d45f07fb4a6b08f0acb8ac15e0e4da80b7f3f3 lists a short reason, but doesn't like to an actual discussion 14:30
14:30 lizmat_ left
leont *link 14:31
tbrowder i 14:33
14:33 molaf joined, rindolf left
tbrowder what is the state of $*IN if the user doesn’t modify it? 14:34
i’ll try to test it...
14:38 scimon left, rindolf joined 14:42 zacts joined 14:46 clarkema joined
leont I'm seriously considering making $*ARGFILES do something else in Getopt::Long, because the v6.d behavior doesn't make sense. 14:47
14:47 reach_satori joined 14:48 skids joined 15:00 scimon joined
leont Looking for a reason that isn't "because zoffix" 15:04
AlexDaniel leont: what's the current behavior exactly and how do you want to change it? 15:05
cpan-p6 New module released to CPAN! DB (0.3) by 03CTILMES 15:06
leont when v6.d, $*ARGFILES only contains $*IN inside MAIN
15:06 pmurias joined
pmurias what's a good terminal font that can display all the weird unicode characters Perl 6 uses? 15:07
leont I would like it to contain the appropriate positional arguments instead
timotimo leont: you can totally create a new IO::CatHandle and expose it as $*ARGFILES
15:07 ufobat left
leont Yeah that's my plan 15:07
timotimo SGTM 15:08
15:15 dylanwh left 15:16 reach_satori left
jkramer pmurias: I like terminus and it seems to support a good portion of unicode, at least I didn't need a character yet that it didn't support 15:18
Also great for coding IMO
15:19 dylanwh joined 15:20 Sgeo_ joined
clarkema Anyone going to be at FOSDEM? 15:20
yoleaux 26 Jan 2019 22:04Z <leont> clarkema: I split up App::Prove6 from TAP::Harness, so the former should also be added to Rakudo Star
15:21 jme` left
leont lizmat and woolfy are already on their way to FOSDEM. I'm probably also going. 15:21
clarkema leont: Yup, just caught up with the ticket for that
15:23 Sgeo left
clarkema Been distracted by the whole 'work' think recently, but will catch up with release stuff soon 15:23
leont Trying to create an overloaded hash 15:33
I think I have to override AT-POS to return a container that can store the thing, but that's about as far as I got 15:34
Erm, AT-KEY 15:35
Ow, there is an ASSIGN-KEY, but it's not mentioned in the documentation of Hash… 15:36
timotimo i think liz made a module to make creating your own hashes easier? 15:37
leont Right 15:38
timotimo but yeah, ASSIGN-KEY should be in the docs
leont For now, inheriting from Hash seems to do what I want #famouslastwords #notestsyet 15:39
15:42 smallick left
tbrowder ok, i give up on ARGFILES, need a good doc example for using with a list of one or more umopenable file names. i’ll keep trying later...bye. 15:47
15:53 zacts left
tbrowder i filed a doc issue requesting a good example of $*ARGFILES use with non-existent files. 15:54
15:59 ravenousmoose[aw joined 16:00 ravenousmoose[aw left 16:03 scimon_ joined
b2gills my $*ARGFILES = IO::CatHandle.new('foo.txt','bar.txt'); .say for lines 16:05
16:05 scimon left
b2gills The point of $*ARGFILES being $*IN inside of MAIN makes sense. MAIN handles @*ARGS, and $*ARGFILES handles @*ARGS. Handling @*ARGS twice doesn't make much sense. 16:09
tbrowder i don’t argue, but i don’t often use main. so docs also need a good example of use inside MAIN. 16:11
leont The main handler could handle the arguments of MAIN and also handle $*ARGFILES, who said anything about handling it twice?
AlexDaniel pmurias: depends on how much unicode you want… Like if you want emojis and stuff, then probably you just have to make sure that it can fallback to other fonts that have more characters 16:13
leont: sorry was away for a bit 16:14
leont: here's the corresponding entry in 6.d-prep github.com/perl6/6.d-prep/blob/mas...nside-main 16:15
leont It makes sense given the current argument handling. I'm not sure it makes sense given my argument handling. 16:21
16:22 isomorphismes left
AlexDaniel c: 2018.05,2018.12 run <perl6 -e>, 「sub MAIN($foo, $bar, *@files) { dd $foo; dd $bar; dd @files; dd $*ARGFILES }」, ‘f’, ‘b’, ‘f1’, ‘f2’ 16:22
committable6 AlexDaniel, gist.github.com/f40d379e7f995e6b8d...4d82b9797e
AlexDaniel leont: ↑ I think it's an improvement
b2gills If a MAIN sub doesn't handle everything in @*ARGS it doesn't get called. Which means there would be nothing left in @*ARGS for $*ARGFILES to handle
timotimo how about "sub MAIN($arg1, $arg2, :$named1, :$named2, *@rest is main-argfiles) { }' 16:23
leont yeah, what timotimo says
b2gills Actually `sub MAIN($arg1, $arg2, :$named1, :$named2, *@*ARGS) { }` would work if the way $*ARGFILES in MAIN is dealt with is by making @*ARGS empty. 16:24
timotimo alternatively '%*MAIN-OPTIONS<slurpy-is-files> = True'
leont I don't think @*ARGS is touched 16:25
tbrowder i still don’t see an argument for $*ARGFILES current behavior outside MAIN. using unix behavior i don’t think is correct. why does the user have to manually check args for fileness when p6 could automatically provide it? at least provide an adverb or something.
b2gills m: .say for lines().grep(/^ foo/) 16:27
camelia ( no output )
tbrowder got to go...bye 16:28
b2gills The way $*ARGFILES works outside of MAIN is for one-liners, and programs that work like one-liners
16:30 jmerelo joined 16:31 zacts joined 16:34 marmor joined 16:39 zakharyas left
daxim the inconsistent output type of `cross(@input<>)` annoys the everlasting fuck out of me. it's supposed to be Seq[List[something]], except when 1 == @input.elems, then it becomes Seq[something] 16:42
m: my @input; @input = 1, (2,3), 4; cross(@input<>).map(-> $i { dd $i.^name }); @input = 1, (2,3); cross(@input<>).map(-> $i { dd $i.^name }); @input = 1; cross(@input<>).map(-> $i { dd $i.^name });
camelia "List"
AlexDaniel daxim: yes 16:47
timotimo indeed :(
AlexDaniel daxim: R#2016 16:48
synopsebot R#2016 [open]: github.com/rakudo/rakudo/issues/2016 [detrap] Inconsistent behaviour of `zip` and friends
AlexDaniel I added 6.e label in a hope that we fix it somehow for the next language release
“annoys …” description is very accurate for me too 16:49
16:52 scimon_ left, mowcat joined
tbrowder how about a pragma so $*ARGFILES is generated at same time as @*ARGS but it only has openable file names? 16:56
sounds like my Proc::More module needs another recipe! 16:57
bye again... 16:58
17:00 yqt joined
leont openable files is hard to define 17:04
17:06 RubioTerra joined, ravenousmoose joined 17:14 marmor left
jmerelo tbrowder: Hum. Could be an idea... 17:18
17:19 molaf left 17:26 melezhik joined
melezhik Hi! How do I import modules function to "main" names space without direct "use" of the module? 17:27
unit module main? 17:28
timotimo you mean re-export from another module?
17:28 ravenousmoose left 17:29 zacts left
timotimo like, module B has "foo" and "bar", main.p6 has "use A" but main.p6 also gets "foo" and "bar"? 17:29
melezhik yes
kinda "transition" export 17:30
in Perl5 I just can "package main {}"
or directly hack with glob
Geth ecosystem: 0612d3e959 | Altai-man++ (committed using GitHub Web editor) | META.list
Add ASN::Grammar

melezhik basically yes, reexport should be fine as well
timotimo github.com/perl6/roast/blob/master...Module.pm6
pmurias AlexDaniel: I want all things that are commonly encountered in Perl 6
timotimo apparently like this?
melezhik not sure if I understand the OuterModule conception ... 17:32
timotimo well
just "use B :ALL, :EXPORT" in my example
put that in the A from my example
melezhik ahh 17:33
let me try
pmurias timotimo: I though about the SDL2 in rakudo.js thing, and it seems doable but crazy
timotimo aaw 17:34
in that case, i'll just have to play around with canvas from rakudo.js
kybr yes, please. that sounds awesome
pmurias timotimo: what we would need to do is to have the NativeCall layer generate and compile a C wrapper
melezhik Error while importing from 'Sparrow6::DSL::Common': no such tag 'EXPORT' 17:35
when I try to
use Sparrow6::DSL::Common :ALL, :EXPORT;
17:35 domidumont1 left
pmurias timotimo: using a canvas directly would remove a layer of craziness ;) 17:35
melezhik should I change module itself as well? 17:36
timotimo oh, hmm
maybe without the ,
let me have a look
github.com/perl6/roast/blob/master...Module.pm6 - that's InnerModule 17:37
so it doesn't have anything special really
pmurias timotimo: I have been neglecting the user facing parts of rakudo.js while hunting down weird bugs but there only a couple of those remaining for my targeted subset so I should on that in the remotely near futre
melezhik ok it compiles now, let me see if helps with my purpose 17:38
timotimo hunting down weird bugs is very important!
17:42 ravenousmoose joined
melezhik it's compiles now, but still does not do reexport 17:45
use Sparrow6::DSL::Common :DEFAULT :EXPORT;
unit module Sparrowdo::DSL::Common; our sub task-run($desc, $plugin, %parameters = %()) is export(:DEFAULT) {} 17:46
when I
timotimo sorry about that :|
melezhik let me write down simple example 17:47
timotimo i'll be afk for a bit first
17:53 ravenousmoose left 17:59 lucasb joined
melezhik gist.github.com/melezhik/186eb92bd...23723e8545 18:00
timotimo melezhik: it seems like your perl6 -I line will also have to pass :ALL to the use statement (not sure if you can do that with -M) 18:03
18:04 reach_satori joined
leont I think you forgot a comma between your pairs 18:04
timotimo putting the comma there led to a compilation error i think? 18:05
melezhik yes
perl6 -I /tmp/ -e 'use Foo :ALL :EXPORT; say bar()' 18:09
Error while importing from 'Foo': no such tag 'ALL'