»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by moritz on 25 December 2014.
[Coke] lizmat;yes. adu: yes. 00:02
adu yeah, perl6-m $(which panda) works fine 00:03
00:17 adu left 00:18 BenGoldberg joined 00:23 KCL_ joined 00:32 adu joined
adu what's the recommended way to parse command-line arguments? 00:33
00:51 skids joined
japhb adu: Use the built-in command-line parsing based on signature introspection of MAIN 00:53
adu japhb: thanks! 00:55
how do I set default, optional and required parameters?
japhb (As an example, `bench` in github.com/japhb/perl6-bench uses this extensively. Details of implementation are in src/core/Main.pm in Rakudo.)
adu japhb: so MAIN (:$output = "-")? 00:56
japhb adu: multi sub MAIN($required, $defaulted = "foo", $optional?, :$option, :$required_option!, :$option-with-default = "bar") 00:57
adu :)
japhb Also, if you run the command with -? or --help, you will get auto-generated help text. You can put your own line of help after each variant using #| style doc comments above each multi sub MAIN. 00:58
adu that's super cool
japhb :-)
What's the IRC name that matches 'zhuomingliang' on GitHub? 01:05
[Coke] I never had adu's panda problem, btw. 01:07
adu [Coke]: I never had this problem until I upgraded to Yosemite 01:08
[Coke] ah. still on 10.9 here.
Ven adu: you might be interested in my advent blog post "the cool subset of main" :P (self-plug ftw) 01:10
japhb: JimmyZ I think
adu Ven: thanks
japhb Ven: thanks
01:11 dayangkun joined
adu oOo NonFile? 01:12
Ven adu: yes? 01:14
(might want to have that third eye checked out) 01:15
adu does perl6 have switch-case?
Ven adu: given / when does that 01:16
01:20 raiph left 01:21 spider-mario left 01:28 raiph joined 01:52 adu left 02:05 Ven left, Ven joined 02:06 adu joined 02:20 rmgk_ joined, rmgk is now known as Guest92087, Guest92087 left, rmgk_ is now known as rmgk 02:24 skids left 02:29 lue left 02:31 jack_rabbit joined
adu omg, I feel so stupid 02:36
I can't make a function
flussence sub foo { :) }
adu pastie.org/9805990
but when I do my $ast = C::Parser::parse("int x;"); 02:37
flussence ah, a *function* not a sub... yeah, that's harder.
adu huh?
why is it harder?
flussence just being silly, don't mind me... :)
adu it doesn't work 02:38
02:38 sirdancealot left
adu "Could not find symbol '&parse'" 02:38
flussence oh... hm. 02:39
adu do I need a public ... sub
?
flussence stick "is export" on it? (I don't think that'll help, sounds like something weird may be going on)
adu hmm
02:42 muixirt left
flussence if you rename sub parse to something that's not named "parse" exactly, does it work then? 02:43
adu flussence: nope 02:44
flussence okay, it's not weird symbol collisions at least. I vaguely recall having to avoid things like that in the past.
02:48 lue joined
flussence r: module P { sub parse($l) { $l } }; say P::parse(1); # golfed down a bit 02:48
+camelia rakudo-parrot 80b912: OUTPUT«Could not find symbol '&parse'␤ in method <anon> at gen/parrot/CORE.setting:13811␤ in any find_method_fallback at gen/parrot/Metamodel.nqp:2807␤ in any find_method at gen/parrot/Metamodel.nqp:989␤ in any at gen/parrot/BOOTSTRAP.nqp:1708␤ …»
..rakudo-moar 80b912: OUTPUT«Could not find symbol '&parse'␤ in method <anon> at src/gen/m-CORE.setting:13871␤ in any find_method_fallback at src/gen/m-Metamodel.nqp:2737␤ in any find_method at src/gen/m-Metamodel.nqp:988␤ in block <unit> at /tmp/tmpfile:1␤␤»
flussence well I'm staring at this and can't see what's wrong... so either you're not crazy or we both are :) 02:51
Ven r: module P { our sub parse($l) { $l } }; say P::parse(1); 02:55
+camelia rakudo-{parrot,moar} 80b912: OUTPUT«1␤»
Ven :)
flussence bah, I tried every scope thing I could think of *but* that... 02:56
adu I've never seen "our" in front of sub
r: module P { sub parse($l) is export { $l } }; say P::parse(1); 02:57
+camelia rakudo-parrot 80b912: OUTPUT«Could not find symbol '&parse'␤ in method <anon> at gen/parrot/CORE.setting:13811␤ in any find_method_fallback at gen/parrot/Metamodel.nqp:2807␤ in any find_method at gen/parrot/Metamodel.nqp:989␤ in any at gen/parrot/BOOTSTRAP.nqp:1708␤ …»
..rakudo-moar 80b912: OUTPUT«Could not find symbol '&parse'␤ in method <anon> at src/gen/m-CORE.setting:13871␤ in any find_method_fallback at src/gen/m-Metamodel.nqp:2737␤ in any find_method at src/gen/m-Metamodel.nqp:988␤ in block <unit> at /tmp/tmpfile:1␤␤»
adu r: module P { method parse($l) { $l } }; say P::parse(1);
+camelia rakudo-parrot 80b912: OUTPUT«Useless declaration of a has-scoped method in module (did you mean 'my method parse'?)␤Could not find symbol '&parse'␤ in method <anon> at gen/parrot/CORE.setting:13811␤ in any find_method_fallback at gen/parrot/Metamodel.nqp:2807␤ in any find…»
..rakudo-moar 80b912: OUTPUT«Useless declaration of a has-scoped method in multi (did you mean 'my method parse'?)␤Could not find symbol '&parse'␤ in method <anon> at src/gen/m-CORE.setting:13871␤ in any find_method_fallback at src/gen/m-Metamodel.nqp:2737␤ in any find_meth…»
flussence it feels like it should've worked to me, same as it would in Perl 5. 02:58
adu r: class P { method parse($l) { $l } }; say P::parse(1);
+camelia rakudo-parrot 80b912: OUTPUT«Could not find symbol '&parse'␤ in method <anon> at gen/parrot/CORE.setting:13811␤ in any find_method_fallback at gen/parrot/Metamodel.nqp:2807␤ in any find_method at gen/parrot/Metamodel.nqp:989␤ in any at gen/parrot/BOOTSTRAP.nqp:1708␤ …»
..rakudo-moar 80b912: OUTPUT«Could not find symbol '&parse'␤ in method <anon> at src/gen/m-CORE.setting:13871␤ in any find_method_fallback at src/gen/m-Metamodel.nqp:2737␤ in any find_method at src/gen/m-Metamodel.nqp:988␤ in block <unit> at /tmp/tmpfile:1␤␤»
adu r: class P { method parse($l) is export { $l } }; say P::parse(1); 02:59
+camelia rakudo-parrot 80b912: OUTPUT«Could not find symbol '&parse'␤ in method <anon> at gen/parrot/CORE.setting:13811␤ in any find_method_fallback at gen/parrot/Metamodel.nqp:2807␤ in any find_method at gen/parrot/Metamodel.nqp:989␤ in any at gen/parrot/BOOTSTRAP.nqp:1708␤ …»
..rakudo-moar 80b912: OUTPUT«Could not find symbol '&parse'␤ in method <anon> at src/gen/m-CORE.setting:13871␤ in any find_method_fallback at src/gen/m-Metamodel.nqp:2737␤ in any find_method at src/gen/m-Metamodel.nqp:988␤ in block <unit> at /tmp/tmpfile:1␤␤»
adu r: class P { our method parse($l) is export { $l } }; say P::parse(1);
+camelia rakudo-moar 80b912: OUTPUT«Too few positionals passed; expected 2 arguments but got 1␤ in method parse at /tmp/tmpfile:1␤ in block <unit> at /tmp/tmpfile:1␤␤»
..rakudo-parrot 80b912: OUTPUT«Type check failed in binding; expected 'P' but got 'Int'␤ in method parse at /tmp/tmpfile:1␤ in block <unit> at /tmp/tmpfile:1␤␤»
raydiak m: class P { our sub foo is export { say 42 }; method foo { foo }; }; P::foo; P.foo; import P; foo; # the 3 obvious options 03:09
+camelia rakudo-moar 80b912: OUTPUT«42␤42␤42␤»
avuserow m: class P { method parse($l) { $l } }; say P.parse(1); 03:10
+camelia rakudo-moar 80b912: OUTPUT«1␤»
03:10 romel left
avuserow adu: ^ 03:18
oh I guess raydiak++ already showed that option :)
adu oh 03:19
raydiak++
raydiak fwiw, the general trend in P6 has been towards the is export solution, unless your interface is OO anyway, in which case you'd probably use a class method...calling with fully-qualified package name w/:: is less common, because unlike P5, subs are not paackage vars by default, so it doesn't work unless the author explicitly thought to add "our" all over the place
:)
adu raydiak: thanks for the help, I never used perl5, so this is all new to me 03:26
my interest in perl6 is almost entirely the mouth-watering grammars :) 03:27
03:29 BenGoldberg left
raydiak ah, then yeah I'd go without the :: stuff unless you have a reason...just mark the sub as you pasted it with 'is export', and probably rename it to c-parse or something 03:29
and you're welcome of course 03:30
and from your users code that would look like 'use C::Parser; my $tree = c-parse(slurp "/usr/include/zmq.h");' 03:32
adu oh, I didn't know you didn't need the :: 03:33
raydiak yep, 'is export' in perl 6 means it gets aliased into the caller's namespace, so you don't worry about the package's name at all after the 'use' (which does 'import' too) 03:35
03:36 mr-foobar left 03:39 skids joined
adu I think I'll use the class/method version 03:39
03:44 noganex_ joined 03:46 ugexe left, ugexe_ joined 03:47 noganex left 03:49 PZt left 03:55 Ven left 04:03 leont left 04:12 raiph left
cbk1090 Is this how to remove a key from a hash... %aHash.delete($someKey); 04:14
04:14 raiph joined 04:17 adu left 04:25 adu joined 04:34 lue left
raydiak cbk1090: %aHash{$someKey}:delete; 04:40
cbk1090 raydiak, Thank you 04:41
04:43 lue joined
raydiak cbk1090: you're welcome 04:43
04:49 skids left
adu how would I represent an enum? 04:52
ah enum Bool <False True> 04:53
raydiak design.perl6.org/S12.html#Enumerations if you need to know more 04:54
04:55 sirdancealot joined 04:57 dayangkun left
adu I figured out the AST! 05:01
05:04 Alula left 05:06 kaare_ joined
raydiak sweet! 05:08
adu raydiak: my first test was on <ident> and instead of Match.new it says Identifier.new :) 05:13
raydiak adu: ah, the power... :) 05:14
adu lol
05:17 kaleem joined
raydiak coincidentally, I'm working in Math::Symbolic::Tree right now, starting to clean the project up and prepare to give it a real API very similar to what you're creating for C right now, but for math 05:17
05:19 telex left
adu raydiak: is it based on MathML/OpenMath? 05:19
raydiak: that's essentially what DROX is
raydiak adu: nah, I just wanted to write a math grammar, then wanted to make it useful for something, ended up with math::symbolic...it's pure perl 05:20
05:20 telex joined, xfix joined 05:21 kaleem left
raydiak adu: ah I see, looks like something I should learn...but no it just takes textual expressions for input...might be cool to give it the ability to read and write mathml 05:25
dinner
adu <3 MathML
not 1 or 2, just 3
because it wasn't until MathML3 that it became compatible with the 10-component OpenMath model 05:26
05:27 Rounin left 05:58 raiph left 06:05 mr-foobar joined
raydiak www.openmath.org/ seems down 06:16
06:18 mr-foobar left
adu webcache.googleusercontent.com/sear...&gl=us 06:21
JimmyZ raydiak: works here
adu not here
I'm also getting a wierd html response from something, but not openmath.org 06:22
raydiak: are you on IPv6? 06:23
+dalek c: 5a99b97 | (Konrad Borowski)++ | lib/Type/IO/Path.pod:
Fix method dir example in IO::Path

