»ö« 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:13 aries_liuxueyang left 00:23 aries_liuxueyang joined
Xliff hoelzro++ 00:31
Nice article. 00:32
Xliff grabs jq
00:32 huggable joined 00:38 gorgonzola left
teatime yar, +1 for uniprops command 00:43
Xliff Hmm.... what package is uniprops in? 00:47
00:49 Actualeyes joined
dalek c: b6ce6ba | coke++ | htmlify.p6:
We aren't using pack, so don't use it
00:49
00:51 mcsnolte joined
[Coke] Xliff: it's core 00:52
... or so I thought. one sec.
er, "uniprop" is core. 00:53
00:54 anomie__ left 00:58 yqt left 01:02 mattp_ joined
teatime [Coke]: we're talking about a CLI tool 01:03
Xliff: article says Unicode::Tussle 01:04
kalkin- who do i have to ping here to get the blessing for a PR adding a module to ecosystem?
hoelzro kalkin-: I can help! 01:05
Xliff: thanks! glad you liked it
kalkin- hoelzro: this would be great! :)
dalek osystem: 3eda843 | (Bahtiar `kalkin-` Gadimov)++ | META.list:
Add Hashids to ecosystem

See github.com/kalkin/perl6-hashids
01:06
osystem: 18e665e | hoelzro++ | META.list:
Merge pull request #213 from kalkin/master

