Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2015-02-20

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:00 * [Coke] submits a macport for moar.
00:02 timotimo TimToady: i'd want to do proper measurements first :)
00:02 grondilu I4ve just tried with SDL_RenderDrawPoints but could not make it to work.
00:03 TimToady what did you feed it?
00:03 grondilu a CArray[SDL_Point], but I may have failed to build it properly
00:04 grondilu https://gist.github.com/gro​ndilu/7e66deb134e630e561ee <= my attempt with SDL_RenderDrawPoints
00:06 timotimo how does it fare when you have an $points instead?
00:07 grondilu not sure what you mean
00:07 timotimo just change the sigil
00:07 grondilu oh
00:07 timotimo just a total shot in the dark
00:08 timotimo um, actually
00:08 timotimo SDL_RenderDrawPoints takes a third argument
00:08 timotimo with the number of points to draw
00:08 grondilu indeed, missed that.
00:09 timotimo you have too much faith in C :)
00:09 timotimo personally, i'd see if the CArray could be re-used, maybe even re-use the SDL_Point structures inside, too
00:10 grondilu I still get a black screen :/
00:11 timotimo update the gist please?
00:11 grondilu done
00:12 grondilu I just added a @points.elems
00:13 timotimo yo ushould also add the third parameter to the function signature up there
00:13 grondilu ahh
00:13 TimToady does a CArray auto-extend like that?
00:13 grondilu forgot that indeed
00:13 grondilu TimToady: that's how it's done in 05-arrays.t in zavolaj I think.
00:14 timotimo yes it does
00:14 TimToady seems like it'd be worthwhile pre-extending in any case
00:14 TimToady if you're going for performance
00:14 timotimo yeah
00:14 grondilu I can't know its size in advance (I only draw one color)
00:14 TimToady do them from the end the beginning, for instance
00:16 TimToady *to
00:16 TimToady or just set point at i and j first
00:17 TimToady oh, nevermind
00:17 TimToady I see it's just a list of random points
00:17 TimToady so roughly %50 are set
00:17 grondilu yes
00:18 TimToady if you reuse you'd have to set them all, but then you'd have to do something like that eventually if you double-buffer or so
00:19 grondilu on the other end, I can use the third argument to SDL_RenderDrawPoints, and always allocate the maximum size array.
00:20 * grondilu tries that
00:21 TimToady then maybe you could just go through and tweak the color of all the points, as timotimo++ suggested, and not realloc each time
00:22 grondilu oh $++ in the if is always 0
00:22 TimToady and maybe that could be done in a separate thread, as long as you don't care about sync
00:22 grondilu m: say "hi"
00:22 camelia rakudo-moar 114659: OUTPUT«hi␤»
00:23 grondilu m: for ^10 { if rand < .9 { say $++ } }
00:23 camelia rakudo-moar 114659: OUTPUT«0␤0␤0␤0␤0␤0␤0␤0␤0␤»
00:23 grondilu ^see?
00:23 TimToady yes, that block is recloned by the outer loop, so that's how it's supposed to behave
00:23 TimToady "state" only goes one level out
00:24 TimToady it's not "static"
00:24 grondilu indeed, just did not foresee it
00:25 TimToady it's easy to think of it as C's "static", I'll grant you
00:25 grondilu ouch:
00:25 grondilu No such method 'bind_pos' for invocant of type 'TypedCArray[SDL_Point]'
00:25 * grondilu updates the gist
00:27 grondilu it's here: my @points := CArray[SDL_Point];
00:27 grondilu @points[$++] := SDL_Point.new for 1 .. $w * $h;
00:27 timotimo TimToady: it's not actually drawing colored points; it clears the screen black and draws white points
00:27 grondilu yes
00:27 TimToady yes, but he was only drawing the black points, I think
00:27 timotimo oh, you already saw
00:27 TimToady and using clear to make white
00:28 grondilu I'm actually drawing white points, but you got the idea.
00:28 grondilu (and clearing in black)
00:28 timotimo %)
00:29 TimToady I would think that C semantics require = rather than :=
00:29 timotimo you can use as many threads as the user has cores to have a "ring buffer" of arrays of random points (and their sizes, of course)
00:30 TimToady or just two channels of buffers handed back and forth, used and re-randomized
00:31 timotimo or that, yeah
00:31 TimToady I see that Point is just a location without color.  is there a Pixel or so that carries the color as well, that you could modify in place?
00:31 grondilu if I don't use := I get 'Cannot modify an immutable TypedCArray[SDL_Point]'
00:32 grondilu TimToady: there is a pixel structure but its format is complicated.
00:33 grondilu I could not make it work anyway (it would have looked more like the C solution)
00:35 * TimToady wonders if you could declare the $!x and $!y as rw and then just randomize those...
00:36 grondilu randomizing the location would not exactly give the same thing.
00:36 TimToady the task doesn't say it has to be exactly 50% bw
00:36 timotimo TimToady: that's not doable yet, but it will be RealSoon™
00:36 timotimo because that's what jnthn is doing right now
00:37 grondilu TimToady: if you randomize the location you need to pick a number of white pixel to through in, that's kind of cheating.
00:38 grondilu well, not cheating, but "artificial" let's say.
00:38 timotimo if you randomize the location, you may end up with two pixels in the same position
00:38 TimToady doesn't specify that it has to come out to 50% white 50% black
00:38 grondilu it has to obey statistical laws, not arbitrary picks.
00:39 TimToady random is...random...
00:39 grondilu you can carefully pick your numbers to match the expected statistics, but that's artificial.
00:39 TimToady you put put up one random pixel per screen and it'd still be random :)
00:39 grondilu it's not the same kind of randomness.
00:40 TimToady IT DOESN'T SPEC THE STATISTICS!!!
00:40 grondilu it was implicit, imho.
00:40 TimToady if it's implicit, it's not there :)
00:41 TimToady and if it makes you feel better, you could use .pick instead of .roll
00:41 TimToady but that'd be slower
00:41 TimToady anyway, it's just an idea
00:42 grondilu well, before I'd get into that I'd first make SDL_RenderDrawPoints work.
00:43 grondilu (or rather I'd wait for someone to make it work)
00:44 TimToady anyhoo, grondilu++ for a first solution
00:45 TimToady and grondilu++ for lot's of other first solutions
00:45 timotimo RenderDrawPoints is still not working?
00:48 Alina-malina joined #perl6
00:48 grondilu I've just made it work in C.  It's faster but not much.  Still can't make it work in Perl 6.
00:48 Alina-malina joined #perl6
00:49 grondilu the C code:  https://gist.github.com/gro​ndilu/588b78f4838bad93ba53
00:52 timotimo btw, https://github.com/timo/SDL2_raw-p6/​blob/master/examples/snake.pl#L48-49 this is how i "upload" raw pixel data onto a drawable surface
00:53 timotimo i think i'll go to bed
00:53 timotimo have a good one!
00:55 grondilu good night
01:01 skids joined #perl6
01:11 raiph joined #perl6
01:25 Mouq joined #perl6
01:32 BenGoldberg joined #perl6
01:50 colomon joined #perl6
01:52 yeahnoob joined #perl6
02:06 japhb DANG IT, I can't get rid of         *resolve stage failed for Grammar::Debugger: Dependency Term::ANSIColor is not present in the module ecosystem
02:06 japhb ... in my "rebuild everything" script
02:11 japhb The section of my script that handles panda: https://gist.github.com/japhb/9cad548e5f8650ebb07a
02:11 japhb Anyone have an idea what change will work around this problem?
02:11 flussence install Term::ANSIColor from a local git clone first, maybe?
02:12 japhb flussence: I suppose -- still makes me wonder if other modules that "should be there" are going to fail as well ....
02:12 japhb And why is this happening in the first place suddenly?
02:14 * flussence shrugs...
02:14 flussence the only useful info I get out of this is that panda's missing a warning message where one's needed
02:16 adu joined #perl6
02:17 timotimo grondilu: couldn't fall asleep yet, so here's what i'm thinking: you're using perl6 "int" but sdl uses "int32"?
02:17 colomon Term::ANSIColor was in the ecosystem this morning....
02:17 * colomon just installed it with no issues
02:18 flussence yeah, something fishy's going on. it's in META.list but panda isn't seeing it for some reason.
02:18 colomon my panda sees it, is what I’m saying
02:18 flussence odd...
02:18 colomon my panda hasn’t gotten the latest update in a few days, I suppose
02:18 japhb colomon: If you 'panda update', does it break?
02:19 * colomon wonders why he would want to try to break his panda
02:19 colomon yes, it does
02:19 japhb OK, so something's messed up in the downloaded file.
02:19 japhb colomon: For SCIENCE!
02:20 colomon wait, wait said that wrong
02:20 colomon Term::ANSIColor still installed fine after panda update
02:20 japhb hmmmm
02:20 japhb Maybe it's a newly-built panda that's broken?
02:21 * japhb worries that some last-minute change in Rakudo before the release broke it
02:21 * colomon will update everything
02:22 colomon did we release today?
02:26 japhb colomon: yes
02:26 colomon \o/
02:27 colomon okay, got the latest rakudo-m, reinstalled panda, did panda update, installed Term::ANSIColor.  It all worked fine.
02:29 flussence maybe it's a filesystem/IO issue?
02:29 flussence that's the only obvious thing I can think of that's changed...
02:30 kshannon joined #perl6
02:30 colomon joined #perl6
02:33 jack_rabbit joined #perl6
02:39 japhb colomon: What directory were you in when you ran the panda commands?
02:39 colomon errr… ~/Videos/Movies
02:41 japhb Huh
02:42 japhb I was wondering if it was only working in the panda dir or rakudo tree or something
02:46 japhb What OS are you on again?
02:46 colomon That was Linux
02:46 japhb Hmmm.  64-bit?
02:46 colomon yes
02:46 japhb Gah.
02:46 colomon same as you?
02:46 japhb Yeah.
02:46 japhb My script sets up a rakudo-moar build tree (with the HEAD sha1 as part of the path), clones nqp and moar in the right places inside it, configures with --gen-nqp --gen-moar, make, make install, then clones a panda in a separate directory and does what was in that gist.
02:46 colomon I’m not on the latest Ubuntu, if that makes you feel better.
02:47 ilbot3 joined #perl6
02:47 Topic for #perl6 is now »ö« Welcome to Perl 6! | http://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: http://irc.perl6.org | UTF-8 is our friend!
02:49 * japhb tries nuking his existing "parent" clone of panda, in case there's something wrong with my local mirror
02:51 * skids wrestles with rakudobrew.  perl6-m seems to install and run fine and you can set a --prefix.  panda installs in languages/perl6/site/ instead of languages/perl6/lib where star put it, then complains of missing m-CORE.setting
02:52 flussence my own rebuild script just nukes everything and copies the panda state file back afterwards, no other state preserved...
02:54 colomon rakudobrew has worked very well for me, but I just use it as is, rather than trying to finesse things with it.
02:54 japhb flussence: I used to attempt to keep the state file, then that just got unreliable at some point, so I just have my rebuild script install all the modules I want to be there by default.
03:03 yeahnoob joined #perl6
03:14 japhb Sonofagun, that was it.  Something was wrong with my panda mirror.
03:15 colomon mirror—
03:15 japhb Updating the panda mirror is just 'cd panda; git pull; git submodule update --init --recursive'
03:15 japhb I wonder what's wrong with the assumption there.
03:15 japhb *my assumptions
03:30 fhelmberger joined #perl6
03:43 firefish5000 joined #perl6
03:59 noganex joined #perl6
04:05 fernando___ joined #perl6
04:05 fernando___ Hi!
04:07 fernando___ Am I doing something wrong:
04:07 fernando___ Any.^add_method("Bla", method () {Bla.new(:id(self))});
04:07 fernando___ it is creating a anon method on Any class
04:07 fernando___ a "<anon>"
04:08 fernando___ but, if I do: Any.^add_method("Bla", method Bla() {Bla.new(:id(self))});
04:08 fernando___ it works
04:08 fernando___ on rakudo star
04:08 fernando___ ~/rakudo-star-2015.01/install/bin/perl6 -v
04:08 fernando___ This is perl6 version 2015.01 built on JVM
04:09 fernando___ can any on help me?
04:10 Mouq fernando___: A) why are you doing this? B) You might want to try "my method …" ?
04:10 Mouq fernando___: Or am I misunderstanding
04:10 Mouq fernando___: I think I am
04:11 fernando___ I am trying to dynamic create a method...
04:11 fernando___ the "Bla" method name for real is a variable...
04:12 fernando___ but I tried to isolate my problem using a "constant"
04:12 fernando___ and it occurred...
04:12 Mouq Right, so in the first example, "Any.Bla" *is* created. It's just that the method that you've put into it doesn't know it has a name, because, well, it doesn't
04:13 japhb you could use 'anon method Blah', though I don't remember if that's NYI
04:13 japhb .ask nine_ Do you have a guide or some slides for Inline::Python?  I actually think I have a business use for this.  :-)
04:13 yoleaux japhb: I'll pass your message to nine_.
04:14 Mouq Any.^add_method("Something", my method SomethingElseCompletely() { … }) will work fine, creating Any.Something, but not Any.SomethingElseCompletely
04:14 fernando___ japhb: I tried that too...(without the Blah...) let me try with the name
04:14 Mouq I'm pretty sure that's a "feature" rather than a "bug" in this case
04:15 fernando___ it created with the "Blah" name... but my problem continue...
04:15 fernando___ I can't create a new method with dynamic name...
04:15 Mouq fernando___: What's the problem?
04:16 fernando___ that's what Im trying to do:
04:17 fernando___ multi method add-resources($resource) {
04:17 fernando___ say $resource.^name;
04:17 fernando___ $resource.^name.fmt("Any.^add_method(%s, method () \{\$resource.new(:id(self))})").say;
04:17 fernando___ my &meth = anon method test () {$resource.new(:id(self))};
04:17 fernando___ Any.^add_method("bla", &meth);
04:17 fernando___ %!resources{$resource.name} = $resource
04:17 fernando___ }
04:17 fernando___ (Im sorry... I didn't want to flood the channel)
04:18 fernando___ Mouq: ^^
04:19 Mouq fernando___: Is http://design.perl6.org/S12.html#FALLBACK_methods helpful?
04:20 fernando___ I don't think so...
04:21 fernando___ the "my method" didn't work for me eigther
04:23 fernando___ Mouq: here, for me the SomethingElseCompletely was created...
04:24 fernando___ is there any way to change the name property of a Method object?
04:26 Mouq m: class Bla { has %rs; method add-r($r) { my &meth = my method { $r.new(:id(self)) }; self.^add_method($r.name, &meth); %rs{$r.name}; self } }; Bla.new.add-r((Any but role {has $.name}).new(:name<foobar>))
04:26 camelia rakudo-moar 114659: ( no output )
04:30 fernando___ Mouq: what is the %rs hash?
04:30 fernando___ sorry, I saw!
04:31 rmgk_ joined #perl6
04:32 fernando___ sorry, I didn't get it...
04:32 fernando___ isn't it giving a name for the Any type?
04:33 fernando___ let me explain from the beginning what I am trying to do:
04:35 fernando___ I am trying to do that any Class "registered" on a specific method (ad-resources) automatic creates a coerce method from Any to that Class
04:35 Mouq Oh
04:36 Mouq m: class Bla { has %rs; method add-r($r) { my \meth = my method { $r.new(:id(self)) }; Any.^add_method($r.name, meth); %rs{$r.name}; self } }; my Bla $b .= new; $b.add-r: (Any but role {has $.name}).new(:name<foobar>); say Any.foobar
04:36 camelia rakudo-moar 114659: OUTPUT«Any+{<anon>}.new(name => Any)␤»
04:37 Mouq m: class Bla { has %rs; method add-r($r) { my \meth = my method { $r.new(:id(self)) }; Any.^add_method($r.name, meth); %rs{$r.name}; self } }; my Bla $b .= new; $b.add-r: (Any but role {has $.name; has $.id}).new(:name<foobar>); say Any.foobar
04:37 camelia rakudo-moar 114659: OUTPUT«Any+{<anon>}.new(name => Any, id => Any)␤»
04:38 Mouq Anyway, this is kind of a hacky way to do it… I'm sure someone else will come up with something better in the morning
04:42 Mouq It also doesn't seem that doing that distributes the new method to derived classes (which is probably reasonable behavior, given that we're not really supposed to be adding methods after composition :P )
04:42 fernando___ just a question: I didn't get... I don't know if I understood, but... I am not passing Any to the add-r()... I am passing another class... and buy passing this class to the add-r, it should create a coerce method from Any to that class...
04:43 Mouq fernando___: Sorry my one-liner isn't very clear. I was just using "Any but role {has $.name}" as an example class
04:43 fernando___ oh! I'm sorry!
04:43 Mouq m: class Res { has $.name}; class Bla { has %rs; method add-r($r) { my \meth = my method { $r.new(:id(self)) }; Any.^add_method($r.name, meth); %rs{$r.name}; self } }; my Bla $b .= new; $b.add-r: Res.new(:name<foobar>); say Bla.new.foobar
04:43 camelia rakudo-moar 114659: OUTPUT«No such method 'foobar' for invocant of type 'Bla'␤  in block <unit> at /tmp/U9ThkiblCj:1␤␤»
04:43 Mouq m: class Res { has $.name}; class Bla { has %rs; method add-r($r) { my \meth = my method { $r.new(:id(self)) }; Any.^add_method($r.name, meth); %rs{$r.name}; self } }; my Bla $b .= new; $b.add-r: Res.new(:name<foobar>); say Any.foobar
04:43 camelia rakudo-moar 114659: OUTPUT«Res.new(name => Any)␤»
04:44 Mouq Again, it doesn't work on anything except Any
04:44 Mouq *Again, the method can't be called on any of the children classes of Any. There may be a way around that, but I don't know
04:45 Mouq m: use MONKEY_TYPING; augment class Any { multi method FALLBACK("foobar") { say "falling back!" } }; Int.foobar
04:45 camelia rakudo-moar 114659: OUTPUT«No such method 'foobar' for invocant of type 'Int'␤  in block <unit> at /tmp/lDTtYMV73O:1␤␤»
04:46 Mouq m: use MONKEY_TYPING; augment class Any { multi method FALLBACK("foobar") { say "falling back!" } }; augment class Int {}; Int.foobar
04:46 camelia rakudo-moar 114659: OUTPUT«falling back!␤»
04:46 Mouq Hm...
04:47 fernando___ humm...
04:48 Mouq fernando___: Sorry I couldn't be of more help
04:49 fernando___ no, you helped a lot!
04:49 fernando___ that's a good way that I can move!
04:49 fernando___ thank you very much!
04:51 Mouq fernando___: np, good luck! :)
04:52 fernando___ it looks that worked...
04:52 fernando___ but didn't coerce my data... :(
04:52 fernando___ thank you very much...
04:53 fernando___ I will sleep a little... tomorrow I'll try again...
04:53 fernando___ thanks!
05:54 diana_olhovik_ joined #perl6
06:05 jack_rabbit joined #perl6
06:10 telex joined #perl6
06:19 firefish5000 joined #perl6
06:36 xfix joined #perl6
06:41 Rounin joined #perl6
06:46 Mouq joined #perl6
06:50 kaleem joined #perl6
06:51 gfldex joined #perl6
06:53 jack_rabbit joined #perl6
06:55 kurahaupo1 joined #perl6
07:04 diana_olhovik joined #perl6
07:19 moritz \o
07:23 [Tux] o/
07:25 dalek Inline-Perl5: fc2b56b | moritz++ | META.info:
07:25 dalek Inline-Perl5: Remove NativeCall as a dependency
07:25 dalek Inline-Perl5:
07:25 dalek Inline-Perl5: it is now (since 2015.02) shipped with rakudo
07:25 dalek Inline-Perl5: review: https://github.com/niner/Inl​ine-Perl5/commit/fc2b56bc0d
07:26 dalek gtk-simple: 55f2965 | moritz++ | META.info:
07:26 dalek gtk-simple: remove NativeCall as a dependency
07:26 dalek gtk-simple:
07:26 dalek gtk-simple: it is now shipped with rakudo.
07:26 dalek gtk-simple: review: https://github.com/perl6/gt​k-simple/commit/55f2965a13
07:29 geekosaur joined #perl6
07:29 dalek zavolaj: 4a29f3b | moritz++ | README.markdown:
07:29 dalek zavolaj: README: mention that NativeCall is shipped with rakudo
07:29 dalek zavolaj: review: https://github.com/jnthn/zavolaj/commit/4a29f3b37f
07:30 jnthn o/
07:30 moritz \o jnthn
07:31 geekosaur joined #perl6
07:32 dalek star: b6d7f3a | moritz++ | tools/star/Makefile:
07:32 dalek star: Adjust versions to the Rakudo 2015.02 compiler release
07:32 dalek star: review: https://github.com/rakudo/star/commit/b6d7f3aa97
07:35 jnthn One loose end that we will want to tie up at some point: where to NativeCall bugs get submitted now?
07:36 moritz rakudobug, I'd hope
07:36 jnthn There's 15 at https://github.com/jnthn/zavolaj/issues
07:36 jnthn rakudobug wfm
07:36 moritz so somebody[tm] should migrate them to rakudobugs, and then disable issues on github
07:37 [Tux] I know about .gist and .perl and I see good use for both, but in e.g.:
07:38 [Tux] m: "\x[0000A0]".perl.say
07:38 camelia rakudo-moar 114659: OUTPUT«" "␤»
07:38 [Tux] is there a way to output that as "\x[A0]"
07:39 dalek star: c36cac0 | moritz++ | modules/ (5 files):
07:39 dalek star: Bring modules up to date
07:39 dalek star: review: https://github.com/rakudo/star/commit/c36cac0bbd
07:39 dalek star: ea65dfa | moritz++ | / (2 files):
07:39 dalek star: Change version numbers in README and Makefile.in
07:39 dalek star: review: https://github.com/rakudo/star/commit/ea65dfa9cf
07:39 FROGGS joined #perl6
07:39 moritz m: say to-json "\x[0000A0]"
07:39 camelia rakudo-moar 114659: OUTPUT«"\u00a0"␤»
07:39 [Tux] that was unexpacted :)
07:39 moritz [Tux]: it seems to be an oversight that .perl doesn't escape that
07:39 [Tux] perlbug it?
07:40 moritz [Tux]: yes
07:40 [Tux] also for €?
07:40 moritz don't think so
07:40 moritz m: say "\x[0]".perl
07:40 camelia rakudo-moar 114659: OUTPUT«"\x[0]"␤»
07:41 moritz m: say "ø".perl
07:41 camelia rakudo-moar 114659: OUTPUT«"ø"␤»
07:41 [Tux] m: "\x[0020ac]".perl.say
07:41 camelia rakudo-moar 114659: OUTPUT«"€"␤»
07:41 FROGGS what is the problem?
07:41 yoleaux 19 Feb 2015 21:27Z <moritz> FROGGS: please remove NativeCall as a dependency from Inline::C. kthxbye
07:41 [Tux] do I really need to-jason to see that it is 20ac?
07:41 FROGGS moritz: will do :o)
07:42 [Tux] FROGGS, one moment, I'll show
07:42 FROGGS m: say to-json "€"
07:42 camelia rakudo-moar 114659: OUTPUT«"\u20ac"␤»
07:42 FROGGS m: say (to-json "€").Str
07:42 camelia rakudo-moar 114659: OUTPUT«"\u20ac"␤»
07:42 FROGGS m: print (to-json "€")
07:42 camelia rakudo-moar 114659: OUTPUT«"\u20ac"»
07:43 [Tux] m: "Đ".perl.say
07:43 camelia rakudo-moar 114659: OUTPUT«"Đ"␤»
07:43 FROGGS ahh, now I understand
07:43 darutoko joined #perl6
07:43 [Tux] is this \x[00d0], \x[0110], or \x[0189] ?
07:43 FROGGS [Tux]: but that is not the purpose of .perl
07:44 raydiak m: "ø".ord.base(16)
07:44 camelia rakudo-moar 114659: ( no output )
07:44 raydiak m: "ø".ord.base(16).say
07:44 camelia rakudo-moar 114659: OUTPUT«F8␤»
07:44 FROGGS .perl lets you serialize things so they can be EVALed at a later point in time
07:44 [Tux] I will keep that in mind
07:44 [Tux] I'll also try to remind the to_json
07:46 FROGGS I'd like to have a Str.uniinfo or so, that provides a hash table containing the data of this page: http://www.fileformat.info/inf​o/unicode/char/20aC/index.htm
07:46 FROGGS m: say uniname "€"
07:46 camelia rakudo-moar 114659: OUTPUT«EURO SIGN␤»
07:46 moritz FROGGS: me too, thought I wouldn't object to a proper object instead of a hash
07:47 FROGGS moritz: hashes are objects too :P
07:47 FROGGS but yeah
07:47 moritz p5 think :-)
07:47 [Tux] m: "\x[00d0]\x[0110]\x[0189]".perl.say
07:47 camelia rakudo-moar 114659: OUTPUT«"ÐĐƉ"␤»
07:47 [Tux] "\x[00d0]\x[0110]\x[0189]".uniinfo.say ? :)
07:48 FROGGS "\x[00d0]\x[0110]\x[0189]".chars».uniinfo».say
07:50 diegok joined #perl6
07:51 raydiak m: Str.^methods».name.grep: /uni/
07:51 camelia rakudo-moar 114659: ( no output )
07:51 raydiak m: say Str.^methods».name.grep: /uni/
07:51 camelia rakudo-moar 114659: OUTPUT«unival univals␤»
07:51 FROGGS moritz: done # Inline::C
07:52 raydiak m: "∈".unival.say
07:52 camelia rakudo-moar 114659: OUTPUT«NaN␤»
07:52 raydiak m: "a".unival.say
07:52 camelia rakudo-moar 114659: OUTPUT«NaN␤»
07:52 FROGGS somebody should write a UniInfo module that just exports uniinfo/uniinfos subs
07:53 moritz FROGGS: thanks
07:53 FROGGS m: "⓯".unival.say
07:53 camelia rakudo-moar 114659: OUTPUT«15␤»
07:53 FROGGS raydiak: ^^
07:54 raydiak neat
07:54 FROGGS aye
07:54 FROGGS m: "㏥".unival.say
07:54 camelia rakudo-moar 114659: OUTPUT«NaN␤»
07:54 FROGGS :o)
07:55 raydiak a character that isn't in my font...don't see those very often :)
07:55 FROGGS m: say uniname "㏥"
07:55 camelia rakudo-moar 114659: OUTPUT«IDEOGRAPHIC TELEGRAPH SYMBOL FOR DAY SIX␤»
07:56 Rounin m: "\x[2603]".unival.say
07:56 camelia rakudo-moar 114659: OUTPUT«NaN␤»
07:56 Rounin m: say uniname "\x[2603]"
07:56 camelia rakudo-moar 114659: OUTPUT«SNOWMAN␤»
07:56 raydiak m: say "\x[2603]"
07:56 camelia rakudo-moar 114659: OUTPUT«☃␤»
07:56 Rounin m: say uniname "爽"
07:56 camelia rakudo-moar 114659: OUTPUT«<CJK Ideograph>␤»
07:58 Rounin m: say 一...十
07:58 camelia rakudo-moar 114659: OUTPUT«5===SORRY!5=== Error while compiling /tmp/4nkEjlLDVP␤Undeclared routines:␤    一 used at line 1␤    十 used at line 1␤␤»
07:58 Rounin m: say "一"..."十"
07:58 camelia rakudo-moar 114659: OUTPUT«一 丁 丂 七 丄 丅 丆 万 丈 三 上 下 丌 不 与 丏 丐 丑 丒 专 且 丕 世 丗 丘 丙 业 丛 东 丝 丞 丟 丠 両 丢 丣 两 严 並 丧 丨 丩 个 丫 丬 中 丮 丯 丰 丱 串 丳 临 丵 丶 丷 丸 丹 为 主 丼 丽 举 丿 …»
07:58 Rounin Oh my
07:59 Rounin I forgot how they're sorted according to dictionary order
08:01 dalek star: ad60319 | moritz++ | docs/announce/2015.02.md:
08:01 dalek star: Draft release announcement for 2015.02
08:01 dalek star: review: https://github.com/rakudo/star/commit/ad603195cc
08:03 Rounin say 1, 2, 3...
08:03 Rounin m: say 1, 2, 3 ...
08:03 camelia rakudo-moar 114659: OUTPUT«5===SORRY!5=== Error while compiling /tmp/_FsjeJV8Qw␤Unsupported use of bare 'say'; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argument␤at /tmp/_FsjeJV8Qw:1␤------> 3say 1, 2, 3 ...7⏏5<EOL>␤    expecting any…»
08:03 Rounin m: say 1, 2, 3, ...
08:03 camelia rakudo-moar 114659: OUTPUT«5===SORRY!5=== Error while compiling /tmp/o9qX4JftTf␤Comma found before apparent series operator; please remove comma (or put parens␤    around the ... listop, or use 'fail' instead of ...)␤at /tmp/o9qX4JftTf:1␤------> 3say 1, 2, 3,7⏏5 ...…»
08:04 jack_rabbit joined #perl6
08:05 sergot morning #perl6
08:06 moritz \o sergot
08:07 prime joined #perl6
08:08 wicope joined #perl6
08:13 rurban joined #perl6
08:19 Ven joined #perl6
08:19 mohij joined #perl6
08:25 _mg_ joined #perl6
08:25 moritz Util: in rakudo there's a prots/darwin_dmg/ directory which you have contributed
08:25 moritz *ports
08:26 moritz Util: however, this is based on parrot, which we'll not use after the 2015.02 release
08:26 moritz Util: so, either we (for some values of "we") can updated that to use MoarVM, or remove it
08:26 moritz Util: any thoughts?
08:30 lumimies joined #perl6
08:32 fhelmberger joined #perl6
08:33 spider-mario joined #perl6
08:33 jack_rabbit joined #perl6
08:40 zakharyas joined #perl6
08:41 mohij joined #perl6
08:45 moritz afk&
08:47 rindolf joined #perl6
08:58 Ven joined #perl6
09:01 jack_rabbit joined #perl6
09:01 grondilu joined #perl6
09:02 grondilu Rounin: 1, 2, 3 ... *
09:02 grondilu (the * is mandatory)
09:02 Rounin Thanks, grondilu! I googled around for it for the longest time, to be honest
09:02 Rounin m: say 2, 3, 5, 7 ... *
09:02 camelia rakudo-moar 114659: OUTPUT«2 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 101 103 105 107 109 111 113 115 117 119 121 123 125 127 129 131 133 135 137 139 141 143 145 147 149 151 153 155…»
09:03 Rounin Ah, so it goes by the 5, 7
09:03 Rounin m: say 1, 2, 6, 24, 120, 720 ... *
09:03 camelia rakudo-moar 114659: OUTPUT«===SORRY!===␤Unable to deduce arithmetic or geometric sequence from 24,120,720 (or did you really mean '..'?)␤»
09:04 Rounin Heheh
09:04 Rounin We're constrained by reality I see
09:07 rurban1 joined #perl6
09:19 kaleem joined #perl6
09:20 bjz joined #perl6
09:21 bjz joined #perl6
09:24 jack_rabbit joined #perl6
09:34 abraxxa joined #perl6
09:34 kjs_ joined #perl6
09:37 brx joined #perl6
09:38 _mg_ joined #perl6
09:41 rurban2 joined #perl6
09:41 rurban2 left #perl6
09:46 nwc10 where's the source for dalek?
09:46 Ven joined #perl6
09:48 sqirrel joined #perl6
09:53 jack_rabbit joined #perl6
09:58 espadrine joined #perl6
10:03 colomon_ joined #perl6
10:05 bjz joined #perl6
10:06 dalek roast: f476a59 | lizmat++ | S17-supply/start.t:
10:06 dalek roast: Fix deprecated .sleep call
10:06 dalek roast: review: https://github.com/perl6/roast/commit/f476a59e26
10:09 dalek roast: f3a8568 | lizmat++ | integration/advent2014-day05.t:
10:09 dalek roast: Fix another .sleep deprecation
10:09 dalek roast: review: https://github.com/perl6/roast/commit/f3a85688cc
10:10 masak good antenoon, #perl6
10:10 tadzik hello masak
10:11 masak hello.
10:11 masak my name is inigo montoya.
10:11 masak you killed my father.
10:12 masak prepare to die.
10:14 tadzik :o
10:17 tadzik prepare, right. Let me put on my die-pants
10:19 lizmat m: say try {die} // "failed"
10:19 camelia rakudo-moar 114659: OUTPUT«failed␤»
10:22 rurban joined #perl6
10:30 spider-mario I have just seen this on Parrot’s web site:
10:30 spider-mario “        + rakudo perl6 announced to drop parrot support.”
10:30 spider-mario is that true?
10:31 spider-mario (http://parrot.org/news/2015/Parrot-7.1.0 )
10:31 lizmat spider-mario: http://pmthium.com/2015/02​/suspending-rakudo-parrot/
10:32 lizmat 2015.02 is the last compiler / * release that will support parrot in the foreseeable future
10:32 spider-mario ok, thanks
10:33 Ven joined #perl6
10:33 spider-mario guess I’ll remove my rakudo-parrot package for arch linux, then
10:33 spider-mario and replace it with rakudo-moarvm
10:34 lizmat that feels future proof to me
10:44 [ptc] lizmat: is anyone working on the Debian Rakudo / Rakudo* package?
10:45 [ptc] I notice that the current Debian package is 2014.07, based on parrot as its backend
10:48 El_Che [ptc]: there is a favolous perl debian team (https://pkg-perl.alioth.debian.org/). However I don't know if they do perl§ packages as well
10:49 lizmat I hope so...   latest debian comes with rakudo 2012.02 on parrot
10:49 tadzik I think moarvm is the problematic part, it shipping its own libtommath etc
10:49 tadzik and debian maintainers don't like it when programs bundle libraries rather than using system libraries
10:54 rurban joined #perl6
10:54 El_Che tadzik: that's a very light way of formulating it
10:54 grondilu that's very sensible, though.
10:55 El_Che tadzik: debian won't ship the pkg UNTIL it's replace by debian libraries. What it's pretty logical for an OS
10:55 grondilu imagine the mess if all packages were shipping their own versions of libraries.
10:56 dalek rakudo/newio: 1146597 | lizmat++ | src/core/Exception.pm:
10:56 dalek rakudo/newio: Fix for #123884, [Tux]++
10:56 dalek rakudo/newio: review: https://github.com/rakudo/rakudo/commit/1146597d0f
10:56 dalek rakudo/newio: d386900 | lizmat++ | src/core/IO/Handle.pm:
10:56 dalek rakudo/newio: Deprecate IO::Handle.input-line-separator for .nl
10:56 synopsebot Link: https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=123884
10:56 dalek rakudo/newio: review: https://github.com/rakudo/rakudo/commit/d386900bf8
10:56 dalek rakudo/newio: 9a75383 | moritz++ | / (79 files):
10:56 dalek rakudo/newio: Remove parrot support from Rakudo.
10:56 dalek rakudo/newio:
10:56 dalek rakudo/newio: Please see http://pmthium.com/2015/02​/suspending-rakudo-parrot/
10:56 dalek rakudo/newio: for some background information
10:56 dalek rakudo/newio: review: https://github.com/rakudo/rakudo/commit/9a75383d91
10:56 dalek rakudo/newio: b327d0e | lizmat++ | / (78 files):
10:56 dalek rakudo/newio: Merge branch 'nom' into newio
10:56 dalek rakudo/newio: review: https://github.com/rakudo/rakudo/commit/b327d0e38c
10:56 * grondilu is on debian sid and can confirm available rakudo is 2014.07-4
10:56 El_Che grondilu: it sounds pretty much to what's coming with docker and co: track each ssl vulnerability
10:57 lizmat Debian 7.8 Wheezy doesn't  :-(
11:00 grondilu tbh it would only make sense to put rakudo on debian/stable at "chrismas".
11:02 [ptc] actually, it would be great if users could just go: apt-get install rakudo and then have a reasonably current version
11:02 El_Che [ptc]: for that scenario you need a p6 repo that people can add
11:02 grondilu "reasonably current" is very subjective.
11:02 El_Che [ptc]: and that install stuff in e.g. /opt
11:03 El_Che so people can install system p6 at the same time
11:03 grondilu apt-get install rakudo works fine on sid.
11:03 [ptc] grondilu: I know ... but having a bleading edge version isn't always the best thing
11:03 grondilu (last time I tried anyway)
11:04 dalek rakudo/newio: c1116de | lizmat++ | src/core/PIO.pm:
11:04 dalek rakudo/newio: Do some more birdlessing
11:04 dalek rakudo/newio: review: https://github.com/rakudo/rakudo/commit/c1116de869
11:04 [ptc] grondilu: it works now, however it's based on parrot, and it would be good to have the option of moarvm or jvm as backends, even for those who simply install from the package manager
11:04 grondilu well, yes.
11:05 [ptc] and if the package comes from official Debian, that's very helpful for an impression of stability as well as to get user uptake
11:06 [ptc] El_Che: a p6 repo is a good idea, but I was thinking more along the lines of official Debian
11:06 skarn joined #perl6
11:07 Ven joined #perl6
11:07 grondilu again, that should happen on Xmas.
11:07 El_Che well, you can do both like Virtualbox
11:07 El_Che standard OS VB is most of the time
11:07 El_Che move to VB repo if you need a new functionality (or a fix for a weird bug)
11:08 [ptc] grondilu: for it to happen at Xmas, the debian package build files need to be accepted into the package maintenance process
11:08 [ptc] which takes a while...
11:09 grondilu well, there is time to prepare.  It's not like Xmas is tomorrow.
11:10 [ptc] grondilu: true, however I've had packages wait months to years before anything starts to happen
11:11 [ptc] does anyone know which package the debian build packages are located?  I've checked the repos under perl6/ and rakudo/, however haven't found anything
11:11 grondilu ok, moreover I suppose debian is not the only GNU/linux distrib so there's no way rakudo can be shipped on all of them for Xmas.
11:12 [ptc] that's true
11:12 [ptc] talking about "other distros": I haven't seen any spec files either.  Is there a repo with these in somewhere?
11:13 dalek star: 2f7d3a2 | timo++ | docs/announce/2015.02.md:
11:13 dalek star: change "January" to "February"
11:13 dalek star: review: https://github.com/rakudo/star/commit/2f7d3a24a1
11:13 moritz timotimo++
11:13 moritz http://home.p6c.org/~moritz/r​akudo-star-2015.02-rc0.tar.gz
11:14 moritz (still with the old announcement)
11:14 moritz it fails jsonrpc on parrot for me
11:14 moritz (and lots of JVM failures; I fear they are expected)
11:15 dalek doc: e600ff3 | paultcochrane++ | t/pod-convenience.t:
11:15 dalek doc: Test Pod::Convenience::pod-with-title
11:15 dalek doc: review: https://github.com/perl6/doc/commit/e600ff3956
11:15 dalek doc: 4f93f87 | paultcochrane++ | t/pod-convenience.t:
11:15 dalek doc: Plan 9 tests
11:15 dalek doc:
11:15 dalek doc: Actually am only adding a plan to the test file; it just so happened to be 9
11:15 dalek doc: tests.  ... Well, it seemed amusing at the time :-)
11:15 dalek doc: review: https://github.com/perl6/doc/commit/4f93f87279
11:15 dalek doc: 26f60cd | paultcochrane++ | lib/Pod/Convenience.pm6:
11:15 dalek doc: Localise variable in pod-lower-headings()
11:15 dalek doc: review: https://github.com/perl6/doc/commit/26f60cd9e9
11:15 dalek doc: 6b25b8a | paultcochrane++ | lib/Language/ (2 files):
11:15 dalek doc: Merge branch 'master' of github.com:perl6/doc
11:15 dalek doc: review: https://github.com/perl6/doc/commit/6b25b8aa83
11:15 dalek doc: 42ed02c | paultcochrane++ | t/pod-convenience.t:
11:15 dalek doc: Test Pod::Convenience::first-code-block
11:15 dalek doc: review: https://github.com/perl6/doc/commit/42ed02c967
11:15 dalek doc: b9300ba | paultcochrane++ | / (3 files):
11:15 dalek doc: Merge branch 'master' of github.com:perl6/doc
11:15 dalek doc: review: https://github.com/perl6/doc/commit/b9300ba774
11:15 El_Che [ptc]: https://packages.debian.org/sid/rakudo
11:15 El_Che [ptc]: the links are on the right
11:16 El_Che [ptc]: the maintainer emails are there as well
11:16 [ptc] El_Che: thanks.  Have looked there.  I meant on GitHub :-)
11:16 timotimo i feel i made a valuable contribution to R* 2015.02
11:16 moritz timotimo: you did
11:17 El_Che [ptc]: well the debian changes are there in the *-debian.tar.gz
11:18 [ptc] El_Che: I know.  I just didn't want to start a new repo or add files to an existing one if they're already in the perl6/ GitHub namespace/ecosystem/thingie
11:19 [ptc] El_Che: I don't want to clobber someone else's work; it'd be nice to build upon it :-)
11:21 |Tux| joined #perl6
11:22 moritz https://github.com/rakudo/star/blo​b/master/docs/announce/2015.02.md feedback welcome
11:23 lizmat moritz: panda givees
11:23 dalek star: 2426ecd | moritz++ | docs/announce/2015.02.md:
11:23 dalek star: announce: be more consistent in the use of markdown
11:23 dalek star: review: https://github.com/rakudo/star/commit/2426ecd25b
11:24 dalek star: 67e5c83 | moritz++ | docs/announce/2015.02.md:
11:24 dalek star: typo, lizmat++
11:24 dalek star: review: https://github.com/rakudo/star/commit/67e5c83694
11:24 lizmat moritz: "in shape en par" -> "in shape and on par"
11:25 dalek star: 35a43b2 | moritz++ | docs/announce/2015.02.md:
11:25 dalek star: wording, lizmat++
11:25 dalek star: review: https://github.com/rakudo/star/commit/35a43b2165
11:25 lizmat that's it
11:25 moritz lizmat++
11:25 Ven lizmat++ timotimo++
11:25 [ptc] moritz: full stop missing at end of second paragraph
11:26 * [ptc] is still reading
11:27 dalek star: 5abb64c | moritz++ | docs/announce/2015.02.md:
11:27 dalek star: Update announcement
11:27 dalek star:
11:27 dalek star: * update list of failing parrot modules (only one)
11:27 dalek star: * missing fullstop, [ptc]++
11:27 dalek star: * more consistent use of markup
11:27 dalek star: review: https://github.com/rakudo/star/commit/5abb64cb19
11:28 lizmat moritz: it seems, 9a75383d *added* S26-documenttation/01-delimited.t to t/spectest.data
11:28 [ptc] moritz: looks good :-)
11:28 [ptc] moritz++
11:29 moritz lizmat: oh, did I mis-merge?
11:30 dalek rakudo/nom: face62b | lizmat++ | t/spectest.data:
11:30 dalek rakudo/nom: Remove references to non-existing test files
11:30 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/face62be4b
11:30 nine_ How can I match white space separated tokens in my grammar? I tried rule server_alias { ServerAlias <domain>+ } as well as rule server_alias { ServerAlias [<domain> \h*]+ } but neither match
11:30 yoleaux 04:13Z <japhb> nine_: Do you have a guide or some slides for Inline::Python?  I actually think I have a business use for this.  :-)
11:30 moritz lizmat++ thanks
11:30 timotimo nine_: you can try [...] +
11:30 timotimo or + % [\h*]
11:31 moritz m: say 'ServerAlias a b c' ~~ /:s ServerAlias [\w+ ]+/
11:31 camelia rakudo-moar 114659: OUTPUT«「ServerAlias a b c」␤»
11:31 moritz seems that [<domain> ]+ should work
11:31 moritz m: say 'ServerAlias a b c' ~~ /:s ServerAlias [\w+] +/
11:31 camelia rakudo-moar 114659: OUTPUT«「ServerAlias a b c」␤»
11:31 moritz as well as <domain> +
11:34 moritz nine_: a word of warning: since apache config directives are separated by newlines, you redefine token ws to only include horizontal whitespace
11:34 moritz otherwise you will get *very+ surprising mis-parses
11:34 nine_ <domain> + works :) [<domain> ]+ seems to require white space after the last domain before the newline
11:35 nine_ moritz: did that
11:35 nine_ moritz: and got them :)
11:35 xfix joined #perl6
11:36 nine_ .tell japh http://niner.name/talks/Leapfrogging the bootstrap/Leapfrogging the bootstrap.pdf is your best bet for now. Page 37 and following. Or have a look at the tests. They should be somewhat instructive. And feel free to ask me any time here.
11:36 yoleaux nine_: I'll pass your message to japh.
11:43 Mouq joined #perl6
11:46 rurban joined #perl6
11:46 coffee` joined #perl6
12:01 [ptc] moritz: there's a routine in Pod::Convenience (pod-gist) which isn't used anywhere in the perl6/doc repo (other than recursively within itself): is it ok if I delete it?
12:01 lizmat m: say npq::unbox_i(42)
12:01 camelia rakudo-moar 114659: OUTPUT«Could not find symbol '&unbox_i'␤  in method <anon> at src/gen/m-CORE.setting:14883␤  in any find_method_fallback at src/gen/m-Metamodel.nqp:2823␤  in any find_method at src/gen/m-Metamodel.nqp:1001␤  in block <unit> at /tmp/hDGI1NllU1:1␤␤»
12:02 [ptc] moritz: Mouq wrote it originally, however isn't around to ask, and thought you'd be a good person to ask :-)
12:02 lizmat m: say Foo::bar()
12:02 camelia rakudo-moar 114659: OUTPUT«Could not find symbol '&bar'␤  in method <anon> at src/gen/m-CORE.setting:14883␤  in any find_method_fallback at src/gen/m-Metamodel.nqp:2823␤  in any find_method at src/gen/m-Metamodel.nqp:1001␤  in block <unit> at /tmp/iJA_PD5rAu:1␤␤»
12:02 lizmat why isn't that a compile time error ?
12:04 lizmat Q: does an nqp::unbox_s create a copy of the string?
12:05 lizmat I would think not, but want to check just in case
12:06 virtualsue joined #perl6
12:08 moritz [ptc]: it's handy for debugging htmlify
12:08 moritz [ptc]: so I'd leave it in
12:09 [ptc] moritz: ok
12:10 [ptc] moritz: it wasn't easy to see what it did and thus wasn't easy to test
12:10 moritz [ptc]: it tries to be a better $pod.gist
12:11 moritz [ptc]: ... unless I totally mis-remember it
12:17 [ptc] moritz: cool, thanks :-)
12:23 timotimo lizmat: it does not, but strings are immutable, at least on moarvm
12:23 lizmat yeah, that's what I figured  :-)
12:27 brx left #perl6
12:28 * moritz had some fun with tooling: https://github.com/tadzik/panda/pull/136
12:31 silug joined #perl6
12:35 tadzik oo
12:35 tadzik ooooo
12:35 tadzik me gusta
12:36 tadzik why does it have 250 commits though? :o
12:37 tadzik because it now contains all the deps' history?
12:38 moritz tadzik: yes
12:39 moritz tadzik: that could be avoided with --squash, if you'd prefer that
12:40 tadzik I think I would, navigating the history now would be a bit more difficult, I think
12:43 nwc10 tadzik/moritz: the trick we were using in perl 5 was to force a non-ff merge
12:43 nwc10 so you end up with a merge commit, the left parent of which is to the start of a run of related commits
12:43 nwc10 and the right parent of which is the run of commits
12:44 nwc10 so the left parent is the "squashed" commit (and the default that most things see)
12:44 nwc10 but the branch to the right preserves the detail
12:44 tadzik sounds nice
12:45 nwc10 see http://perl5.git.perl.org/perl.gi​t/blob/HEAD:/pod/perlgit.pod#l733
12:45 nwc10 (dear everyone reading the IRC logs in years to come, that URL is prbably going to go wrong. Sorry)
12:51 moritz the subtree merges aren't fast-forward
12:51 moritz so that's how it is now
12:51 moritz just github shows them linearly
12:53 molaf_ joined #perl6
12:53 moritz for example https://github.com/tadzik/panda/commit/76b5d is a merge commit
12:55 rurban joined #perl6
12:57 tadzik aha
12:58 dalek rakudo/nom: 36ffb65 | lizmat++ | src/core/Str.pm:
12:58 dalek rakudo/nom: Make generic Str.subst between 5 - 10% faster
12:58 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/36ffb6543a
12:58 dalek rakudo/nom: bf2d1dd | paultcochrane++ | lib/Test.pm:
12:58 dalek rakudo/nom: Add simple use-ok implementation
12:58 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/bf2d1dd79d
12:58 dalek rakudo/nom: 32523c1 | lizmat++ | lib/Test.pm:
12:58 dalek rakudo/nom: Merge pull request #367 from paultcochrane/pr/add_use_ok
12:58 dalek rakudo/nom:
12:58 dalek rakudo/nom: Add simple use-ok implementation
12:58 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/32523c10e7
12:59 [ptc] lizmat++ thanks :-)
12:59 lizmat [ptc]++ # thank you!
13:00 [ptc] lizmat: no problems!  I hope it works ok.  Am using it a bit more now and finding that the simple implementation might not have been good enough *sigh*
13:00 [ptc] lizmat: I'll update it if I find any problems
13:00 lizmat well, another PR is welcome
13:01 [ptc] ok :-)
13:17 dalek rakudo/nom: bf00eff | lizmat++ | src/core/Str.pm:
13:17 dalek rakudo/nom: Small cleanup I forgot just now
13:17 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/bf00eff49c
13:17 lizmat afk for a few hours
13:37 Ven joined #perl6
13:39 Util moritz: I plan to update ports/darwin_dmg/ to support (and default to) MoarVM.
13:43 [Coke] Util: is that a self contained .dmg installer?
13:46 moritz Util: ok, great
13:48 Util [Coke]: It generates a .dmg of the R* "installed" dirs, all corrected to point to /Applications/Rakudo_Star. So yes, the end product is a drag-and-drop "self-contained".
13:49 [Coke] lizmat: those test files exist, but they probably needed to have a newline between them.
13:49 Util It has a few problems with getting the last lib-path cross-references fixed, and that is why I have not strted deploying .dmgs of R* yet.
13:50 Util The binaries would work on the machines of people who had (for example) ever built R* themselves, but not on machines completely new to R*.
13:50 [Coke] Util: nice. I am working on getting rakudo-m and rakudo-j on macports, will have to think about how we want to deal with recommended modules there. I really don't want to go the path of having each module in as a separate plugin, but it seems there's an overwhelming amount of prior art.
13:50 Util I will fix this during my update.
13:51 [Coke] er, *as a separate port
13:52 Util [Coke]: Do you mean rakudo-m from Rakudo, or rakudo-m from Rakudo Star?
13:55 moritz tadzik: https://github.com/tadzik/panda/pull/137 for your pleasure, now with only 9 commits
13:55 beastd joined #perl6
13:56 * Util is a Homebrew user, so has no advice on your macports modules. Coke++ for it, though!
13:58 [Coke] a fiver tried to introduce me to homebrew, but at the time, it had none of the stuff I used.
13:59 [Coke] Util: just bundled MoarVM (simple) next is to do nqp in 2 or 3 flavors, then rakudo in 2 flavors. Then I'll worry about what to do with Star.
14:00 moritz fwiw you could make a star-modules bundle (like Task::Star), which requires rakudo, and adds all the modules
14:01 dalek doc: 1b44b51 | paultcochrane++ | t/pod-convenience.t:
14:01 dalek doc: Add plan to first-code-block tests
14:01 dalek doc: review: https://github.com/perl6/doc/commit/1b44b51038
14:01 dalek doc: 85e24fa | paultcochrane++ | / (2 files):
14:01 dalek doc: Add initial Pod::Htmlify
14:01 dalek doc:
14:01 dalek doc: This currently only exports url-munge(); more to come.
14:01 dalek doc: Also added tests of url-munge().
14:01 dalek doc: review: https://github.com/perl6/doc/commit/85e24faa29
14:01 dalek doc: 71799fb | paultcochrane++ | Makefile:
14:01 dalek doc: Add a simple Makefile
14:01 dalek doc:
14:01 dalek doc: This aids slightly in building the html and running the test suite.
14:01 dalek doc: review: https://github.com/perl6/doc/commit/71799fb896
14:01 dalek doc: 3f26e7b | paultcochrane++ | htmlify.p6:
14:01 dalek doc: Use url-munge from Pod::Htmlify in htmlify.p6
14:01 dalek doc: review: https://github.com/perl6/doc/commit/3f26e7bb28
14:02 moritz [ptc]++ # brining some order to the mess I made with htmlify
14:03 moritz *bringing
14:04 dalek doc/inline-pygments: 63f0b7c | moritz++ | htmlify.p6:
14:04 dalek doc/inline-pygments: Attempt to make Inline::Python optional
14:04 dalek doc/inline-pygments:
14:04 dalek doc/inline-pygments: ... falling back to the old shelling-out code
14:04 dalek doc/inline-pygments: review: https://github.com/perl6/doc/commit/63f0b7c5ec
14:04 [ptc] hopefully I'm not breaking anything...  I'm really just a hacker at heart!
14:05 moritz well, if you break something, we'll fix it
14:06 moritz *shrug*
14:06 moritz it's not like we have five 9s SLA or something
14:06 ingy Greetings. https://github.com/acmeism/RosettaCodeData is now completely up to date!
14:07 moritz [ptc]: and in the long run, tests will help us not to break things, so it's really the best possible direction
14:07 moritz \o ingy
14:08 ingy Util++  # a ton of minor fixes of human mucked up wiki pages
14:08 * [ptc] doesn't want to know about SLAs anymore...
14:09 moritz heh :-)
14:10 * [ptc] thinks the name ITIL is amusing, especially if one speaks German
14:10 ingy Util: 100 new tasks added. I forgot that the new task addition is not automatic.
14:10 ingy yet :)
14:12 larion joined #perl6
14:13 dalek doc: 39e1c0f | paultcochrane++ | lib/Language/functions.pod:
14:13 dalek doc: Remove extra '<' in C< > block
14:13 dalek doc: review: https://github.com/perl6/doc/commit/39e1c0f94e
14:13 dalek doc: 1ebc2d6 | paultcochrane++ | htmlify.p6:
14:13 dalek doc: Rename pygmentize-code-blocks -> highlight-code-blocks
14:13 dalek doc:
14:13 dalek doc: We don't need to know how the code blocks are being highlighted, especially
14:13 dalek doc: not in the name of the sub which does the highlighting.
14:13 dalek doc: review: https://github.com/perl6/doc/commit/1ebc2d6c6a
14:17 kjs_ joined #perl6
14:21 raiph joined #perl6
14:30 tadzik moritz++ awesome :)
14:30 Kristien joined #perl6
14:30 Kristien What are the use cases for ENTER?
14:31 Kristien I can't really think of any
14:32 moritz I think it's mostly there for symmetry to LEAVE
14:32 moritz for example it could be nice to set up a temp file in ENTER and unlink it in LEAVE
14:32 Kristien ah I see
14:33 moritz or one could start something asynchronously while the rest of the routine runs, without putting it on top of the routine
14:34 masak m: for 1..2 { ENTER { my $t = (^1000).roll; say "Setting up $t"; LEAVE say "Tearing down $t" }; say "Processing..." }
14:34 camelia rakudo-moar 114659: OUTPUT«Setting up 622␤Tearing down 622␤Processing...␤Setting up 357␤Tearing down 357␤Processing...␤»
14:34 masak hm.
14:34 masak so, not like PRE and POST, then.
14:34 masak guess that one can be argued both ways...
14:35 masak m: for 1..2 { my $t; ENTER { $t = (^1000).roll; say "Setting up $t" }; LEAVE { say "Tearing down $t" }; say "Processing..." }
14:35 camelia rakudo-moar 114659: OUTPUT«Setting up 261␤Processing...␤Tearing down 261␤Setting up 702␤Processing...␤Tearing down 702␤»
14:35 masak better. :)
14:37 PerlJam masak: what do you mean "not like PRE and POST"?
14:37 moritz PRE/POST are always scoped to a routine
14:37 moritz so you can nest the POST inside the PRE block if you want
14:38 masak PerlJam: POST can be nested inside PRE to benefit from its lexicals.
14:38 PerlJam oh, I see.
14:38 masak yeah, it's all about what it binds to, I guess.
14:38 masak LEAVE binds to any block.
14:39 masak m: for 1..2 { ENTER { my $t = (^1000).roll; say "Setting up $t"; NEXT say "Tearing down $t" }; say "Processing..." }
14:39 camelia rakudo-moar 114659: OUTPUT«Setting up 471␤Processing...␤Setting up 449␤Processing...␤»
14:39 moritz m: my $x = { PRE False }; $x()
14:39 camelia rakudo-moar 114659: OUTPUT«Precondition 'False' failed␤  in block  at /tmp/SBc_ioAFVI:1␤  in block <unit> at /tmp/SBc_ioAFVI:1␤␤»
14:39 moritz m: my $x = { PRE False }; say "alive"; $x()
14:39 camelia rakudo-moar 114659: OUTPUT«alive␤Precondition 'False' failed␤  in block  at /tmp/YM35kmDD2w:1␤  in block <unit> at /tmp/YM35kmDD2w:1␤␤»
14:39 moritz seems like PRE isn't tied to a routine
14:39 masak I'm surprised the NEXT one above doesn't show "Tearing down <n>"
14:39 masak moritz: oh right, it doesn't!
14:39 masak moritz: then it wouldn't work with loops.
14:40 masak so there *is* a special case of sorts for POST.
14:40 moritz masak: you didn't call next; did you?
14:40 masak m: for 1..2 { ENTER { my $t = (^1000).roll; say "Setting up $t"; NEXT say "Tearing down $t" }; say "Processing..."; next }
14:40 camelia rakudo-moar 114659: OUTPUT«Setting up 984␤Processing...␤Setting up 97␤Processing...␤»
14:40 masak moritz: I don't think I have to.
14:40 masak moritz: there's like an implicit `next` at the end of a loop.
14:40 * masak submits rakudobug
14:41 tadzik moritz++ # awesome work on panda
14:41 PerlJam m: for 1..2 { ENTER { my $t = (^1000).roll; say "Setting up $t"; next; NEXT say "Tearing down $t" };
14:41 camelia rakudo-moar 114659: OUTPUT«5===SORRY!5=== Error while compiling /tmp/GUyw7r38lf␤Unable to parse expression in block; couldn't find final '}' ␤at /tmp/GUyw7r38lf:1␤------> 3$t"; next; NEXT say "Tearing down $t" };7⏏5<EOL>␤»
14:41 PerlJam blah
14:41 Kristien I found a wonderful Java refactoring tool today.
14:41 PerlJam m: for 1..2 { ENTER { my $t = (^1000).roll; say "Setting up $t"; next; NEXT say "Tearing down $t" }; }
14:41 camelia rakudo-moar 114659: OUTPUT«Setting up 349␤Setting up 651␤»
14:42 Kristien it's called rm it even ships with codeutils
14:42 PerlJam even with the next ...
14:42 PerlJam :)
14:42 masak Kristien: refactoring. you keep using that word. I don't think it means what you think it means.
14:42 PerlJam m: for 1..2 { ENTER { my $t = (^1000).roll; say "Setting up $t"; NEXT say "Tearing down $t" }; next; }
14:42 camelia rakudo-moar 114659: OUTPUT«Setting up 606␤Setting up 552␤»
14:42 PerlJam huh
14:43 Kristien masak: it has "factori" in it so I guess it has to do with adding factories to your design
14:43 masak m: for 1..2 { NEXT say "hup!" }
14:43 camelia rakudo-moar 114659: OUTPUT«hup!␤hup!␤»
14:43 masak m: for 1..2 { ENTER { NEXT say "hup!" } }
14:43 camelia rakudo-moar 114659: ( no output )
14:44 masak p6: for 1..2 { ENTER { NEXT say "hup!" } }
14:44 camelia rakudo-{parrot,moar} 114659: ( no output )
15:03 nine_ So I parsed my Apache config into an AST. Now I'd like to convert this into an AST for an Nginx config. Are there some best practices/examples for how to do that?
15:04 _mg_ joined #perl6
15:05 moritz nine_: the rakudo way would be to do a tree transform into an nginx tree, and then a code/config emitting stage
15:06 arnsholt It depends on how general you want/need it to be
15:07 nine_ moritz: what would the code for such a tree transform look like?
15:07 arnsholt But you can probably get away with traversing the Apache AST and building an Nginx object as you go
15:07 arnsholt Then dump the nginx object to string when you're done
15:08 nine_ arnsholt: that's what I'm going to do unless someone knows a better way
15:09 moritz nine_: probably a tree traversal that, at each node calls a multi sub that transform a single node into another node
15:10 nine_ multi sub! I'd have forgotten about them. So many shiny new toys :)
15:12 moritz nine_: they seem to be the cleanest solution, because they don't attach the transformation knowledge to the source type (as methods would), and neither are they a huge chain of if statements
15:13 moritz at least that's how JSON::Tiny does the serialization
15:14 |Tux| just re-synced from rakudobrew: I now do see a speedup (I think)
15:14 |Tux| 40.x => 38.x seconds
15:17 nine_ Perl 6 makes parsing so much fun, I wish I had more things to parse :)
15:18 telex joined #perl6
15:24 dalek doc: 6f0eb63 | moritz++ | lib/Language/functions.pod:
15:24 dalek doc: Explain "is assoc"
15:24 dalek doc: review: https://github.com/perl6/doc/commit/6f0eb637af
15:24 moritz nine_: well, you can now start parsing nginx config files :-)
15:25 moritz nine_: also I'm kinda interested in a general-purpose apache config parser
15:25 moritz nine_: it seems to hit a sweet spot of readability both in the small and the in the large; it allows delimited groups as well as newline-separated short directives
15:26 moritz and there are at least two projects where I'd have used it if I had found a proper parser for it on CPAN
15:26 nine_ moritz: I already wrote a grammar that can parse some nginx config :) As we discovered in the past few months, Apache just sucks as front end proxy for starman. So we're now migrating to Nginx. With > 1400 virtual hosts, that's kind of a challenge. Hence the try to automate this.
15:27 dalek doc: 8255be9 | moritz++ | lib/Language/functions.pod:
15:27 dalek doc: remove a TODO marker where I have no idea what is to be done
15:27 dalek doc: review: https://github.com/perl6/doc/commit/8255be997e
15:27 moritz nine_: so you're writing Perl 6 for $work?
15:27 nine_ moritz: indeed I do :)
15:27 moritz nine_: please blog about it :-)
15:28 smls joined #perl6
15:28 nine_ moritz: I don't need to parse Nginx configs for the conversion, but will use the code later for automating some standard config changes.
15:28 moritz nine_: oh, and are you available for hire? We'd need somebody who can do both perl 5 and python (and a bit of frontend work), and Perl 6 would be a plus in my eyes :-)
15:29 moritz oh wait, you said you did it for $work, so likely not
15:30 nine_ moritz: I'm very comfortable where I am right now. Hey, I can even write Perl 6 at work :) When I do have time to code something...
15:35 moritz http://arstechnica.com/information-technol​ogy/2015/02/linux-has-2000-new-developers-​and-gets-10000-patches-for-each-version/ those are seriously impressive numbers, IMHO
15:37 smls m: my $c = 1; say [$c, ++$c].perl;
15:37 camelia rakudo-moar 114659: OUTPUT«[2, 2]␤»
15:37 smls m: my $c = 1; say [$c + 0, ++$c].perl;
15:37 camelia rakudo-moar 114659: OUTPUT«[1, 2]␤»
15:37 smls ^^ same in Perl 5.
15:37 smls Is it that referencing a variable in the same expression that changes it is simply undefined behavior?
15:38 smls Or is there some more fine-grained rule to what you can expect it to do?
15:38 masak I don't really see what the problem is.
15:38 moritz I'm not quite sure, but I can explain the values above easily
15:38 masak if you're thinking in terms of sequence points, then surely each evaluated element is one.
15:39 masak surely there's nothing weird about a variable changing its value from one array element to another?
15:39 moritz S03 talks about sequence points
15:39 masak *especially* in element order :)
15:39 smls masak: Well, [$c, ++$c].perl; could also interpolate the value of $c into the first array element, *before* the second expression gets to increment it
15:40 moritz http://design.perl6.org/S03.html#Sequence_points
15:40 moritz smls: no, [...] is a call to circumfix:<[ ]>
15:40 moritz smls: and argument lists are evaluated before they are passed on to the callee
15:41 smls ah ok
15:41 smls but still, it means that the single $c argument is evaluated to its container, nhot the value
15:42 smls and only after the whole argument list has been evaluated, it's value is read
15:48 smls m: my $c = 1; my @a = $c, ++$c; say @a.perl;  # same with list assignment (or binding)
15:48 camelia rakudo-moar 114659: OUTPUT«Array.new(2, 2)␤»
15:49 smls So I guess the correct way to think about it is that the comma operator makes no promises about being a sequence point?
15:50 smls (unlike in C)
15:51 smls Or is it really about the container vs value distincion I mentioned above?
15:51 moritz smls: $c is evaluated to a variable. If you assigned to it (instead of binding), it references a container
15:51 moritz smls: and the decontainerization (if it happens) is done by the binder
15:51 moritz so, as part of passing the arguments, *after* they have been evaluated
15:52 smls m: my $c = 1; say ($c, ++$c).perl;   # what is the "binder" in this case?
15:52 camelia rakudo-moar 114659: OUTPUT«(2, 2)␤»
15:52 moritz smls: there's a call to infix:<,> in there
15:52 moritz for the comma
15:53 moritz and that call involves the binder, like every call
15:53 smls ok
15:56 smls m: say &postcircumfix:<[ ]>.gist
15:56 camelia rakudo-moar 114659: OUTPUT«use of uninitialized value $name of type Any in string context  in block <unit> at /tmp/bPoGfF5upf:1␤␤sub postcircumfix:<[ ]> (Any |) { #`(Sub|48789632) ... }␤»
15:56 smls ^^ bug in .gist ?
15:57 moritz yes
16:00 fernand__ joined #perl6
16:00 skids joined #perl6
16:00 fernand__ Hi! can anyone help me? I am trying to make a role that when someone create a class that do that role, it automatically creates a coerce method from Any (and all descendents) to that class.
16:01 fernand__ is that possible?
16:01 fernand__ my 2nd try was call a method from another class passing the role's class as parameter and the method should use the Any.^add_method() to create a new method named as the class name
16:01 fernand__ m: class BlaWithRole {}; class TypeManager {method register($type) {my &meth = my method () {$resource.new};Any.^add_method($resource.^name, &meth);}}; TypeManager.register(BlaWi​thRole);Any.^methods.say;
16:01 camelia rakudo-moar 114659: OUTPUT«5===SORRY!5=== Error while compiling /tmp/UWaycFaSMk␤Variable '$resource' is not declared␤at /tmp/UWaycFaSMk:1␤------> 3 {my &meth = my method () {$resource.new7⏏5};Any.^ad​d_method($resource.^name, &meth␤    expecting any of:␤        me…»
16:01 fernand__ my bad...
16:02 Ven it has to be possible, it's #perl6 :P
16:02 dalek perl6-roast-data: 00fb121 | coke++ | / (5 files):
16:02 dalek perl6-roast-data: today (automated commit)
16:02 dalek perl6-roast-data: review: https://github.com/coke/perl6​-roast-data/commit/00fb12166e
16:02 fernand__ m: class BlaWithRole {}; class TypeManager {method register($type) {my &meth = my method () {$type.new};Any.^add_method($type.^name, &meth);}}; TypeManager.register(BlaWi​thRole);Any.^methods.say;
16:02 camelia rakudo-moar 114659: OUTPUT«exists_key delete_key delete_pos list flat eager hash Parcel elems end keys kv values pairs invert squish rotor reverse sort reduce combinations permutations unique uniq pick roll classify categorize lol map for flatmap duckmap deepmap tree Array push unsh…»
16:02 Ven fernand__: you can chat in private with camelia through /w camelia m: ... to perfect your gists before putting them on the channel if you're unsure, or just use the REPL
16:03 fernand__ Ven: thanks, Im sorry...
16:03 Ven It's fine, I do it all the time :). It's really just more comfortable, if you don't have a REPL hanging around
16:04 fernand__ this code for me is creating a anon method on Any...
16:07 Ven sorry, I can't really help you, I'm not much into the metamodel stuff
16:07 fernand__ can any one help me?
16:12 perl6_newbee joined #perl6
16:12 perl6_newbee hi together
16:16 nine_ Servas
16:18 fernando___ joined #perl6
16:24 fernand__ How could I automaticaly create a coerce method for classes that do a specific role?
16:25 masak fernand__: maybe ask with code? your question is a bit abstract.
16:26 fernand__ masak: masak, here is something that looks a bug for me:
16:26 fernand__ class BlaWithRole {}; class TypeManager {method register($type) {my &meth = my method () {$type.new};Any.^add_method($type.^name, &meth);}}; TypeManager.register(BlaWi​thRole);Any.^methods.say;
16:26 _mg_ joined #perl6
16:26 fernand__ it's creating a anon method on Any
16:26 dalek doc: b060886 | (Adrian Kreher)++ | htmlify.p6:
16:26 dalek doc: Use Inline::Python to interact with pygments
16:26 dalek doc:
16:26 dalek doc: This is significantly faster when syntax highlighting but requires
16:26 dalek doc: Inline::Python which is currently difficult to build. On my machine,
16:26 dalek doc: htmlify with an external pygments takes around 22:20, while using it via
16:26 dalek doc: Inline::Python took only 6:25.
16:26 dalek doc: review: https://github.com/perl6/doc/commit/b0608864eb
16:26 dalek doc: 63f0b7c | moritz++ | htmlify.p6:
16:27 dalek doc: Attempt to make Inline::Python optional
16:27 dalek doc:
16:27 dalek doc: ... falling back to the old shelling-out code
16:27 dalek doc: review: https://github.com/perl6/doc/commit/63f0b7c5ec
16:27 dalek doc: 471e680 | moritz++ | htmlify.p6:
16:27 dalek doc: Merge branch 'inline-pygments'
16:27 dalek doc: review: https://github.com/perl6/doc/commit/471e6802a8
16:27 tadzik \o/
16:27 moritz htmlify.p6 is back to ~5min with Inline::Python and pygments
16:27 moritz nine_++ # Inline::Python
16:28 moritz avuserow++ # initial perl6/doc patch for using Inline::Python
16:29 fernand__ masak: did you see?
16:29 flussence .oO( our biggest performance problem today is the startup time of *python*... )
16:30 skids fernand__: maybe there is away to name the method before passing it to add_method?  Agree that's probably a bug.
16:31 smls With Inline::Python it will be more difficult make it process multiple snippets in parallel, right?
16:31 fernand__ skids: could you reproduce this "bug"?
16:32 moritz smls: possibly
16:32 smls Also, since when does Camelia use IRC colors?
16:32 smls :)
16:32 flussence since oh... a day or 2 ago
16:32 smls nice
16:32 * |Tux| throws spaces at smls :)
16:32 smls ;)
16:33 fernand__ skids: I tried to rename it... but I couldn't...
16:35 Ven joined #perl6
16:37 moritz m: my $x = my anon method () {}; $x.name = 'flurb'; say $x
16:37 camelia rakudo-moar 114659: OUTPUT«5===SORRY!5===␤Type 'anon' is not declared␤at /tmp/QmWWjqg53C:1␤------> 3my $x = my anon7⏏5 method () {}; $x.name = 'flurb'; say $x␤Malformed my␤at /tmp/QmWWjqg53C:1␤------> 3my $x = my 7⏏5anon method () {}; $x.name = 'flurb'; sa…»
16:37 moritz m: my $x = my  method () {}; $x.name = 'flurb'; say $x
16:37 camelia rakudo-moar 114659: OUTPUT«Cannot modify an immutable Str␤  in block <unit> at /tmp/vktYEfkPdd:1␤␤»
16:37 moritz m: my $x = my  method () {}; $x.set_name('flurb'); say $x
16:37 camelia rakudo-moar 114659: OUTPUT«flurb␤»
16:37 moritz fernand__: you can use .set_name
16:38 nine_ smls: this is so typical Python. Despite several people asking how to embed multiple interpreters, the answers are only that exceedingly few people need this and one should use multiple processes instead.
16:39 skids fernand__: Yes I can see an <anon> method added on a very recent build of rakudo as well.
16:39 moritz well, we could limit the Inline::Python calls to a single thread
16:40 moritz but parallelizing htmlify doesn't work; the concurrency support is too unreliable right now :(
16:45 fernand__ with the set_name it's working!!!
16:46 fernand__ but it steel looks a bug for me...
16:46 jluis joined #perl6
16:47 moritz it doesn't look like a bug to me
16:47 moritz you install an anon method, so that's what you get
16:47 moritz the MOP is a fairly low-level thing; you shouldn't expect a lot of "Do what I mean" from it
16:48 diana_olhovik joined #perl6
16:49 fernand__ moritz: but why would the .^add_method would expect a "name" if it isn't being used?
16:50 fernand__ add_method($object, $name, code); what is that $name for?
16:51 moritz fernand__: the name by which you can call the method
16:51 moritz m: Any.^add_method('thingy', my method () { 'argl' }); Any.thingy
16:51 camelia rakudo-moar 114659: ( no output )
16:51 moritz m: Any.^add_method('thingy', my method () { 'argl' }); say Any.thingy
16:51 camelia rakudo-moar 114659: OUTPUT«argl␤»
16:51 moritz see, you can call it by that name
16:51 fernand__ for me its creating a anon method...
16:52 fernand__ that's the "bug"
16:52 moritz fernand__: there are two names
16:52 moritz fernand__: one that the method itself knows about
16:52 moritz fernand__: and one by which you can call it from the outside
16:52 moritz (or more than one, if you install the same method with multiple names)
16:52 moritz that's a feature.
16:52 skids Well, one could argue that .^methods should show you the latter.
16:53 moritz skids: what would be the use?
16:53 moritz well
16:53 skids To see what methods you can call.
16:53 moritz that's what .^method_table does
16:54 moritz m: class A { }; A.^add_method('flurb', my method () { }); say A.^method_table.perl
16:54 camelia rakudo-moar 114659: OUTPUT«("flurb" => method <anon> ($: *%_) { #`(Method|62862072) ... }).hash␤»
16:55 skids m: class BlaWithRole {}; class TypeManager {method register($type) {my &meth = my method () {$type.new};Any.^add_method($type.^name, &meth);}}; TypeManager.register(BlaWithRol​e);Any.^method_table.keys.say; # fernand__'s example
16:55 camelia rakudo-moar 114659: OUTPUT«exists_key delete_key delete_pos list flat eager hash Parcel elems end keys kv values pairs invert squish rotor reverse sort reduce combinations permutations unique uniq pick roll classify categorize lol map for flatmap duckmap deepmap tree Array push unsh…»
16:55 skids doh. clipped.
16:55 moritz skids: that's why I used a separate class in my example, not Any :-)
16:57 fernand__ I understood!
16:57 fernand__ thank you very much!
16:57 fernand__ I have another question:
16:57 moritz you're welcome
17:01 fernand__ I could create a method on Any... Why I can't use this method on  Int?
17:05 moritz fernand__: do you want the short or the lang answer?
17:05 nine_ both :)
17:06 moritz short: "likely a bug"
17:06 fernand__ the longest the best... (i want to understand...)
17:06 moritz long: each type is "composed" when the closing curly brace of the definition is parsed
17:07 moritz this composition publishes a method cache
17:07 moritz so, in this order, Any is declared and composed, Int is declared and composed
17:07 moritz now you add a method to Any
17:07 moritz but Int doesn't know that, and doesn't update its method cache
17:08 moritz why? because Any doesn't know that Int is a subclass of it
17:08 moritz and it can't hold a reference to it, because then classes could never get garbage-collected
17:08 moritz so, one could say it's a bug in rakudo
17:08 moritz but one could also say that it's a bug in the code that adds a method after a class was composed
17:09 moritz and that doesn't attempt recompose the class (and its subclasses)
17:09 [Coke] also, don't do that.
17:09 moritz aye
17:09 moritz don't muck with built-in types; they are about as global as anything you get in Perl 6
17:09 moritz and modifying globals is BAD, with capital B
17:11 fernand__ :)
17:12 fernand__ but, so, if I do augment class Int {} after add the method on Any it should recreate the cache?
17:12 moritz for Any, yes
17:14 fernand__ didn't work for me...
17:14 fernand__ but ok... I shouldn't use it anyway...
17:14 moritz fernand__: how did you test whether the method cache for Any was updated?
17:15 fernand__ I tryed to call the method...
17:15 moritz on Any?
17:15 fernand__ on Int
17:15 moritz well, Int has its own type cache
17:16 fernand__ I realy think I am going to the wrong way...
17:16 moritz fernand__: what are you trying to achieve, in the end?
17:17 fernand__ the right question is: how can I make a custom class be automatically "translated" from any descendent of Any.
17:18 moritz you create a constructor or a coercer that accepts Any
17:18 moritz and you do that in the target method
17:18 moritz erm
17:18 moritz target class
17:18 fernand__ could you show me a example?
17:19 dalek doc: e354b41 | moritz++ | lib/Type/Metamodel/MethodContainer.pod:
17:19 dalek doc: document method_table
17:19 dalek doc: review: https://github.com/perl6/doc/commit/e354b41605
17:19 moritz fernand__: well, the easiest route is the constructor
17:19 moritz m: class MyThing { has $.thing; method new($x) { self.bless(thing => $x } }; say Mything.new(42).perl
17:19 camelia rakudo-moar 114659: OUTPUT«5===SORRY!5=== Error while compiling /tmp/DoUxheHyRA␤Unable to parse expression in argument list; couldn't find final ')' ␤at /tmp/DoUxheHyRA:1␤------> 3method new($x) { self.bless(thing => $x 7⏏5} }; say Mything.new(42).perl␤    expectin…»
17:20 moritz m: class MyThing { has $.thing; method new($x) { self.bless(thing => $x) } }; say Mything.new(42).perl
17:20 camelia rakudo-moar 114659: OUTPUT«5===SORRY!5=== Error while compiling /tmp/8iTogVFBp_␤Undeclared name:␤    Mything used at line 1. Did you mean 'MyThing'?␤␤»
17:20 moritz m: class MyThing { has $.thing; method new($x) { self.bless(thing => $x) } }; say MyThing.new(42).perl
17:20 camelia rakudo-moar 114659: OUTPUT«MyThing.new(thing => 42)␤»
17:20 kjs_ joined #perl6
17:20 moritz here the conversion is just stuffing the source value into an attribute
17:20 moritz but you could do any logic you like in method new()
17:21 kjs_ joined #perl6
17:21 fernand__ the problem is:
17:22 fernand__ I have a class with a custom class as a attribute...
17:22 Rounin joined #perl6
17:23 fernand__ I'd like to give a Any descendent to the constructor of the first class an it should translate to the custom class...
17:23 moritz so have the first class call OtherClass.new($thing) in its constructor
17:25 moritz the proper solution would be to use a coercion type for the attribute, but I don't think they work yet
17:26 fernand__ somethink like it:
17:26 fernand__ class ClassA {}; class ClassB {has ClassB $.b}; ClassB.new(:b(42));
17:26 fernand__ yes, I was trying to coerce...
17:27 nine_ fernand__: can you tell us in a less abstract way what you're trying to do?
17:27 Kristien joined #perl6
17:29 Kristien hi
17:31 _mg_ joined #perl6
17:32 TimToady Kristien: \o
17:32 PuercoPop left #perl6
17:32 Kristien how's it going. I wrote lots of Perl 5 today :v
17:32 TimToady we all have our little faults... :)
17:32 moritz fernand__: http://perlpunks.de/paste/show/54e76faa.5e74.199
17:33 moritz fernand__: OuterThing wraps the "a" in a MyThing in that example
17:33 moritz fernand__: which should be pretty much what you want
17:33 TimToady fernand__: when someone keeps asking how to do something specific, and doesn't say what they're actually trying to do, we tend to think there may be an XY problem, and that maybe you're trying to drive a screw with a hammer
17:34 fernand__ nine_: I am trying to create a Role (named Resource) that wait for a method (::?CLASS::U:) load() on a Class (example Post) that receive a id and return a hash with data. with that data it will create a new Post object. the data can have the value "author" as a id, for example 42. The type of author on Post class is another Resource class (Person)
17:35 Kristien TimToady: and C programmers have little segfaults!
17:36 fernand__ and  I need that when the load caller create the object, and make something like Post.new(|{author => 42}) it should create a obj Person(:id(42)) and store on author attribute od Post
17:37 fernand__ *of
17:37 moritz fernand__: are you writing an ORM?
17:38 fernand__ a JSON::API framework
17:38 moritz ah, nice
17:39 moritz an ORM, where R = REST :-)
17:39 TimToady what does a POST object do?
17:39 fernand__ TimToady: it represents a (blog) post
17:39 Kristien why allcaps?
17:40 TimToady this was not at all clear...
17:40 fernand__ I meant Post
17:40 TimToady Kristien: that was not at all clear either, but probably lack of caffeine in my case
17:40 Kristien I want an OOM where the second O is OData. I have to deal with a crappy OData API (Exact Online) and it's cumbersome to do with direct JSON stuff.
17:41 TimToady but I also typed it directly under the REST, so that might've influence me too
17:41 TimToady most of my thinking is subconscious...
17:42 dalek doc: 7e45e2d | moritz++ | lib/Language/objects.pod:
17:42 dalek doc: Mention BUILDALL overriding in object construction
17:42 dalek doc: review: https://github.com/perl6/doc/commit/7e45e2dfbe
17:42 moritz where should I best document {call,next}{with,same} on doc.perl6.org?
17:43 moritz in language/objects? or as subs in Mu?
17:43 TimToady same place you talk about generalized dispatchers?
17:43 moritz muhahaha
17:43 moritz I don't even know what generalized dispatchers are :-)
17:43 moritz TimToady: you're welcome to contribute that section :-)
17:43 PerlJam moritz: where do you talk about proto?
17:44 Kristien moritz: OOP section
17:44 Kristien inheritance and roles
17:44 Kristien somewhere there
17:44 moritz PerlJam: not yet, but I think it'll go into Language/functions.pod
17:44 masak a generalized dispatcher is like a diffeomorphism between two submanifolds, except over the rationals, not the integers.
17:44 masak I dare you to prove me wrong :P
17:45 PerlJam masak: this is IRC, I don't have to prove anything .... YOU'RE WRONG!
17:45 nwc10 TimToady: you're awareof the term "Birmingham Screwdriver"? -- http://www.urbandictionary.com/defi​ne.php?term=birmingham+screwdriver
17:45 * masak has been reading too much slightly too advanced math lately
17:47 TimToady S12 talks about it primarily under method dispatch, but then mentioned nextsame again under multiple dispatch
17:47 fernand__ nine_: moritz: thats what I'm trying to do: https://gist.github.com/ano​nymous/69e8ad1f6a3b9c29fe9c
17:47 * moritz think about renaming functions.pod into routines.pod, and putting it there
17:48 masak moritz: that might be the right thing to do, but let me devil-advocate a little: "routine" is Perl 6-think. "function" is what a beginner is more likely to look for (or find and think appropriate).
17:49 masak moritz: you and I naturally go "oh, routines are the generalization of functions, methods. submethods, macros etc". people not well-versed in p6 lingo wouldn't.
17:49 TimToady .oO(functions and other routines)
17:49 smls moritz: operators are also routines though, aren't they?
17:50 smls and they have their own page
17:50 moritz smls: yes. That's why functions.pod covers custom routines
17:50 moritz smls: only built-in operators have their own page
17:50 PerlJam masak: are you advocating for sections on functions, methods, submethods, etc. that all link to the section on routines?
17:51 TimToady routines, disambiguation
17:51 masak PerlJam: yes, maybe.
17:52 masak PerlJam: maybe it's nice to actually talk about the specific things in detail, without generalizing first thing and then having to talk only on the general level.
17:52 moritz where does nextsame work? dispatching to the next multi? to the original in a wrap? to the next (non-multi) method?
17:53 masak moritz: maybe there should be a section for each individual "use" of nextsame, like the ones you just listed?
17:53 smls I admit that with the current content of the language/functions page, it would make more sense to name it language/routines
17:53 masak moritz: "Using `nextsame` to call the original in a wrap"
17:53 smls Though the page's summary suggests that it may have initially been intended to have a different focus
17:54 smls Also, we use the name "Routines" in the main menu for the API documentation
17:55 perl6_newbee n8 all
17:55 smls so we're kinda already relying on users being able to understand/guess the meaning of the word
17:56 mr-foobar joined #perl6
18:01 masak "Routines (functions, methods, etc)"
18:03 smls in the API docs, the word "sub" or "subroutine" is usually used rather than "function"
18:07 smls how about two /language pages covering what the current /language/functions apparently set out do cover:
18:07 TimToady originally, Perl was trying to avoid confusion from Pascal programmers who think of procedures in opposition to functions
18:07 smls - /language/routines (subtitle: "Subroutines, methods, operators and more")
18:07 smls - /language/functional (Subtitle: "Functional programming with Perl 6")
18:07 Kristien Subroutinal programming
18:08 Kristien SP sounds like "socialist party" — eek
18:08 * TimToady remembers when we got pushback on the ss/// name :)
18:09 TimToady but we're trying to avoid becoming a taboo society
18:10 TimToady someone should say "lol" there :)
18:10 Mouq joined #perl6
18:10 smls well as long as the Unicode swastika symbol doesn't become a built-in operator...
18:11 TimToady it's not tilted, so we're not Waiting for Godwin
18:11 TimToady someone should write that play
18:11 Kristien In Funciton that would also work
18:12 Kristien Funciton programs are invariant under 90º rotations, but not under 45º rotations. :)
18:12 Kristien So you can work with four people on the same file!
18:13 smls .u 🗺
18:13 yoleaux No characters found
18:14 smls ?
18:15 Kristien m: say '🗺'
18:15 camelia rakudo-moar 114659: OUTPUT«🗺␤»
18:15 Kristien camelia: good girl
18:16 TimToady were you trying for 卍?
18:16 smls no, i just discovered the Unicode world map symbol and thought it was funny
18:16 TimToady but without 45° you can't get the 8-fold way wheel
18:17 Kristien you can do 8-fold in Perl 6
18:18 Kristien m: sub infix:<8>($x, $y) { $x * $y }; say [8] 1 2 3 4;
18:18 camelia rakudo-moar 114659: OUTPUT«5===SORRY!5=== Error while compiling /tmp/t8EyiTkkKy␤Two terms in a row␤at /tmp/t8EyiTkkKy:1␤------> 3nfix:<8>($x, $y) { $x * $y }; say [8] 1 7⏏2 3 4;␤    expecting any of:␤        infix stopper␤        infix or meta-infix␤       …»
18:18 Kristien oh, you can't :(
18:18 Kristien m: sub infix:<8>($x, $y) { $x * $y }; say [8] 1, 2, 3, 4;
18:18 camelia rakudo-moar 114659: OUTPUT«24␤»
18:18 Kristien oh, you can :)
18:18 Kristien An 8 fold!
18:19 Kristien is there <…> for numbers?
18:19 Kristien m: say map { .Int }, <1 2 3 4> # shorthand for this
18:19 camelia rakudo-moar 114659: OUTPUT«1 2 3 4␤»
18:20 TimToady .u midline
18:20 yoleaux U+1CD4 VEDIC SIGN YAJURVEDIC MIDLINE SVARITA [Mn] (◌᳔)
18:20 yoleaux U+22EF MIDLINE HORIZONTAL ELLIPSIS [Sm] (⋯)
18:20 TimToady there's that one, and all the other orientations
18:22 TimToady .u l.ellipsis
18:22 yoleaux U+002E FULL STOP [Po] (.)
18:22 yoleaux U+0065 LATIN SMALL LETTER E [Ll] (e)
18:22 yoleaux U+0069 LATIN SMALL LETTER I [Ll] (i)
18:22 TimToady boo, no regex
18:22 TimToady that works in my program :)
18:22 moritz TimToady: so IRCbotify your program :-)
18:23 smls Kristien: Isn't <1 2 3 4> supposed to return IntStr objects according to spec? (though I kinda hope it won't - Cool already provides a system to treats strings and numbers interchangeably, so do we really need another?)
18:23 pullphinger joined #perl6
18:23 Kristien :O
18:23 TimToady smls: but that doesn't get you an appropriate dispatch for things that were intended to be numeric
18:23 smls m: say <1 2 3 4>>>.Int.perl   # hyper is shorter than map
18:23 camelia rakudo-moar 114659: OUTPUT«(1, 2, 3, 4)␤»
18:25 smls m: say ('a', 'd' ... *)[^5]
18:25 camelia rakudo-moar 114659: OUTPUT«a d e f g␤»
18:25 smls ^^ should that be smarter (like it is with numbers)?
18:25 TimToady that would be a low-luminance feature
18:26 smls i.e. continue to count in steps of 3
18:26 TimToady and you use case?
18:26 TimToady *r
18:26 smls none :D
18:26 smls just playing around
18:27 smls kindo expected ranges to be built on the generic .pred/.succ feature though
18:27 smls s/ranges/series/
18:28 TimToady so build a type in which 'a'.succ eq 'd' :P
18:28 smls And if not, wouldn't it be better if the range operator refused threw an error for string inputs?
18:29 Kristien m: my $s = 'abc'; $s++; say $x
18:29 camelia rakudo-moar 114659: OUTPUT«5===SORRY!5=== Error while compiling /tmp/mvhMOcXdTg␤Variable '$x' is not declared␤at /tmp/mvhMOcXdTg:1␤------> 3my $s = 'abc'; $s++; say $x7⏏5<EOL>␤    expecting any of:␤        postfix␤»
18:29 Kristien m: my $s = 'abc'; $s++; say $s
18:29 camelia rakudo-moar 114659: OUTPUT«abd␤»
18:29 Kristien :O
18:29 smls Rather than loose its "smart" behavior and always do single-increment
18:29 TimToady there are two different useful semantics here
18:29 smls 'cause the latter can already be done with ..
18:29 Kristien can Perl 6 regexes be used as a C library?
18:29 TimToady m: say 'z'.succ
18:29 camelia rakudo-moar 114659: OUTPUT«aa␤»
18:29 Kristien or does that need a new implementation like P6CRE? :P
18:30 TimToady m: say '!' ... '~'
18:30 camelia rakudo-moar 114659: OUTPUT«! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~␤»
18:30 TimToady notice two different behaviors of 'z' here
18:30 Kristien All those sigils!
18:30 dalek rakudo/nom: 59b16d5 | lizmat++ | t/spectest.data:
18:30 dalek rakudo/nom: Properly fix mis-merge, [Coke]++
18:30 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/59b16d5ec6
18:31 [Coke] Kristien: they are not bundled in a way that is easy to access from C, no.
18:31 moritz though you could go the chain through Inline::Perl6 :-)
18:31 [Coke] however, you can easily do the inverse and call your C from perl 6.
18:31 TimToady now, tell me what the 7th member of your 'a','d' sequence is?
18:32 smls m: say ('!' .. '~').list;
18:32 camelia rakudo-moar 114659: OUTPUT«! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~␤»
18:32 kurahaupo1 joined #perl6
18:32 TimToady m: say ('a'...*)[0,3...*][6]
18:33 mglass_ joined #perl6
18:33 TimToady hmm
18:33 TimToady that's supposed not eagerize the subscript
18:33 camelia rakudo-moar 114659: OUTPUT«(timeout)»
18:33 smls ^^ TimToady: How about keeping  ('a' ... *) with a single LHS value as is, but throwing a warning/error if the LHS has more than one values
18:33 smls because that indicates a wrong assumption about what it does
18:33 TimToady m: say ('a'...*)[0,3...99][6]
18:33 camelia rakudo-moar 114659: OUTPUT«s␤»
18:34 TimToady m: say ('a'...*)[0,3...99][7]
18:34 camelia rakudo-moar 114659: OUTPUT«v␤»
18:34 TimToady m: say ('a'...*)[0,3...99][^9]
18:34 camelia rakudo-moar 114659: OUTPUT«a d g j m p s v y␤»
18:34 TimToady m: say ('a'...*)[0,3...99][^11]
18:34 camelia rakudo-moar 114659: OUTPUT«a d g j m p s v y ab ae␤»
18:34 TimToady m: say ('a'..."\xfffc")[0,3...99][^11]
18:34 camelia rakudo-moar 114659: OUTPUT«a d g j m p s v y | ␤»
18:35 TimToady so it's pretty easy to get your 'a','d' sequence, modulo bugs
18:35 smls Also, making it an error would allow adding the "smart sequence detection" (like it already does for numbers) in Perl 6.x if a usecase for it does appear...
18:36 TimToady but we don't know that someone doesn't want 'a','d','e','f'....
18:36 smls then they can use parens
18:37 TimToady we did discuss many generalizations of the detector, and decided that pretty much anything after arithmetic/geometric was just obfuscation
18:37 masak +1
18:37 jluis_ joined #perl6
18:37 TimToady the most notable proposal was to recognize OEIS sequences :)
18:37 TimToady but then why not just write oeis(42)
18:38 TimToady so I am dubious of future 'extensions' in any case...
18:38 lizmat moritz: re http://irclog.perlgeek.de/p​erl6/2015-02-20#i_10149105 about parents not knowing who their children are:
18:38 lizmat I think that should be solved for 6.0
18:39 TimToady it would be nice to be able to do a lazy subscript on a lazy list though...
18:39 grettir joined #perl6
18:39 masak lizmat: that doesn't sound to me like it must be a blocker for 6.0.0
18:40 lizmat well, then maybe we shouldn't have augment in 6.0 either
18:40 TimToady that doesn't sound to me like a problem that necessarily needs to be solved at all
18:40 TimToady in general, categories should not be tracking their instances
18:40 lizmat because you cannot explain when augmenting a super class, does not make its subclasses be augmented as well
18:41 lizmat or that module loading order is going to determine if an augment is seen by a sub class or not
18:41 TimToady are we talking about cache invalidation here?
18:41 zakharyas joined #perl6
18:41 lizmat possibly
18:41 masak moritz: I've heard (and made) the argument about leaky types before -- but I wonder how much of a problem that would be in practice? types behave differently from object-level things, they are relatively rare, and have long lifetimes anyway.
18:42 lizmat but we would need to know which caches to invalidate
18:42 lizmat invalidating *all* classes feels, eh. GILlish
18:42 TimToady well, that's why you're not supposed to do it very often
18:43 TimToady and that's what P5 does, and that works just fine
18:43 raiph joined #perl6
18:43 lizmat I think P5 got smarter than that, actually
18:43 lizmat it will only invalidate caches it needs to invaiidate
18:43 lizmat well, post 5.12 I think
18:44 * TimToady is not inclined to pander to augmentors
18:44 lizmat ok, so we need to invalidate all caches on an augment
18:44 TimToady it's a hard thing that should be possible
18:45 mr-foobar joined #perl6
18:45 lizmat I'm nor even sure if "invalidate all caches" is an option programmatically atm
18:45 TimToady we don't need to, but I think here's one of those spots where we don't torment the implementors on behalf of the (ab)users
18:46 * lizmat seems to recall that jnthn said having parents know about their children, would need to be done at some point
18:46 TimToady well, it could merely be a global generation counter in the cache lookup, perhaps with exceptions for anything that was originally seeded in the cache because it's a circularity saw
18:46 lizmat otoh, that could just be wishful thinking on my part atm
18:47 TimToady yes, but I think I disagree with jnthn++ a bit on the efficacy of that approach
18:48 TimToady that being said, tracking child types is likely to be easier than tracking child instances, so if he really wants to inflict that torment on himself, he can
18:49 TimToady but pre-6.0 I'd go for the simplest thing that maintains correct semantics, and that'd be a global generation count
18:49 smls TimToady: One thing that makes augmenting built-in classes tempting in Perl 6, is the fact that many buil-in types put their coercer methods in Any, and custom classes may want to emulate that
18:49 smls (which is basically what fernand__'s asked for above, I think)
18:49 lizmat m: class A { }; class A::B { }; say A::B.isa(A)  # this will trip up a lot of people
18:49 camelia rakudo-moar 114659: OUTPUT«False␤»
18:50 lizmat m: class A { }; class A::B is A { }; say A::B.isa(A)   # need to be explicit
18:50 camelia rakudo-moar 114659: OUTPUT«True␤»
18:51 smls if that's not possible, custom classes will always kinda be second-class citizens
18:51 fernand__ exactally what I was asking!
18:51 TimToady but we allow come-from as well as go-to coercers, which is the normal way to handle that
18:52 smls how would a custom class implement a come-from coercer from built-in types?
18:52 TimToady and a type that is so important that it needs its methods in Any is likely to not be much damaged by a global augment generation counter
18:53 mr-foobar joined #perl6
18:53 TimToady an important type will fire off near startup anyway, when most caches are still empty
18:53 TimToady smls: with the standard type name coerces
18:54 TimToady it's only if you must force your methods to be magical that you need Any access
18:54 TimToady and we've pretty much only granted that to list methods for Any
18:54 TimToady and "scalar" methods for Cool
18:55 gfldex joined #perl6
18:55 TimToady but you can do $x.MyType and get the MyType() definition for free
18:57 fernand__ TimToady: are you saying that is possible to do something like 42.MyType ?
18:58 fernand__ that was what I was trying to do creatng a new method on Any
18:58 TimToady m: class MyType { method postcircumfix:<( )>($from) { say $from } }; say 42.MyType
18:58 camelia rakudo-moar 114659: OUTPUT«No such method 'MyType' for invocant of type 'Int'␤  in block <unit> at /tmp/DDwq67tWp0:1␤␤»
18:58 TimToady that's supposed to failover
18:59 TimToady seems to be it used to
18:59 _mg_ joined #perl6
19:00 TimToady maybe I wrote it rwrong
19:00 TimToady m: class MyType { method postcircumfix:<( )>($from) { say $from } }; say MyType(42)
19:00 camelia rakudo-moar 114659: OUTPUT«42␤True␤»
19:00 TimToady no, the failover is busted
19:01 fernand__ and if it works, than should this work? my MyType $x = 42?
19:02 TimToady not that specifically, because you didn't specify a coercion type there
19:03 TimToady pretty soon, my MyType() $x = 42; should work
19:03 smls TimToady: But ideally you'd only want to define the postcircumfix () on the type object, right?
19:03 TimToady but coercion types only work in signatures so far
19:04 smls Also, if that's the recommended mechanism, why don't the built-in classes do that?
19:04 smls (and put their coercers in Any instead)
19:04 fernand__ m: class MyType { method postcircumfix:<( )>($from) { say $from } }; MyType() $x = 42; $x.perl.say
19:04 camelia rakudo-moar 114659: OUTPUT«5===SORRY!5=== Error while compiling /tmp/L81kUdhV3f␤Two terms in a row␤at /tmp/L81kUdhV3f:1␤------> 3:<( )>($from) { say $from } }; MyType() 7⏏5$x = 42; $x.perl.say␤    expecting any of:␤        infix stopper␤        infix or meta-in…»
19:05 TimToady fernand__: you need a declarator
19:05 TimToady like 'my'
19:05 mr-foobar joined #perl6
19:05 fernand__ coercive type declarations not yet implemented. Sorry.
19:06 fernand__ m: class MyType { method postcircumfix:<( )>($from) { say $from } }; my MyType() $x = 42; $x.perl.say
19:06 camelia rakudo-moar 114659: OUTPUT«5===SORRY!5=== Error while compiling /tmp/zbxCNexXtQ␤MyType() cannot be used as a nominal type on a variable␤at /tmp/zbxCNexXtQ:1␤------> 3($from) { say $from } }; my MyType() $x 7⏏5= 42; $x.perl.say␤    expecting any of:␤        constr…»
19:06 aa0e-40a0 joined #perl6
19:06 TimToady m: class MyType { method postcircumfix:<( )>($from) { say $from } }; my (MyType() $x) := 42; $x.perl.say
19:06 camelia rakudo-moar 114659: OUTPUT«Too few positionals passed; expected 1 argument but got 0␤  in block <unit> at /tmp/CVA4ZRAW7R:1␤␤»
19:07 TimToady m: class MyType { method postcircumfix:<( )>($from) { say $from } }; my (MyType() $x) ::= 42; $x.perl.say
19:07 camelia rakudo-moar 114659: OUTPUT«Too few positionals passed; expected 1 argument but got 0␤  in block <unit> at /tmp/dlxtwrigaM:1␤␤»
19:07 fernand__ https://gist.github.com/ano​nymous/e3481d2cf907cccbd984
19:08 TimToady fernand__: coercive types were not yet implemented in 2015.01
19:08 TimToady this is brand-new stuff
19:08 TimToady and they're only implemented where the old 'as' syntax was supported, so far
19:09 TimToady as you can see from the error, something isn't passed as a parameter where one is expected internally
19:09 fernand__ Im cloning...
19:10 smls m: class MyType { method postcircumfix:<( )>($self:U: $from) { "from $from" } }; say MyType(42)
19:10 camelia rakudo-moar 114659: OUTPUT«===SORRY!===␤Cannot invoke this object (REPR: P6opaque, cs = 0)␤»
19:10 smls :/
19:12 TimToady looks like it's trying, anyway
19:13 TimToady m: class MyType { method postcircumfix:<( )>($self:U: $from) { "from $from" } }; say 42.MyType
19:13 camelia rakudo-moar 114659: OUTPUT«===SORRY!===␤Cannot invoke this object (REPR: P6opaque, cs = 0)␤»
19:13 TimToady looks like the failover is there too, just not working for some reason
19:13 FROGGS joined #perl6
19:14 aa0e-40a0 left #perl6
19:14 TimToady m: class MyType does Callable { method postcircumfix:<( )>($self:U: $from) { "from $from" } }; say 42.MyType
19:14 camelia rakudo-moar 114659: OUTPUT«===SORRY!===␤Cannot invoke this object (REPR: P6opaque, cs = 0)␤»
19:15 * TimToady shrugs, and looks for more caffeine
19:16 moritz m: class MyType {method invoke($from) { "from $from" } }; say MyType(42)
19:16 camelia rakudo-moar 114659: OUTPUT«from 42␤»
19:16 moritz m: class MyType {method invoke($from) { "from $from" } }; say 42.MyType
19:16 camelia rakudo-moar 114659: OUTPUT«No such method 'MyType' for invocant of type 'Int'␤  in block <unit> at /tmp/kkYK8sk79j:1␤␤»
19:16 TimToady ah, we renamed it, eh
19:16 TimToady that should probably be uppercase
19:16 moritz +1
19:18 TimToady but maybe that's when the failover got busted
19:19 smls What about requiring the invocant to be a type object with :U, is that supposed to work?
19:19 TimToady yes
19:20 TimToady m: class MyType {method invoke(MyType:U: $from) { "from $from" } }; say MyType(42)
19:20 camelia rakudo-moar 114659: OUTPUT«from 42␤»
19:20 TimToady m: class MyType {method invoke(MyType:U: $from) { "from $from" } }; say MyType.new.(42)
19:20 camelia rakudo-moar 114659: OUTPUT«Invocant requires a type object, but an object instance was passed␤  in method invoke at /tmp/JOcMxPBmQ2:1␤  in block <unit> at /tmp/JOcMxPBmQ2:1␤␤»
19:20 TimToady not only is it supposed to work, it does, shock!
19:21 smls :)
19:21 * TimToady had better escape to the backlog while something is working right...
19:21 Sqirrel joined #perl6
19:22 zakharyas joined #perl6
19:26 Kristien joined #perl6
19:26 MadcapRusso what does the backslash mean in the operator `=:=`'s signature: multi sub infix:<=:=>(Mu \a, Mu \b)
19:27 fernand__ how can I get the Attribute type from its meta object?
19:27 masak MadcapRusso: it's a kind of sigil.
19:27 TimToady MadcapRusso: it means just do a raw bind of the argument to the name, no item or list assumptoins
19:27 TimToady not really a sigil
19:28 masak kinda
19:28 timotimo .tell grondilu be sure to hit me up with the white noise thing when you're back, and tell me if using int32 instead of int fixes things
19:28 yoleaux timotimo: I'll pass your message to grondilu.
19:28 TimToady more like the absence of one
19:28 TimToady it also declares a term
19:28 moritz m: say Date.^attributes.grep(*.name eq 'year').type.^name # for fernand__
19:28 camelia rakudo-moar 114659: OUTPUT«No such method 'type' for invocant of type 'List'␤  in block <unit> at /tmp/yNkWbXBdUO:1␤␤»
19:28 fernand__ and how can I set it's value? I cant use .set_value() it isnt working...
19:28 moritz m: say Date.^attributes.first(*.name eq 'year').type.^name # for fernand__
19:28 camelia rakudo-moar 114659: OUTPUT«Nil␤»
19:28 moritz hrmpf
19:28 moritz m: say DateTime.^attributes.first(*.name eq 'minute').type.^name # for fernand__
19:28 camelia rakudo-moar 114659: OUTPUT«Nil␤»
19:29 moritz m: say DateTime.^attributes.perl
19:29 camelia rakudo-moar 114659: OUTPUT«(Attribute.new(), Attribute.new(), Attribute.new(), Attribute.new(), Attribute.new(), Attribute.new(), Attribute.new(), Attribute.new())␤»
19:29 TimToady if it were really a sigil, you could use twigils after it
19:29 moritz m: say DateTime.^attributes>>.name
19:29 camelia rakudo-moar 114659: OUTPUT«$!year $!month $!day $!hour $!minute $!second $!timezone &!formatter␤»
19:29 dalek doc: 2898af7 | paultcochrane++ | Makefile:
19:29 dalek doc: Add html-nohighlight Makefile target
19:29 dalek doc:
19:29 dalek doc: Which doesn't run the syntax highlighting and is thus a bit faster.
19:29 dalek doc: review: https://github.com/perl6/doc/commit/2898af7fc4
19:29 moritz oh
19:29 dalek doc: f442416 | paultcochrane++ | / (3 files):
19:29 dalek doc: Move footer-html into Pod::Htmlify
19:29 dalek doc: review: https://github.com/perl6/doc/commit/f442416fd0
19:29 moritz m: say DateTime.^attributes.first(*.name eq '$!minute').type.^name # for fernand__
19:29 camelia rakudo-moar 114659: OUTPUT«Int␤»
19:29 moritz now it works
19:29 fernand__ moritz: thanks!
19:31 MadcapRusso TimToady: is it using the backslash so that the \a and \b remain in their respective containers? (for the =:= operator)
19:32 dalek doc: a7d5119 | moritz++ | lib/Language/functions.pod:
19:32 dalek doc: Document {call,next}{same,with}
19:32 dalek doc: review: https://github.com/perl6/doc/commit/a7d51190ae
19:33 fernand__ moritz: how to set the value?
19:33 TimToady MadcapRusso: yes
19:34 TimToady it's also faster in theory, though not necessarily in practice
19:34 TimToady it allows the caller to make a $ vs @ distinction, instead of imposing one ourselves
19:36 TimToady I think $ is faster than \ in practice because the optimizer works harder on $, iirc
19:36 moritz fernand__: with set_value
19:36 moritz fernand__: http://doc.perl6.org/routine/set_value
19:36 fernand__ https://gist.github.com/ano​nymous/a58e4878c1d545f49575
19:36 fernand__ Not enough positional parameters passed; got 2 but expected 3
19:37 moritz fernand__: yes. Read the error message. Compare it with the docs
19:38 FROGGS m: my $dt = DateTime.now; $dt.^attributes.first(*.name eq '$!minute').set_value($dt, 42); say $dt # fernand__
19:38 camelia rakudo-moar 114659: OUTPUT«2015-02-20T20:42:17+0100␤»
19:38 FROGGS fernand__: though, you usually dont want to do that :o)
19:38 TimToady when you're working with meta-objects, you often have to pass in a non-meta-object also
19:39 TimToady we should require a declaration of 'use MONKEY_BUSINESS;' or so for meta-manipulation
19:39 FROGGS aye
19:39 FROGGS use META_MONKEY
19:39 TimToady use MONKEY'S_UNCLE
19:40 TimToady use MONKEY_SEE-NO-EVIL;
19:40 TimToady I kinda like that one
19:41 TimToady use MONKEY_AROUND
19:41 fernand__ FROGGS: why not?
19:41 TimToady if 'meta' is 'around'
19:42 danstoner joined #perl6
19:43 FROGGS fernand__: the object you want to mess with should expose a rw-accessor instead
19:43 TimToady the metamodel is technically outside the language, and might evolve in a direction that breaks your code
19:43 Hor|zon joined #perl6
19:44 * TimToady is not even quite sure we should be documenting it on doc.perl6.org so plainly
19:44 fernand__ but if I cant make auto-coercion from Any to my custom class, I cant see other way to do what I want...
19:45 TimToady it's already supposed to be possible within the language, it's just busted
19:45 TimToady so we should unbust it
19:46 TimToady things inside the language will have more guarantees of stability going forward
19:47 TimToady as soon as you start going into the metasystem, you risk paradox (in the form of running into one of our carefully hidden circularity saws)
19:48 TimToady and basically, we reserve the right to move the circularity saws from one spot to another without changing the official language
19:48 TimToady but anything hidden behind a .HOW or a .^ is officially part of the implementation rather than the language
19:49 TimToady at least that's HOW I've always thought of it
19:49 TimToady we probably need metamodel versioning independent of language versioning, in fact
19:50 fernand__ makes sense...
19:50 TimToady no, never say that about me...the best you can say is that I sound like I make sense :)
19:51 * masak .oO( there are morphisms between TimToady and sense, but none of them are bijections... ) :P
19:52 TimToady I see that the implementation of 'invoke' relies on introspection to decide between 'invoke' and 'postcircumfix:<( )>', but why didn't we just alias the two symbols instead, and avoid the introspection smell?
19:53 TimToady Morphism: the cult of shapes
19:54 TimToady not to mention the introspection overhead?
19:54 zakharyas joined #perl6
19:55 TimToady hmm, maybe I know
19:55 TimToady m: sub foo { say "hi" }; &foo.postcircumfix:<( )>
19:55 camelia rakudo-moar 114659: OUTPUT«No such method 'postcircumfix:<( )>' for invocant of type 'Sub'␤  in block <unit> at /tmp/AZIOeMsF5a:1␤␤»
19:56 TimToady nope, it's not even there, so can't be deprecating...
19:56 TimToady m: sub foo { say "hi" }; &foo.invoke
19:56 camelia rakudo-moar 114659: OUTPUT«No such method 'invoke' for invocant of type 'Sub'␤  in block <unit> at /tmp/VLvnThmCrL:1␤␤»
19:56 TimToady oh, come on... :)
19:56 masak :(
19:56 TimToady can't we have a *little* consistency?
19:57 * masak 's submit finger itches
19:57 TimToady INVOKE should work on anything Callable, you'd think
19:58 TimToady unless it should be called, like, CALL
19:58 masak invoke sounds fine to me.
19:58 masak I draw parallels with at_pos and friends.
19:59 TimToady those are mostly called magically as well
19:59 masak right.
19:59 TimToady so properly oughta be uppercase
20:00 TimToady it's not just phasers that are called magically
20:01 TimToady and the all-caps idea is about things that magically come-from somewhere because of their special name, not just about phasers
20:02 masak *nod*
20:03 TimToady well, we probably have to rethink all our indexing for NSA anyway
20:03 TimToady gee, that sounds bad...
20:03 [Tux] http://www.dagolden.com/index.php/2406/thoughts-​on-getting-perl-6-for-christmas/#perl_community
20:04 spider-mario joined #perl6
20:04 Kristien damn
20:08 geekosaur they already did...
20:10 TimToady yes, we need to switch our internal module names to include version sometime soon, with bare names being aliases within a lexical scope
20:10 TimToady vers/auth I should say
20:12 TimToady ::() can lookup in the current lexical scope, but output of typenames should probably depend on whether there is more than one version loaded
20:13 TimToady so if there are two different versions of Foo loaded, instead of (Foo) we might get (Foo:ver<1.23>:auth<jnthn>)
20:13 TimToady but if there's only one loaded, we can probably get away with (Foo)
20:14 FROGGS it might be handy to spit auth the ver/auth evey time
20:14 FROGGS so you are always aware what distribution you actually use
20:14 skids That would make common debugging ugly.
20:14 TimToady you really want to see (Int:ver<6.0>:auth<TPF>) every time
20:15 FROGGS ohh, perhaps not for internal suff
20:15 FROGGS stuff*
20:15 TimToady nor for stuff you only ever load one version of, even if not internal
20:15 TimToady we aren't just trying to streamline this for ourselves :)
20:15 eternaleye joined #perl6
20:16 TimToady we do plan to have users someday :)
20:16 skids Someone will come asking for an intrspective way to get the canonical name, though.
20:16 TimToady well, that's probably .^name or so
20:16 TimToady or .^longname
20:17 TimToady but once we're into OO-land, pretty much everything has to be longname
20:17 TimToady since you don't know the lexical scope anymore
20:18 TimToady or shortname, as long as you know it's unique, is my proposal
20:19 skids m: module A {  class B { } }; A::B.WHAT.say
20:19 camelia rakudo-moar 114659: OUTPUT«(B)␤»
20:19 TimToady but identity is critical, is the long-standing point that S11 has been trying to make, both internally and in the official library
20:20 TimToady and the forest of identity often gets lost in the trees
20:21 TimToady m: module A {  class B { } }; A::B.perl.say
20:21 camelia rakudo-moar 114659: OUTPUT«B␤»
20:21 TimToady m: module A {  class B { } }; B.new.perl.say
20:21 camelia rakudo-moar 114659: OUTPUT«5===SORRY!5=== Error while compiling /tmp/DEg0X9utZE␤Undeclared name:␤    B used at line 1␤␤»
20:22 TimToady (B) should probably be (A::B) if that's its global name
20:22 skids So, maybe that's something to clean up alongside versioning.
20:22 TimToady yup
20:24 pippo joined #perl6
20:25 pippo o/ #perl6
20:25 skids o/
20:26 pippo I need something like the sub "note" but that does not add the trailing \n. does this function exist?
20:28 smls m: print $*ERR: "Hello world"
20:28 camelia rakudo-moar 114659: OUTPUT«Hello world»
20:28 smls pippo: ^^
20:29 pippo smls: thank you! that is what I needed!
20:34 Alina-malina joined #perl6
20:37 skids Can an is repr('CPointer') class usefully define a way to serialize/deserialize an instance?
20:37 FROGGS skids: with nativecast(), yes
20:38 skids Are there actually docs on nativecast?
20:38 FROGGS I'm not sure....
20:40 FROGGS m: use NativeCall; sub malloc(long) returns OpaquePointer is native { * }; my $ptr = malloc(8); say $ptr; say nativecast(Int, $ptr) # skids
20:40 camelia rakudo-moar 114659: OUTPUT«OpaquePointer<0x4b797a0>␤139909031614120␤»
20:40 skids Basically I'm wondering if I can help rakudo constant-fold.
20:41 FROGGS wow, cpanda does still work
20:43 timotimo .tell grondilu you got "cannot modify an immutable TypedCArray blah" because you put a type object into the @points, rather than an instance
20:43 yoleaux timotimo: I'll pass your message to grondilu.
20:48 rurban joined #perl6
20:50 * grondilu is actually here
20:50 yoleaux 19:28Z <timotimo> grondilu: be sure to hit me up with the white noise thing when you're back, and tell me if using int32 instead of int fixes things
20:50 yoleaux 20:43Z <timotimo> grondilu: you got "cannot modify an immutable TypedCArray blah" because you put a type object into the @points, rather than an instance
20:51 timotimo oh hey grondilu
20:51 grondilu I'm pretty sure I did put instances.
20:51 rurban1 joined #perl6
20:51 grondilu also: hello
20:51 timotimo not in your gist :)
20:53 grondilu ok well I'll try agagin
20:53 timotimo i'm also a bit baffled as to why it won't work
20:53 ugexe is there a nice way to get skip()/todo()/skip_rest() to place nicely with subtest?
20:53 grondilu I'll start again from https://gist.github.com/gro​ndilu/7e66deb134e630e561ee
20:56 skids ugexe: well, todo plays nicely with throws_like, so I would imagine...
20:57 ugexe ill write up an example in a minute, but the problem is it seems to mess up the count, and then testing things it shouldnt
20:57 grondilu timotimo: check this out:
20:57 grondilu m: use NativeCall; class Foo is repr("CStruct") {}; my @a := CArray[Foo]; @a[0] :=
20:57 camelia rakudo-moar 114659: OUTPUT«5===SORRY!5=== Error while compiling /tmp/NXzalHU3RR␤Bogus statement␤at /tmp/NXzalHU3RR:1␤------> 3uct") {}; my @a := CArray[Foo]; @a[0] :=7⏏5<EOL>␤    expecting any of:␤        prefix or term␤        prefix or meta-prefix␤»
20:57 grondilu Foo.new'
20:58 grondilu ahhh
20:58 grondilu m: use NativeCall; class Foo is repr("CStruct") {}; my @a := CArray[Foo]; @a[0] := Foo.new
20:58 camelia rakudo-moar 114659: OUTPUT«No such method 'bind_pos' for invocant of type 'TypedCArray[Foo]'␤  in sub postcircumfix:<[ ]> at src/gen/m-CORE.setting:3288␤  in block <unit> at /tmp/Eyxb9Ko4eP:1␤␤»
20:58 grondilu ^weird, isn't it?
20:59 dalek ecosystem: 292c8dd | FROGGS++ | META.list:
20:59 dalek ecosystem: add Foo v1.0 and Foo v1.2 for testing multiple versions
20:59 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/292c8ddb50
20:59 timotimo m: use NativeCall; class Foo is repr("CStruct") {}; my @a := CArray[Foo].new; @a[0] := Foo.new
20:59 camelia rakudo-moar 114659: OUTPUT«Unexpected named parameter 'BIND' passed␤  in sub postcircumfix:<[ ]> at lib/NativeCall.pm:324␤  in block <unit> at /tmp/M6bdLgpCzI:1␤␤»
20:59 timotimo m: use NativeCall; class Foo is repr("CStruct") {}; my @a := CArray[Foo].new; @a[0] = Foo.new
20:59 camelia rakudo-moar 114659: ( no output )
20:59 FROGGS m: use NativeCall; class Foo is repr("CStruct") {}; my @a := CArray[Foo].new; @a[0] = Foo.new
20:59 camelia rakudo-moar 114659: ( no output )
20:59 timotimo i told you, you were using a type object
20:59 grondilu oh
20:59 grondilu in the array yes
21:00 grondilu my bad
21:00 telex joined #perl6
21:01 timotimo Invalid renderer
21:01 timotimo says GetError
21:02 * FROGGS .oO( *Cough*, computer says no! )
21:03 FROGGS btw, both panda/CPAN and panda/eleven seem to be in a very good shape
21:04 grondilu I don't get any more error but the screen remains black.
21:04 ugexe skids: you were right, todo works. its was just skip/skip_rest that doesnt handle subtests
21:05 timotimo yeah, you have to SDL_GetError
21:06 dalek rakudo/nom: e6b992f | lizmat++ | src/core/Str.pm:
21:06 dalek rakudo/nom: Make s/// up to 25% faster (for many changes)
21:06 dalek rakudo/nom:
21:06 dalek rakudo/nom: - abstract optimized .subst case into private method APPLY-MATCHES
21:06 dalek rakudo/nom: - optimize APPLY-MATCHES further by avoiding repeat checks where possible
21:06 dalek rakudo/nom: - make both .subst and .subst-mutate use this private method
21:06 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/e6b992f0cd
21:06 flussence lizmat++ # all these optimizations are crazy-awesome
21:08 lizmat now, if someone could help me with passing a :SINK parameter to .subst-mutate if s/// is called in sink context
21:09 lizmat we probably could make s/// for strings an order of magnitude faster
21:10 skids ugexe: yeah looks like todo is implemented differently via todo_upto_testnum
21:10 skids *test_num
21:11 raydiak \o
21:13 ugexe fwiw this was what happened:
21:13 ugexe m: use Test; plan 1; skip_rest(); subtest { ok 0; ok 1; };
21:13 camelia rakudo-moar 114659: OUTPUT«1..1␤ok 1 - # SKIP <unknown>␤    not ok 1 - ␤    ␤# Failed test at /tmp/Nmzoq7W5Mm line 1␤    ok 2 - ␤    1..2␤    # Looks like you failed 1 tests of 2␤not ok 2 - ␤␤# Failed test at /tmp/Nmzoq7W5Mm line 1␤# Looks like you planned 1 te…»
21:16 TimToady lizmat: in the long run, sink will end up negotiated by the GLR, so I wouldn't put too much work into short-term fixes; the definitiion of "too much" is of course left up to you :)
21:17 lizmat TimToady: well, I'm not sure how the GLR would handle something like subst-mutate
21:17 lizmat which changes $self *and* returns the matches
21:17 TimToady it is nice to know what sorts of speedups are negotiable, of course
21:17 TimToady and maybe in the specific case of sink, the compiler can do the negotiation
21:18 TimToady and hence can apply it to something like s///, which we usually think of as a scalar op, even though s:g/// really is a list op
21:18 lizmat yes, my idea is that the compiler adds a :SINK named param
21:18 lizmat just like in the:
21:18 lizmat %hash<foo bar baz>:delete
21:18 raydiak grondilu: when you get to the point where it works, you'll definitely want to use loop(;;) with a native int counter for iterating over every pixel...otherwise you'll get single-digit fps at 640x480 before even adding 1 line of code to the loop body
21:18 lizmat case
21:19 TimToady things under the GLR will have those based on caller context though, not static context
21:19 lizmat where we don't actually need the values, just have the keys removed
21:19 TimToady *have to choose those
21:20 lizmat but I get the nudge  :-)
21:20 lizmat I just hope pmichaud will be able to start soon
21:20 TimToady and even for the GLR, we'll know some caller contexts at compile time, and can choose the exact implementation in advance
21:20 lizmat indeed
21:20 lizmat :-)
21:20 TimToady but the exact low-level api for getting more values will be more closuer-based, likely
21:20 TimToady *sure
21:21 TimToady not so much method based
21:21 lizmat ok... looking forward to things to come
21:21 grondilu raydiak, timotimo: well, frankly I've gave up already.  I'll go back to it one day but I'll try to use pixels and not points.
21:21 TimToady in the case of strictly lazy, we'll have closures that simply return one value
21:22 TimToady and hopefully sufficient inlining tech to simplify a stack of lazy closures
21:22 grondilu (I mean, writing on the SDL_Surface directly, as in the C solution)
21:22 TimToady (not quite there yet, since inlining doesn't extend to clones yet as I understand it)
21:22 lizmat TimToady: indeedy :-)
21:24 TimToady but I could easily be misunderstanding that
21:24 timotimo grondilu: i fear i'll finish the task before you try again :)
21:24 TimToady well, it's a wiki
21:25 * TimToady missed lunchtime, eep
21:27 fernand__ is there any way that I can create a class LocalResource and when I use it on another class (has LocalResource[Person] $.author) and when I instanciate the class Class.new(:author(42)) the attribute of the object will have a LocalResource object with attr class = Person and id = 42 ?
21:28 FROGGS $ perl6-m -e '{ use Foo:ver(v1.0); say Foo.ver }; { use Foo:ver(v1.2); say Foo.ver };'
21:28 FROGGS ===SORRY!===
21:28 FROGGS Merging GLOBAL symbols failed: duplicate definition of symbol Foo
21:28 FROGGS :o(
21:28 diakopter joined #perl6
21:29 firefish5000 m: given "OptA" { for <OptA OptB> -> $Opt {when "$Opt" { say "{$Opt} Succeeded"; }} ; default { say "$_ Defaulted"; } }
21:29 camelia rakudo-moar 114659: OUTPUT«OptA Succeeded␤OptA Defaulted␤»
21:29 firefish5000 m: LABELG: given "OptA" { for <OptA OptB> -> $Opt {when "$Opt" { say "{$Opt} Succeeded"; LABELG.succeed; }; default { say "$_ Defaulted"; } }
21:29 camelia rakudo-moar 114659: OUTPUT«5===SORRY!5=== Error while compiling /tmp/K6LDSQZ94q␤Unable to parse expression in block; couldn't find final '}' ␤at /tmp/K6LDSQZ94q:1␤------> 3ed; }; default { say "$_ Defaulted"; } }7⏏5<EOL>␤»
21:29 firefish5000 From S04#Switch-statements . I thought this should work. However I didnt see it from a quick look in NYI in bugs nor a test for it in the linked file.
21:30 skids FROGGS: there's an alternate-auth Digest::MD5 in Sum if you want to play with that, too.
21:30 firefish5000 m: LABELG: given "OptA" { for <OptA OptB> -> $Opt {when "$Opt" { say "{$Opt} Succeeded"; LABELG.succeed; }}; default { say "$_ Defaulted"; } }
21:30 camelia rakudo-moar 114659: OUTPUT«OptA Succeeded␤No such method 'succeed' for invocant of type 'Label'␤  in block  at /tmp/S3yvICiNfR:1␤  in block <unit> at /tmp/S3yvICiNfR:1␤␤»
21:30 dalek rakudo/nom: 232601a | lizmat++ | src/core/Str.pm:
21:30 dalek rakudo/nom: Oops, any named param should take slow path
21:30 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/232601aff1
21:31 FROGGS fernand__: LocalResource[Person] sounds more like a typed role
21:31 Kristien m: say Int[42]
21:31 camelia rakudo-moar 114659: OUTPUT«===SORRY!===␤Type Int cannot accept type arguments␤»
21:31 Kristien Int doesn't act like a list. :(
21:31 fernand__ typed role? is there any documentation about that?
21:31 FROGGS skids: I run into the same issue probably... but I put it on my list
21:32 skids fernand__: http://design.perl6.org/S14.html
21:32 diakopter m: say Int[[42]]
21:32 camelia rakudo-moar 114659: OUTPUT«Type Int cannot accept type arguments␤  in any parameterize at src/gen/m-Metamodel.nqp:2628␤  in block <unit> at /tmp/vXcjy0JpgJ:1␤␤»
21:32 yoleaux 22 Sep 2014 17:48Z <[Coke]> diakopter: - think I figured out the problem - can you up the swap space on host08 to match host07? (I can probably stumble my way through this if needed)
21:32 yoleaux 13 Oct 2014 19:13Z <[Coke]> diakopter: is host08 as zippy as it's going to get?
21:32 FROGGS fernand__: https://perl6advent.wordpress​.com/2009/12/18/day-18-roles/ look at role DeliveryCalculation[::Calculator] {
21:33 FROGGS diakopter: nice try :o)
21:33 diakopter it's a different error
21:33 diakopter ish
21:33 [Coke] OHAI diakopter
21:34 diakopter howdy
21:34 flussence "Files=940, Tests=34541, 315 wallclock secs"... my desktop is getting *very* close to breaking 5 minutes on the spectest. That figure's already dropped half a minute this month.
21:34 FROGGS firefish5000: it is NYI for Labels, correct... also stuff like LABEL.keep
21:34 kaare_ joined #perl6
21:34 [Coke] diakopter: ignore those, I'm no longer using host08.
21:34 diakopter k
21:35 FROGGS well, at least that works:
21:35 FROGGS $ perl6-m -e 'use Foo:ver(v1.2); say Foo.ver' # v1.2
21:35 FROGGS $ perl6-m -e 'use Foo:ver(v1.0); say Foo.ver' # v1.0
21:37 FROGGS (ver is just a normal method that returns a literal version string...)
21:37 grondilu timotimo: by all means, do so :)
21:37 FROGGS and that's with panda/eleven, which installs all distributions into a "database"
21:38 dalek rakudo/newio: face62b | lizmat++ | t/spectest.data:
21:38 dalek rakudo/newio: Remove references to non-existing test files
21:38 dalek rakudo/newio: review: https://github.com/rakudo/rakudo/commit/face62be4b
21:38 dalek rakudo/newio: bf2d1dd | paultcochrane++ | lib/Test.pm:
21:38 dalek rakudo/newio: Add simple use-ok implementation
21:38 lizmat sorry dalek
21:39 dalek joined #perl6
21:39 lizmat flussence: Files=940, Tests=34541, 181 wallclock secs ( 9.30 usr  3.18 sys + 1082.07 cusr 140.33 csys = 1234.88 CPU) on mine
21:39 kjs_ joined #perl6
21:42 firefish5000 FROGGS,  Alright then (I thought I might be calling it wrong), Label.next works for my case, ill use it. Thanks!
21:42 skids m: use MONKEY_TYPING; role Foo[:$bar = 4] { method bar { $bar } }; augment class IO::Path { also does Foo[:bar(8)] }; "/tmp/erf".IO.bar.say; # fernand__
21:42 camelia rakudo-moar 114659: OUTPUT«No such method 'bar' for invocant of type 'IO::Path'␤  in block <unit> at /tmp/jhJgsyTFIk:1␤␤»
21:43 skids hrm.
21:43 skids That worked locally. -- oh evalbot doesn't do MONKEY_TYPING probably
21:44 TimToady I don't think we have that restriction
21:45 TimToady if we did, it would complain on the use
21:45 lizmat m: use MONKEY_TYPING; augment class Str { method foo { "foo" } {; say Str.foo
21:45 camelia rakudo-moar 114659: OUTPUT«5===SORRY!5=== Error while compiling /tmp/WDN9foPYfS␤Unexpected block in infix position (two terms in a row, or previous statement missing semicolon?)␤at /tmp/WDN9foPYfS:1␤------> 3ugment class Str { method foo { "foo" } 7⏏5{; say Str.foo…»
21:45 lizmat m: use MONKEY_TYPING; augment class Str { method foo { "foo" } }; say Str.foo
21:45 camelia rakudo-moar 114659: OUTPUT«foo␤»
21:45 lizmat .oO( works ok )
21:45 timotimo how do i bitwise-negate an int?
21:45 TimToady m: say +^ 0
21:45 camelia rakudo-moar 114659: OUTPUT«-1␤»
21:47 grondilu m: say +^ my int $ = 0
21:47 camelia rakudo-moar 114659: OUTPUT«-1␤»
21:48 TimToady note that you're still likely getting an Int there
21:48 grondilu m: say (+^ my int $ = 0).WHAT
21:48 TimToady we don't have inplace native ops yet
21:48 camelia rakudo-moar 114659: OUTPUT«(Int)␤»
21:49 raydiak m: say (my int $).WHAT
21:49 camelia rakudo-moar 114659: OUTPUT«(Int)␤»
21:49 TimToady this is why .WHAT must eventually be a macro, not a method
21:49 TimToady currently it must box it to call it
21:49 diakopter m: say int()
21:49 camelia rakudo-moar 114659: OUTPUT«(int(Any))␤»
21:49 diakopter m: say int(-1)
21:49 camelia rakudo-moar 114659: OUTPUT«Cannot invoke this object (REPR: P6int, cs = 0)␤  in block <unit> at /tmp/4IuNCpiLAU:1␤␤»
21:49 grondilu am I wrong if I have the feeling MoarVM's designers understimated the importance of natives and that this is why it takes time to have them?
21:50 FROGGS m: sub foo(int(Numeric) $x) { say $x.WHAT }; foo(42)
21:50 camelia rakudo-moar 114659: OUTPUT«No such method 'int' for invocant of type 'Int'␤  in sub foo at /tmp/N1UWOpcPCY:1␤  in block <unit> at /tmp/N1UWOpcPCY:1␤␤»
21:50 TimToady I don't think they were underestimating them, just running scared :)
21:50 PerlJam grondilu: ask on #moarvm, but I have a feeling you are wrong :)
21:50 lizmat grondilu: afaik, it was planned all along, but lack of tuits made them not appear yet
21:50 flussence .oO( using some rough math, about a quarter of the spectest time is spent doing perl6-m startup. If that gets as fast as other languages (÷10), I can see my old cpu possibly "running a 4 minute mile"... )
21:53 fernand__ skids: https://gist.github.com/ano​nymous/e26c27566bccf21dfdb9
21:55 timotimo m: say "1234" ~~ / (<digit>+) <{ $0.Str.Int.is-prime }> /
21:55 camelia rakudo-moar 114659: OUTPUT«This type cannot unbox to a native string␤  in sub MAKE_REGEX at src/gen/m-CORE.setting:15302␤  in block  at src/gen/m-CORE.setting:15228␤  in method INTERPOLATE at src/gen/m-CORE.setting:15218␤  in method ACCEPTS at src/gen/m-CORE.setting:15350␤…»
21:55 timotimo ^- what?
21:55 flussence did you mean <?{ there?
21:57 mohij joined #perl6
21:58 * lizmat has done enough damage for today
21:58 lizmat sleep&
21:59 diakopter m: say int(int)
21:59 camelia rakudo-moar 114659: OUTPUT«(int(int))␤»
22:00 diakopter wonders never marvel
22:02 virtualsue joined #perl6
22:05 FROGGS_ joined #perl6
22:06 moritz http://www.dagolden.com/index.php/2406/t​houghts-on-getting-perl-6-for-christmas/
22:10 timotimo flussence: probably did, thanks
22:10 timotimo how do i grammar.parse again without anchoring to begin-of-strign and end-of-string?
22:11 moritz timotimo: .subparse
22:11 moritz timotimo: and here I need to tell you that http://doc.perl6.org/routine/parse even mentions .subparse
22:12 moritz huh, it seems that we've documented .parse and .subparse twice :(
22:12 TimToady moritz: yes, that's why we were talking about internal versioning
22:13 moritz ah, in Language/grammars.pod and in Type/Grammar.pod
22:13 moritz TimToady: I don't quite see how internal versioning relates to that
22:14 smls I remain unconvinced by the whole "minimalist languages are easier than rich languages" meme.
22:14 TimToady to the dagolden article
22:14 moritz ah
22:14 TimToady he talks about multiple versions loaded simultaneously
22:14 smls you don't hve to "master" a language in the sense of understanding every last bit of it perfectly, before you can start to use it.
22:15 smls It's not like programs written in minimalist languages involve less complexity
22:15 [Coke] Hai.
22:15 smls they just express in in the form of module APIs etc instead of syntax
22:15 grondilu smls: well, lambda-calculus is the obvious counter-example.
22:16 moritz grondilu: how is that a counter-example?
22:16 grondilu it's as simple as it gets, yet I would not say it's easy.
22:16 grondilu 23:15 < smls> they just express in in the form of module APIs etc instead of syntax
22:16 TimToady we should all program turing machines, since those are as simple as possible
22:16 grondilu ^so true
22:16 diakopter O_O
22:17 moritz grondilu: I think I misunderstood what you meant by "counter-example"
22:17 TimToady it's an example you lay on the counter :)
22:17 smls or sometimes they express it in the form of many, many nested/combined used of the same few syntax elements, when a single high-level syntax would map much more closely to how a human might think of the problem.
22:18 grondilu amen
22:19 moritz smls: I think we're all in violent agreement there; but it's one of the big unsettled questions in programming language design, much like dynamic vs. static typing
22:19 moritz the other side has good arguments too, if you ask them :-)
22:19 moritz I mean, they'll say they have good arguments
22:20 grondilu but we're still more right than them because in perl you can program in their style, but the reciprocal is usually not true.
22:21 grondilu (but then I guess they would launch the "too much freedom is bad" argument)
22:21 moritz anyway, on the dagolden blog post: it's hard to follow good distribution practises when you don't even have a fraction of the infrastructure that you'll eventually need
22:21 grondilu (or the "there should only be one way to do things)
22:21 kjs_ joined #perl6
22:22 grondilu s/)/")
22:22 moritz though I do wonder if we should start to make versioned releases of our modules, just to pratise
22:22 moritz and to start to create a need to deal with them
22:23 moritz but not today; now is time for sleep&
22:25 flussence if anyone wants to experiment on that sorta thing, some of my modules oh github are properly versioned and tagged (and signed)...
22:27 Mouq joined #perl6
22:32 bayprogrammer joined #perl6
22:34 smls_ joined #perl6
22:39 firefish5000 How does one call a fully qualified sub. ie 'use Foo; Foo::Bar();' where Bar is an exported sub of module Foo.
22:39 espadrine joined #perl6
22:39 timotimo m: my @foo := 0..* Z~ "a"..*; say @foo[0..5]
22:39 camelia rakudo-moar 114659: OUTPUT«0a 1b 2c 3d 4e 5f␤»
22:39 TimToady firefish5000: it has to be declared our to be visible globally
22:40 firefish5000 ah, so our sub Bar?
22:40 TimToady yes, but we tend to discourage uppercase sub names, since that's how most types are
22:40 TimToady unless you're trying to fit into an existing culture
22:41 TimToady std: foo
22:41 camelia std f9b7f55: OUTPUT«5===SORRY!5===␤Undeclared routine:␤     'foo' used at line 1␤Check failed␤FAILED 00:00 134m␤»
22:41 TimToady std: Foo
22:41 camelia std f9b7f55: OUTPUT«5===SORRY!5===␤Undeclared name:␤        'Foo' used at line 1␤Check failed␤FAILED 00:00 134m␤»
22:41 TimToady and you might get better diags
22:42 firefish5000 aaa... I just have a horible habit of Capatalizing Each Word...
22:42 grondilu German people do that, don't they?
22:42 firefish5000 Changed my code and its working.
22:42 TimToady grondilu: not the Verbs
22:45 espadrine_ joined #perl6
22:48 firefish5000 Is there a way to Ourify all the subs by default? And if so, how would you declar one to be private?
22:49 dalek doc: b3e3379 | paultcochrane++ | lib/Language/io.pod:
22:49 dalek doc: Document I/O
22:49 dalek doc: review: https://github.com/perl6/doc/commit/b3e3379f66
22:49 dalek doc: e83ed7b | paultcochrane++ | lib/Type/IO/FileTestable.pod:
22:49 dalek doc: Make more explicit that -e and -f aren't in Perl 6
22:49 dalek doc: review: https://github.com/perl6/doc/commit/e83ed7bb7f
22:58 TimToady well, doubtless one could do BEGIN OUR::{$_} = MY::{$_} for MY::.keys.grep(/^'&'/); or some such
22:58 TimToady it might even work
22:59 TimToady but yes, then your implicit 'my' would turn into 'our'
22:59 TimToady so probably better just to use explicit 'our' on the non-my subs
22:59 TimToady or pull the aliases from the export list rather than from MY::
23:02 Sqirrel joined #perl6
23:09 masak 'night, #perl6
23:09 diakopter m: macro marco {}
23:09 camelia rakudo-moar 114659: ( no output )
23:10 raydiak good night masak
23:16 firefish5000 Alright. Thanks TimToady. As you stated, using our would probably be better. (gave the code a try anyways, but wasn't able to figure out how to make it work. nice to know we can see the OUR/MY list that way though)
23:20 dalek doc: 738d615 | paultcochrane++ | lib/Language/io.pod:
23:20 dalek doc: Correct links to IO-related types/roles
23:20 dalek doc: review: https://github.com/perl6/doc/commit/738d615104
23:20 masak diakopter: I saw that.
23:22 locsmif joined #perl6
23:25 diakopter masak: o noes
23:25 timotimo sad of the day: unicode die faces don't have univals defined
23:32 firefish5000 TimToady, lol, I knew that that would help me in some way. I finally figured out how to add subs in a loop like I use add_method for methods and tokens. Cuts my code 1/3;
23:40 timotimo where can i have a look at what *is* defined with a unival?
23:40 timotimo we didn't roll unival on our own, right?
23:50 jack_rabbit joined #perl6
23:54 eternaleye joined #perl6
23:58 Kristien My GC tried to allocate terabytes of memory since I didn't initialise a variable. :(
23:58 diakopter uh oh
23:59 TimToady m: say uniprop('⅔','numericvalue')
23:59 camelia rakudo-moar 114659: OUTPUT«0.66666667␤»
23:59 TimToady m: say uniprop('⅔','numericvalue').WHAT
23:59 camelia rakudo-moar 114659: OUTPUT«(Str)␤»
23:59 Kristien lol

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo