»ö« 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 epony joined 00:03 headcase left, epony left 00:05 epony joined, cognominal left 00:16 cognominal joined 00:21 vike left 00:30 skids joined 00:32 Cabanossi left 00:35 Cabanossi joined 00:37 mcmillhj joined 00:40 mcmillhj left 01:10 headcase joined 01:25 skids left 01:33 bwisti joined 01:36 zakharyas joined 01:41 virtualsue left 01:46 ilbot3 left, virtualsue joined
[Coke] twitter.com/cokefloats/status/9103...4732293120 - two proposals this round. 01:47
01:47 kyan joined 01:55 ilbot3 joined, ChanServ sets mode: +v ilbot3 02:01 noganex_ joined 02:04 noganex left 02:15 rngoodn joined 02:16 skids joined 02:17 rngoodn left 02:23 rngoodn joined
AlexDaniel m: say (<a b c>,<x y z>) Z (2,1) 02:29
camelia (((a b c) 2) ((x y z) 1))
AlexDaniel is there any easy way to get ‘c’, ‘y’ from that ^ ?
m: say zip (<a b c>,<x y z>), (2,1), :with({$^a[$^b]})' 02:31
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3 b c>,<x y z>), (2,1), :with({$^a[$^b]})7⏏5'
expecting any of:
infix
infix stopper
postfix
statement end
AlexDaniel m: say zip (<a b c>,<x y z>), (2,1), :with({$^a[$^b]})
camelia (c y)
02:34 Cabanossi left
AlexDaniel m: say (<a b c>,<x y z>) Z[&({$^a[$^b]})] (2,1) 02:35
camelia (c y)
02:35 Cabanossi joined 02:42 Ben_Goldberg joined, BenGoldberg left, Ben_Goldberg is now known as BenGoldberg 02:45 rngoodn left 02:49 benchable6 joined, rngoodn joined 02:53 myrin joined 03:00 noganex joined, troys_ is now known as troys 03:03 noganex_ left, Cabanossi left 03:05 Cabanossi joined 03:17 wamba joined 03:20 headcase left 03:22 Ven`` joined 03:25 headcase joined 03:29 headcase left 03:30 Ven`` left 03:31 rngoodn left 03:32 Cabanossi left 03:33 headcase joined 03:34 Cabanossi joined, headcase_ joined 03:37 headcase left 03:39 pilne left
Geth whateverable: c6aa350dee | (Daniel Green)++ | 2 files
Add memory used to uptime command