Add Hashids to ecosystem
hoelzro kalkin-++
kalkin- hoelzro: Thank you! :) 01:07
hoelzro happy to be of service!
01:07 anomie__ joined 01:08 AlexDaniel left 01:09 perlawhirl joined
Xliff hoelzro++, now see? THAT is service! ;) 01:13
01:15 xinming left 01:17 xinming joined 01:28 kalkin- left, kalkin-_ joined 01:29 pierre_ joined 01:30 pierre_ left, pierre_ joined 01:34 kalkin-_ is now known as kalkin- 01:35 kent\n left 01:46 ilbot3 left 01:47 ilbot3 joined 01:54 BenGoldberg joined 02:07 pierre_ left 02:10 pierre_ joined, Zoffix joined 02:13 labster left 02:19 pierrot joined 02:26 kid51 left 02:27 pierre_ left 02:31 pierre_ joined 02:41 Actualeyes left 02:42 perlawhirl left 02:44 noganex joined 02:46 noganex_ left 02:56 pierre_ left, pierre_ joined, skink left 02:57 cpage_ left 03:01 |meta left, mcsnolte left 03:10 dj_goku joined 03:16 MadcapJake left 03:18 MadcapJake joined 03:20 ssotka left, MadcapJake left 03:21 jrusso joined 03:22 jrusso is now known as MadcapJake 03:29 jack_rabbit joined 03:34 labster joined 03:41 cpage_ joined 03:43 cpage_ left, cpage_ joined
PerlJam nine++ Just saw your GPW talk. Very nice! 03:53
03:56 Actualeyes joined 03:57 Ben_Goldberg joined, BenGoldberg left 03:58 Ben_Goldberg is now known as BenGoldberg 04:01 Ben_Goldberg joined 04:02 BenGoldberg left, Ben_Goldberg is now known as BenGoldberg 04:22 khw left 04:24 Sgeo left 04:29 Cabanossi left 04:31 Cabanossi joined 04:32 huggable left, huggable joined 04:37 pierre_ left 04:46 pierre_ joined 04:50 pierre_ left 04:52 mohae joined 04:54 mohae_ left 04:56 azawawi joined 04:57 Sgeo joined
azawawi pasteboard.co/1lKrDoSB.png # GTK::Scintilla: Zoom and long lines API :) 04:57
04:59 azawawi left 05:02 anomie__ left, anomie__ joined 05:20 ssotka joined
nine PerlJam: thanks :) 05:25
05:32 domidumont joined 05:33 BenGoldberg left 05:36 domidumont left 05:37 domidumont joined 05:38 kent\n joined, kent\n left, kent\n joined 05:44 Actualeyes left 05:47 pierre_ joined 05:51 pierre_ left 05:52 nadim left, nadim joined 05:59 bjz joined 06:00 Actualeyes joined 06:01 bjz_ left 06:02 silug left 06:07 sno left 06:12 bjz left 06:13 rurban joined 06:17 silug joined 06:18 wamba joined 06:19 ufobat joined 06:20 pierre_ joined 06:23 bjz joined 06:26 domidumont left, firstdayonthejob joined 06:28 labster left 06:29 bjz left 06:32 _mg_ joined 06:33 dwarring left 06:39 abraxxa joined 06:41 ufobat left 06:44 abraxxa left, firstdayonthejob left, abraxxa joined 06:53 abraxxa left 06:54 abraxxa joined 06:55 ufobat joined 07:05 jjido joined 07:06 jjido left, cosimo joined 07:07 cosimo left 07:08 cosimo joined 07:14 bjz joined 07:16 darutoko joined 07:20 g4 joined 07:22 labster joined 07:29 zakharyas joined 07:30 jack_rabbit left 07:34 jack_rabbit joined 07:36 ssotka left 07:37 kanishka joined, pierre_ left 07:44 luiz_lha left, luiz_lha_ joined 07:45 pierre_ joined 07:47 pierre_ left, pierre_ joined 07:51 mr-foobar joined 07:52 sno joined 07:56 dakkar joined 08:01 mr-foobar left 08:03 pierre_ left 08:04 bjz left 08:09 pierre_ joined 08:10 zakharyas left 08:11 pierre_ left, pierre_ joined 08:21 aries_liuxueyang left 08:22 TreyHarr1 left, TreyHarr1 joined 08:24 ocbtec joined, aries_liuxueyang joined 08:26 rurban left 08:28 darutoko left 08:32 huggable left 08:39 luiz_lha_ is now known as luiz_lha 08:44 pierre_ left 08:48 Ven joined 08:53 pierre_ joined 08:58 pierre_ left 09:02 iH2O joined 09:03 iH2O left 09:06 pierre_ joined 09:11 RabidGravy joined 09:18 Ven left
RabidGravy boom 09:20
09:26 Actualeyes left 09:33 TEttinger left 09:44 domidumont joined 09:49 wamba left 09:54 zakharyas joined 09:58 rindolf joined, ocbtec left 10:02 bjz joined 10:03 ocbtec joined 10:09 wamba joined, grondilu joined 10:11 labster left 10:16 anomie__ left
Zoffix .ask TimToady would you have time to offer a ruling on what the default tolerance to is-approx in Test.pm6 should be? Is it relative or absolute, and what value? My ideal choice would be absolute with $*TOLERANCE to match ≅. The specs/docs use absolute at 1e-5. And current impl uses relative at 1e-6. My more detailed plan for rewrite of is-approx: github.com/zoffixznet/debug/blob/m...-rework.md 10:21
yoleaux Zoffix: I'll pass your message to TimToady.
Zoffix yoleaux, join #perl6-dev
10:22 pierre_ left 10:29 wamba left
Zoffix .tell TimToady sorry, ≅ uses relative tolerance, not absolute, but my ideal choice would still be to match it. 10:31
yoleaux Zoffix: I'll pass your message to TimToady.
Zoffix That or change it to absolute :P Why is it relative? I thought it was at 1e-15 to get rid of Num fuzziness 10:33
(change it on ≅)
m: say 3e20 ≅ 3e20+100000 10:34
camelia rakudo-moar 33ab86: OUTPUT«True␤»
Zoffix m: say 3e20 ≅ 3e20+1000000
camelia rakudo-moar 33ab86: OUTPUT«False␤»
Zoffix m: say &[≅](”Your mamma so fat”) 10:41
camelia rakudo-moar 33ab86: OUTPUT«True␤»
grondilu (well that's a weird string fill-in) 10:50
Zoffix ≅ should also use <= and not < methinks 10:52
m: my $*TOLERANCE = 0; say 24 ≅ 24
camelia rakudo-moar 33ab86: OUTPUT«False␤»
Zoffix Maybe I'll file a bug report to find out why from Sam why I'm wrong.... 10:53
10:55 azawawi joined
azawawi hi 10:55
Zoffix \o 10:56
11:03 brrt joined
azawawi RabidGravy: ping 11:06
Zoffix: :)
Zoffix: i need menubar wrapped in GTK::Simple (github.com/perl6/gtk-simple/tree/m...TK/Simple) 11:07
pasteboard.co/1lKrDoSB.png # GTK::Scintilla demo should have a menu bar
11:12 kid51 joined 11:14 xinming left, xinming joined 11:16 _mg_ left 11:17 kid511 joined
RabidGravy boom 11:18
11:18 kid51 left
RabidGravy azawawi, the only thing that is preventing me from implementing menus there is that there is just so much to implement 11:21
azawawi link it plz 11:22
RabidGravy developer.gnome.org/gtk3/stable/GtkMenuBar.html 11:26
I haven't made anything yet 11:27
azawawi zetcode.com/gui/gtk2/menusandtoolbars/ ? 11:28
so basically wrap GTK::MenuBar and GTK::Menu and GTK::MenuItem ? 11:30
RabidGravy yeah 11:31
11:31 brrt left
dalek k-simple: 7791648 | azawawi++ | README.md:
Make AppVeyor CI badge work
11:32
11:46 kyrose joined
kyrose Hi, I am new to Perl language (both 5 and 6). I wanted to know, should I learn perl 5 first and then move to perl 6? 11:47
RabidGravy Thinking of using martinfowler.com/apsupp/recurring.pdf as a basis for a high level scheduling thingy, is there any other useful reading on the matter
kyrose, well a lot of the Perl 5 knowledge will be transferrable to Perl 6, but it's not required 11:48
ilmari if you don't already know Perl 5, trying to learn both at the same time could get confusing 11:49
RabidGravy if you're doing it just for more knowledge I would leap in to 6, if you're doing it for more pragmatic reasons (such as work) then I'd start with 5
ilmari like trying to learn e.g. spanish and italian at the same time
kyrose I just wanted to learn for fun. I like the C-syntax style of this high level language, but also wanted to learn perl 6 for production(maybe) 11:50
ilmari in that case I'd go straight for perl 6
11:50 kid511 left
RabidGravy yeah, 6 11:50
kyrose thanks. Ermm, also, is Perl 6 got an official forum and somehow the infamous CPAN? 11:51
ilmari there's modules.perl6.org/ 11:52
RabidGravy well there are a fraction of the number of modules, but modules.perl6.org/
at some point it will be folded into the architecture that underlies CPAN 11:53
11:53 cgfbee left
kyrose Ty. So, how about perl 5, will it stay version 5 forever? The website says 'perl 6 and perl 5 is a different language'? 11:54
RabidGravy yeah, the sub-version will monotonously increase forever
11:54 rindolf left
DrForr It should really be considered 'perl5' version 24, at the moment. 11:54
11:55 xinming left 11:56 bjz left
RabidGravy yeah, it's significantly different to the 5.000m that I first used 11:56
kyrose I see
11:57 skids left
kyrose Oh I just realized travis-ci build for github do support Perl 6. This is very useful. 11:58
RabidGravy yeah, most of the module developers use it
11:59 bjz joined
kyrose I hope perl will be supported more soon. I always see 'perl is dead, perl is ugly, perl is this perl is that', even looking for tutorial :(. And a web dev told me to not use Perl. 12:00
RabidGravy Well Perl is most definitely not dead, it's just not quite as fashionable as some languages 12:01
teatime yeah, that has become the fashionable opinion
12:02 Akagi201 left
teatime but it's so undeserved :( 12:02
DrForr It's fashionable for Python users to slag it for no good reason.
kyrose Yeah true. I tried perl 5 for my sysadmin task, even I'm very new at it, I can do much useful stuff in 2 lines.
RabidGravy that's been true since the late 90s
anyhow, I've got to go out and buy a garden fork as the previous one self destructed on Monday 12:03
toodles
kyrose Bye. Anyway, I'm kyrose, I think I wanna familiarize myself with Perl 6 community. Nice to meet you guys. 12:05
DrForr Check out perl6.org for starters.
kyrose Thanks for the reference. 12:07
12:08 pmurias joined 12:09 cgfbee joined
literal m: my $foo = <foo bar>.SetHash; say $foo.WHAT 12:10
camelia rakudo-moar 725054: OUTPUT«(SetHash)␤»
literal m: my %foo = <foo bar>.SetHash; say %foo.WHAT
camelia rakudo-moar 725054: OUTPUT«(Hash)␤»
literal why is the latter not a SetHash?
jnthn Because assignment is *into* the thing on the left 12:11
So you have a Hash (resulting from `my %foo`) and you're assigning the values from the SetHash into it 12:12
m: my %foo := <foo bar>.SetHash; say %foo.WHAT
camelia rakudo-moar 725054: OUTPUT«(SetHash)␤»
jnthn Binding is what's wanted in this case
literal I was under the impression that the % sigil could be used for many 'hashy' types, not just Hash. Is that incorrect?
jnthn It can, but you need to bind
literal ok, so with assignment @ and % are always Array and Hash ?
jnthn Yes 12:13
literal alright
jnthn Unless you bind something else
Or use `is`
12:13 xinming joined
jnthn m: my %foo is SetHash = <foo bar>; say %foo.WHAT 12:13
camelia rakudo-moar 725054: OUTPUT«Cannot modify an immutable SetHash␤ in block <unit> at /tmp/UGhEW5ZIwo line 1␤␤»
jnthn Ah, but SetHash has not STORE method I guess
12:13 rindolf joined
jnthn So yeah, use the binding thing I mentioned above 12:14
literal yeah
12:16 ocbtec left
El_Che wouldn't be a good idea to add "rakudobrew build zef" to trakudo.org/how-to-get-rakudo/#Insta...akudobrew? Now it only mentions panda 12:16
12:19 pmurias left, pmurias joined 12:26 ZoffixW joined 12:27 azawawi left, ocbtec joined
ZoffixW kyrose, you can use most of Perl 5's modules (metacpan.org/) from Perl 6. See Inline::Perl5 . Talk for the module: www.youtube.com/watch?v=CEs1g94qNs...e=youtu.be 12:28
hugTABTAB.,.. damn you bot :(
kyrose Thanks ZoffixW
timotimo i'm surprised synopsebot6 is still up :P
kyrose allisonrandal.com/2013/03/31/mythb...love-perl/ - Whoa! Perl philosophy makes the devs so different in expressing their thought! 12:30
12:31 huggable joined
ZoffixW Yey.. 10th time the charm it seems. 12:31
huggable, Inline::Perl5
huggable ZoffixW, nothing found
ZoffixW huggable, module Inline::Perl5
huggable ZoffixW, nothing found
ZoffixW Ah, right. I never reimplemented that feature after the time I wiped the server... 12:32
kyrose can I ask. what is huggable? Is that bot command?
ZoffixW kyrose, yes, huggable is a Perl 6 IRC robot 12:33
There's a major bug that prevents it from joining half the time that I'm yet to find time to fix :P
kyrose wait, you're the bot developer?
ZoffixW huggable, Inline::Perl5 :is: Inline::Perl5 lets you use most of Perl 5's CPAN from Perl 6. See modules.perl6.org/repo/Inline::Perl5 and the talk about the module www.youtube.com/watch?v=CEs1g94qNso
huggable ZoffixW, Added Inline::Perl5 as Inline::Perl5 lets you use most of Perl 5's CPAN from Perl 6. See modules.perl6.org/repo/Inline::Perl5 and the talk about the module www.youtube.com/watch?v=CEs1g94qNso
ZoffixW kyrose, I guess :) 12:34
kyrose ZoffixW, cool!
perlpilot buenos dias señors y señoras 12:36
DrForr ?Que tal? 12:38
12:39 kyrose left
perlpilot good this morning so far 12:39
12:45 huf joined 12:47 Sgeo left 12:52 Akagi201 joined 12:55 _mg_ joined, domidumont left, sufrostico joined, ZoffixW left
[Coke] Many eyes make light work. 13:00
13:01 pierre_ joined
grondilu hello. Question : in linear algebra we often see expressions like transpose(A)*M*A. Do you think it's possible to define a ternary operator a*b*c in order to optimize this kind of expression? 13:03
of course a, b and c would have constraints. 13:04
13:04 jack_rabbit left
perlpilot grondilu: Almost all "is it possible" type questions have an answer of "yes" in Perl 6 ;) 13:05
grondilu I'm not sure there is a syntax for ternary operator though 13:06
m: sub ternary:<§ §>($, $, $) {...}
camelia rakudo-moar 725054: OUTPUT«5===SORRY!5=== Error while compiling /tmp/p6LhJIsk7i␤Cannot add tokens of category 'ternary'␤at /tmp/p6LhJIsk7i:1␤------> 3sub ternary:<§ §>7⏏5($, $, $) {...}␤»
timotimo we currently implement the ?? !! with a special grammar rule in the perl6 grammar
grondilu timotimo: yeah that's what I thought
13:07 kanishka left
grondilu though I suppose I could mix the output of a*b with a role used as a constraint for the second multiplication. 13:07
though it'd be pretty ugly, especially since I want the constraint on c depending on a. 13:09
like where c == transpose(a) for instance.
13:09 tbrowder joined
perlpilot grondilu: I think it was brrt that was saying the other day that there wasn't going to be enough pressure to make "PDL in Perl6" because why not just use PDL or NumPy or R or etc. Whatever you're doing ... keep doing it :) 13:10
grondilu truly it's not for linear algebra that I'm considering it, rather for my Clifford module. But the linalg exemple makes things simpler to explain. 13:11
13:11 brrt joined
perlpilot grondilu: for that particular example, it seems like you'd want a binary op on A and M that would do transpose(A)*M*A 13:16
13:20 |meta joined, ZoffixW joined
ZoffixW m: class MyTernaryFalse {}; class MyTernaryTrue { has $.value }; sub infix:<§> { ($^a ~~ MyTernaryFalse) ?? $^b !! ($^a ~~ MyTernaryTrue) ?? $^a.value !! $^a ?? MyTernaryTrue.new(:value($^b)) !! MyTernaryFalse.new }; say 0 § "a" § "b"; say 1 § "a" § "b" 13:21
camelia rakudo-moar ef376d: OUTPUT«b␤a␤»
13:21 skids joined
DrForr I still want to see § as a sigil for sets :) 13:23
ZoffixW .u §
yoleaux U+00A7 SECTION SIGN [Po] (§)
ZoffixW m: 1 ~~ Illegal ?? 2 !! 3; class Illegal {} 13:24
camelia rakudo-moar ef376d: OUTPUT«5===SORRY!5=== Error while compiling /tmp/vPjLothpBE␤Expected a term, but found either infix ?? or redundant prefix ?␤ (to suppress this message, please use a space like ? ?)␤at /tmp/vPjLothpBE:1␤------> 031 ~~ Illegal ??7⏏5 2 !! 3; class…»
ZoffixW ^ LTA error
m: (1 ~~ Illegal) ?? 2 !! 3; class Illegal {}
camelia rakudo-moar ef376d: OUTPUT«5===SORRY!5=== Error while compiling /tmp/53guuJnmev␤Illegally post-declared type:␤ Illegal used at line 1␤␤»
13:26 kyrose joined
ZoffixW m: wat ?? 2 !! 3; 13:26
camelia rakudo-moar ef376d: OUTPUT«5===SORRY!5=== Error while compiling /tmp/rz9bTxDv4M␤Expected a term, but found either infix ?? or redundant prefix ?␤ (to suppress this message, please use a space like ? ?)␤at /tmp/rz9bTxDv4M:1␤------> 3wat ??7⏏5 2 !! 3;␤»
ZoffixW m: (wat) ?? 2 !! 3;
camelia rakudo-moar ef376d: OUTPUT«5===SORRY!5=== Error while compiling /tmp/7MWXNvY9ts␤Undeclared routine:␤ wat used at line 1. Did you mean 'WHAT'?␤␤»
kyrose Hi, is this a good way to write simple perl class - pastebin.com/Zu42sb99
grondilu perlpilot: I don't want to introduce an other symbol. I'd like the optimization to be invisible. 13:27
ZoffixW kyrose, that looks good to me
Though, I'd pic FtoF as method name
*CtoF
kyrose ZoffixW: thanks ^_^ 13:28
ZoffixW kyrose, and you ought to make ℃ and ℉ as postfix ops :P 13:29
13:29 yqt joined, bjz_ joined
ZoffixW I had a plan to release a module like that at the back of my mind for awhile 13:29
kyrose ah 13:30
13:30 bjz left, Zero_Dogg left, Zero_Dogg joined
timotimo ℉ ought to give a syntax error immediately 13:30
ZoffixW Why?
timotimo because, ugh, fahrenheit 13:31
please autodefenestrate if you want to use fahrenheit for anything :P
kyrose I'm happy to try to make a module now! ^^
13:32 pmurias left
[Coke] timotimo: hey, some of us are stuck with it. :| 13:32
13:32 Actualeyes joined 13:33 pierrot left
timotimo be the change i want to see in the world! ;) 13:33
ZoffixW m: sub postfix:<℃> ($c) { class :: { method to-f { $c * 9/5 + 32 } }.new }; say 100℃.to-f 13:34
camelia rakudo-moar ef376d: OUTPUT«212␤»
geekosaur thinks both of those should produce Kelvin
DrForr Rankine FTW :) 13:35
kyrose <> <- what is that called? 13:36
ZoffixW m: sub postfix:<℃> ($c) { my $z = class :: {}.new; $z.^add_method('℉', { $c * 9/5 + 32 } ); $z }; say 100℃."℉"()
camelia rakudo-moar ef376d: OUTPUT«212␤»
13:36 gtodd joined
ZoffixW kyrose, wordspace or something like that 13:37
m: say <blah blah blah and more blah>.join: '|'
camelia rakudo-moar ef376d: OUTPUT«blah|blah|blah|and|more|blah␤»
RabidGravy qw
ZoffixW Saves you from typing 'blah', 'blah', 'blah', 'and', 'more', 'blah',
quote words
kyrose ZoffixW, oh you mean like <dog cat chicken> instead of ("dog", "cat", "chicken")? 13:38
ZoffixW right 13:39
kyrose oh, so it's more like a symbol?
and how do you use that compiler XD
*camelia bot
ZoffixW m: code to execute
camelia rakudo-moar ef376d: OUTPUT«5===SORRY!5=== Error while compiling /tmp/zXs7XKu99Z␤Undeclared routines:␤ code used at line 1␤ execute used at line 1␤ to used at line 1. Did you mean 'so', 'tc'?␤␤»
ZoffixW or m: URL to a gist
kyrose m: print "Hello world\n"; 13:40
camelia rakudo-moar ef376d: OUTPUT«Hello world␤»
kyrose oh I see now
Man, I'm such a noob. I need to learn a lot!
ZoffixW kyrose, I feel the same... and I wrote my first program 16 years ago :P
DrForr So do I :) 13:41
Only 16? Wowsers.
kyrose 16 years?! You guys are perl hackers it seems.
RabidGravy I wrote my first program 38 years ago and I still haven't a clue, obviously not Perl though 13:42
DrForr I've done this (not professionally) for about 36 years myself :)
kyrose I just started 3 hours ago. :O
gtodd I am goofing around with feeds and lists/arrays to see how fast they are compared with last time I checked :) 13:43
DrForr (obviously not all Perl, but ... At least the last ~20 years.)
ZoffixW Sheesh, the argument for Fahreinheit over Celcius is so flimsy www.zmescience.com/other/fahrenheit...after-all/ 13:44
kyrose and you guys still loyal to it by being here.
ZoffixW The author obviously never seen a decimal point.
gtodd some of the "tests" (not really) might have been from pre GLR ... so this is now an error perl6 -e 'my @arr := "/usr/share/dict/web2".IO.slurp.lines(:eager); @arr ==> grep({m/<<zygote>>/}) ==> my $word; say $word'
"expected Positional but got Seq"
ZoffixW kyrose, I'm not loyal :) I use it 'cause I like it and I'll be gone the second something better comes along.
gtodd and this works: perl6 -e 'my @arr = "/usr/share/dict/web2".IO.slurp.lines(:eager); @arr ==> grep({m/<<zygote>>/}) ==> my $word; say $word 13:45
13:45 wamba joined
kyrose ZoffixW: :) 13:45
oh oh, I tried this but doesn't work. hold on
tony-o i like celsius, that's one of the few measurements i like from the metric system 13:46
gtodd I'm assuming that why I needed := (vs. = in current perl6) is "something about GLR, just forget this and move on"
13:46 pmurias joined
kyrose m: perl -e 'my $x = 0; while ($x <= 100) { print "The [$x]\n"; $x++}' 13:46
camelia rakudo-moar ef376d: OUTPUT«5===SORRY!5=== Error while compiling /tmp/pCKRwKkOA_␤Two terms in a row␤at /tmp/pCKRwKkOA_:1␤------> 3perl -e7⏏5 'my $x = 0; while ($x <= 100) { print "␤ expecting any of:␤ infix␤ infix stopper␤ postfix␤ …»
ZoffixW m: my $x = 0; while ($x <= 100) { print "The [$x]\n"; $x++} 13:47
camelia rakudo-moar ef376d: OUTPUT«The [0]␤The [1]␤The [2]␤The [3]␤The [4]␤The [5]␤The [6]␤The [7]␤The [8]␤The [9]␤The [10]␤The [11]␤The [12]␤The [13]␤The [14]␤The [15]␤The [16]␤The [17]␤The [18]␤The [19]␤The [20]␤The [21]␤The [22]␤The [23]␤Th…»
ZoffixW Seems to work fine for me
kyrose whot, hmm
ZoffixW m: "The [$x]".say for ^100 13:48
camelia rakudo-moar ef376d: OUTPUT«5===SORRY!5=== Error while compiling /tmp/PATZXYY1Dv␤Variable '$x' is not declared␤at /tmp/PATZXYY1Dv:1␤------> 3"The [7⏏5$x]".say for ^100␤»
ZoffixW m: "The [$_]".say for ^100
camelia rakudo-moar ef376d: OUTPUT«The [0]␤The [1]␤The [2]␤The [3]␤The [4]␤The [5]␤The [6]␤The [7]␤The [8]␤The [9]␤The [10]␤The [11]␤The [12]␤The [13]␤The [14]␤The [15]␤The [16]␤The [17]␤The [18]␤The [19]␤The [20]␤The [21]␤The [22]␤The [23]␤Th…»
kyrose wow, there's more than one way to do it.
gtodd anyway the above used to take 44 seconds and now only takes 29 :-) 13:49
ZoffixW That's the Perl moto
timotimo what? for just 100 ints? :o
gtodd and time perl6 -e 'say "/usr/share/dict/web2".IO.slurp.lines(:eager).grep("zygote");' used to take 61 seconds and now only takes 0.87 seconds 13:50
timotimo oh
ZoffixW gtodd, is your rakudo older than two hours?
gtodd heheh
ZoffixW ?
kyrose ZoffixW: yeah, forgot the philosophy of Perl XD
gtodd the old results were from 9 months ago I think
ZoffixW I think jnthn++ pushed a whole bunch of performance fixes 2 hours ago is why I ask
gtodd Zoffix rakudo from about an hour ago 13:51
ZoffixW: I was just taking a walk down memory/performance lane ...
13:51 darutoko joined
gtodd ZoffixW: there was a "naïve benchmark" I'd always try: www.perlmonks.org/?node_id=1099617 13:56
13:58 ptolemarch joined
ZoffixW Calling it naive is giving it too much credit :P 13:59
gtodd ZoffixW: the difference is still large but on my system I think perl5 is around 0.5 second and perl6 is around 20 seconds on a log file with 500k+ lines so massive speed up by perl6
ZoffixW Which perl5 version?
gtodd ZoffixW: well you'd have to write it differently now anyway doesn't ~~ m/ / give an error in perl6 ? 14:00
perl5 is 5.22 I think
yes
ZoffixW m: say 'foo' ~~ m/'f'/
camelia rakudo-moar ef376d: OUTPUT«「f」␤»
DrForr 5.24.0 is current. 14:02
gtodd hrrm yes: as written on the perlmonks node perl6 -n -e 'say $0 if ~~ m/(<<\w**5>>)/' logs.txt gives me an error about terms 14:03
perlpilot "if ~~ m//" doesn't make any sense 14:04
14:04 zakharyas left 14:05 zakharyas joined
gtodd yeah I guess it used to work anyhway I changed it to: if m// 14:05
heheh look away :) perl6 -n -e 'say $/.Str if /(<<\w**5>>)/' logs.txt 14:06
anyway that node is notorious :)
grrr
perlpilot why does the P6 put the word boundaries within the parens, but the P5 puts them outside? 14:09
14:09 zakharyas left 14:11 cdg joined
perlpilot time perl -n -E 'say $1 if /\b(\w{5})\b/;' /usr/share/dict/words >/dev/null --> real0m0.296s 14:12
time perl6 -n -e 'say ~$0 if m/<< (\w**5) >>/;' /usr/share/dict/words >/dev/null --> real0m56.632s
14:13 g4 left
gtodd perlpilot: time perl6 -n -e 'say $/.Str if m/<<\w**5>>/;' /usr/share/dict/web2 .... works without the parens and is faster for me so I don't know :-D 14:19
kyrose I don't know why, but class for perl 6 really make my eye seeing perl code easier. I can track where object and output goes now.
RabidGravy yeah 14:21
gtodd perlpilot: although still 25 seconds versus 0.24
14:24 brrt left 14:25 pierre_ left
kyrose Okay. I gtg. Bye! 14:28
14:28 kyrose left, cosimo left
gtodd perlpilot: anyway I think the word boundary stuff in perl5 is more part of the regex "sub language" ?? with perl6 there is a :P5 modifier for matching using the RE syntax ... it slows things down a bit AFAICT 14:32
14:37 kanishka joined 14:40 cosimo joined 14:41 kyrose joined
kyrose Hi, I see there are Int, Str, but is there Float? Or how to make like 'my Float $e = 90.2; say $e;' 14:43
timotimo we have Num for that
but when you write 90.2 you get a Rat instead 14:44
kyrose oh
thanks
14:45 sena_kun joined
perlpilot kyrose: you really want to use Rat if you can. 14:45
kyrose I'll see what I can do perlpilot 14:46
ZoffixW There's Numeric too, if you don't care what type of number it is
Or you can omit a type entirely. Gradual Typing, baby <3
sena_kun hi, folks. Please, check out new PR to ecosystem. 14:47
ZoffixW perl6.party/post/Perl-6-Types--Made-for-Humans
dalek osystem: 927ec76 | Altai-man++ | META.list:
Add WWW::DuckDuckGo to the ecosystem
osystem: 1b73f40 | (Zoffix Znet)++ | META.list:
Merge pull request #214 from Altai-man/master