It now uses IO, instead of Str to prevent depreciation warnings.
Fixes #35.
06:25
06:25 dayangkun joined
xfix Argh, I was supposed to say path here, not Str. 06:25
Oh well.
06:26 dayangkun left
xfix (I like how in Fossil, you can change the commit description even after committing... you can do that in git as well, but it requires forced push that forks the repository) 06:26
adu raydiak: web.archive.org/web/20141219235328/...nmath.org/ 06:27
the web can never die
06:47 araujo joined 06:49 kaleem joined 07:05 __rnddim__ joined, lue left, __rnddim__ is now known as lue
raydiak hopes someone creaates a mathml p6 module some day 07:07
07:08 Mso150 joined 07:30 chenryn joined
raydiak g'night #perl6 07:39
07:48 Mso150 left 08:12 rindolf joined, rindolf left 08:15 darutoko joined 08:22 kjs_ joined 08:29 kjs_ left 08:30 avalenn joined 08:37 rindolf joined
adu raydiak: good idea 08:42
09:05 Akagi201 left 09:09 KCL joined 09:10 KCL_ left 09:15 sirdancealot left 09:43 kjs_ joined 09:50 kjs_ left 09:58 sqirrel__ joined 10:01 stux|RC-only joined 10:15 adu left 10:20 kjs_ joined 10:27 kjs_ left 10:28 Psyche^ joined 10:32 Patterner left 10:33 virtualsue joined 10:35 chenryn left 10:44 spider-mario joined 10:54 pmqs_ left 10:59 ilogger2 joined, ChanServ sets mode: +v ilogger2 11:03 chenryn joined 11:04 chenryn left 11:08 Ven joined 11:15 Ven left 11:18 sqirrel__ left 11:29 virtualsue left 11:39 Ven joined
moritz \o 11:50
11:52 rindolf left 11:53 virtualsue joined 11:58 kaleem left 12:10 isleofmax joined 12:11 zakharyas joined 12:15 xinming_ left 12:17 xinming joined 12:21 isleofmax left 12:23 KCL_ joined 12:26 KCL left 12:39 virtualsue left 12:46 sqirrel__ joined 12:51 rurban joined
Ven o/ #perl6 12:54
12:59 smls joined, darutoko- joined
smls o/ 12:59
My advent article won: i.imgur.com/OfKumKC.png :P 13:00
Technically because it was hackernews'ed, and not on its own merit, but whatever...
:)
13:00 darutoko left
smls :) 13:00
moritz smls++ 13:08
a few years back we had a day with more than 10k page views 13:09
that day it was on the slashdot front page, hackernews (which was much smaller back then), and Tim O'Reilly twittered about it
smls nice 13:10
moritz perl6advent.wordpress.com/wp-admin...2009-12-07
ah yes, that was our first year 13:11
13:13 sirdancealot joined 13:21 zakharyas left
timotimo i.imgur.com/A02GMnT.jpg - wat, that is pretty harsh 13:24
why are we still linking to raw.githubusercontent.com/mj41/Per...odData.png as "summary chart" when it's from march 2014? 13:28
moritz we shouldn't
13:33 yeahnoob joined 13:38 leont joined
xfix timotimo, I personally wouldn't call OOP bad. It's just that OOP by default is awful. 14:00
(and well, even with all fixes, object method call operator is still ugly ->)
I actually somewhat like Perl 5 OOP model, but I also realize it's quite strange. 14:01
It's flexible enough that there are libraries that make OOP easier.
14:02 zakharyas joined 14:16 yeahnoob|2 joined 14:17 yeahnoob|2 left 14:19 yeahnoob left, yeahnoob joined 14:23 kjs_ joined 14:24 raiph joined 14:33 LLamaRider joined 14:37 zakharyas left 14:46 pecastro left 14:48 estrabd joined 14:49 estrabd left 14:50 perlfan joined 14:51 gfldex joined, gfldex left, gfldex joined 15:03 sqirrel__ left 15:12 salv0 left 15:17 cibs left
Ven smls++ # curse, foiled again! 15:29
15:30 salv0 joined 15:33 Rounin joined 15:36 skids joined, telex left
moritz tadzik: ping 15:36
15:36 skids joined
moritz tadzik: ping 15:36
15:38 telex joined 15:50 Ven left 15:55 leont left 15:56 KCL_ left 16:00 mvuets joined, mr-foobar joined 16:04 zakharyas joined 16:05 Spot__ left 16:06 Spot__ joined, ggherdov left, Spot__ joined, lumimies left
b2gills Doe anybody know how to turn `subset Even of Int where * %% 2` into `class Even of Int { ... }` 16:07
16:07 lumimies joined
moritz b2gills: you can't 16:08
b2gills You mean you can't change the Meta Class?
moritz I mean you can't use inheritance to narrow down allowed values 16:09
b2gills I figured that much out 16:10
16:10 ggherdov joined
moritz so what do you want to achieve? 16:10
colomon are you asking for something which is not inheritance? (ie it's not class Even is Int, but "of"?) 16:11
b2gills I wanted to know how the subset keyword was short for something else
colomon it's short for saying "where * %% 2" over and over again
moritz m: subset Even of Int where * %% 2; say Even.HOW.^name 16:12
camelia rakudo-moar 80b912: OUTPUT«Perl6::Metamodel::SubsetHOW␤»
+camelia rakudo-moar 80b912: OUTPUT«Perl6::Metamodel::SubsetHOW␤»
b2gills Like `" $a "` being short for `qq" $a "` which is short for `Q:..." $a "`
moritz b2gills: it has its own meta class
b2gills I did that already
moritz b2gills: so it's not reducible to another construct, except in the sense that everything is Turing complete in here
16:12 itz_ is now known as itz
moritz b2gills: so it's not reducible to another construct, except in the sense that everything is Turing complete in here 16:12
b2gills Well at some level there is another way to do it ( that is probably compiler specific ) 16:13
I was just trying to think of how Perl 6 handles a lot of the syntactic constructs for the programmer 16:14
16:15 rindolf joined
b2gills ... perhaps creating a blog post, or a slide-show for others to read/use ( or series thereof ) 16:16
16:20 virtualsue joined
moritz b2gills: also feel free to write such docs for doc.perl6.org :-) 16:23
16:25 Ven joined
b2gills That my be too much internalized pressure for me to handle. ( It took me weeks to get up enough "courage" to overcome that "pressure" to even start writing the Pi post I wrote ) 16:29
I basically had to shut off my brain and just click the publish button to post it publicly 16:30
TimToady b2gills++ # growth action 16:31
b2gills Yeah I'm finally about at the point I should have been when Perl5 came out 16:32
16:33 Ven left
tadzik moritz: pong 16:37
16:38 LLamaRider left 16:39 xopatch left 16:40 zakharyas left
moritz tadzik: what would it take to install local (bundled) modules with panda, letting it figuring out the dependencies? 16:41
tadzik: I guess what I want to task, I can pass it a project.json file and a bunch of directories, and have panda install them in the correct order? 16:42
16:43 Rounin left 16:50 ggoebel111111117 joined
jdv79 how do i tell what openssl IO::Socket::SSL is using? 16:50
tadzik moritz: that's roughtly what bootstrap is doing
moritz tadzik: then I guess I'll study (and possibly extend) that a bit more 16:51
16:53 ggoebel111111116 left
TimToady If any of you get to 2015 before me, let me know whether Perl 6 is out yet. :) 16:57
moritz TimToady: I'm still in 2014, and I've spotted it in the wild! 16:58
m: role A { trusts Int } 17:00
17:00 xfix is now known as notfix
camelia rakudo-moar 80b912: OUTPUT«===SORRY!=== Error while compiling /tmp/4e5NIrjXbm␤Method 'add_trustee' not found for invocant of class 'Perl6::Metamodel::ParametricRoleHOW'␤at /tmp/4e5NIrjXbm:1␤------> ␤» 17:00
moritz m: role A { trusts Int }
should roles have trust?
+camelia rakudo-moar 80b912: OUTPUT«===SORRY!=== Error while compiling /tmp/4e5NIrjXbm␤Method 'add_trustee' not found for invocant of class 'Perl6::Metamodel::ParametricRoleHOW'␤at /tmp/4e5NIrjXbm:1␤------> ␤»
moritz should roles have trust?
dalek c: 16122bf | moritz++ | lib/Type/Metamodel/Trusting.pod:
Document Metamodel::Trusting
17:01
+dalek doc: 16122bf | moritz++ | lib/Type/Metamodel/Trusting.pod:
+dalek doc: Document Metamodel::Trusting
+dalek doc: review: github.com/perl6/doc/commit/16122bf322
17:02 notfix is now known as xfix, xfix is now known as ZoruaTrainer 17:03 ZoruaTrainer left 17:05 adu joined, Ven joined 17:13 njmurphy joined 17:14 Ven left 17:18 smls left 17:23 yeahnoob left, cibs joined, Ven joined 17:31 Ven left 17:40 zakharyas joined 17:46 virtualsue left
b2gills m: class LTA-FALLBACK { multi method FALLBACK ('not-called'){...} }; LTA-FALLBACK.method 17:50
camelia rakudo-moar 80b912: OUTPUT«Cannot call 'FALLBACK'; none of these signatures match:␤:(LTA-FALLBACK: Str $ where { ... }, *%_)␤ in any at src/gen/m-Metamodel.nqp:2638␤ in block <unit> at /tmp/X0_tGpObDo:1␤␤»
+camelia rakudo-moar 80b912: OUTPUT«Cannot call 'FALLBACK'; none of these signatures match:␤:(LTA-FALLBACK: Str $ where { ... }, *%_)␤ in any at src/gen/m-Metamodel.nqp:2638␤ in block <unit> at /tmp/X0_tGpObDo:1␤␤»
TimToady m: class LTA-FALLBACK { multi method FALLBACK ('not-called'){...} }; LTA-FALLBACK.not-called 17:54
camelia rakudo-moar 80b912: OUTPUT«Unhandled exception: Stub code executed␤ at <unknown>:1 (/home/camelia/rakudo-inst-1/languages/perl6/runtime/CORE.setting.moarvm:throw:4294967295)␤ from src/gen/m-CORE.setting:13875 (/home/camelia/rakudo-inst-1/languages/perl6/runtime/CORE.setting.…»
+camelia rakudo-moar 80b912: OUTPUT«Unhandled exception: Stub code executed␤ at <unknown>:1 (/home/camelia/rakudo-inst-1/languages/perl6/runtime/CORE.setting.moarvm:throw:4294967295)␤ from src/gen/m-CORE.setting:13875 (/home/camelia/rakudo-inst-1/languages/perl6/runtime/CORE.setting.…»
b2gills I just think the error could be improved to say that it couldn't find the method named `method` and none of the `FALLBACK` methods match 17:55
TimToady nod
17:56 sirdancealot left 17:58 LLamaRider joined 18:02 mr-foobar left, mr-foobar joined 18:15 LLamaRider left 18:16 rindolf left 18:18 kjs_ left
b2gills subset IntStr of Cool where Int|Str; # almost works like it's supposed to 18:18
m: subset IntStr of Cool where Int|Str; my IntStr $is; $is= 2; multi test(Int $){...}; multi test(Str $){...}; test($is)
camelia rakudo-moar 80b912: OUTPUT«===SORRY!===␤Cannot invoke null object␤»
+camelia rakudo-moar 80b912: OUTPUT«===SORRY!===␤Cannot invoke null object␤»
b2gills m: subset IntStr of Cool where Int|Str; my IntStr $is; $is= 2; multi test(IntStr $){...}; test($is) 18:19
camelia rakudo-moar 80b912: OUTPUT«Unhandled exception: Stub code executed␤ at <unknown>:1 (/home/camelia/rakudo-inst-1/languages/perl6/runtime/CORE.setting.moarvm:throw:4294967295)␤ from src/gen/m-CORE.setting:13875 (/home/camelia/rakudo-inst-1/languages/perl6/runtime/CORE.setting.…»
+camelia rakudo-moar 80b912: OUTPUT«Unhandled exception: Stub code executed␤ at <unknown>:1 (/home/camelia/rakudo-inst-1/languages/perl6/runtime/CORE.setting.moarvm:throw:4294967295)␤ from src/gen/m-CORE.setting:13875 (/home/camelia/rakudo-inst-1/languages/perl6/runtime/CORE.setting.…»
18:27 pmqs_ joined
timotimo merry change-of-year, everyone 18:36
TimToady b2gills: thing is, for IntStr you need storage for both an Int and a Str, and a subset won't give you that 18:40
well, unless you can convince the type system that something is derived from Int while actually (re)converting from Str 18:41
which just might work, but you'd have to shadow all the Int methods 18:42
b2gills So theoretically IntStr is Int does Stringy 18:43
TimToady niecza works it out so that it's multiple inheritance, but the Str bit is more distant
unfortunately rakudo's Int and Str types are not currently able to support "is Int is Str" without prodding 18:45
TimToady hasn't figured out how to prod them yet...
basically both types are acting kind of like natives, insofar as their storage is not composable 18:46
(under MI, anyway) 18:47
b2gills Well IntStr does run counter to most of the type system
TimToady it might be sufficient to support IntCool with a .Str override for most purposes 18:48
raydiak won't complete coercion support remove a bunch of the use cases for intstr?
TimToady but we still need to remember the original string somewhere
raydiak: no, we'll always have text that wants to be evaluated in terms of what it looks like 18:49
if not command line, in < 1 2.3 5i > or as the result of a prompt
b2gills m: <5e5> ne 5e5 18:50
18:50 spider-mario left
camelia ( no output ) 18:50
b2gills m: <5e5> ne 5e5
m: say <5e5> ne 5e5
+camelia ( no output )
camelia rakudo-moar 80b912: OUTPUT«True␤»
b2gills m: say <5e5> ne 5e5
+camelia rakudo-moar 80b912: OUTPUT«True␤»
TimToady n: say <5e5> ne 5e5 18:51
camelia niecza v24-109-g48a8de3: OUTPUT«(signal ABRT)Stacktrace:␤␤ at <unknown> <0xffffffff>␤ at (wrapper managed-to-native) object.__icall_wrapper_mono_gc_alloc_string (intptr,intptr,int) <0xffffffff>␤ at (wrapper alloc) object.AllocString (intptr,int) <0xffffffff>␤ at string…»
+camelia niecza v24-109-g48a8de3: OUTPUT«(signal ABRT)Stacktrace:␤␤ at <unknown> <0xffffffff>␤ at (wrapper managed-to-native) object.__icall_wrapper_mono_gc_alloc_string (intptr,intptr,int) <0xffffffff>␤ at (wrapper alloc) object.AllocString (intptr,int) <0xffffffff>␤ at string…»
TimToady wow
raydiak ah I see
b2gills It's almost like niecza is mostly abandoned
TimToady n: say <1/2> eq '1/2'
camelia niecza v24-109-g48a8de3: OUTPUT«(signal ABRT)Stacktrace:␤␤ at <unknown> <0xffffffff>␤ at (wrapper managed-to-native) object.__icall_wrapper_mono_gc_alloc_string (intptr,intptr,int) <0xffffffff>␤ at (wrapper alloc) object.AllocString (intptr,int) <0xffffffff>␤ at string…»
+camelia niecza v24-109-g48a8de3: OUTPUT«(signal ABRT)Stacktrace:␤␤ at <unknown> <0xffffffff>␤ at (wrapper managed-to-native) object.__icall_wrapper_mono_gc_alloc_string (intptr,intptr,int) <0xffffffff>␤ at (wrapper alloc) object.AllocString (intptr,int) <0xffffffff>␤ at string…»
TimToady n: say <1/2>.WHAT
camelia niecza v24-109-g48a8de3: OUTPUT«(signal ABRT)Stacktrace:␤␤ at <unknown> <0xffffffff>␤ at (wrapper managed-to-native) object.__icall_wrapper_mono_gc_alloc_string (intptr,intptr,int) <0xffffffff>␤ at (wrapper alloc) object.AllocString (intptr,int) <0xffffffff>␤ at string…»
+camelia niecza v24-109-g48a8de3: OUTPUT«(signal ABRT)Stacktrace:␤␤ at <unknown> <0xffffffff>␤ at (wrapper managed-to-native) object.__icall_wrapper_mono_gc_alloc_string (intptr,intptr,int) <0xffffffff>␤ at (wrapper alloc) object.AllocString (intptr,int) <0xffffffff>␤ at string…»
TimToady something broke in niecza 18:52
n: say < 1/2 >.WHAT
camelia niecza v24-109-g48a8de3: OUTPUT«(signal ABRT)Stacktrace:␤␤ at <unknown> <0xffffffff>␤ at (wrapper managed-to-native) object.__icall_wrapper_mono_gc_alloc_string (intptr,intptr,int) <0xffffffff>␤ at (wrapper alloc) object.AllocString (intptr,int) <0xffffffff>␤ at string…»
+camelia niecza v24-109-g48a8de3: OUTPUT«(signal ABRT)Stacktrace:␤␤ at <unknown> <0xffffffff>␤ at (wrapper managed-to-native) object.__icall_wrapper_mono_gc_alloc_string (intptr,intptr,int) <0xffffffff>␤ at (wrapper alloc) object.AllocString (intptr,int) <0xffffffff>␤ at string…»
b2gills n: say var('1/2').WHAT
camelia niecza v24-109-g48a8de3: OUTPUT«(signal ABRT)Stacktrace:␤␤ at <unknown> <0xffffffff>␤ at (wrapper managed-to-native) object.__icall_wrapper_mono_gc_alloc_string (intptr,intptr,int) <0xffffffff>␤ at (wrapper alloc) object.AllocString (intptr,int) <0xffffffff>␤ at string…»
+camelia niecza v24-109-g48a8de3: OUTPUT«(signal ABRT)Stacktrace:␤␤ at <unknown> <0xffffffff>␤ at (wrapper managed-to-native) object.__icall_wrapper_mono_gc_alloc_string (intptr,intptr,int) <0xffffffff>␤ at (wrapper alloc) object.AllocString (intptr,int) <0xffffffff>␤ at string…»
TimToady n: say 1/2
camelia niecza v24-109-g48a8de3: OUTPUT«(signal ABRT)Stacktrace:␤␤ at <unknown> <0xffffffff>␤ at (wrapper managed-to-native) object.__icall_wrapper_mono_gc_alloc_string (intptr,intptr,int) <0xffffffff>␤ at (wrapper alloc) object.AllocString (intptr,int) <0xffffffff>␤ at string…»
+camelia niecza v24-109-g48a8de3: OUTPUT«(signal ABRT)Stacktrace:␤␤ at <unknown> <0xffffffff>␤ at (wrapper managed-to-native) object.__icall_wrapper_mono_gc_alloc_string (intptr,intptr,int) <0xffffffff>␤ at (wrapper alloc) object.AllocString (intptr,int) <0xffffffff>␤ at string…»
b2gills n: say ''
TimToady something broke badly
camelia niecza v24-109-g48a8de3: OUTPUT«(signal ABRT)Stacktrace:␤␤ at <unknown> <0xffffffff>␤ at (wrapper managed-to-native) object.__icall_wrapper_mono_gc_alloc_string (intptr,intptr,int) <0xffffffff>␤ at (wrapper alloc) object.AllocString (intptr,int) <0xffffffff>␤ at string…»
+camelia niecza v24-109-g48a8de3: OUTPUT«(signal ABRT)Stacktrace:␤␤ at <unknown> <0xffffffff>␤ at (wrapper managed-to-native) object.__icall_wrapper_mono_gc_alloc_string (intptr,intptr,int) <0xffffffff>␤ at (wrapper alloc) object.AllocString (intptr,int) <0xffffffff>␤ at string…»
raydiak timotimo: and a happy new year to you as well, good sir 18:53
TimToady anyway, IntStr used to work in niecza...
19:08 Sir_Ragnarok left 19:10 raiph left, Sir_Ragnarok joined 19:36 perturbation joined 19:47 raiph joined
dalek atures: 10c1436 | timotimo++ | template.html:
the GoodData summary chart is quite a bit outdated by now.
19:49
+dalek features: 10c1436 | timotimo++ | template.html:
+dalek features: the GoodData summary chart is quite a bit outdated by now.
+dalek features: review: github.com/perl6/features/commit/10c1436b2c
19:52 BenGoldberg joined 19:59 zakharyas left 20:09 virtualsue joined 20:24 FROGGS_ joined 20:27 FROGGS[tab] left, FROGGS__ left
raydiak aw...new year's day is the 1-year anniversary of the last niecza commit 20:33
moritz :(
20:35 FROGGS[tab] joined
b2gills I would prefer it if there was at least 3 different implementations of Perl6, with at least one of them on 3 VMs 20:35
moritz too 20:36
but I'm not one to start a new implementation 20:37
raydiak looks at the synopses as an implementor might, and feels overwhelmed
moritz is scared of codegen
b2gills I would also prefer it if JavaScript wasn't the defacto web VM
moritz or the DOM the standard UI toolkit of the web 20:38
but changing that would be a major project larger than p6, and I prefer to stick with p6 for now :-)
TimToady too 20:40
b2gills This is one aspect were I wish Microsoft had been victorious ( you could write in vbscript on IE, and I think at one point with Perl if you downloaded ActivePerl from ActiveState ) 20:43
geekosaur vbscript was not an improvement over js... 20:45
20:53 darutoko- left 20:55 psch joined
raydiak has a special irrational hatred for JS and IE which stems from years spent trying to write large webapps as polyglots of the different browser dialects in pre-jquery days 20:55
psch hi #perl6 \o 20:56
raydiak o/ psch
b2gills geekosaur: It was an improvement the way Microsoft did it, which allowed other languages to use the same facility
psch o/ raydiak 20:58
b2gills m: multi test ( Cool $r as Rat ){ say $r.WHAT; nextsame }; multi test ( Rat $r ){ $r }; say test 5; # should this actually work? 21:03
camelia rakudo-moar 80b912: OUTPUT«(Rat)␤Nil␤»
+camelia rakudo-moar 80b912: OUTPUT«(Rat)␤Nil␤»
21:04 BenGoldberg left
psch m: sub f(|c (Cool $r as Rat)) { say c[0].WHAT; say $r.WHAT}; f 5 21:07
camelia rakudo-moar 80b912: OUTPUT«(Int)␤(Rat)␤»
+camelia rakudo-moar 80b912: OUTPUT«(Int)␤(Rat)␤»
psch b2gills: i'm not sure that's conclusive though. i'd assume nextwith uses the capture as-is, i.e. as in my example, not after spreading to parameters and their coercion 21:08
b2gills m: multi test ( Cool $r ){ callwith($r.Rat) }; multi test ( Rat $r ){ $r }; say test 5
camelia rakudo-moar 80b912: OUTPUT«Nil␤»
+camelia rakudo-moar 80b912: OUTPUT«Nil␤»
b2gills m: multi test ( Cool $r ){ test($r.Rat) }; multi test ( Rat $r ){ $r }; say test 5 21:09
camelia rakudo-moar 80b912: OUTPUT«5␤»
+camelia rakudo-moar 80b912: OUTPUT«5␤»
psch b2gills: i think it's that {call,next}{with,same} redispatches on the current dispatcher, and 5 is Cool but not Rat 21:10
m: class C { multi method f(Cool $r as Rat) { say "Cool \$ as Rat" }; multi method f(Rat $r) { say "Rat \$r" }; }; c.*f(5) 21:12
camelia rakudo-moar 80b912: OUTPUT«===SORRY!=== Error while compiling /tmp/kL_SXGkjhH␤Undeclared routine:␤ c used at line 1␤␤»
+camelia rakudo-moar 80b912: OUTPUT«===SORRY!=== Error while compiling /tmp/kL_SXGkjhH␤Undeclared routine:␤ c used at line 1␤␤»
psch m: class C { multi method f(Cool $r as Rat) { say "Cool \$ as Rat" }; multi method f(Rat $r) { say "Rat \$r" }; }; C.*f(5)
camelia rakudo-moar 80b912: OUTPUT«Cool $ as Rat␤»
+camelia rakudo-moar 80b912: OUTPUT«Cool $ as Rat␤»
psch m: class C { multi method f(Cool $r as Rat) { say "Cool \$ as Rat" }; multi method f(Rat $r) { say "Rat \$r" }; }; C.*f(5.0)
camelia rakudo-moar 80b912: OUTPUT«Rat $r␤» 21:13
+camelia rakudo-moar 80b912: OUTPUT«Rat $r␤»
psch m: Rat.^mro.say
camelia rakudo-moar 80b912: OUTPUT«(Rat) (Cool) (Any) (Mu)␤»
+camelia rakudo-moar 80b912: OUTPUT«(Rat) (Cool) (Any) (Mu)␤»
psch huh, i'd have expected that to call both. unless $c.*meth is NYI
21:15 colomon left 21:22 rurban left 21:33 pmurias joined, colomon joined
pmurias b2gills: the bad thing about multiple implementations is that is splits developers 21:34
b2gills That is true to some extent, but what about the people who start another project because they don't want to work on the current one 21:35
pmurias It's not always bad 21:37
but it might make sense to look into why they don't want to work on the current one 21:38
21:38 virtualsue left
colomon niecza was super-important as a proof-of-concept. 21:38
you youngsters ;) may not remember, but there was once a time when "everybody" knew that Perl 6 couldn't run on a VM like JVM or .NET. 21:39
Thus Parrot.
b2gills I was thinking of something I heard on "Linux Action Show" about the systemd devide
At the time it couldn't as easily be built on JVM 21:40
colomon Niecza was the first implementation to prove that running p6 on a VM other than Parrot was even possible; and that it generally could outperform Parrot. 21:41
b2gills As someone who started learning assembly before Perl, I did like that Parrot was more like the underlying hardware 21:42
21:42 Mso150 joined
colomon Oh, Parrot was a great idea. 21:44
b2gills Some great ideas turn out to be dumb ones 21:45
colomon … I don't know that that's fair to it.
But I'm very glad we have nqp running on MoarVM and JVM. 21:46
b2gills I didn't mean Parrot in particular, and I think Parrot was needed to get to here and now
Strings ending with a null byte was a great idea at the time, but is incredibly stupid now with Unicode 21:47
So at the time Parrot was the best way forward, and even with a time-machine still would be 21:48
( null terminated strings was directed at C and hardware ) 21:50
My feelings for Parrot is similar to my feelings for Neanderthals, at the time they were absolutely necessary, but there usefulness has waned over time. ( I actually hope Parrot can become as useful as Moar eventually ) 21:53
21:55 xfix joined, araujo left 21:56 araujo joined
b2gills It seems like `nextwith` et all doesn't work quite right in a multi where it is effectively super-type of the rest of the multis 22:06
It does work if it is a super-role though
22:07 alexghacker left
psch m: multi f(Cool $r) { say "Cool \$r"; nextsame }; multi f(Any $r) { say "Any \$r" }; f(5) 22:08
camelia rakudo-moar 80b912: OUTPUT«Cool $r␤Any $r␤»
+camelia rakudo-moar 80b912: OUTPUT«Cool $r␤Any $r␤»
b2gills Maybe its the roles that all of the Cool types do 22:09
psch note it's the narrower type that matches
Cool as Rat vs Rat is the wider type that matches
the dispatcher doesn't consider the narrower type, cause that doesn't match 22:10
22:11 kst` is now known as kst 22:14 colomon left
dalek ast: 7759c2d | util++ | / (10 files):
Fix typos.
22:14
+dalek roast: 7759c2d | util++ | / (10 files):
+dalek roast: Fix typos.
+dalek roast: review: github.com/perl6/roast/commit/7759c2d6de
22:16 Mso150 left
b2gills m: multi f ( Cool:D $f ){ nextwith $f.Rat }; multi f( Rational:D $r ){ $r }; say f 5 22:20
camelia rakudo-moar 80b912: OUTPUT«Nil␤»
+camelia rakudo-moar 80b912: OUTPUT«Nil␤»
b2gills m: multi f ( Cool:D $f ){ nextwith $f.Rat }; multi f(Any:D $a){ $a.WHAT }; multi f( Rational:D $r ){ $r }; say f 5
camelia rakudo-moar 80b912: OUTPUT«(Rat)␤»
+camelia rakudo-moar 80b912: OUTPUT«(Rat)␤»
b2gills I though that 'redispatch' would just try all of the options again, possibly calling the same one infinitely 22:21
psch it calls the next matching candidate 22:22
with or without returning, and with the same or new arguments
b2gills Then redispatch in S 12 should be switched with a different word or phrase 22:23
22:25 muraiki_ joined
psch S12:940 22:27
synopsebot Link: perlcabal.org/syn/S12.html#line_940
22:27 ruoso_ joined, sunnavy_ joined
psch key words "in the list" 22:27
although i do agree that the use of "redispatch" in the code block is misleading
pmurias b2gills: you think developement on Parrot will resume to the point when it get to the level MoarVM is right now? 22:28
s/when/where/
22:28 FROGGS__ joined 22:29 btyler_ joined, rhr joined, sivoais_ joined, petercom1and joined
raydiak m: multi test (Cool $r) { &::(&?ROUTINE.name)($r.Rat) }; multi test (Rat $r) { $r }; say test 5; # so is this the best/onlyish way to accomplish that, then? 22:29
camelia rakudo-moar 80b912: OUTPUT«5␤»
+camelia rakudo-moar 80b912: OUTPUT«5␤»
22:29 ugexe joined
b2gills No but one can hope 22:31
22:31 colomon joined
psch raydiak: i'd say so. i'm not sure someone with more insight into S12 might have a different perspective, but to me wanting to do that has a bit of a design smell with it 22:32
i'd find the other way around more sensible, i.e. from narrow to wider type, and that works with {next,call}{same,with}
22:32 MilkmanD1n joined
psch well, nextsame actually 22:32
22:34 FROGGS_ left, raiph left, pmqs_ left, Spot__ left, njmurphy left, ugexe_ left, mtj_- joined, integral left, Juerd left, lsm-desktop left, sunnavy left, ruoso left, btyler left, eternaleye left, sivoais left, petercommand left, mtj_ left, MilkmanDan left, skarn left, rhr_ left, njmurphy left, isacloud_ left, hobbified left, mtj_- joined 22:39 rurban joined, adu left
b2gills That means that you either have to put the commonest logic in the most basest variant, or start the dispatch over by using the name of the sub (in some form or another) 22:40
22:41 skarn joined
psch but that does make sense, doesn't it? having the most common logic in the dispatch candidate that matches most (or even all) use cases 22:44
b2gills It probably does most of the time, but not always. I was using it to allow all Cool types but have it dispatched on the numerator and denominator of a Rational ( without having to do `( Cool $ as Rational ( :$numerator, :denominator($) where 1 ) )` ) 22:47
22:48 hobbs joined, Juerd joined, hobbs left, hobbs joined 22:49 lsm-desktop joined, isacloud joined
psch b2gills: so your case is "match anything Cool, but if it's already a Rat do something special"? 22:49
22:49 njmurphy joined, eternaleye joined
b2gills No it's allow every Cool but turn it into a Rational and dispatch on the numerator and denominator. 22:50
22:50 Spot__ joined 22:52 integral joined, integral left, integral joined
b2gills I was creating a set of subs that turned a number into a mixed fraction the same way you would write it on paper 22:53
22:54 no_libsoup_for_y joined, xfix left
b2gills multi sub as-fraction ( Rational $ (:$numerator, :$denominator where $numerator < * ) ){ "$numerator/$denominator" } 22:55
multi as-fraction ( Rational:D $ ( :$numerator, :$denominator ) --> Str ){
Int($numerator / $denominator) ~ ' ' ~ abs($numerator) mod $denominator ~ '/' ~ $denominator
}
22:58 perturbation left
gfldex happy new perl6 year from germany :) 23:02
23:05 atta left
psch m: sub mixed-fract(Cool $in) { $in.floor ~ " " ~ ($in - $in.floor).Rat.nude.join("/") }; say mixed-fract 612/32 # b2gills 23:09
camelia rakudo-moar 80b912: OUTPUT«19 1/8␤»
+camelia rakudo-moar 80b912: OUTPUT«19 1/8␤»
psch that's how i'd do that 23:10
23:10 atta joined
psch plus a check if a non-integer portion actually exists, so you don't get the extra space 23:10
oh, although floor doesn't work for negative numbers i guess 23:13
that discussion came up recently :)
m: sub mixed-fract(Cool $in) { $in.floor ~ " " ~ ($in - $in.truncate).Rat.nude.join("/") }; say mixed-fract -612/32 # b2gills 23:14
camelia rakudo-moar 80b912: OUTPUT«-20 -1/8␤»
+camelia rakudo-moar 80b912: OUTPUT«-20 -1/8␤»
psch m: sub mixed-fract(Cool $in) { $in.truncate ~ " " ~ ($in - $in.truncate).Rat.nude.join("/") }; say mixed-fract -612/32 # b2gills
camelia rakudo-moar 80b912: OUTPUT«-19 -1/8␤»
+camelia rakudo-moar 80b912: OUTPUT«-19 -1/8␤»
psch hm, two minuses isn't right either :/
m: sub mixed-fract(Cool $in) { $in.truncate ~ " " ~ ($in - $in.truncate).Rat.abs.nude.join("/") }; say mixed-fract -612/32 23:17
camelia rakudo-moar 80b912: OUTPUT«-19 1/8␤»
+camelia rakudo-moar 80b912: OUTPUT«-19 1/8␤»
psch m: sub mixed-fract(Cool $in) { $in.truncate ~ " " ~ ($in - $in.truncate).Rat.abs.nude.join("/") }; say mixed-fract 0
camelia rakudo-moar 80b912: OUTPUT«0 0/1␤»
+camelia rakudo-moar 80b912: OUTPUT«0 0/1␤»
psch the " 0/1" is the wonky bit :P
the easiest way to solve that would be an Int candidate that just .Strs the input i think 23:25
oh, of course Cool is a bad param constraint... 23:26
m: multi mixed-fract(Int $in) { $in.Str }; multi mixed-fract(Rational $in) { $in.truncate ~ " " ~ ($in - $in.truncate).Rat.abs.nude.join("/") }; say mixed-fract 1/5 # 23:27
camelia rakudo-moar 80b912: OUTPUT«0 1/5␤»
+camelia rakudo-moar 80b912: OUTPUT«0 1/5␤»
23:28 xfix joined 23:39 adu joined
moritz happy new year everybody! 23:40
no_libsoup_for_y moritz: Happy new year
23:46 sirdancealot joined
bcode Year.new(:happy) 23:46
23:51 LLamaRider joined
adu bcode: that's cute 23:54
bcode I just *had* to think of it when seeing "new year" in here :) 23:55
23:57 telex left, pmurias left 23:58 telex joined, FROGGS__ left
moritz m: class Year is Date { }; say Year.new(:happy) 23:59
camelia rakudo-moar 80b912: OUTPUT«2015-12-24␤»
+camelia rakudo-moar 80b912: OUTPUT«2015-12-24␤»
moritz \o/