Also log the output of the uptime command at the end of a test run for each bot.
Addresses part of #197.
03:40
03:44 todd joined
todd HI All, I forgot where I wrote down how to pass read/write variables to subs. I can't fing it on perl6.org and google give me 1001 hits on perl 5. Can someone point me to a link? 03:45
raschipi docs.perl6.org/type/Signature#inde..._Modifiers ? 03:48
todd Perfect! Thank you! Bye bye 03:49
03:49 todd left 03:51 rngoodn joined 03:56 rngoodn left 04:00 BenGoldberg left, aborazmeh joined, aborazmeh left, aborazmeh joined 04:03 Cabanossi left 04:04 Cabanossi joined 04:05 rngoodn joined 04:09 troys is now known as troys_, headcase_ left 04:15 skids left
sacomo is there a reason for this behavior: 04:17
m: "perl6" ==> uc() ==> my $str; say $str;
camelia [PERL6]
sacomo m: "perl6" ==> uc() ==> say(); 04:18
camelia PERL6
sacomo straight to say() prints a Str, but assigning to $str creates an Array.
m: "perl6" ==> uc() ==> &{ .^name.say }(); 04:20
camelia Str
04:28 bisectable6 left 04:31 wamba left 04:32 Cabanossi left 04:34 Cabanossi joined 04:35 headcase joined
AlexDaniel goddamn Roman numerals 04:35
04:38 rngoodn left 04:39 nadim joined 04:40 myrin left 04:42 rngoodn joined 04:43 headcase left 04:48 todd joined 04:49 headcase joined, cdg joined
todd Hi All, I am looking for a reference that tells me what the rulrs are when I use something like `sub XOpenDisplay(Str $name = ':0')`. I would like a reference that explains the various different types like "Str" and "int" and so on and so forth. Not finding it on per6.org and Google POUNDS me with perl 5 hits. 04:51
raschipi docs.perl6.org/type.html ?
04:53 headcase left
todd doesn't really help. I want to know 32 bit, 64 bit integers, etc, when I am calling a system library 04:53
04:54 cdg left, myrin joined
raschipi docs.perl6.org/language/nativecall...ing_Values ? 04:54
todd Perfect! Thank you! bye bye 04:55
04:55 khw left
raschipi When you said "int" and "Str" that threw me off because those can't be used with nativecall 04:55
04:58 headcase joined, todd left 05:02 headcase left 05:03 Cabanossi left 05:04 Cabanossi joined 05:07 headcase joined 05:11 headcase left 05:13 troys_ is now known as troys 05:26 araujo left 05:27 araujo joined, araujo left, araujo joined 05:39 headcase joined 05:40 rngoodn left 05:44 headcase left 05:48 headcase joined 05:53 lowbro left, lowbro joined 05:54 lowbro left, lowbro joined 05:57 headcase left 06:02 domidumont joined 06:07 headcase joined 06:17 troys left 06:20 headcase left 06:22 ShalokShalom left
AlexDaniel ok, now I can finally sleep peacefully code-golf.io/ 06:23
TEttinger u: ̇
unicodable6 TEttinger, Found nothing!
TEttinger u: 775
unicodable6 TEttinger, Found nothing!
06:25 headcase joined
AlexDaniel u: 0x775 06:26
unicodable6 AlexDaniel, U+0775 ARABIC LETTER FARSI YEH WITH EXTENDED ARABIC-INDIC DIGIT TWO ABOVE [Lo] (ݵ)
AlexDaniel TEttinger: what were you looking for? Maybe I know
06:27 ShalokShalom joined
TEttinger nah, it was some weird char that was in a case conversion 06:28
turkish I with a dot above, when made lower-case, became ascii i with an extra dot added 06:29
the extra dot being a diacritic
06:29 headcase left
AlexDaniel u: a􏿽xCC􏿽x87 06:30
unicodable6 AlexDaniel, U+0227 LATIN SMALL LETTER A WITH DOT ABOVE [Ll] (ȧ)
AlexDaniel u: _̇
unicodable6 AlexDaniel, U+005F LOW LINE [Pc] (_)
AlexDaniel, U+0307 COMBINING DOT ABOVE [Mn] ( ̇)
AlexDaniel TEttinger: oh, I see now. Unicodable does not really understand combining characters 06:31
it combines with a space before and I guess it ends up with an empty string
TEttinger huh
AlexDaniel uhhh… IIRC it wasn't trivial to fix this issue 06:32
by the time the bot gets the string, the combined thingy is already eaten by IRC::Client, or something…
so you have to restore it somehow
at least, that's what I can remember about this issue 06:33
06:33 Cabanossi left 06:34 headcase joined, Cabanossi joined 06:37 kyan left, AlexDaniel left 06:41 cosimo left 06:42 darutoko joined 06:43 headcase left
u-ou How do I install a module from inside its git repo? 06:44
is there some standard way?
moritz zef install .
u-ou it fails on zef
wait 06:45
nvm
that's probably what I want
I can zef the last commit that works
06:47 |oLa| joined 06:48 headcase joined 06:49 firecat left 06:52 headcase left, |oLa| left, mr-foobar left 06:53 |oLa| joined
u-ou I can install NCurses with zef install NCurses --force-test but am afraid to use it as I don't know what test failed. How do I find out? 06:56
07:00 krunen_ joined 07:01 jonas1 joined, mr-foobar joined 07:02 wamba joined, Cabanossi left 07:04 Cabanossi joined 07:06 krunen_ left, Deejizzel joined, headcase joined 07:07 krunen_ joined
tyil hmm, docs for Bailador are conflicting 07:07
one page says to use `method`, other page says to use `to`
(both give me the same error, though)
Deejizzel So what's up everybody I'm new 07:08
tyil Deejizzel: perl 6 is up
trying to get controllers in bailador to not error out 07:09
and preferably have the controller methods able to get the request body
07:11 headcase left 07:13 cschwenz joined 07:14 Deejizzel left 07:16 headcase joined 07:18 myrin left 07:20 headcase left 07:25 headcase joined 07:29 headcase left 07:32 Cabanossi left, piojo joined 07:33 myrin joined 07:34 headcase joined
piojo Hi, does anyone know how to disable buffering for $*ERR and $*OUT? It's going to cause misery, since in my environment perl6 can't figure out whether it's attached to a TTY 07:34
07:35 Cabanossi joined 07:38 headcase left 07:43 headcase joined, mrdside joined
mrdside привет 07:44
07:47 headcase left 07:49 piojo_ joined 07:50 piojo left, piojo_ is now known as piojo, cosimo joined 07:57 headcase joined, cosimo left, cosimo_ joined 07:58 myrin left
piojo Alternatively, is it possible to close and reopen stdout with :!buffer? 07:59
08:01 headcase left 08:03 vike joined 08:06 headcase joined 08:09 lowbro left
piojo Wow, this actually seems to work: 08:13
$*OUT = $*OUT.open(:!buffer); $*ERR = $*ERR.open(:!buffer);
I can't believe the API exists to open an already open handle 08:14
08:15 headcase left 08:16 dakkar joined 08:19 knobo joined 08:21 myrin joined 08:23 todd joined
todd Hi All, I am looking at docs.perl6.org/routine-sub.html and can not find a sub that will tell me what OS I am in. Does such a critter exist? Do you have a link to such? 08:24
moritz m: say $*OS
camelia Dynamic variable $*OS not found
in block <unit> at <tmp> line 1
moritz m: say $*KERNEL
camelia linux (4.4.70.18.9.default)
moritz todd: ^^ something like this? 08:25
DrForr pokes his head in for a few minutes in between setting stuff up.
todd $ perl6 -e 'say $*KERNEL' linux (3.10.0.693.1.1.el.7.x.86._.64) 08:26
that will work. Is there anythig that just says "windows" or "linux"? 08:27
Any of you guys on Windows? what does `perl6 -e 'say $*KERNEL' ` give you? 08:28
08:28 aborazmeh left 08:29 pmurias joined
moritz m: say $*KERNEL.^name 08:29
camelia Kernel
pmurias m: my int $x; say $x.WHAT; # Should that be int or Int? 08:30
yoleaux 19 Sep 2017 15:19Z <jnthn> pmurias: A while back you asked if the continuation protect flag should stay or go away. Turns out, stay: github.com/rakudo/rakudo/commit/29863a0bdc
camelia (Int)
moritz no docs yet for type Kernel :(
m: say Kernel.^methods
camelia (BUILD name version release hardware arch archname bits signals signal Str gist auth signature desc)
tyil todd: use split on teh output of $*KERNEL
and take the first piece
moritz m: say $*KERNEL.name
camelia linux
tyil or what moritz just did
he's better than I am with this
todd $ perl6 -e 'say $*KERNEL.name' linux 08:31
a thing of beauty. Thank you!
pmurias we have a fudged test in roast for: my int $x; say $x.WHAT being int not sure if I should remove it?
08:32 rindolf joined
todd Anyoine running Windows? What does `perl6 -e 'say $*KERNEL.name'` give you? 08:33
08:33 ccakes left, ccakes joined, wamba left, headcase joined
tyil tfw everyone awake is sane enough to avoid windows 08:35
08:38 headcase left
moritz any <MSWin32 mingw msys cygwin> 08:38
according to roast
piojo It says win32, even in cygwin and msys. 08:41
08:42 mniip left 08:43 headcase joined, AlexDaniel joined
todd chuckle. Win32 thank you! 08:46
bye bye
08:47 headcase left 08:48 mniip joined, todd left 08:49 mr-foobar left 08:50 cdg joined, AlexDaniel left, mr-foobar joined 08:52 headcase joined 08:55 cdg left 08:56 headcase left 08:58 wamba joined 09:01 headcase joined 09:03 Aaronepower left 09:05 headcase left 09:10 headcase joined 09:14 virtualsue left 09:15 headcase left 09:16 virtualsue joined 09:22 raschipi left 09:24 headcase joined
u-ou m: $x 09:25
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$x' is not declared
at <tmp>:1
------> 3<BOL>7⏏5$x
09:28 headcase left 09:33 headcase joined, Aaronepower joined 09:36 Aaronepower left, Aaronepower joined 09:37 aborazmeh joined, aborazmeh left, aborazmeh joined, kerframil joined, headcase left 09:42 headcase joined 09:43 zakharyas left, zakharyas joined 09:47 headcase left, zakharyas left 09:48 mr-foobar left 09:49 aborazmeh left 09:52 headcase joined, mr-foobar joined 09:54 domidumont left 09:55 TEttinger left 09:57 Aaronepower left 09:58 Aaronepower joined 10:01 headcase left, mrdside left 10:03 Cabanossi left 10:05 Cabanossi joined
perlawhirl erm 10:07
there are 2 modules listed on the ecosystem called Net::ZMQ
which one does zef install if i ask, and does it pick the "right" one
github.com/arnsholt/Net-ZMQ 10:08
github.com/gabrielash/perl6-zmq
10:13 Aaronepower left 10:15 todd joined 10:16 Aaronepower joined
todd Hi All, Anyone have a link to a list of reserved words/ Stuff line @*ARGS, $*PROGRAM-NAME, $?FILE, etc.? 10:16
10:18 Aaronepower left
moritz those are variables, not reserved words 10:19
jnthn todd: docs.perl6.org/language/variables#..._variables and below. Also what moritz said :) 10:20
10:21 fluca1978 joined, knobo left
todd Awesome! Thank you! 10:22
bye bye 10:30
10:30 todd left, Ven`` joined
lizmat news.perlfoundation.org/2017/09/gra...l-6-p.html # timotimo++ 10:32
10:32 patrickz joined 10:33 Cabanossi left
fluca1978 I'm a little confused about "precedence drop": when should I use and to which purpose? 10:34
10:35 Cabanossi joined, headcase joined 10:37 Aaronepower joined
fluca1978 for instance, what is the real difference between 10:39
$f.foo( ['a', 'b', 'c'] );
and
$f.foo: ['a', 'b', 'c'] ;
10:39 headcase left 10:40 mr-foobar left
jnthn Nothing in that case. It means the rest of the statement will be taken as the argument list. 10:40
my ($x, $y) = $f.foo(1), $f.bar(2); # puts the results into $x and $y 10:41
10:41 mr-foobar joined
jnthn my ($x, $y) = $f.foo: 1, $f.bar: 2; # actually means $f.foo(1, $.bar(2)) 10:41
oops, $f.bar
Which in that case wouldn't be what you wanted :)
piojo jnthn: so it's just another way to pass arguments? 10:42
jnthn Yes
Sometimes it's clearer and saves parentheses clutter
I especially like it in things like
$lock.protect: {
...code here...
}
Then you don't need the ); on the end
Since } is a statement terminator 10:43
fluca1978 thanks jnthn, but can I use it only on methods or also sub?
sacomo hi everyone
10:43 knobo joined
piojo Ahh. Well, it reminds me of the Haskell $ operator: its precedence is so weak that its purpose is essentially to split the line, like putting parentheses around the whole RHS 10:43
jnthn fluca1978: It's only for methods; the equivalent for sub calls is to just not use parens at all 10:44
some-sub 1, 2, another-sub 3, 4; # same as some-sub(1, 2, another-sub(3, 4))
piojo jnthn: thanks, that inconsistency had been tripping me up.
fluca1978 thanks jnthn 10:45
tbrowder .tell ugexe will zef install a man page? if so, how should a module author provide the sources? 10:47
yoleaux tbrowder: I'll pass your message to ugexe.
10:51 piojo_ joined 10:54 piojo left 10:57 fluca1978 left, margeas joined 10:58 Ven`` left, headcase joined 11:03 headcase left
pmurias bartolin: is anything blocking the JVM backend or just a lack of tuits? 11:04
11:09 eliasr joined 11:10 lowbro joined, lowbro left, lowbro joined 11:11 virtualsue_ joined, virtualsue left, virtualsue_ is now known as virtualsue 11:13 headcase joined 11:17 headcase left, rindolf left 11:22 headcase joined 11:26 headcase left 11:29 ShalokShalom left, myrin left 11:31 headcase joined 11:33 Cabanossi left 11:34 Cabanossi joined 11:35 setty1 joined 11:36 headcase left, ShalokShalom joined 11:40 headcase joined 11:45 headcase left 11:48 mr-foobar left 11:50 headcase joined 11:51 mr-foobar joined 11:52 ShalokShalom_ joined 11:54 headcase left 11:55 ShalokShalom left 11:59 headcase joined 12:00 drbojingle joined
timotimo y'all forgot about $*DISTRO.is-win last night :) 12:02
moritz or maybe we never knew about it in the first place :-)
12:03 nattefrost joined, headcase left 12:05 Aaronepower left
sacomo hello 12:06
timotimo o/
sacomo is this the ==> feed operator is intended behavior? 12:07
m: "perl6" ==> uc() ==> say();
camelia PERL6
sacomo m: "perl6" ==> uc() ==> my $str; say $str; 12:08
camelia [PERL6]
sacomo see how it created the Array?
m: "perl6" ==> uc() ==> &{ .^name.say }();
camelia Str
12:08 headcase joined 12:09 piojo joined
sacomo it seems to happen any time a single value is fed into a $ container 12:12
pmurias jnthn: Iterable is assumed to be hard baked into perl 6 semantics? nqp::p6decontrv works differently depending on it's definition 12:14
12:16 ShalokShalom_ is now known as ShalokShalom
timotimo sacomo: i believe that's intended. you get the PERL6 "without the array" when feeding it into say() because it passes the items as individual parameters 12:17
m: ("perl6", "foobar") ==> say()
camelia (perl6 foobar)
timotimo oh, or not i guess
12:17 patrickz left
timotimo tbh i haven't used the feed operators in a loooong while 12:18
jnthn It just calls .push on the target 12:19
That will vivify an Array inside of the Scalar container
So yeah, no surprise there.
sacomo ok
m: %{:name('Perl6')} ==> my %h; say %h;
camelia {name => Perl6}
sacomo m: 6 ==> my $i; say $i; 12:20
camelia [6]
jnthn pmurias: What does "depending on its definition" mean?
12:20 astj left, astj joined
jnthn pmurias: But yeah, iirc that op checks if there's an Iterable and re-wraps the return value if so 12:21
12:21 headcase left
pmurias jnthn: that means Iterable is part of the language semantics? 12:22
sacomo it *feels* like it should just create a single value scalar in that situation. just wondering if there is some reason why making a new Array is more useful here
12:23 headcase joined
jnthn pmurias: Sure 12:23
sacomo: The point of ==> is producer/consumer list processing 12:24
sacomo: At some point in the future it'll likely schedule each phase on a separate thread
12:25 astj left
sacomo ok, then that would make sense. So feed shouldn't be seen as an alternative to method chaining (.&) when not expecting a list/hash? 12:25
geekosaur if you intend a single value, building a pipeline for it makes little sense (and a fair amount of overhead, likely). it makes sense in the context of a stream of values
pmurias btw. that op grabs Iterable for the first time from it's callers lexical scope so crazy things will happen if it ends up being called for the first time from a custom setting :)
12:27 headcase left 12:29 headcase joined 12:32 astj joined 12:36 astj left, llfourn left, headcase left 12:37 headcase joined, piojo left, piojo joined 12:38 AlexDaniel joined 12:43 headcase left 12:44 AlexDaniel left 12:48 Cabanossi left 12:49 Cabanossi joined 12:54 AlexDaniel joined 12:58 atta joined 13:07 bisectable6 joined, ChanServ sets mode: +v bisectable6 13:08 darutoko- joined, darutoko- left, wamba left 13:11 darutoko left 13:15 kerframil left 13:18 rindolf joined, wamba joined 13:25 mcmillhj joined 13:35 rindolf left 13:36 astj joined 13:40 astj left 13:43 headcase joined 13:45 ufobat joined 13:46 bwisti left 13:47 headcase left, ruoso___ joined 13:51 headcase joined, headcase left, headcase joined 13:54 lowbro left, drbojingle left 13:57 wamba left 14:02 skids joined 14:05 wamba joined 14:07 headcase left 14:08 headcase joined 14:12 headcase left 14:15 jonas1 left 14:18 headcase joined 14:27 ponbiki left 14:32 rindolf joined 14:35 ponbiki joined 14:47 rindolf left 14:55 AlexDaniel left 14:56 Aaronepower joined 14:59 astj joined 15:02 rindolf joined 15:05 xinming__ joined 15:06 domidumont joined 15:08 xinming_ left 15:09 kerframil joined 15:11 troys joined 15:19 rindolf left 15:22 knobo left 15:29 rindolf joined 15:32 Cabanossi left 15:35 Cabanossi joined 15:36 ShalokShalom left
grondilu m: class Foo { constant Foo foo .= new }; 15:38
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing initializer on constant declaration
at <tmp>:1
------> 3class Foo { constant Foo7⏏5 foo .= new };
grondilu m: class Foo { constant foo = Foo.new };
camelia 5===SORRY!5=== Error while compiling <tmp>
An exception occurred while evaluating a constant
at <tmp>:1
Exception details:
No such method 'new' for invocant of type 'Foo'
in block at <tmp> line 1
15:38 ShalokShalom joined, dogbert2 left
grondilu I suppose it's because the constant evaluation occurs before class composition? 15:38
kind of annoying. I have a compunit class and I want it to export particular instances as constants. Can't I do that? 15:44
piojo m: class Foo {...}; class Foo { constant foo = Foo.new; } 15:45
camelia 5===SORRY!5=== Error while compiling <tmp>
An exception occurred while evaluating a constant
at <tmp>:1
Exception details:
No such method 'new' for invocant of type 'Foo'
in block at <tmp> line 1
piojo too bad.
grondilu Basically a Vector class exporting e0, e1, etc as the orthonormal basis 15:46
timotimo m: class Test; constant foo = $?CLASS.new 15:47
camelia 5===SORRY!5=== Error while compiling <tmp>
Semicolon form of 'class' without 'unit' is illegal. You probably want to use 'unit class'
at <tmp>:1
------> 3class Test;7⏏5 constant foo = $?CLASS.new
timotimo m: unit class Test; constant foo = $?CLASS.new
camelia 5===SORRY!5=== Error while compiling <tmp>
An exception occurred while evaluating a constant
at <tmp>:1
Exception details:
No such method 'new' for invocant of type 'Test'
in block at <tmp> line 1
15:47 cdg joined
piojo ‎grondilu‎: it works if you explicitly define method new 15:47
grondilu I did
timotimo i'd suggest working with an EXPORT sub
grondilu oh wait
piojo m: class Foo { method new() { }; constant foo = Foo.new; }
camelia ( no output )
grondilu I didn't. My bad.
though I don't want to mess up the inheritage tree of new 15:48
*inheritance 15:49
piojo ‎grondilu‎: how about a helper method, then?
grondilu ?
piojo method Create { new(); }
not sure if that works, though
15:49 wamba left
piojo m: class Foo { method Create() { $?CLASS.new(); }; constant foo = Foo.Create; } 15:50
camelia 5===SORRY!5=== Error while compiling <tmp>
An exception occurred while evaluating a constant
at <tmp>:1
Exception details:
No such method 'new' for invocant of type 'Foo'
in method Create at <tmp> line 1
in block at <tmp> line …
15:50 mr-foobar left
grondilu btw don't use uppercase in methods 15:51
(or rather firstcase, maybe) 15:52
15:53 mr-foobar joined
grondilu forgot how one call the style where the first letter is uppercase 15:53
piojo is that the convention? I'l try to keep that in mind.
grondilu first letter in uppercase is for class names, IIRC
15:53 rgrau joined
piojo perl6 certainly has more conventions available--it doesn't need case as much as other languages 15:53
because of being able to use dashes in names 15:54
I thought that was blasphemy when I first saw it, but it's pretty cool.
15:54 cdg_ joined
grondilu yeah it's cool. I wish I could also use single quotes, though. As in Scala IIRC 15:54
timotimo "initial case"? 15:55
grondilu (or Haskell, can't quite remember)
m: say "foo".tc
camelia Foo
piojo Haskell has single quotes
timotimo wait, you're allowed single quotes though?
m: my $foo'bar = 99;
camelia ( no output )
grondilu forgot what tc stands for in .tc
piojo m: my $day's-earinings = 0;
camelia ( no output )
timotimo Title Case
grondilu oh yeah
piojo but haskell allows quote at the end, like x' for "x prime"
grondilu m: say my $foo'bar = pi
timotimo m: class Oh { method yo'yo { say "whoa, 90s!" } }; Oh.yo'yo
camelia 3.14159265358979
whoa, 90s!
timotimo oh, yes, indeed
grondilu oh boy I can use single quotes. TIL 15:56
piojo but with the same rule as dashes
grondilu m: say my $foo' = pi # even at the end of the name?
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3say my $foo7⏏5' = pi # even at the end of the name?
expecting any of:
constraint
infix
infix stopper
postfix…
15:57 wamba joined
grondilu ah, not at the end 15:57
perlpilot I wonder what the implications would be to allow for ' at the end of identifiers?
grondilu pretty sure it's possible in either Scala or Haskell
15:58 AlexDaniel joined, cdg left
grondilu has been reading about both languages lately so he tends to mix things up :P 15:58
piojo I think Haskell kind of needs it, in a way that perl6 doesn't
after all, in haskell you can't have: x=5; x *= 2; 15:59
so it's awfully useful to be able to refer to x' and x''
otherwise people would have to call the new variables x2 and x3, and we can't have that. :) 16:00
grondilu m: sub postfix:<'>(Int $n) { $n + 1 }; say 12'
camelia 13
grondilu well at least we can do that^
piojo nice!
I'm still pretty enamoured with being able to define postfix operators for units, like 12kg 16:01
grondilu that will be useful for my Polynomial module, when I write the derivatives
piojo it doesn't work very well in the REPL, though
grondilu piojo: I think someone wrote a Physics::Units module recently
piojo grondilu: really? That would be awesome! I'll search for that, thanks
16:02 Cabanossi left
grondilu can't find it in the module repo, though :( 16:02
there was a blog entry : p6steve.wordpress.com/2017/08/18/p...-in-perl6/ 16:03
timotimo you know the slang that lets you end method names in ? and ! 16:04
probably possible to have that also let you put a ' at the end of things
16:04 troys is now known as troys_ 16:05 Cabanossi joined
grondilu I thought about writing postfix methods for units once, but the SI prefix system made it more difficult than I thought 16:07
basically I had no idea how to implement a "prefix to a suffix" 16:08
so I gave up
that's the kind of thing that would require a slang, I think
16:09 cschwenz left
grondilu physics is more interesting without dimensions, anyway ;) 16:10
16:10 andrzejku left
grondilu back to my initial question : is it not possible to have a compunit class export particular instances as constants? 16:13
perlpilot wonders how Physics::Unit handles dimensionless quantities
16:13 astj left 16:14 wamba left
perlpilot grondilu: I would think it possible. 16:14
grondilu I've tried and failed
16:14 astj joined
perlpilot m: class Foo { }; constant f is export = Foo.new; # something like that 16:16
camelia ( no output )
timotimo perlpilot: that's not a unit class :) 16:17
grondilu: have you tried an EXPORT sub?
grondilu oh yeah I guess that would work 16:18
16:19 astj left
grondilu I just need to cache it 16:19
perlpilot oh, I didn't read compunit as "unit class Foo;" but just as "compilation unit"
grondilu isn't it what compunit means? 16:20
ilmari unit class Foo; just means that 'class Foo' applies to the entire compilation unit 16:21
perlpilot every module and EVAL is a compilation unit, but not every one is a "unit class" thingy :)
ilmari m: class Foo {}; unit class Bar; 16:22
camelia 5===SORRY!5=== Error while compiling <tmp>
Too late for unit-scoped class definition;
Please use the block form.
at <tmp>:1
------> 3class Foo {}; unit class Bar;7⏏5<EOL>
ilmari thus ^^
16:23 troys_ is now known as troys
timotimo well, it makes the class become the compilation unit 16:23
rather than having a package with the class in it or something
grondilu ok
16:24 astj joined
perlpilot so ... anyway, what I said works, so use that :) 16:24
16:25 headcase left 16:27 dakkar left 16:28 Ven`` joined 16:31 mcmillhj left 16:32 headcase joined, headcase left, thundergnat joined, headcase joined, rngoodn joined
rngoodn What is the most used file extension? .pl6 ot .p6 or... ? 16:33
thundergnat m: say my $xʼ = 'x prime'; # grondilu 16:34
camelia x prime
16:34 Cabanossi left 16:35 Cabanossi joined, thundergnat left 16:37 headcase left
piojo thundergnat: clever. I wouldn't, but clever. 16:37
timotimo i usually write .p6 scripts and .pm6 modules
16:37 xinming__ left 16:38 xinming__ joined, xinming__ left 16:39 xinming_ joined, mcmillhj joined 16:40 xinming_ is now known as xinming 16:46 leont joined 16:47 rngoodn left 16:49 mr-foobar left 16:52 mr-foobar joined
jdv79 gist.github.com/anonymous/f1c7e97d...0d7840464a 16:57
bug right? ^^
timotimo why? 17:00
oh, because that one listens
maybe the code needs to switch socket and peer around when it's a listening socket, but it didn't seem like it'd need that to me when i wrote it
huh, the peer port is also not 8888 17:01
jdv79 shouldn't the socket port be 8888 there? 17:02
17:03 piojo left
timotimo [pid 22615] getpeername(32, {sa_family=AF_INET, sin_port=htons(8888), sin_addr=inet_addr("127.0.0.1")}, [128->16]) = 0 17:03
[pid 22615] getsockname(32, {sa_family=AF_INET, sin_port=htons(47298), sin_addr=inet_addr("127.0.0.1")}, [16]) = 0
so something's clearly off here.
i can't see an obvious mistake 17:05
17:07 epony left 17:10 itaipu joined, wamba joined 17:11 leont left
jdv79 both ports are wrong 17:14
amazingly those look untested 17:17
17:18 entonian joined
jdv79 i'll but it 17:21
*bug
17:23 entonian left, nadim left 17:30 rgrau left, cdg_ left
jdv79 now i can't even see my new ticket as spam 17:31
rt is unfun
17:37 headcase joined 17:40 cdg joined
timotimo did the way uv_tcp_get*name work change? 17:40
17:41 cdg left 17:43 headcase left
jdv79 ah, its RT#132135 17:47
synopsebot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=132135
timotimo jdv79: rakudo is just passing on what moarvm got from the get*name call, somehow it ends up bogus 17:50
17:50 samcv left
timotimo c: 2017.07,2017.08,2017.09 start react whenever IO::Socket::Async.listen(<0.0.0.0>,8888) {say $_.socket-port; say $_.peer-port}; sleep 1;IO::Socket::Async.connect(<0.0.0.0>,8888);sleep 1 17:50
committable6 timotimo, ¦2017.07: «» ¦2017.08: «47138␤55523» ¦2017.09: «47138␤55779» 17:51
17:51 samcv joined
timotimo c: head start react whenever IO::Socket::Async.listen(<0.0.0.0>,8888) {say $_.socket-port; say $_.peer-port}; sleep 1;given IO::Socket::Async.connect(<0.0.0.0>,8888).result { .host-port.say; .peer-port.say } ;sleep 1 17:52
committable6 timotimo, ¦head: «Cannot find this revision (did you mean “Bend”?)»
timotimo c: HEAD start react whenever IO::Socket::Async.listen(<0.0.0.0>,8888) {say $_.socket-port; say $_.peer-port}; sleep 1;given IO::Socket::Async.connect(<0.0.0.0>,8888).result { .host-port.say; .peer-port.say } ;sleep 1
committable6 timotimo, ¦HEAD(78a4824): «47138␤No such method 'host-port' for invocant of type 'IO::Socket::Async'␤ in block <unit> at /tmp/TfkaLjGIMl line 1␤␤996 «exit code = 1»»
timotimo c: HEAD start react whenever IO::Socket::Async.listen(<0.0.0.0>,8888) {say $_.socket-port; say $_.peer-port}; sleep 1;given IO::Socket::Async.connect(<0.0.0.0>,8888).result { .socket-port.say; .peer-port.say } ;sleep 1
committable6 timotimo, ¦HEAD(78a4824): «47138␤3300␤3300␤47138»
17:52 andrzejku joined
timotimo maybe it actually returned an error 17:53
no, it returns 0, as if it had succeeded
grondilu m: class A does Numeric { multi method Numeric { NaN } }; multi infix:<+>(A $, A $) { 1 }; say [+] A.new 17:55
camelia NaN
grondilu m: class A does Numeric { multi method Numeric { NaN } }; multi infix:<+>(A $, A $) { 1 }; say [+] A.new, A.new
camelia 1
grondilu what must I do to overload the behavior of [+] with one element? 17:56
timotimo oh ffs, the mvmroot macro is making it impossible to step into the interesting code
grondilu m: class A does Numeric { multi method Numeric { NaN } }; multi infix:<+>(A $, A $x?) { 1 }; say [+] A.new, A.new 17:57
camelia 1
grondilu m: class A does Numeric { multi method Numeric { NaN } }; multi infix:<+>(A $, A $x?) { 1 }; say [+] A.new
camelia NaN
17:57 leont joined
grondilu m: class A does Numeric { multi method Numeric { NaN } }; multi infix:<+>(A $) { 1 }; say [+] A.new 17:57
camelia 1
grondilu ^I guess this will do
AlexDaniel code-golf.io/ # π and 𝑒 tasks are waiting for their heroes 18:00
jdv79 my c-fu is weak but it looks "ok" 18:05
timotimo jdv79: yeah but all the values are garbage?!? :( :( 18:06
github.com/bnoordhuis/libuv-chat/b...sockname.c - here's libuv example code using getsockname
jdv79 they are; oddly
18:12 headcase joined 18:13 headcase left 18:14 headcase joined 18:16 headcase left, headcase joined 18:19 cdg joined 18:33 Cabanossi left 18:34 Cabanossi joined 18:36 kybr left 18:37 geekosaur left 18:40 cdg left 18:45 TEttinger joined 18:46 geekosaur joined 18:57 troys is now known as troys_ 19:03 |oLa|1 joined 19:04 |oLa| left
grondilu AlexDaniel: maybe we used different tricks for Pascal's triangle 19:08
AlexDaniel grondilu: then 32 is possible 19:13
19:13 vendethiel- joined 19:14 Ven`` left
AlexDaniel grondilu: nevermind I think I just did 31 19:16
19:16 andrzejku left
AlexDaniel the website is broken but it is 31 19:17
19:20 mr-foobar left 19:21 domidumont left 19:22 mr-foobar joined
moritz for my current book project I wrote a small too that splits a PDF file into separate files per chapter: gist.github.com/moritz/8cd941011b5...23fe279e84 19:23
s/too/tool/
it uses bookmarks (what you see as side bars in most PDF readers) to determine the chapter boundaries 19:24
of course, pdftk does the heavy listing, but I still found it useful :-)
Zoffix m: say +combinations(8,$_) for 0..8
camelia 1
8
28
56
70
56
28
8
1
Zoffix m: for 0..20 -> $row { say +combinations(8,$row) for 0..$row; say "|" } 19:25
camelia 1
|
8
8
|
28
28
28
|
56
56
56
56
|
70
70
70
70
70
|
56
56
56
56
56
56
|
28
28
28
28
28
28
28
|
8
8
8
8
8
8
8
8
|
1
1
1
1
1
1
1
1
1
|
0
0
0
0…
Zoffix boo 19:26
oh
m: for 0..20 -> $row { say +combinations($row,$_) for 0..$row; say "|" }
camelia 1
|
1
1
|
1
2
1
|
1
3
3
1
|
1
4
6
4
1
|
1
5
10
10
5
1
|
1
6
15
20
15
6
1
|
1
7
21
35
35
21
7
1
|
1
8
28
56
70
56
28
8
1
|
1
9
36
84
126
moritz better :-)
19:29 mcmillhj left
AlexDaniel Zoffix: oh wow 19:29
Zoffix :)
AlexDaniel Zoffix: if only “combinations” was a shorter word, right?
Zoffix Yeah heh 19:30
AlexDaniel Zoffix: but that's awesome, I didn't think about it
Zoffix++
19:31 mcmillhj joined
grondilu maybe we could cheat and put a shorter alias in the core just for code golf contests :P 19:32
Zoffix >:D
AlexDaniel even if it was called “c”, I still find it a bit hard to get it under 40 characters 19:34
buuut maybe, maybe…
19:35 rindolf left
grondilu I'm a bit confused about what Numeric does exactly. If I write an hyper-complex class, should it implement Numeric? It does algebra, but it's not a scalar. 19:36
19:36 vendethiel- left
grondilu Also I'm not sure I see the advantage of implementing Numeric. 19:36
Like I was hoping defining &[*] would automatically give me &[**], but apparently not :/ 19:37
Zoffix 0.o
grondilu &[**] falls back to $^a.Numeric**$^b.Numeric IIRC
which seems dumb to me 19:38
Zoffix Why dumb?
grondilu shouldn't &[**] be [*] $^a xx $^n
Zoffix If you wanted 1000 or more times slower, sure :) 19:39
Power op just uses C's pow. What you wrote generates a Rakudo lazy Seq then consumes it, while calling the multiplication op $^n-1 times
moritz also, what if $^n isn't integer? 19:40
grondilu it was just an example
my point was that instead of falling back to .Numeric, it should use the multiplication
moritz: good point
though I can restrict that case in the signature 19:41
Zoffix But multiplication then would have to fall back to Numeric, so you made power op thousands of times slower for no good reason. 19:42
grondilu I guess there's something I don't understand about what Numeric is
Zoffix It might make more sense for whatever custom thing you're building, but not for core ops and types that are meant to work together..
grondilu I guess I'm just better off not implementing it 19:43
Zoffix grondilu: Numeric role is done by all numeric types and ops and things can typematch on it. And Numeric coercer method just asks for one of those numeric types
m: .Numeric.^name.say for '42', '1.0', '1e0', '1+1i'
camelia Int
Rat
Num
Complex
19:44
grondilu Should Quaternions for instance implement Numeric?
They do in github.com/Util/Perl6-Math-Quatern...ernion.pm6 19:45
Zoffix No idea :) If their .Numeric can return one of the core types, then sure, as you get all the ops working fine for free, if the .Numeric returns just itself, then I'd expect a lot of infiniloops in dispatch that you were experiencing before
So it's more of a "CoreNumeric" I guess rather than Numeric. At least that's my understanding of it, while working with core stuff. Dunno how designers thought of it
19:47 Cabanossi left
grondilu Interestingly enough, Complex does Numeric but has no .Numeric 19:47
m: say 1i.Numeric
camelia 0+1i
grondilu hum
Zoffix s: 1i, 'Numeric', \()
SourceBaby Zoffix, Sauce is at github.com/rakudo/rakudo/blob/78a4...eric.pm#L5
Zoffix Just uses the one from the role that returns `self` 19:48
grondilu I see
so if there were no definition of &[**] in Complex, it would loop forever 19:49
19:49 Cabanossi joined
Zoffix m: &[**].candidates».say 19:50
camelia sub infix:<**> ($x = 1) { #`(Sub|64870056) ... }
sub infix:<**> (\a, \b) { #`(Sub|64871576) ... }
sub infix:<**> (Real \a, Real \b) { #`(Sub|64871424) ... }
sub infix:<**> (Int:D \a, Int:D \b) { #`(Sub|64870512) ... }
sub infix:<**> (int $a, int …
Zoffix m: &[**].candidates».signature.say
camelia (($x = 1) (\a, \b) (Real \a, Real \b) (Int:D \a, Int:D \b) (int $a, int $b --> int) (Num:D \a, Num:D \b) (num $a, num $b --> num) (Rational \a, Int \b) (Complex:D \a, Complex:D \b --> Complex:D) (Real \a, Complex:D \b --> Complex:D) (Complex:D \a, Real \…
Zoffix s: &[**], \(class {}.new, class {}.new)
SourceBaby Zoffix, Sauce is at github.com/rakudo/rakudo/blob/78a4...ic.pm#L261
Zoffix yeah, looks like it
Zoffix &
19:50 mr-foobar left
grondilu there's something fishy about all this, can't quite put my finger on it 19:51
I just don't like the idea that I *have to* define &[**]($, Int $) when I already defined &[*]. It's clearly redundant. 19:53
Just like I shouldn't have to define $a - $b. It should automatically turn into $a + (-1)*$b 19:54
basically we should have an Algebra role. But I guess it could be a module.
(a user module I mean) 19:55
19:56 epony joined 19:58 AlexDaniel left
grondilu though ideally even Numeric should implement that role, so it would make sense to put it in the core. 19:58
19:58 rindolf joined
grondilu but then there would be the issue with the lexical scopes mentioned yesterday (IIRC), so that's not possible either. 19:59
there is just something wrong and un-satisfying imho
perlpilot yeah, we should only have to define a small number of primitives and Perl should deduce the rest! 20:00
grondilu not sure that's irony or what
20:01 mr-foobar joined
perlpilot it's perhaps 1/2 sarcasm. While I tend to agree with you in theory, I accept that reality is always more complicated. 20:01
If someone could come up with a scheme that works and is performant, I'm all for it :) 20:03
moritz grondilu, perlpilot: gist.github.com/masak/8e082999e06b...2899bbcde5
20:04 mcmillhj left
perlpilot moritz: is there a tldr on that? :) 20:05
moritz perlpilot: not really; it's just taken the "small number of primitives" to the extreme :-)
grondilu moritz, I think I know what lambda calculus is, and I really think what I'm asking is not that deep.
20:06 lichtkind joined 20:09 mcmillhj joined, cdg joined 20:13 headcase left, Aaronepower left
grondilu something like that: gist.github.com/grondilu/996c4d4b8...fdc095e488 20:15
so a class implementing Algebra would only have to define the ADD and MULTIPLY methods 20:17
the operators would come for free
20:18 cdg_ joined
BooK m: say !'' 20:19
camelia True
BooK m: say !!''
camelia False
20:19 headcase joined
BooK m: say ! !'' 20:19
camelia False
BooK m: say ! ! ''
camelia False
BooK m: say !! ''
camelia Non ast passed to WANTED: NQPMu
5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3say !!7⏏5 ''
expecting any of:
infix
infix stopper
postfix
statement end
20:19 ufobat left
BooK I guess because ?? !! 20:20
but confusing still
20:21 cdg left 20:22 Aaronepower joined
Juerd m: say !! 20:23
camelia 5===SORRY!5=== Error while compiling <tmp>
Prefix ! requires an argument, but no valid term found
at <tmp>:1
------> 3say !!7⏏5<EOL>
expecting any of:
prefix
20:23 headcase left
Juerd m: !! 20:23
camelia 5===SORRY!5=== Error while compiling <tmp>
Prefix ! requires an argument, but no valid term found
at <tmp>:1
------> 3!!7⏏5<EOL>
expecting any of:
prefix
Juerd In the REPL, !! by itself results in Nil
BooK the error message didn't help: I remembered about the ternary when grepping the source for !! showed it to me
Aaronepower What's the best way to get a list of files of a certain extension in a directory? I tried using IO::Glob, but it doesn't seem to work. 20:24
20:25 headcase joined
Juerd m: !! while 1 20:25
camelia ===SORRY!===
Cannot find method 'okifnil' on object of type NQPMu
Juerd What the... :D
perlpilot neat. 20:26
crazy. but neat.
moritz Aaronepower: dir($path).grep(/\.md$/)
BooK ! is a naughty character anyway 20:27
moritz m: ! while 1 20:28
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
while used at line 1
BooK 0.o 20:29
geekosaur there aren't that many actual keywords in perl 6
moritz Juerd's example seems to be a bug in EXPR 20:30
BooK if would kinda neat if the only one was 'goto'
moritz nah, 'comefrom' :-)
Aaronepower moritz: How do I do recursive? 20:31
moritz Aaronepower: File::Find or Path::Iterator, I think 20:33
BooK moritz: is perl6 powerful enough to have a comefrom? 20:38
20:39 kerframil left
moritz BooK: I have not the slightest idea :-) 20:40
Zoffix BooK: any error mentioning AST is a bug as it's just guts leaking out. It should be filed as a ticket 20:43
20:57 mr-foobar left 21:00 mr-foobar joined 21:02 Cabanossi left 21:03 headcase left 21:04 Cabanossi joined 21:06 itaipu left, wamba left 21:07 skids left 21:09 lichtkind left
BooK Zoffix: i will 21:11
21:13 itaipu joined 21:15 piojo_ left
Zoffix Thanks. 21:16
21:20 nattefrost left 21:22 khw joined 21:23 mcmillhj left 21:24 piojo joined 21:29 thundergnat joined
thundergnat Is there any way to expose the transform used by the collate method to the user? 21:31
so it could, for instance, be used as a single arity transform modifier to sort? 21:32
thundergnat probably something I should be asking samcv...
samcv hello 21:33
thundergnat ooo!
samcv transform?
do you understand how the UCA works?
thundergnat umm. Take a look at this gist gist.github.com/thundergnat/3d71a3...d7e2fa94e6
samcv not sure what you're trying to do? 21:34
thundergnat unicmp must use some kind of comparison to figure out the order, I was wondering if it could be coerced into a transform of some kind 21:35
21:35 pecastro left
samcv well 21:35
it's complex
thundergnat I maintain the Sort::Naturally module. I'm trying to make it work with collation
samcv thundergnat, read cry.nu/perl6/grant-status-update-2/ 21:36
where i talk a bit about how the uca works
also read the docs on MVM collation github.com/MoarVM/MoarVM/blob/mast...n.asciidoc
21:36 kyan joined
samcv for detail on how it's actually implemented 21:37
timotimo does collation only work if there's two input strings and is only able to give a less/same/more output?
thundergnat Could we get a routine that returns that array and a three character string. [.0706.0020.0002].chars or some such
s/and/as/ 21:38
for each character in the string
21:39 epony left
samcv you want to return the array data? 21:39
for each character?
i mean. i'm not sure why .collate isn't sufficient?
what are you trying to achieve?
that .collate does not do
timotimo "natural sort" is a big thing 21:40
samcv define that
thundergnat Well, what I want is a transform function, but the array data would allow that
timotimo i.e. sorting 20 after 3 even though 2 comes before 3
samcv so you want numeric sort?
thundergnat m:gist.github.com/thundergnat/3d71a3...d7e2fa94e6
evalable6 thundergnat, It looks like a URL, but mime type is ‘text/html; charset=utf-8’ while I was expecting something with ‘text/plain’ or ‘perl’ in it. I can only understand raw links, sorry.
samcv is that all we're talking about?
thundergnat m: gist.github.com/thundergnat/3d71a3...d7e2fa94e6
camelia (144th 17th 2 32nd 3rd 95 æon Æon aether apple außen Autumn Bald ball Évian evoke)
(2 3rd 17th 32nd 95 144th aether apple außen Autumn Bald ball evoke Æon æon Évian)
(2 3rd 17th 32nd 95 144th æon Æon aether apple außen Autumn Bald ball Év…
samcv just .collate but sorting numbers differently?
thundergnat The first list is collated, the second is naturally sorted and collated ^^ 21:41
21:41 kyan_ joined
samcv well i could just add that feature 21:41
that seems like a much easier way to do things
though it sounds slightly annoying but. i mean implementing the UCA in perl6 again would be a pain 21:42
it took me months to write it. so the raw data is really i mean. idk how useful it is
21:42 kyan left
thundergnat I was just asking if the is a user exposed way to access the collation data so it can be used in a transform routine 21:42
samcv also. what about data of multiple codepoints in a row? 21:43
how would that be accessed?
kyan_ Hi! When I try to install zef, (using the instrtuctions in the README), it gives me an error "Aborting due to test failure: zef:ver<0.1.29>:auth<github:ugexe>"
samcv but i'd ask you to read github.com/MoarVM/MoarVM/blob/mast...n.asciidoc
timotimo kyan_: can you start out by telling us what "perl6 --version" gives you?
kyan_ This is Rakudo version 2017.05 built on MoarVM version 2017.05
timotimo okay, perhaps you'll need an older zef for that 21:44
samcv thundergnat, we don't actually traverse the entire strings either. i have lots of optimizations. and it'd be much better just to add natural sort capabilities to moarvm
kyan_ Ah, thanks. I'll try one from around then.
timotimo good luck!
21:45 troys_ is now known as troys
timotimo though depending on what other modules you'll be installing and using, perhaps there'll be more modules you'll need older versions of 21:45
21:45 headcase joined
thundergnat samcv ok. I'll read that in depth, I don't know enough to know if what I'm asking is unreasonable. The ncollate routine in the aformentioned gist works, it's just ugly 21:45
timotimo not terribly likely, but possible
21:45 itaipu left 21:46 itaipu joined
samcv thundergnat, yes i'd say read that document. and also i can maybe add natural sort. but then i'd have to add the ability to backtrack which would be annoying. or make it much slower since i'd have to detect all numbers and hm 21:46
kyan_ yay, it worked ! Thanks :)
21:47 headcase_ joined
timotimo cool 21:47
samcv we iterate both strings into a ringbuffer of size 3. when we find a differeing codepoint. we then use that data, possibly further down the string as well to sort with. but if we had to check if the last thing was a number. then we may care about ones behind that as well. and what if there's numbers going back even further. we would have to backtrack and find it again. sounds annoying 21:48
but i could figure out a way to do it if it seems important enough
kyan_ Hm, doesn't want to install readline though, since /usr/lib64/libreadline.so isn't a ELF file (the real libreadline.so is /lib64/libreadline.so.6.3)
timotimo ah, yes, it's probably a little linker script, isn't it? 21:49
kyan_ Cannot locate native library 'libreadline.so': /usr/lib64/libreadline.so: invalid ELF header — yeah
timotimo you can git clone the readline module and enter the exact version in the "is native" traits it uses; it probably has one variable up top where that can be set
thundergnat samcv don't add stuff to core unnecessarily, Sort::Naturally lives quit happily in a module. This was more a "I wonder if" question than a "I gotta have"
samcv well 21:50
thundergnat *quite
timotimo my constant LIB = ( 'readline' );
samcv doesn't seem that unneccisary. seems to be a common use case to sort numbers properly
timotimo it could be enough to change that to ( 'readline', v6.3 )
21:50 headcase left
timotimo who here is good with the nativecall library finding code? 21:50
21:51 mr-foobar left, epony joined
samcv i mean it'd be slower. and we could have a ringbuffer which expands. and it expands to the size of how many digits it has encountered. then also, what's the max length that is ok 21:52
thundergnat It isn't for a general case though, only when you're sorting lists with a mix of strings and 'numeric' strings together. Not worth slowing down or bulking up the general case.
samcv of digits length. and do we accept unicode digits too, or just numbers
no i would never do that thundergnat :)
slow down the general case
kyan_ Ok, I just changed that line... 21:53
samcv i'm just saying it could be done
kyan_ Now it wants "ufo" or "panda" to build it :P
samcv and i'd rather do that then expose the data. since that would be much more work than that one line of code...
thundergnat You worked too hard to make it so good, don't make it worse on my behalf. Kudos, by the way.
21:54 mr-foobar joined
samcv Numbers. A customization may be desired to allow sorting numbers in numeric order. If strings including numbers are merely sorted alphabetically, the string “A-10” comes before the string “A-2”, which is often not desired. This behavior can be customized, but it is complicated by ambiguities in recognizing numbers within strings (because they may be formatted according to different language conventions). Once each number is recognized, it 21:54
can be preprocessed to convert it into a format that allows for correct numeric sorting, such as a textual version of the IEEE numeric format.
kyan_ heh, ~/.perl6/bin/zef install ufo worked
ugexe m: use NativeCall; sub foo() is native("xxx", v1.2) { }; foo()
camelia Cannot locate native library 'libxxx.so.1.2': libxxx.so.1.2: cannot open shared object file: No such file or directory
in method setup at /home/camelia/rakudo-m-inst-1/share/perl6/sources/24DD121B5B4774C04A7084827BFAD92199756E03 (NativeCall) line 320…
kyan_ Hm, didn't work, trying ~/.perl6/bin/zef install panda instead :) 21:55
timotimo no, not ufo
you can just "zef install ." inside the folder
we should throw ufo and panda out of the readme
kyan_ Oh, ok, thanks!
thundergnat samcb or you could use something similar to the &natural transform in that gist.
timotimo haha 21:56
i opened an issue about "shouldn't mention ufo any more" in november 2016
i should open a pull request instaed so the repo owner can just casually click "merge" and be done with it
kyan_ Yay, Readline working in perl6 repl now! Thanks :) 21:57
timotimo done 21:58
21:59 headcase_ left
timotimo DrForr: github.com/drforr/perl6-readline/pull/19 - if you would? :) 21:59
22:02 Cabanossi left 22:04 Cabanossi joined 22:09 epony left 22:14 leont left 22:20 AlexDaniel joined, setty1 left 22:21 mr-foobar left 22:24 mr-foobar joined 22:25 kyan_ left 22:28 rindolf left 22:34 skids joined 22:35 pecastro joined 22:37 epony joined 22:42 itaipu left 22:46 headcase joined 22:48 Cabanossi left, pmurias left 22:50 Cabanossi joined 23:06 |oLa|1 left
samcv thundergnat, 23:11
this is acceptable order? (Autumn Bald aether apple außen ball evoke Æon Évian æon 2 3rd 17th 32nd 95 144th) 23:12
thundergnat samcv Traditionally numerics sort before alphabetics but that wouldn't be the end of the word. 23:16
*world
samcv but something similar to that? 23:17
thundergnat Yes
23:19 cdg joined
thundergnat Umm. Wait a minute. I would expect Bald to sort just before ball and Autumn to come after außen 23:19
samcv yeah ignore that
the numbers are sorting right is the main thing
(æon Æon aether apple außen Autumn Bald ball Évian evoke 2 3rd 17th 32nd 95 144th) 23:20
ok there we go
thundergnat m: gist.github.com/thundergnat/3d71a3...d7e2fa94e6 23:21
camelia (2 3rd 17th 32nd 95 144th æon Æon aether apple außen Autumn Bald ball Évian evoke)
23:21 cdg_ left
samcv well UCA sorts numbers after letters so that's why it sorts numbers last 23:22
though i did do some quick hacks for numbers
23:22 audiatorix joined 23:23 cdg left 23:25 BenGoldberg joined
samcv so it seems to be doable 23:26
so it will likely get implemented. sometimes soonish
thundergnat Cool. would it deal with numbers embedded in alphabetic strings? 23:28
m: gist.github.com/thundergnat/3d71a3...d7e2fa94e6
camelia (2 3rd 17th 32nd 95 144th æon Æon aether apple außen Autumn Bald ball Évian evoke file3 file17 file21)
samcv thundergnat, yes 23:29
thundergnat samcv++
awesome
samcv thundergnat, if you want to try it out github.com/samcv/MoarVM/tree/natural 23:33
let me know if there's any issues, aside from numbers sorting after letters
will speed up time for me to implement it by a lot if you can test it some. especially testing things like numbers embedded in text, and also testing the end of line. i.e. '10' unicmp '1' how there's no text after it? i've tested the simple cases. but there may be more 23:35
where if you imagine it, numbers, non numbers and end of string are three distinct entities that need testing in all their combinations of those three 23:36
within string and end of string etc being the differing codepoints between the two strings for example
i tested this at least and seems to work: 23:37
for ^10000000 { my $a = 1000.rand.Int; my $b = 1000.rand.Int; if ("$a-" unicmp "$b") |("$a" unicmp "$b") !== ($a cmp $b) { die "aaaa $a b $b" } }
23:43 troys is now known as troys_
thundergnat samcv I'm running out of time for tonight,family stuff and work tomorrow but I'll see if I can look at it tomorrow. 23:49
samcv no problem. i'm not in a rush
thundergnat I really didn't mean for you to have to implement it, I was just really asking somewhat uninformed questions... but thanks. 23:50
23:51 thundergnat left 23:53 audiatorix left
timotimo another case of perl6 devs underpromising and overdelivering? %) 23:56
timotimo disappears into bed