Add WWW::DuckDuckGo to the ecosystem
sena_kun thanks.
perlpilot heh, ZoffixW++ you're too fast.
As I was looking at it, the PR changed before my eyes as if by magic ;) 14:48
ZoffixW :)
gregf_ /aws
14:49 wamba left
gregf_ :/ sorry 14:49
kyrose m: my $tenth = 1/10; say $tenth.WHAT; 14:51
camelia rakudo-moar ef376d: OUTPUT«(Rat)␤»
timotimo m: say 0.1e0.WHAT 14:52
camelia rakudo-moar ef376d: OUTPUT«(Num)␤»
14:52 sena_kun left
kyrose weird..my rakudo didn't compile above code with perl -e 14:52
[Coke] jezu, I'm coming up on 40 years here.
ZoffixW m: my $tenth = 1/10; say $tenth.nude;
camelia rakudo-moar ef376d: OUTPUT«(1 10)␤»
timotimo well, yeah, you need perl6 -e instead :)
[Coke] (in time from first program from backscroll) 14:53
kyrose well, yeah, you need perl6 -e instead :), I just realized I use perl5. Thanks Errgh. (annoying when 2 version of perl installed in the same machine) 14:54
ZoffixW kyrose, use camelia via /msg instead of perl6 -e '...'
/msg camelia m: 'blah'
kyrose thanks for that info 14:55
ZoffixW kyrose, for scripts, some folks like to plop `use v6` at the start that cries when you run the script with the wrong perl
kyrose so do i need to include that even for one liner?
RabidGravy and indeed modules
no, it's not required
ZoffixW never uses it 14:56
kyrose ^^
15:02 kurahaupo joined 15:05 kyrose left 15:08 tbrowder left
RabidGravy I think I've broken my brane trying to reconcile martinfowler.com/apsupp/recurring.pdf and rrules from www.rfc-editor.org/rfc/rfc5545.txt 15:12
15:13 pmurias left
ZoffixW that looks scary :) 15:14
172 pages... like a small novel
geekosaur horror story, probably 15:15
15:15 pmurias joined 15:25 _mg_ left 15:28 atje joined, _mg_ joined 15:29 atje left
titsuki Hi all. I have a question. Is the behavior that the submethod doesn't check its name of the arguments a bug ? 15:30
m: class A { multi submethod BUILD(:%hash) { "hash".say; }; multi submethod(:$text) { "text".say; }; multi submethod BUILD(:@array) { "array".say; }; }; A.new(text => "10");
camelia rakudo-moar 4a2929: OUTPUT«hash␤»
15:31 yqt left, Akagi201 left
titsuki I think that it should say "text". 15:31
timotimo hah 15:32
you have a method called "submethod" there
you may want a multi submethod called "BUILD" instead
titsuki sorry 15:33
m: class A { multi submethod BUILD(:%hash) { "hash".say; }; multi submethod BUILD(:$text) { "text".say; }; multi submethod BUILD(:@array) { "array".say; }; }; A.new(text => "10"); 15:34
camelia rakudo-moar 4a2929: OUTPUT«hash␤»
titsuki it still says "hash"
Xliff titsuki: You are getting a hash because that's what you are passing.
m: class A { multi submethod BUILD(:%hash) { "hash".say; }; multi submethod BUILD(:$text) { "text".say; }; multi submethod BUILD(:@array) { "array".say; }; }; A.new(:text("10"));
camelia rakudo-moar 4a2929: OUTPUT«hash␤»
Xliff Technically named parameters are hashes. 15:35
timotimo um, only if you slurp it
psch m: class A { multi submethod BUILD(:$text) { "text".say; }; multi submethod BUILD(:%hash) { "hash".say; }; multi submethod BUILD(:@array) { "array".say; }; }; A.new(:text("10"));
camelia rakudo-moar 4a2929: OUTPUT«text␤»
psch order of declaration
Xliff psch++
ugexe it because you need to mark them required, named arguments are optional
ZoffixW :o 15:36
I didn't know order of declaration mattered.
psch it does for nameds, and optionals in general i think too
jnthn For tie-breaking, yes, and named parameters only ever act as tie-breakers in multi dispatch
15:36 pmurias left
ZoffixW m: class A { multi submethod BUILD(:%hash!) { "hash".say; }; multi submethod BUILD(:$text!) { "text".say; }; multi submethod BUILD(:@array) { "array".say; }; }; A.new(:10text); 15:36
camelia rakudo-moar 4a2929: OUTPUT«text␤»
ZoffixW ugexe++
psch ah, right, it's actually just for tie-breaking. not related to the parameter type 15:37
titsuki ugexe: I see. Thanks !
Xliff I get confused with the (:(val)name) passing method.
psch m: say :("foo")bar # ?
camelia rakudo-moar 4a2929: OUTPUT«5===SORRY!5=== Error while compiling /tmp/oh_N8OS3HN␤Two terms in a row␤at /tmp/oh_N8OS3HN:1␤------> 3say :("foo")7⏏5bar # ?␤ expecting any of:␤ infix␤ infix stopper␤ postfix␤ statement end␤ …»
psch Xliff: not sure what you mean, no such form exists :) 15:38
Xliff In named parameter passing. Look at Zoffy's last example. Particularly the last statement.
ZoffixW :4242foo
15:38 kaare__ joined
ZoffixW Xliff, if it's digits only, you can write it first and avoid parens 15:38
psch right, but that's explicitly only [ <colon> <numeric> <ident> ]
Xliff ZoffixW, I prefer :foo(4242)
ZoffixW too many parens for my taste :) 15:39
Xliff LOL
I understand that. Really.
15:39 ptolemarch left
ZoffixW m: say :١١١foo 15:39
camelia rakudo-moar 4a2929: OUTPUT«===SORRY!===␤Error encoding ASCII string: could not encode codepoint 1633␤»
Xliff Except I have a higher tolerance. Now anything LISPy.... that is Too Many Parens.
ZoffixW 0.o
psch .u circled ten 15:40
yoleaux U+2469 CIRCLED NUMBER TEN [No] (⑩)
U+24FE DOUBLE CIRCLED NUMBER TEN [No] (⓾)
U+277F DINGBAT NEGATIVE CIRCLED NUMBER TEN [No] (❿)
ZoffixW m: say % = :١١١foo
camelia rakudo-moar 4a2929: OUTPUT«===SORRY!===␤Error encoding ASCII string: could not encode codepoint 1633␤»
psch m: say :⑩foo
camelia rakudo-moar 4a2929: OUTPUT«5===SORRY!5===␤Argument to "say" seems to be malformed␤at /tmp/5V8oziV1za:1␤------> 3say7⏏5 :⑩foo␤Confused␤at /tmp/5V8oziV1za:1␤------> 3say :7⏏5⑩foo␤ expecting any of:␤ colon pair␤Other potential difficultie…»
ZoffixW .u ١
yoleaux U+0661 ARABIC-INDIC DIGIT ONE [Nd] (١)
psch $<num> = [\d+] <identifier>
is the actual part of the rule 15:41
m: say "١" ~~ /\d/
camelia rakudo-moar 4a2929: OUTPUT«「١」␤»
psch nqp-m: say "١" ~~ /\d/
camelia nqp-moarvm: OUTPUT«Confused at line 2, near "say \"١\" ~~"␤ at gen/moar/stage2/NQPHLL.nqp:706 (/home/camelia/rakudo-m-inst-1/share/nqp/lib/NQPHLL.moarvm:panic)␤ from gen/moar/stage2/NQP.nqp:927 (/home/camelia/rakudo-m-inst-1/share/nqp/lib/nqp.moarvm:comp_unit)␤ from gen/m…»
psch nqp-m: say( "١" ~~ /\d/ )
camelia nqp-moarvm: OUTPUT«١␤»
psch still, that's a bit curious
ZoffixW What's nqp-m?
psch nqp-moar
timotimo it's the nqp compiler for moarvm
ZoffixW Just nqp, with no rakudo on top? 15:42
psch exactly
timotimo correct
just like what we use to build rakudo
15:42 khw joined
ZoffixW reported it: rt.perl.org/Ticket/Display.html?id=128306 15:43
nqp-m: say("١" ~~ /\d/) 15:44
camelia nqp-moarvm: OUTPUT«١␤»
psch oh, i see why that's broken 15:49
ZoffixW Why? :)
psch nqp-m: say +"١" 15:50
camelia nqp-moarvm: OUTPUT«Error encoding ASCII string: could not encode codepoint 1633␤ at /tmp/dr08X0vIo6:1 (<ephemeral file>:<mainline>)␤ from gen/moar/stage2/NQPHLL.nqp:1505 (/home/camelia/rakudo-m-inst-1/share/nqp/lib/NQPHLL.moarvm:eval)␤ from gen/moar/stage2/NQPHLL.nqp:1708 …»
psch because nqp doesn't convert that properly to a numeric type
the moar fix would be in MoarVM/src/core/coerce.c i suppose 15:51
'cause i don't think we want to have coerce logic in nqp itself 15:52
i suppose moar already should have access to the necessary unival pieces
m: say +"١" 15:53
camelia rakudo-moar 4a2929: OUTPUT«1␤»
psch yeah, line 251, we have to reach into whatever exactly sits behind unival when the ascii decode fails and see if we get a value there 15:54
ZoffixW m: use Test foo => 'bar', 42 15:55
camelia rakudo-moar 4a2929: OUTPUT«5===SORRY!5=== Error while compiling /tmp/_exhwyVr8D␤Error while importing from 'Test': no such tag 'foo'␤at /tmp/_exhwyVr8D:1␤------> 3use Test foo => 'bar', 427⏏5<EOL>␤»
ZoffixW m: use Test [foo => 'bar', 42]
camelia rakudo-moar 4a2929: OUTPUT«5===SORRY!5=== Error while compiling /tmp/ON6L3MG2vY␤Error while importing from 'Test': no such tag 'foo'␤at /tmp/ON6L3MG2vY:1␤------> 3use Test [foo => 'bar', 42]7⏏5<EOL>␤»
psch not sure how we do that in moar though. in nqp-j i'd put a try/catch... :)
ZoffixW No easy way to pass a list of Pair|Str into sub EXPORT, is there?
15:56 wamba joined
ZoffixW m: use Test @(foo => 'bar', 42) 15:57
camelia rakudo-moar 4a2929: OUTPUT«===SORRY!===␤Cannot invoke this object (REPR: Null; VMNull)␤»
ZoffixW :(
15:57 ssotka joined
nine m: use Test ("foo" => 'bar', 42) 15:58
camelia rakudo-moar 4a2929: OUTPUT«5===SORRY!5=== Error while compiling /tmp/NViUsnsn6g␤Error while importing from 'Test': no such tag 'foo'␤at /tmp/NViUsnsn6g:1␤------> 3use Test ("foo" => 'bar', 42)7⏏5<EOL>␤»
16:01 inokenty left
ZoffixW m: use Test [[[42, "foo" => 'bar']]] 16:01
camelia rakudo-moar 4a2929: OUTPUT«5===SORRY!5=== Error while compiling /tmp/P8gJS1_7xO␤Error while importing from 'Test': no such tag 'foo'␤at /tmp/P8gJS1_7xO:1␤------> 3use Test [[[42, "foo" => 'bar']]]7⏏5<EOL>␤»
ZoffixW ~_~
m: use Test 42, ['foo' => 'bar'] 16:02
camelia rakudo-moar 4a2929: OUTPUT«5===SORRY!5=== Error while compiling /tmp/nWa4aFG0rj␤Error while importing from 'Test':␤no EXPORT sub, but you provided positional argument in the 'use' statement␤at /tmp/nWa4aFG0rj:1␤------> 3use Test 42, ['foo' => 'bar']7⏏5<EOL>␤»
ZoffixW Well... this isn't too too bad
16:03 Yary joined
ZoffixW or use Test 42, <foo bar> 16:04
Yary Is there a way to make a "private subclass" such that only the parent class can "see", instantiate an object of that subclass?
Xliff RabidGravy, are you working on some kind of Scheduler or Events Calendar?
(RFCs seem designed to hurt branes, tho)
psch m: class A { my class B { }; method getB { B.new } }; say A.getB.WHAT; try say A::B.new; say $!.perl 16:05
camelia rakudo-moar 4a2929: OUTPUT«(B)␤X::AdHoc.new(payload => "Could not find symbol '\&B'")␤»
psch Yary: ^^^ like that?
Yary perfect! Yes & I was just trying the same thing here :-)
16:05 domidumont joined
Yary scoping works 16:06
RabidGravy Xliff, yeah part of the requirement for Emitria6 (or whatever I end up calling it,) I already made Chronic to dip my toe in the water but need "every two weeks at the same wall-clock time" and friends 16:07
Xliff And what is Emitria6, again? =) 16:09
ZoffixW *sigh* this is royally annoying. Was going to write a quickie module, but struggling with damn arg passing to EXPORT
m: sub (*@args) { say @args.elems }( 42, <foo bar> )
camelia rakudo-moar 4a2929: OUTPUT«3␤»
ZoffixW ^ is there a way to make <foo bar> go in as one el and not be broken into two?
Xliff m: sub (*@args) { say @args.elems }( 42, [<foo bar>] )
camelia rakudo-moar 4a2929: OUTPUT«3␤»
psch m: sub (*@args) { say @args.elems }( 42, $(<foo bar>) )
Xliff Hrm.
camelia rakudo-moar 4a2929: OUTPUT«2␤»
RabidGravy Xliff, I plan to finish github.com/jonathanstowe/Emitria in P6 rather than 5
Xliff Ooh! Nice! 16:10
ZoffixW psch, is that a least ugly way? the "42, <foo bar>" is user-facing :/
psch ZoffixW: well, $<> doesn't work cause that's looking into $/
jnthn m: sub (**@args) { say @args.elems }( 42, <foo bar> ) 16:11
camelia rakudo-moar 4a2929: OUTPUT«2␤»
psch jnthn++
ZoffixW jnthn++
Xliff jnthn++
But...but.... **!
Where can I find docs on that?
psch doc.perl6.org/type/Signature#Slurpy...Parameters
Xliff \o/ 16:12
psch++
OK. I need to find a book for doctor visit. 16:13
\o
timotimo psch, um, not sure we want +"silly-unicode-numeral-here" to Just Work
psch timotimo: but it already does work?
timotimo it ... does?
psch timotimo: well, unless you mean in nqp of course
.u circled ten
yoleaux U+2469 CIRCLED NUMBER TEN [No] (⑩)
U+24FE DOUBLE CIRCLED NUMBER TEN [No] (⓾)
U+277F DINGBAT NEGATIVE CIRCLED NUMBER TEN [No] (❿)
psch m: say +"⑩" 16:14
camelia rakudo-moar 4a2929: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5⑩' (indicated by ⏏)␤ in block <unit> at /tmp/UDHu5B1g9b line 1␤␤Actually thrown at:␤ in block <unit> at /tmp/UDHu5B1g9b line 1␤␤»
psch ah, that one doesn't
the arabic did
.u arabic numeral one
yoleaux No characters found
psch m: say +"١"
camelia rakudo-moar 4a2929: OUTPUT«1␤»
timotimo :o
i did not know that
psch timotimo: i'd totally agree on circled ten or such
but that one seems fine
16:15 ptolemarch joined
Yary for funny number discussion, see www.nntp.perl.org/group/perl.perl6....36616.html 16:17
especially www.nntp.perl.org/group/perl.perl6....36618.html
timotimo that's about identifiers, not string content
identifiers and terms, that is 16:18
Yary well, once you numify a string... ok they are different
16:18 setty1 joined
Yary For the sake of consistency I'd expect "Nd" unicode to evaluate to the same number quoted or unquoted 16:19
ZoffixW m: "⑩" + 0
camelia rakudo-moar 4a2929: OUTPUT«WARNINGS for /tmp/5jJ6KTP9fb:␤Useless use of "+" in expression "\"⑩\" + 0" in sink context (line 1)␤Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5⑩' (indicated by ⏏)␤ in block <unit> at /tmp/5j…»
ZoffixW m: say "⑩" + 0
camelia rakudo-moar 4a2929: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5⑩' (indicated by ⏏)␤ in block <unit> at /tmp/zaVgbbXxcD line 1␤␤Actually thrown at:␤ in block <unit> at /tmp/zaVgbbXxcD line 1␤␤»
ZoffixW lizmat, I thought you made these work awhile back? ^ 16:20
Yary m: +"६೬𝟨"
camelia rakudo-moar 4a2929: OUTPUT«WARNINGS for /tmp/CpG1JF2Csx:␤Useless use of "+" in expression "+\"६೬𝟨\"" in sink context (line 1)␤»
Yary m: 0 +"६೬𝟨"
camelia rakudo-moar 4a2929: OUTPUT«WARNINGS for /tmp/HagNOv_Ldp:␤Useless use of "+" in expression "0 +\"६೬𝟨\"" in sink context (line 1)␤»
psch m: say +"६೬𝟨"
camelia rakudo-moar 4a2929: OUTPUT«666␤»
ZoffixW Yary, you need a say
16:20 gtodd left
Yary yup thx 16:20
ZoffixW .u half zero 16:21
yoleaux U+0F33 TIBETAN DIGIT HALF ZERO [No] (༳)
ZoffixW m: say +"༳"
camelia rakudo-moar 4a2929: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5༳' (indicated by ⏏)␤ in block <unit> at /tmp/f1n6lBcnp5 line 1␤␤Actually thrown at:␤ in block <unit> at /tmp/f1n6lBcnp5 line 1␤␤»
psch m: say ༳
camelia rakudo-moar 4a2929: OUTPUT«-0.5␤»
ZoffixW I think maybe the fix was abandoned due to fractions. There's an RT somewhere on this topic though
16:22 stmuk_ joined 16:24 stmuk left
ZoffixW m: sub (**@args where {(.all ~~ Str) or (.all ~~ List)}) { }( 'foo', <foo bar> ) 16:24
camelia rakudo-moar 4a2929: OUTPUT«Constraint type check failed for parameter '@args'␤ in sub at /tmp/pPF8WLQGNJ line 1␤ in block <unit> at /tmp/pPF8WLQGNJ line 1␤␤»
ZoffixW What is its problem now? ~_~
Oh 16:25
Never mind
16:26 cdg left
ZoffixW m: sub (**@args where {not .grep: {$_ !~~ Str|List} }) { }( 'foo', <foo bar> ) 16:26
camelia ( no output )
ZoffixW m: sub (**@args where {not .grep: {$_ !~~ Str|List} }) { }( 'foo', <foo bar>, 42 )
camelia rakudo-moar 4a2929: OUTPUT«Constraint type check failed for parameter '@args'␤ in sub at /tmp/gRIwxo2pM9 line 1␤ in block <unit> at /tmp/gRIwxo2pM9 line 1␤␤»
16:27 _mg_ left
psch m: sub (**@args where .none !~~ Str|List) { }( 'foo', <foo bar> ) 16:28
camelia ( no output )
psch m: sub (**@args where .none !~~ Str|List) { }( 'foo', <foo bar>, 42 )
camelia ( no output )
ZoffixW Smartmatch on two junctions
psch huh, does that do something other than i assumed?
m: say 1|2 ~~ Int|Str
camelia rakudo-moar 4a2929: OUTPUT«True␤»
psch m: say 1|2 ~~ Num|Str 16:29
camelia rakudo-moar 4a2929: OUTPUT«False␤»
psch m: say 1|"foo" ~~ Int|Str
camelia rakudo-moar 4a2929: OUTPUT«True␤»
ZoffixW m: say 4.4|4.4 ~~ Int|Str
camelia rakudo-moar 4a2929: OUTPUT«False␤»
ZoffixW hmm
m: say 4|4.4 ~~ Int|Str
camelia rakudo-moar 4a2929: OUTPUT«True␤»
psch m: say 1&2 ~~ Num|Str 16:30
camelia rakudo-moar 4a2929: OUTPUT«False␤»
psch m: say 1&2 ~~ Int|Str
camelia rakudo-moar 4a2929: OUTPUT«True␤»
timotimo doesn't smart match with junctions do "strange things"?
psch m: say 1&"foo" ~~ Int&Str
camelia rakudo-moar 4a2929: OUTPUT«False␤»
timotimo m: say <1> ~~ Int&Str
camelia rakudo-moar 4a2929: OUTPUT«True␤»
ZoffixW All I recall is a conversation that .all ~~ Int|Str wasn't working because of Junction ~~ Junction, but I don't recall more than that
psch i don't know, it looks ok from here. i rather assume i'm misunderstanding how .none and .any work together 16:31
timotimo m: say <1>&<foo> ~~ Int&Str
camelia rakudo-moar 4a2929: OUTPUT«False␤»
timotimo m: say <1>&<99> ~~ Int&Str
camelia rakudo-moar 4a2929: OUTPUT«True␤»
timotimo m: say <1>|<bbq> ~~ Int&Str
camelia rakudo-moar 4a2929: OUTPUT«True␤»
ZoffixW
.oO( I need to write about Junctions.... )
psch well, throwing IntStr on top of that doesn't make it easier to see through :S
timotimo hahaha
psch m: say ('foo', $(<foo bar>), 42).none !~~ Str|List 16:32
camelia rakudo-moar 4a2929: OUTPUT«True␤»
psch m: say ('foo', $(<foo bar>), 42).none !~~ Str
camelia rakudo-moar 4a2929: OUTPUT«True␤»
psch m: say ('foo', $(<foo bar>), 42).none !~~ Nil
camelia rakudo-moar 4a2929: OUTPUT«False␤»
psch m: say ('foo', $(<foo bar>), 42).none !~~ Int
camelia rakudo-moar 4a2929: OUTPUT«True␤»
psch that seems somewhat wrong 16:33
m: say (1, 2, 3).none ~~ * < 2
camelia rakudo-moar 4a2929: OUTPUT«{ ... }␤»
psch m: say (1, 2, 3).none ~~ { $_ < 2 }
camelia rakudo-moar 4a2929: OUTPUT«none(True, False, False)␤»
16:33 molaf joined
ZoffixW m: say (1, 2, 3).none.List 16:34
camelia rakudo-moar 4a2929: OUTPUT«none((1), (2), (3))␤»
ZoffixW m: say (1, 2, 3).none.List[0]
camelia rakudo-moar 4a2929: OUTPUT«none(1, 2, 3)␤»
timotimo when you ().none.List, it'll distribute the .List to all elements in the Junction 16:35
if you want to get the individual values out of a junction, you're Doing It Wrong™ and you should be using sets instead
ZoffixW Seems $juncA ~~ $juncB is similar to calling for $juncB.elems { $_ ~~ $juncA }, which in turn becomes $juncB.elems -> $outer { for $juncA.elems -> $inner { $outer ~~ $inner } }, 16:38
ZoffixW feels just more confusion was added right now :)
mst ZoffixW: eh? 16:39
ZoffixW mst, I thought I was the Canadian out of the two of us :P
timotimo don't call it .elems :)
ZoffixW Well, I see my int $elems = nqp::elems($states); in the sauce so :) 16:40
timotimo yeah, but "for 10 -> $outer { ... } doesn't give you a sensible result 16:41
ZoffixW Ah, right :) My bad
.each
Do we have .each?
timotimo we don't yet have that
the specs speculate its existence, though
but i imagine calling .each on a junction will give you a junction of each-junctions
ZoffixW m: say 'foo' ? 'bar' : 'ber'; 16:42
camelia rakudo-moar 4a2929: OUTPUT«5===SORRY!5=== Error while compiling /tmp/sapHdEN0fo␤Unsupported use of ? and : for the ternary conditional operator; in Perl 6 please use ?? and !!␤at /tmp/sapHdEN0fo:1␤------> 3say 'foo' ?7⏏5 'bar' : 'ber';␤»
ZoffixW Is this actually a fatal error?
Damn. My dream of creating a 'customary' ternary in Perl 6 has been crushed right when I was about to taste the sweetness of accomplishing it. 16:43
m: sub infix:<?> { $^a < $^b }; sub infix:<:> { $^a < $^b }; say 1 ? 'foo' : 'ber';
camelia rakudo-moar 4a2929: OUTPUT«5===SORRY!5=== Error while compiling /tmp/WGMQbRoXjF␤Unsupported use of ? and : for the ternary conditional operator; in Perl 6 please use ?? and !!␤at /tmp/WGMQbRoXjF:1␤------> 3 }; sub infix:<:> { $^a < $^b }; say 1 ?7⏏5 'foo' : 'ber';␤»
ZoffixW ^ that is broken in my book
And not only because it's preventing me to create a customary ternary :)... I don't think
psch ZoffixW: you can write a Slang to get around that 16:44
ZoffixW: but it's a hard parser rule
ZoffixW I don't know Slangs :(
psch which means you have to change the parser to allow it
Slang::Tuxic is fairly approachable i'd say
ZoffixW psch, by "hard" you mean difficult?
psch ZoffixW: no, i mean hard in the sense of fixed :)
ZoffixW Tuxic looks pretty scary 16:45
I guess not knowing grammars along with not knowing Slangs is a hindrance :P 16:46
psch well, yeah, you should know grammars to write a Slang
considering a Slang is a partial overwrite of Perl6::Grammar :S
ZoffixW Do we have any decent docs on them? Other than docs.perl6.org/language/grammars, which is super basic 16:47
psch the only thing i see missing there is proto regexes 16:48
timotimo and it's not a documentation on slangs :)
psch ah, no, that's actions down there...
ZoffixW: docs.perl6.org/type/Grammar has a bit more 16:49
ZoffixW Really? The Grammars I've seen seem miles more complex than what's described in that doc. Like wtf is .add_mystery here and $pos and $/.CURSOR stuff two lines above: github.com/FROGGS/p6-Slang-Tuxic/b...xic.pm#L23
timotimo hehe.
well, $/.CURSOR is just long for $¢ 16:50
does that help? :D
ZoffixW The last thing that code needs is adding mystery :P
psch ZoffixW: that's Perl6::Grammar internals that we unfortunately have to expose because no one has tuits or a plan for a good user-facing Slang interface
ZoffixW psch, are there docs for Perl6::Grammar internals?
psch ZoffixW: there's a few comments... :)
ZoffixW heh 16:51
ZoffixW will try to read that later
psch you'll probably also want to at least glance at nqp/HLL::Grammar
ZoffixW Thanks. Will do
psch but in general i found that --target=parse with a snippet that you want to understand and following the tokens through Perl6::Grammar is a good start
there's not many spots where that isn't enough - one of them is EXPR :P 16:52
ZoffixW m: sub infix:<?> { $^a < $^b }; say 1 ? 5 16:54
camelia rakudo-moar 4a2929: OUTPUT«5===SORRY!5=== Error while compiling /tmp/1HNIQNZ4WV␤Confused␤at /tmp/1HNIQNZ4WV:1␤------> 3sub infix:<?> { $^a < $^b }; say 17⏏5 ? 5␤ expecting any of:␤ infix␤ infix stopper␤ postfix␤ statement end…»
16:55 abraxxa left 16:56 dakkar left 16:57 zhmylove left
RabidGravy If anyone is into in making short examples then working through en.wikibooks.org/wiki/Computer_Sci...n_Patterns might be fun 17:03
17:05 aries_liuxueyang left 17:06 aries_liuxueyang joined 17:07 kanishka left 17:12 Yary left
ZoffixW m: sub infix:«xx» is assoc<left> { $^a - $^b }; sub infix:<xxx> is assoc<left> { $^a + $^b }; say 1 xx 5 xxx 6 17:14
camelia rakudo-moar 4a2929: OUTPUT«-10␤»
ZoffixW Shouldn't this produce 2 ?
17:14 firstdayonthejob joined
psch m: sub infix:«xxxx» { $^a - $^b }; sub infix:<xxx> { $^a + $^b }; say 1 xxxx 5 xxx 6 17:16
camelia rakudo-moar 4a2929: OUTPUT«2␤»
psch i guess you're stepping on the CORE xx somehow
ZoffixW Ah. thanks
ummm... 17:17
psch m: sub infix:«xxxx» is assoc<left> { $^a - $^b }; sub infix:<xxx> is assoc<left> { $^a + $^b }; say 1 xxxx 5 xxx 6
camelia rakudo-moar 4a2929: OUTPUT«2␤»
psch just to verify left is actually the default associativity :)
ZoffixW m: sub infix:«<» { say 'first'; $^a - $^b }; sub infix:<»> { say 'second'; $^a + $^b }; say 1 < 5 » 6
camelia rakudo-moar 4a2929: OUTPUT«second␤first␤-10␤»
ZoffixW Is this now because I'm stepping on core '<' ?
psch i'd assume so, yeah 17:18
ZoffixW That has the aroma of a nice, juicy bug stew
psch m: sub infix:«<» is looser(&infix:«<») { say 'first'; $^a - $^b }; say 1 < 2 < 3 17:19
camelia rakudo-moar 4a2929: OUTPUT«5===SORRY!5=== Error while compiling /tmp/ShXEns1VME␤Routine given to looser does not appear to be an operator␤at /tmp/ShXEns1VME:1␤»
ZoffixW wat
psch m: sub infix:«<» is looser('&infix:«<»') { say 'first'; $^a - $^b }; say 1 < 2 < 3 17:20
camelia rakudo-moar 4a2929: OUTPUT«5===SORRY!5=== Error while compiling /tmp/fOyQ76h9zM␤Can't use unknown trait 'is looser' in a sub declaration.␤at /tmp/fOyQ76h9zM:1␤ expecting any of:␤ rw raw hidden-from-backtrace hidden-from-USAGE␤ pure default DEPRECATED i…»
ZoffixW 0.0
m: sub prefix:<∑> (*@els) is looser(&infix:<,>) { @els.sum }; say ∑ 1, 2, 3, 4;
camelia rakudo-moar 4a2929: OUTPUT«10␤»
psch m: sub infix:«<»($a, $b) is tighter('&infix:«<»') { say 'first'; $a - $b }; say 1 < 2 < 3 17:21
camelia rakudo-moar 4a2929: OUTPUT«5===SORRY!5=== Error while compiling /tmp/HiEWTCAvLR␤Can't use unknown trait 'is tighter' in a sub declaration.␤at /tmp/HiEWTCAvLR:1␤ expecting any of:␤ rw raw hidden-from-backtrace hidden-from-USAGE␤ pure default DEPRECATED …»
timotimo ZoffixW: the error is b0rked. it complains because there's no match with a String
psch m: sub infix:«<»($a, $b) is tighter(&infix:«<») { say 'first'; $a - $b }; say 1 < 2 < 3
camelia rakudo-moar 4a2929: OUTPUT«5===SORRY!5=== Error while compiling /tmp/8tRUVeoPLO␤Routine given to tighter does not appear to be an operator␤at /tmp/8tRUVeoPLO:1␤»
ZoffixW m: sub prefix:«∑» (*@els) is looser(&infix:<,>) { @els.sum }; say ∑ 1, 2, 3, 4;
camelia rakudo-moar 4a2929: OUTPUT«10␤»
psch multi sub trait_mod:<is>(Routine $r, Str :$looser!) {
ZoffixW timotimo, where in Junction stuff?
psch is the decl in operators.pm
timotimo uh? 17:22
no, "is looser" i mean
oh, huh?
that's weird.
anyway, AFK
psch :D
m: sub infix:«<»($a, $b) is tighter(&infix:«>») { say 'first'; $a - $b }; say 1 < 2 < 3
camelia rakudo-moar 4a2929: OUTPUT«5===SORRY!5=== Error while compiling /tmp/3z1w46v0ZM␤Routine given to tighter does not appear to be an operator␤at /tmp/3z1w46v0ZM:1␤»
psch well, yeah, weird :) 17:23
ZoffixW m: sub infix:«<»($a, $b) is equiv(&infix:«>») { say 'first'; $a - $b }; say 1 < 2 < 3
camelia rakudo-moar 4a2929: OUTPUT«5===SORRY!5=== Error while compiling /tmp/9q4AFR9W6w␤Routine given to equiv does not appear to be an operator␤at /tmp/9q4AFR9W6w:1␤»
psch i mean, i won't deny that i'm trying for weird... :P
ZoffixW m: multi sub infix:«+»($a, $b) is equiv(&infix:«+») { say 'first'; $a - $b }; say 1 < 2 < 3
camelia rakudo-moar 4a2929: OUTPUT«True␤»
ZoffixW m: multi sub infix:«<»($a, $b) is equiv(&infix:«<») { say 'first'; $a - $b }; say 1 < 2 < 3
camelia rakudo-moar 4a2929: OUTPUT«5===SORRY!5=== Error while compiling /tmp/_yBrqTOJyd␤Routine given to equiv does not appear to be an operator␤at /tmp/_yBrqTOJyd:1␤»
psch m: multi sub infix:«+»($a, $b) is tigher(&infix:«+») { say 'first'; $a - $b }; say 1 + 1 + 1
camelia rakudo-moar 4a2929: OUTPUT«5===SORRY!5=== Error while compiling /tmp/S06MGyzxgz␤Can't use unknown trait 'is tigher' in a sub declaration.␤at /tmp/S06MGyzxgz:1␤ expecting any of:␤ rw raw hidden-from-backtrace hidden-from-USAGE␤ pure default DEPRECATED i…»
psch m: multi sub infix:«+»($a, $b) is tighter(&infix:«+») { say 'first'; $a - $b }; say 1 + 1 + 1
camelia rakudo-moar 4a2929: OUTPUT«3␤»
psch m: sub infix:«+»($a, $b) is tighter(&infix:«+») { say 'first'; $a - $b }; say 1 + 1 + 1 17:24
camelia rakudo-moar 4a2929: OUTPUT«first␤first␤-1␤»
geekosaur didn't we determine that the infix:mumble syntax was oddly specific sometimes?
psch oh duh
geekosaur have to dig in the source to see exactly how infix > was declared
psch yeah, the looser and tigher implementations only check for foofix:<...>
not with the fancy french ones
so yeah, of course we don't find < and >
ZoffixW So it's impossibru?
geekosaur yug
psch ZoffixW: well, it has to be fixed, actually :) 17:25
geekosaur well, someone could fix looser and tighter traits
ZoffixW pfftt... some language you got here. I was promised unbound power and riches but I can't even redefine what < does!!
psch m: say &infix:('<')
camelia rakudo-moar 4a2929: OUTPUT«5===SORRY!5=== Error while compiling /tmp/BSd8fi_bm1␤You can't adverb ␤at /tmp/BSd8fi_bm1:1␤------> 3say &infix:('<')7⏏5<EOL>␤»
ZoffixW shakes fist
psch m: say &infix:['<']
camelia rakudo-moar 4a2929: OUTPUT«sub infix:«<» (Mu $?, Mu $?) { #`(Sub+{<anon|50686624>}|63800176) ... }␤»
psch i guess that's the safest form we have
m: say &postcircumfix:['[', ']']
camelia rakudo-moar 4a2929: OUTPUT«sub postcircumfix:<[ ]> (| is raw) { #`(Sub+{<anon|50686896>}+{Precedence}+{<anon|50686896>}|51738848) ... }␤»
psch buuuut 17:26
runtime lookup
so eh
that means we have to somehow lift the current compile time code that makes the different foofix:... thingies work into runtime
which is a bit harder than fixing tighter and looser :/
probably mostly in World.canonicalize_pair, if someone feels up for that 17:29
i have to get myself dinner :S
17:29 nowan left 17:30 jack_rabbit joined, azawawi joined
azawawi . 17:30
jnthn I suspect the issue may be that add_categorical in the grammar bails out immediately if it finds we already have the op, whereas it perhaps should check if there's a new prec/assoc defined and still go ahead and do the grammar tweak if so.
psch: ^^
So it's hopefully "just" a fix there 17:31
azawawi Can this CPU run Perl 6 ark.intel.com/products/94456/Intel-...o-3_50-GHz ? :)
17:31 sno left
azawawi drooling 17:31
psch jnthn: how would that help with the runtime lookup confusion with different colonpairs for foofix declarations?
m: say ::(q{&infix:['==']}) 17:32
camelia rakudo-moar 4a2929: OUTPUT«No such symbol '&infix:['==']'␤ in block <unit> at /tmp/msXpTZEZUa line 1␤␤Actually thrown at:␤ in block <unit> at /tmp/msXpTZEZUa line 1␤␤»
psch m: say &infix:['==']
camelia rakudo-moar 4a2929: OUTPUT«sub infix:<==> (Mu $?, Mu $?) { #`(Sub+{<anon|50686624>}+{Precedence}|43371392) ... }␤»
17:32 nowan joined
jnthn psch: Oh, that's separate. I was looking at the sub infix:«<»($a, $b) is tighter(...) case :) 17:33
Or rather, that's the one I noticed :)
ZoffixW azawawi, they have a better one: www.pcworld.com/article/3050466/har...-boom.html
psch jnthn: that's the same issue, actually. the Str candidates for tighter and looser use ::() to find the op 17:34
ZoffixW azawawi, and I did run P6 on a 20-core box... minute and a half spectest is nice :)
azawawi ZoffixW: cool :)
psch jnthn: well, with the Str candidates for tighter and looser it's the same issue, at least... :)
17:34 |meta is now known as |2701
azawawi ZoffixW: most likely im buying this though i7-6800K ark.intel.com/products/94189/Intel-...o-3_60-GHz 17:35
ZoffixW: ditching AMD FX 8150 and going for Intel :)
ZoffixW nice nice 17:36
azawawi ZoffixW: a 2nd gen i5 is faster than my AMD single thread :( 17:37
jnthn psch: We have...Str candidates for tighter and looser?!
Why? :)
ZoffixW Damn, the 10-core one is actually buyable :S www.tigerdirect.ca/applications/cat...490_125490
Now all I need is a small loan of a million dollars.
azawawi ZoffixW: Got "Notice: Order Verification Required" :) 17:38
ZoffixW heh
psch jnthn: no idea why, but it's been about 3/4th of a year, since b670517 17:39
m: sub infix:<~.~> is tighter<+> { }
camelia ( no output )
psch ^^^ that form apparently
ZoffixW They even got a 14-core one, for $3,392: www.tigerdirect.ca/applications/Sea...CatId=8732
jnthn Ugh 17:40
17:41 ZoffixW left
nine azawawi: faster at what exactly? AFAIK the AMD FX have superior integer performance and are leading in compilation benchmarks. 17:43
azawawi nine: cpuboss.com/cpus/Intel-Core-i7-2600...MD-FX-8150 # single core performance 17:44
nine: same cpuboss.com/cpus/Intel-Core-i5-2500...MD-FX-8150 17:45
azawawi goes back to GTK::Scintilla 17:46
stmuk_ umm that's 2nd gen Intel .. I think we are on 6th now 17:52
17:55 zhmylove joined 18:00 zhmylove left
nine stmuk_: it's also a 5 year old AMD CPU 18:04
18:05 inokenty joined 18:06 zhmylove joined 18:07 _nadim joined, spider-mario joined 18:10 nadim left, edehont joined, spider-mario left 18:11 spider-mario joined 18:16 sjn left
RabidGravy fixes the tests for DateTime::Timezone 18:19
18:19 Akagi201 joined
dalek c: bd2191e | (Jan-Olof Hendig)++ | doc/Language/5to6-perlfunc.pod:
Fixed broken link
18:22
18:23 nadim joined 18:25 isBEKaml joined, _nadim left, Akagi201 left 18:27 _nadim joined 18:29 nadim left, nadim joined 18:32 _nadim left 18:35 _nadim joined 18:36 zakharyas joined 18:38 nadim left 18:40 autarch joined 18:43 dha joined 18:44 nadim joined 18:45 jack_rabbit left 18:47 _nadim left 18:48 _nadim joined
dalek c: e6972f2 | (Jan-Olof Hendig)++ | doc/Type/X/DateTime/TimezoneClash.pod:
Added docs for X::DateTime::TimezoneClash
18:48
18:49 nadim left
RabidGravy there 18:53
18:54 vendethiel joined
vendethiel o/ #perl6 18:55
18:56 zakharyas left 18:57 isBEKaml left, labster joined 18:59 azawawi left
RabidGravy harr! 18:59
18:59 sno joined
dalek c: 9953a9c | (Jan-Olof Hendig)++ | doc/Type/DateTime.pod:
Fixed typo
19:03
19:07 gnull left 19:08 gnull joined 19:10 nadim joined, daxim left 19:12 lizmat_ joined 19:13 _nadim left, lizmat left 19:16 nadim left, firstdayonthejob left, nadim joined 19:17 darutoko left, firstdayonthejob joined 19:18 _nadim joined 19:22 nadim left 19:23 Actualeyes left 19:24 nadim joined, domidumont left
dalek c/makefile: 2d1a54f | coke++ | htmlify.p6:
git has files in this dir, no need to mkdir
19:26
19:26 _nadim left 19:30 nadim left 19:32 nadim joined 19:33 nadim left 19:36 nadim joined 19:37 kaare__ left, nadim left 19:38 nadim joined 19:42 ptolemarch left 19:44 gtodd joined 19:45 _nadim joined 19:46 nadim left
gtodd camelia: we should be able to vote on the best snippets of the day / week / something can you save the snippets and then we send you ++'s 19:46
camelia: I know you are a bot ... but you're a perl6 bot so ...
19:47 ZoffixW joined
ZoffixW She's not a Perl 6 bot tho :P 19:47
gtodd maybe one camelia and yoleaux go for coffee ... they're looking for thing to do ...
oh right I mean #perl6 :)
ZoffixW Aah :) 19:48
gtodd meant
ZoffixW huggable, hug camelia
huggable hugs camelia
ZoffixW sees a romance spark
gtodd maybe camelia and yoleaux should go for coffee ... look for something to do together 19:49
ZoffixW yoleaux, source 19:50
yoleaux, help
19:50 ZoffixW left
gtodd yoleaux: vote ? 19:50
19:52 _nadim left 19:53 cdg joined, cdg left, cdg joined 19:54 TEttinger joined 19:58 pierrot joined 19:59 ptolemarch joined 20:01 girafe joined, rindolf left
[Coke] hoelzro: the first bit to pick out for ||izing on perl6-doc is the type graphs... and that's not trivial. Guessing we'll have to make a config step to generate the dependency relationship, and then render that as makefile rules -and- as perl6 code for later use. 20:03
hoelzro eesh, I didn't think of that 20:05
20:06 mr-foobar joined
[Coke] it's doable. i was just hoping for a quick thing I could carve out. :) 20:06
20:06 ufobat left
[Coke] I have a "perl6 Configure.p6" step already on the makefile branch (a trivial one), will keep hacking. 20:07
hoelzro [Coke]++ # godspeed
20:12 colomon left
teatime m; $two = "a\c[COMBINING ACUTE ACCENT]"; say $two.codes; 20:13
m: $two = "a\c[COMBINING ACUTE ACCENT]"; say $two.codes;
camelia rakudo-moar 4a2929: OUTPUT«5===SORRY!5=== Error while compiling /tmp/QMJlPwqVC5␤Variable '$two' is not declared␤at /tmp/QMJlPwqVC5:1␤------> 3<BOL>7⏏5$two = "a\c[COMBINING ACUTE ACCENT]"; sa␤»
teatime m: my $two = "a\c[COMBINING ACUTE ACCENT]"; say $two.codes;
camelia rakudo-moar 4a2929: OUTPUT«1␤»
20:14 edehont left
[Coke] teatime: you're too late. by the time the string is constructed, it's combined. 20:16
20:20 huf left, huf_ joined
jnthn m: my $two = "a\c[COMBINING ACUTE ACCENT]"; say $two.NFD.codes; # have to force NFD if you want 2 20:21
camelia rakudo-moar 4a2929: OUTPUT«2␤»
20:21 yqt joined
teatime so, do strings not remember their original byte representation 20:22
jnthn No 20:23
'cus strings are for representing Unicode text, not a bunch of bytes :) 20:24
teatime sure
I had thought TimToady told me that input would not be coerced before output unless done explicitly
I must have misunderstood
I would think of "a\c[COMBINING ACUTE ACCENT]" and "\c[LATIN SMALL LETTER A WITH ACUTE]" as two valid, distinct unicode strings. and each would have its byte representation for the specific encoding, utf8 or whatever. 20:27
treating them as truly equivalent is another step (NFG, I guess) after the unicode/bytes distinction 20:28
20:30 edehont joined, cpage_ left 20:31 JackLearn2 joined, JackLearn2 left, cdg left
teatime I should have asked, do strings not remember their original .codes/.univalss representation 20:32
perlpilot teatime: That seems like a weird concept to me. Do numbers remember their "original representation"? 20:34
20:36 edehont left
teatime I guess I thought, that a String is a list of codepoints, ultimately. 20:36
I did not realize that the conveniences of NFG were inherient to the Str type 20:37
perlpilot Sounds like too much computer-think and not enough human-think ;)
teatime I'm not so sure 20:38
timotimo what teatime means is normalization, i'd expect
NFG comes after NFC, so all strings you get in rakudo are NFG-normalized plus a little bit extra 20:39
teatime I thought Str was ultimately a list of Unicode codepoints, not NFG codepoints/values
hoelzro I would say it's a list of graphemes
NFG is post-codepoint 20:40
teatime and I thought that operations like .chars that make use of NFG were just implemented on-top-of a still-existing list-of-unicode-codepoints representation.
hoelzro afaik, MoarVM strings are lists of graphemes 20:42
timotimo yeah, we give O(1) access to graphemes by their index
teatime ok. so I definitely have to use a lot more blobs/bufs now
timotimo that's what NFG is all about
you can also use Uni objects
teatime well, isn't that on-point 20:43
20:45 jimlenz joined, setty1 left 20:50 Zoffix left 20:53 dolmen joined
dogbert17 the class Date contains a method daycount, which calculates the number of days since Nov. 17, 1858. What's the story behind that? 20:57
vendethiel nine: did you actually talk with the "goto label between languages" guy? :P (btw, very nice talk) 20:58
grondilu en.wikipedia.org/wiki/Julian_day
dogbert17 grondilu: thx, seems to be used by astronomers 21:00
21:10 skids left 21:13 cpage_ joined 21:28 dha left 21:37 cdg joined 21:42 girafe left 21:52 lizmat_ is now known as lizmat 22:06 jimlenz left 22:08 cfloare left 22:11 jdv79 left 22:12 cgfbee left 22:15 jdv79 joined, Sgeo joined 22:19 spider-mario left, skids joined 22:21 |2701 left 22:28 dolmen left 22:33 stevieb joined
stevieb hey all! 22:33
22:36 RabidGravy left
stevieb I finally figured out (a convoluted, perl6-inexperienced) way to capture a files line endings, and write out a file using the saved EOLs regardless of platform... perlmonks.org/?node_id=1164685 22:36
22:37 anomie__ joined
timotimo that's really the most complicated way i've ever seen to compare a number to two possible numbers 22:38
.unpack("H*") should be the same - at least when run on a single byte, which is the case with read(1) - as .base(16) 22:39
and using $hex eq '0d' | '0a' should give you about 10000x the performance of the regex solution 22:40
stevieb I was just messing around. I didn't really care at the end what it looked like. I've given up on it now that I know an approach, and have gone back to studying the docs
timotimo but it's even easier to not use strings at all and just compare the number to be == 0x0d | 0x0a
heh, ok
stevieb ahhh, ok, I like that == 0x0d | 0x0a... I tried variations on that, but obviously not one that worked at the time. Thanks! 22:41
timotimo :) 22:42
it'd have to be $buf[0] of course
otherwise == will numify the buffer, which is equivalent to counting how many elements it has
and you know that it only has one element on every iteration, so the comparison against any number but 1 will always fail 22:43
stevieb I haven't got to the Buf docs quite yet, but that makes sense. I've been spending the day reading the docs from the beginning, letting each doc guide me to the next, and testing/ingraining what I'm learning. There are a lot of semantics I really like. Hyper operator, feeds etc. I also am liking the class setup from what I've played with so far 22:44
timotimo yup, classes are really quite powerful in perl6 22:45
stevieb I like the true separation of private attr/methods vs public ones.
unlike Moose, where all attrs create a public accessor
timotimo i can't speak to that, as i've never done any p5 programming 22:47
22:49 bjz_ left
stevieb gotcha. I've only ever touched Moose when providing patches/PRs. In my own projects, I've never used it (just used the built-in OO). Perl6 is a lot like Python (which is what I get paid to write in). Some things better so far, some not so much. 22:49
22:50 jack_rabbit joined
timotimo i always thought the big thing about python's OO is that you can basically assign to any name on your objects 22:54
whereas in perl6 you'll always declare your attribute up front
though you can design objects that behave like the python thing
22:57 firstdayonthejob left 22:59 cgfbee joined
stevieb yes, you can assign to any name on the object, and they become new attributes (but no accessor is created). 23:04
timotimo python doesn't use accessors for everything, though 23:05
stevieb nope
timotimo so that's not important, IMO 23:06
23:09 bjz joined
stevieb I like the pre-declared idea. In Python/Perl5, if someone adds a 'blah' attr to my object (breaking encapsulation), their code breaks if I decide to later add the same attr internally 23:11
timotimo you can use __slots__ in python
that gets around that problem
23:11 |2701 joined
timotimo in CPython that'll even give you a performance boost 23:11
(not on PyPy, because PyPy basically does that optimization for you for free)
did you know that pypy is absolutely fantastic and 100% amazing? 23:12
23:15 anomie__ left 23:16 pierre_ joined 23:17 _nadim joined 23:22 bjz left 23:29 mr-foobar left
arnsholt Yeah, PyPy is pretty damn cool 23:45
23:53 |2701 is now known as |meta, kurahaupo left 23:54 cdg left 23:58 pierre_ left