Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-11-04

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:11 pierre_ joined #perl6
00:28 ifdog joined #perl6
00:34 Xliff Does anyone know if cglobal still needs the full library name as stated here: https://docs.perl6.org/language​/nativecall#Exported_variables
00:37 Xliff Nope! Don't look like it.
00:46 Xliff Also what's the best way to handle FILE* passing using NativeCall?
00:46 timotimo just use Pointer without anything specific, i guess
00:48 Xliff Hrm.
00:48 timotimo they aren't really pointers, but when you use Pointer you get the right size for pointers on your platform, right?
00:50 leont In C89, not all pointers need to be equally sized AFAIK
00:50 Xliff Yeah.
00:50 timotimo oh jesus christ ...
00:51 timotimo what platforms do we support that have that?
00:51 Xliff Hmm... lemme look up IO::Handle, again.
00:51 leont I don't think any reasonable platforms have differently sized pointers, but it is legal and has existed
00:52 geekosaur timotimo, none I suspect. variable pointer sizes were a thing on old mainframes
00:52 timotimo OK
00:52 leont Old DOS also had a long/short pointer concept
00:52 geekosaur like on PDP10s a (char) pointer could index part of a machine word, since it packed from 4 to 6 characters depending on representation into a 36-bit word
00:52 leont but that wasn't type dependent like some platforms had them -_-
00:53 timotimo oh yeah, lptr, i remember hearing of those
00:54 geekosaur also there used to be tagged architectures, where the tag size depended on the type
00:55 Xliff OK. So --> sub fdopen(int32 $fd, Str $mode) is native returns Pointer { * };
00:55 Xliff That way I can use $iohandle.native-descriptor()
00:56 Xliff The only trick is guessing $mode.
00:56 leont That problem isn't perl related :-p
01:01 Xliff leont: Actually, it is.
01:01 Xliff IO::Handle knows the mode, so why can't it be retrieved from the object?
01:02 Xliff Nothing in the docs.
01:03 Xliff I mean it really isn't the problem as long as the person opening the IO::Handle is the person converting it to a pointer, but that's not always the case for modules.
01:03 leont Ah like that
01:04 setty1 joined #perl6
01:05 skink joined #perl6
01:07 skink viki, @_@
01:07 skink For the thing earlier, say $buf works after doing Buf.new($buf[..]), but only if you previously said $buf
01:11 aborazmeh joined #perl6
01:11 aborazmeh joined #perl6
01:16 geekosaur Xliff, I don't think IO::Handle knows the mode /per se/. the underlying libuv descriptor probably (but not certainly) does, but may not make it available or moarvm may not provide a way to query it
01:17 geekosaur and not all of them are opened in a way where you can know for sure (if you inherit a handle as stdin/stdout/stderr, it is not necessarily open for read/write/write respectively: ttys/ptys, network sockets, and on BSDs pipes can be open read+write)
01:18 Xliff geekosaur: Hence my comment.
01:19 Xliff So I have to hold my nose and use "w" for my calls to fdopen()
01:20 Xliff But you are correct, my assertion that IO::Handle always knew the mode was incorrect.
01:20 Xliff Well... first .h file conversion to module complete. On to the actual classes.
01:20 Xliff First step in a looong journey.
01:22 timotimo have you had a look at gptrixie yet?
01:22 timotimo because that'll turn a .h file into a nativecall-using module for you
01:24 Xliff Yes, I am very familiar with gprixie. I used it for Audio::OggVorbis.
01:24 Xliff It has its flaws.
01:24 timotimo good to know
01:25 Xliff Particularly, it has a maximum limit before it will crash.
01:25 timotimo oh, wow
01:25 Xliff It will *not* handle libxml2
01:25 Xliff Nor, by extension, libxslt
01:26 timotimo i wonder what exact part causes the crash?
01:26 skink Speaking of nativecall stuff
01:26 skink I am heavily limited as to what methods I can put on a repr('CPointer'), yeah?
01:26 Xliff timotimo: Don't know. I haven't had the patience to complete my trace.
01:27 Xliff skink: You can have methods on a repr('CPointer') as long as you don't try to use self.
01:27 timotimo skink: shouldn't be, no
01:27 timotimo you can totally use self
01:27 Xliff Hmmm...
01:27 Xliff That's changed since my XML::LibXML days.
01:27 timotimo it could be i'm full of crap
01:27 Xliff (ie... the summer)
01:27 timotimo but it shouldn't be a problem
01:28 skink I can use self yeah, for self.free() { handle_free(self) }
01:28 Xliff skink: What are you trying to do?
01:28 skink But I can't have a method that asks for in this case a size_t
01:28 Xliff skink: Yeah, that's legit
01:28 timotimo "asks for"?
01:28 skink >Cannot look up attributes in a type object
01:28 Xliff Thaaat's the one
01:28 timotimo that sounds like you're calling a method on an undefined instance of something
01:29 Xliff skink: Can you pastebin some code?
01:29 timotimo actually, that error could totally get more output
01:29 skink sec
01:29 Xliff s/pastebin/fpaste/
01:29 skink gotta update this gist anyway
01:29 Xliff Or gist.
01:29 Xliff I need to stop using pastebin and start using more gist.
01:30 skink https://gist.github.com/skinkade/​0a1a83adfbf26ac84527cc47b2224ed2
01:31 skink I copy-pasted that codeblock from the nativecall docs, apart from CCRNG.buffer(size_t $len)
01:31 wisti joined #perl6
01:32 Xliff skink: Yeah. repr('CPointer') can't have attributes.
01:32 skink que lastima
01:33 skink Guess I just need a buffer(ptr, len) then?
01:33 timotimo i just pushed a moarvm commit that also tells you what exact type it's trying to access
01:34 Xliff skink: Why do you think you need $!initialized?
01:34 skink Like I said, copy-paste :)
01:34 Xliff LOL
01:34 Xliff Fair enough.
01:34 skink Without buffer though, it works
01:35 timotimo i wonder why we allow attributes to be put onto an "is repr('CPointer')" class at all
01:36 Xliff Yeah, it's confusing.
01:36 skink So we can do hacky crap? :)
01:36 Xliff Could be useful as long as only the P6 side uses it though.
01:37 Xliff skink: You could have an inner class that handles the repr('CPointer') stuff.
01:37 Xliff Then a regular P6 class.
01:37 Xliff If you really want to do it the way I think you are trying to do it.
01:38 MasterDuke IO::Handle had a .mode, it returns the .mode of its $!path
01:38 skink I mean this is just a POC that I was seeing if I could make look nice.
01:38 MasterDuke *has
01:38 MasterDuke doesn't seem to be in the docs though
01:38 Xliff MasterDuke: Is that the mode it was opened with or the file permissions?
01:38 MasterDuke file permissions
01:39 Xliff HAH! Knew it.
01:39 Xliff Not the mode I'm looking for. Thanks, though.
01:39 MasterDuke tbrowder was also looking for the opened mode, Zoffix suggest how he could add it
01:40 mst joined #perl6
01:40 BinGOs joined #perl6
01:40 Ulti joined #perl6
01:41 MasterDuke https://irclog.perlgeek.de/​perl6/2016-11-02#i_13505117
01:42 Xliff m: class A { class B {}; }; my $a = A.new
01:42 camelia rakudo-moar 5b2bde: ( no output )
01:43 Xliff skink: I've commented on your gist. See if that makes any sense.
01:44 mst joined #perl6
01:46 aborazmeh joined #perl6
01:46 aborazmeh joined #perl6
01:46 pierre_ joined #perl6
01:46 Xliff Aaand another. ;)
01:48 Xliff *sigh*
01:48 Xliff viki is Zoffix?
01:48 skink You cannot declare attribute '$!rng' here; maybe you'd like a class or a role?
01:48 skink for the last one
01:48 skink first one got the same 'you cannot have attributes' thing
01:49 Xliff That man has more nicks than random alias generator.
01:49 Xliff Maybe he is a random alias generator.
01:49 Xliff skink: o_O
01:53 Xliff skink: What language is rust written in?
01:53 Xliff That is not C
01:53 skink what :D
01:54 Xliff gcc barfed when I tried to compile the first part of your gist.
01:54 Xliff Do you know how hard compiler barfage is to get out of cotton?!?!?
01:54 Xliff ]8-D
01:55 skink Oh, well this is good
01:55 skink I am now getting inconsistent sigsegvs :D
01:56 skink script'll work once or twice then die
01:56 * Xliff headdesks
01:56 Xliff Rust is a language. Thanks skink!
01:56 Xliff :P
01:56 skink I thought you were joking :)
01:56 Xliff Nope. No alcohol, tonight.
01:57 Xliff Inconsistent SEGVs is something you will always have to worry about with NativeCall
01:57 Xliff But rakudo is no longer complaining, right?
01:58 Xliff About the only thing you can do is to turn on debugging information in your rust-build lib
01:58 Xliff Then use perl6-gdb-m
01:58 Xliff Just for shits and grins... Comment out $!rng.free
01:59 skink I reverted back to some earlier non-OO code
01:59 Xliff It's possible that DESTROY isn't being called when you think it should be.
02:00 Xliff And with that.... I must go *poof*
02:00 Xliff Good luck, skink!
02:03 cdg joined #perl6
02:04 japhb Xliff: People seem to assume a lot regarding $Zoffix.nicks.  For one, that they are merely nicks and not distinct personas.  Or that Zoffix is the root persona.  Or that all $Zoffix.nicks are male-gendered (and that Zoffix itself is).  I see no particular reason to assume any of these, unless Zoffix has specifically stated otherwise ....
02:08 seatek even if he/she/* stated otherwise, he/she/* might be lying
02:08 yoleaux 3 Nov 2016 14:01Z <gfldex> seatek: have you considered to include the following module into the tutorial? https://github.com/jnthn/grammar-debugger
02:08 * geekosaur assumes they are nicks, and Zoffix is approximately human
02:09 seatek i see no reason to assume Zoffix is human, or even a mammal
02:10 japhb .oO( On the Internet, why would anyone care if you're a dog? )
02:11 seatek i would be unreasonbly swayed to the points any dog was trying to make
02:13 seatek gfldex: i didn't even know about that grammar debugger myself! I'll need to play with it for a while before i do so i can sound like i know something
02:22 Su-Shee joined #perl6
02:29 Xliff I still want to learn grammars.
02:29 Xliff I just haven't had the time.
02:30 Xliff japhb: So the rule about Zoffix is "Do not assume you know Zoffix"
02:30 seatek Xliff: new tutorial for grammars in the docs now that takes you from knowing nothing about them rather than having to work it out for yourself
02:30 Xliff I got that, already. :)
02:31 Xliff seatek: https://docs.perl6.org/language/grammars ??
02:31 seatek Xliff: would be curiouss if you found it helpful
02:32 Xliff Will take a look, then
02:32 seatek Xliff: https://docs.perl6.org/language/grammar_tutorial
02:32 skink japhb, Can we actually have a $Zoffix.nicks for one of the bots to list all his known aliases?
02:32 seatek Xliff: if you stumble on something or it doesn't make sense somehow along the way...
02:33 Xliff seatek: I will drop you a line or something.
02:34 Xliff Or write a gist and pass that through yoleaux
02:34 skink ... is yoleaux pronounced yolo?
02:36 seatek Xliff: sweet thanks Xliff :) I really want it to work for people. I had a heck of time trying to understand them myself at first
02:36 Xliff skink: Yes. Using a bad french accent.
02:37 Xliff Well, I get the grammar creation part. It's the Actions that I don't get.
02:37 Xliff Which I guess we'll find out.
02:37 seatek :)
02:41 Xliff LOL
02:42 Xliff "But not really."
02:42 seatek hehe :)
02:46 Xliff Not a good sign in a dry piece of documentation, but makes for great reading.
02:46 seatek well, they're a little weird...
02:46 Xliff Good documentation should make for moderately decent reading.
02:46 Xliff And this is a tutorial, so less formal language is usually helpful.
02:46 seatek gfldex: love the ::Tracer! that would have come in handy had i known about it. have a feeling i'll need to get some inheritances built up to really effectively learn the debugger element
02:46 Xliff Hmmmm.....
02:46 seatek Xliff: thanks! yeah, that's what I was kinda going for... i wish i would have had that. i was struggling trying to figure out what was going on for a long time
02:46 Xliff seatek++: I now understand what "make" and "made" do after hearing about them for so long.
02:46 Xliff I still don't see the reason for it yet....
02:46 seatek Xliff: ha!! yeah. such a simple thing once it clicks eh?
02:46 seatek keep going you will :)
02:47 Xliff seatek: Wow! That was a quick and easy read for a simple grammar, and it makes sense.
02:47 seatek Xliff: yay! :)
02:47 Xliff The next thing that would be helpful is a "step 2" or "Intermediate" tutorial.
02:47 seatek now do you know what actions are? :)
02:48 Xliff Go from parsing single lines to a multi-line object... ala a simple language parser.
02:48 Xliff Oh, I've always known they were a class, but I have the gist of them.
02:49 seatek multi-line wouldn't be any different -- newlines are just whitespace
02:49 Xliff At least now I may be able to get some idea as to how SLANG::SQL works.
02:49 Xliff Nice job, seatek!
02:50 Xliff Now I have to get ready for sleep. My eyelids are getting heavy.
02:50 seatek Xliff: thank you!
02:50 Xliff yw
02:50 seatek well, good dreams
03:08 dalek doc: de536c7 | seatek++ | doc/Language/grammar_tutorial.pod6:
03:08 synopsebot6 Link: http://doc.perl6.org/language/grammar_tutorial
03:08 dalek doc: mention Grammar::Debugger
03:08 dalek doc:
03:08 dalek doc: and also format break a couple lines at 80 cols. Maybe 100 cols. Maybe 1 80 and the other 100.
03:08 dalek doc: review: https://github.com/perl6/doc/commit/de536c7692
03:10 PerlJam joined #perl6
03:32 atweiden joined #perl6
03:33 djbkd joined #perl6
03:52 samcv i'm trying to alter the value of just one value in a multi dimensional array. doing %hash{'key'} = thing => 'value'; removes the other things from the hash that are there
03:52 samcv well that are in 'key'
03:54 geekosaur well, yes, that is exactly what you told it to do
03:54 geekosaur %hash{'key
03:54 geekosaur er
03:54 noganex_ joined #perl6
03:55 geekosaur %hash{'key'}{'thing'} = 'value';
03:55 samcv that's what i thought, and i tried that. but i get an error, let me find it
03:55 geekosaur wonder if you need a . in there (which would be ugh)
03:56 samcv maybe it's because it's %!hash in a method, but i can do what i said above that removes values because it replaces the whole key fine
03:57 samcv Type check failed in assignment to %!channel-event-data; expected Hash but got Array hmm
03:57 geekosaur m: my %h = (a => {b => 'c', d => 'e'}); %h<a><d> = 'f'; dd %h
03:57 camelia rakudo-moar 5b2bde: OUTPUT«Hash %h = {:a(${:b("c"), :d("f")})}␤»
03:57 samcv but i'm doing now.Str
03:57 samcv m: my %h = a => now.Str;
03:57 camelia rakudo-moar 5b2bde: ( no output )
03:58 samcv m: my %h = a => now.Str; say %h;
03:58 camelia rakudo-moar 5b2bde: OUTPUT«{a => Instant:1478231921.060494}␤»
03:58 geekosaur ...then why pair syntrax there
03:58 samcv %.channel-event-data{$e.nick}{'spoke'} = now.Str; this is what i have in my file
03:58 samcv so maybe it's the now.Str getting something weird
03:58 samcv m: now.Str.WHAT.say
03:58 camelia rakudo-moar 5b2bde: OUTPUT«(Str)␤»
03:58 samcv hm
03:59 geekosaur oh, I read that error backwards...
03:59 pierre_ joined #perl6
04:00 samcv ok i tested and %.channel-event-data{$e.nick}{'spoke'} = '1000'; also removes the other values in it
04:00 geekosaur oh... it's an attribute. that gets trickier
04:00 samcv not sure why
04:00 samcv yeah maybe i should not do that
04:00 geekosaur it's calling an accessor, which may not be doing what you expect
04:12 cyphase joined #perl6
04:21 samcv hmm looks like it was getting a multidimensional array not a hash
04:21 samcv what's the best way to convert from an array to a hash?
04:22 gfldex m: dd <a b c d>.Hash
04:22 camelia rakudo-moar 5b2bde: OUTPUT«Hash % = {:a("b"), :c("d")}␤»
04:22 gfldex depends on the structure of your array
04:22 wisti joined #perl6
04:23 gfldex m: dd do for <a b c d> { $^a => $^b }
04:23 camelia rakudo-moar 5b2bde: OUTPUT«(:a("b"), :c("d"))␤»
04:23 gfldex that's actually a list of Pair tho
04:26 samcv i'm trying to use json::tiny {name => [{spoke => 0} {join => 1477091584} {part => 1477090875}], here is one of the things in the array
04:26 samcv when i print it
04:27 samcv when i do .Hash it says typcheck failed. i specified my Hash %hash
04:28 gfldex can you gist the code in question?
04:30 samcv here you go gfldex http://vpaste.net/Esirp
04:30 samcv %channel-event-data = from-json($!channel-event-fh.slurp-rest).Hash; this line is what's causing the typecheck error
04:31 gfldex i'm asking for a gist because of https://packages.debian.org/jessie/gist btw
04:33 gfldex also, a gist would show line numbers. Makes talking about the code easier.
04:37 gfldex from-json can return all kind of things. So just calling .Hash on it is dangerous in any case
04:37 samcv yeah there's not much info on the github page for it
04:39 gfldex ohh, my Hash %foo is a Hash of Hash and from-json will never return that
04:40 gfldex as I see it from-json can return Int, Str, List (or Array) and Hash
04:42 Xliff What does the JSON look like?
04:42 gfldex i would leave the data returned as it is and either handle it with a given/when block (if it's simple) or a recursive multi walker if it's complex
04:42 Sgeo_ joined #perl6
04:43 Tonik joined #perl6
04:43 Su-Shee_ joined #perl6
04:46 gfldex samcv: also: https://gfldex.wordpress.com/​2016/08/01/walk-on-the-flats/ and https://gfldex.wordpress.com/2015/12/20/i-can-wri​te-them-nearly-as-fast-as-you-can-read-them-now/
04:54 samcv ah so leaving it as a list would be best...
04:54 samcv that sounds sub optimal. well i created the json from a hash at least
04:55 samcv but unfortunately tiny json isn't returned it as one i guess
04:55 pierre_ joined #perl6
05:01 gfldex m: sub type-dump(\any = Empty){ any ~~ Iterable ?? any».&type-dump !! any.WHAT }; say type-dump([a=>1, b=>2, {:c(3)}, 42 ])
05:01 camelia rakudo-moar 5b2bde: OUTPUT«[(Pair) (Pair) {c => (Int)} (Int)]␤»
05:02 gfldex samcv: ^^^ simply type dumper that will walk a tree
05:02 gfldex Perl 6 is awesome :)
05:02 samcv it is
05:15 Su-Shee_ joined #perl6
05:33 wamba joined #perl6
05:35 Cabanossi joined #perl6
05:56 cpage_ joined #perl6
06:11 Tonik joined #perl6
06:13 Su-Shee joined #perl6
06:23 domidumont joined #perl6
06:25 ufobat joined #perl6
06:28 domidumont joined #perl6
06:30 djbkd joined #perl6
06:32 Khisanth joined #perl6
06:38 canopus joined #perl6
06:41 andrzejku joined #perl6
06:42 aborazmeh joined #perl6
06:42 aborazmeh joined #perl6
06:45 bjz joined #perl6
06:48 RabidGravy joined #perl6
06:49 pierre_ joined #perl6
06:50 cgfbee joined #perl6
06:51 japhb .tell tadzik I sent you a PR to add 256-color and 24-bit RGB color support to Terminal::ANSIColor.  Enjoy.  :-)
06:51 yoleaux japhb: I'll pass your message to tadzik.
06:56 domidumont joined #perl6
07:02 andrzejku joined #perl6
07:05 sivoais joined #perl6
07:14 darutoko joined #perl6
07:16 bjz joined #perl6
07:16 neuraload joined #perl6
07:17 llfourn_ m: my $foo = "bar"; for |$foo { $_ = "baz" }; # is |$foo on a non-iterable meant to decont?
07:17 camelia rakudo-moar 5b2bde: OUTPUT«Cannot assign to an immutable value␤  in block <unit> at <tmp> line 1␤␤»
07:19 jameslenz joined #perl6
07:21 Xliff gfldex++: Awesome code!
07:22 bjz joined #perl6
07:27 eliasr joined #perl6
07:29 perlawhirl joined #perl6
07:31 firstdayonthejob joined #perl6
07:50 bjz joined #perl6
07:51 sivoais joined #perl6
07:54 Su-Shee_ joined #perl6
07:59 Su-Shee joined #perl6
08:11 TeamBlast joined #perl6
08:18 bjz joined #perl6
08:23 brrt joined #perl6
08:25 noganex joined #perl6
08:32 maybekoo2 joined #perl6
08:35 masak morning, #perl6
08:36 DrForr Mornin'.
08:37 zakharyas joined #perl6
08:42 Su-Shee_ joined #perl6
08:43 lizmat good morning, #perl6!
08:44 masak ahoj lizmat
08:44 brrt good *, lizmat, DrForr, masak
08:45 bjz_ joined #perl6
08:46 lizmat brrt: maybe it's time for a blog post on the JIT progress ?  :-)
08:46 neuraload joined #perl6
08:46 brrt :-$
08:46 brrt yes... it probably is...
08:46 brrt I'm overengineering my blog posts, usually
08:50 moritz brrt: it would also be a awesome if you wrote something about the JIT project for the perl 6 advent calendar
08:50 DrForr Well, I announced the Perl 6 Pocket Reference (not the actual name) at Cluj.pm - Going to get started this weekend.
08:51 moritz \o/
08:51 brrt it's time for perl6 books, yes :-)
08:51 moritz DrForr++
08:51 brrt moritz: but *what*?
08:51 * moritz has prepared three blog posts so far for his book, but will wait a bit with publishing them
08:52 moritz brrt: whatever you find interesting. Or others could find interesting
08:52 brrt usually perl6 advent calendars are 'treats' of things that can be practically applied by readers
08:52 brrt well... what i find interesting
08:52 moritz doesn't have to be this will
08:52 moritz *way
08:52 brrt this morning I realized that there is an isomorphism between recursion and queueing
08:52 brrt is isomorphism even the correct word?
08:52 moritz you could distill a progress report from the grant reports so far; or write about the tiler
08:52 brrt recursion is a subset of queueing?
08:53 moritz if it's a subset, it's not isomorphism :-)
08:53 brrt true
08:53 brrt hmm
08:55 wamba joined #perl6
08:55 DrForr Amusingly one of my slides last night had people asking about transfinite arithmetic :)
08:56 Su-Shee left #perl6
08:56 brrt what is transfinite arithmetic.... is it what it sounds like? and how would that ever work
08:57 DrForr Arithmetic involving aleph-null and above :)
08:58 rindolf joined #perl6
09:13 lizmat afk for a bit&
09:14 Actualeyes joined #perl6
09:18 wamba joined #perl6
09:18 labster joined #perl6
09:26 KevinYang joined #perl6
09:29 KevinYang left #perl6
09:30 espadrine joined #perl6
09:31 araujo joined #perl6
09:54 pierre_ joined #perl6
10:04 viki m: sub type-dump(\any = Empty){ any ~~ Iterable ?? any».&type-dump !! any.WHAT }; say type-dump([a=>1, b=>2, {:c(3)}, 42 ])
10:04 camelia rakudo-moar 050cf7: OUTPUT«[(Pair) (Pair) {c => (Int)} (Int)]␤»
10:04 viki m: say deepmap {.WHAT}, [a=>1, b=>2, {:c(3)}, 42 ]
10:04 camelia rakudo-moar 050cf7: OUTPUT«[(Pair) (Pair) {c => (Int)} (Int)]␤»
10:05 viki Xliff: Rust is written in.. Rust :)
10:13 cpin joined #perl6
10:17 nadim joined #perl6
10:21 rindolf joined #perl6
10:24 ocbtec joined #perl6
10:24 viki japhb: interesting hypothesis :) What if there is no Zoffix persona and the different nicks represent the ever-changing and ever-new personas assumed by the persona-less Zoffix entitity? Either that, or Zoffix is just trolling everyone :}
10:25 viki .oO( the zoffix is a lie )
10:28 leont joined #perl6
10:30 AlexDaniel joined #perl6
10:30 pmurias joined #perl6
10:33 djbkd joined #perl6
10:43 chansen_ joined #perl6
10:44 damnlie_ joined #perl6
10:44 JimmyZ joined #perl6
10:44 notbenh_ joined #perl6
10:44 mephinet joined #perl6
10:45 avalenn joined #perl6
10:45 ilmari joined #perl6
10:45 mrsolo joined #perl6
10:47 clkao joined #perl6
10:47 timeless joined #perl6
10:48 Hotkeys joined #perl6
10:49 robinsmidsrod joined #perl6
10:55 dylanwh joined #perl6
10:57 ugexe joined #perl6
10:59 jnap_ joined #perl6
11:04 moritz the conitnuity (or lack thereof) or identity is an interesting research topic, IMHO
11:05 brrt continuity of what?
11:05 cdg joined #perl6
11:05 moritz s/or/of/
11:05 moritz of identity
11:07 user9 joined #perl6
11:07 rodarmor joined #perl6
11:11 perlawhirl joined #perl6
11:13 perlawhirl hi perlers.
11:14 perlawhirl i have a question that's kinda hard to explain over irc, so i've put it in a gist: https://gist.github.com/0racle/2​c29dc664135525959ccefa795767a08
11:16 perlawhirl I'm not sure if I can do it by returning an explicit Seq.new...
11:18 brrt I think the thing you are running into is that you want lazy-indexed behaviour rather than lazy-sequence behaviour
11:18 brrt the AT-POS solution seems good to me
11:20 perlawhirl yeah, it's good for something simple, but means you can't really pass additional args to .thing().
11:21 leont_ joined #perl6
11:21 perlawhirl my other though was just to return an anon class that implements AT-POS
11:21 perlawhirl might have a play with that idea
11:21 nadim_ joined #perl6
11:30 mephinet joined #perl6
11:37 cdg_ joined #perl6
12:15 pierre__ joined #perl6
12:19 zakharyas joined #perl6
12:21 cgfbee joined #perl6
12:23 yoleaux joined #perl6
12:27 dalek doc: 8e6f20a | coke++ | doc/Language/grammar_tutorial.pod6:
12:27 synopsebot6 Link: http://doc.perl6.org/language/grammar_tutorial
12:27 dalek doc: remove trailing whitespace
12:27 dalek doc: review: https://github.com/perl6/doc/commit/8e6f20a6b6
12:40 pmurias node.js-- # v8-profiler is broken on node 7.0 and the pull request to fix it is unmerged :(
12:43 masak pmurias: oh, so it's not just me -- node.js seems to be a bit of a wild west of "move fast and break things"
12:46 DrForr AFAIK TauStation's node.js stack is still technically broken because there's a broken module in npm.
12:47 masak DrForr: does it prevent them from doing work?
12:47 perlpilot masak: that's been my experience as well.
12:47 moritz I hope they run a local npm mirror
12:47 masak this year I read an article whose point was "if you really care about stability, make a snapshot of node_modules"
12:48 masak I went looking for it the other week, but I couldn't find the article again :/
12:48 masak it was in connection to the pad-left thing
12:48 moritz we have a nexus running, which acts as a caching proxy for npm modules
12:48 masak moritz: it's not just about them being available though, it's also about them being updated under your feet with breaking changes
12:49 moritz masak: can't you pin versions?
12:49 DrForr No, we just pin module versions using .. gulp?
12:49 * masak .oO( from the department of "OMG dependencies are tricky" )
12:49 masak moritz: yes -- provided you do that for everything I guess it's the same
12:49 moritz masak: well, there's something to be said for rebuilding the environment on each build, just to make sure you still can
12:50 gfldex m: class C { method subscript(|c){ say "subscript of: ", c.perl } }; multi sub postcircumfix:<[ ]>(C:D \SELF, \pos){ SELF.subscript(pos) }; C.new.[1,42];
12:50 camelia rakudo-moar b1c41b: OUTPUT«subscript of: \((1, 42))␤»
12:51 gfldex .tell perlawhirl objects can be made aware of being subscripted with class C { method subscript(|c){ say "subscript of: ", c.perl } }; multi sub postcircumfix:<[ ]>(C:D \SELF, \pos){ SELF.subscript(pos) }; C.new.[1,42];
12:51 yoleaux gfldex: I'll pass your message to perlawhirl.
12:52 mscha joined #perl6
12:52 mscha m: say e**(π*i) + 1;
12:52 camelia rakudo-moar b1c41b: OUTPUT«0+1.22464679914735e-16i␤»
12:55 R_I_D joined #perl6
12:56 masak m: my %h = a => 1, b => 2; subset mh of Str where %h{$_} :exists; my mh $x = "b"; %h<b> :delete; say $x
12:56 camelia rakudo-moar b1c41b: OUTPUT«b␤»
12:56 masak ta-daa!
12:56 masak (not a but, just something to keep in mind)
12:56 masak bug*
12:58 R_I_D do modules need to be explicitly linked when perl6 is called?
12:58 masak no
12:59 masak R_I_D: the whole compilation stage is largely hidden and implicit -- you indicate a source file, and perl6 goes and figures it out from there
12:59 R_I_D okay.  I have a User.pm6 file which delcares a user object, and a test-user.pm6 file which invokes a new() one.
13:00 R_I_D the test file has User.pm6 at line one, but when I run perl6 test-user.pm6, it says cannot find User
13:00 timotimo '.' isn't in the search path by default
13:01 masak I tend to do `export PERL6LIB=lib`
13:01 masak (that's assuming that the User.pm6 file is in lib/)
13:01 R_I_D You put that in your .bashrc?
13:01 masak no, but that could totally be done
13:02 masak I just re-run it when I have a fresh tab that I do perl6 development in :)
13:02 DrForr I just do 'alias 6="perl6 -Ilib"' and put my libraries in lib/.
13:02 viki R_I_D: you can also include paths with -I switch
13:02 cdg joined #perl6
13:03 DrForr (which is pretty much perl6 standards.)
13:06 R_I_D ah! it's alive! thanks everyone
13:07 masak no problem! bring it on! :D
13:08 rindolf joined #perl6
13:13 mscha m: my \ℕ = 1..∞; say 42 ∈ ℕ;
13:14 lichtkind joined #perl6
13:14 camelia rakudo-moar b1c41b: OUTPUT«(timeout)»
13:20 wamba joined #perl6
13:20 viki m: my \ℕ = 1..∞; say 42 ~~ ℕ;
13:20 camelia rakudo-moar b1c41b: OUTPUT«True␤»
13:20 viki mscha: the ∈ is a set operator and converts args to sets, which causes the hang. The smartmatch against a range is the Right Way to do it.
13:23 bjz joined #perl6
13:23 viki m: multi infix:<∈> (\n, Range \r) { n ~~ r }; my \ℕ = 1..∞; say 42 ∈ ℕ;
13:23 camelia rakudo-moar b1c41b: OUTPUT«True␤»
13:24 cpage joined #perl6
13:24 awwaiid though then 12.5 ∈ ℕ will still not work out very well :) . or will it...
13:24 awwaiid m: my \ℕ = 1..∞; say 12.5 !~~ ℕ
13:24 camelia rakudo-moar b1c41b: OUTPUT«False␤»
13:24 awwaiid AMAZING
13:24 cpage__ joined #perl6
13:25 viki :)
13:25 viki m: my \ℕ = 1..∞; say 12.5+1i ~~ ℕ
13:25 camelia rakudo-moar b1c41b: OUTPUT«True␤»
13:25 viki heh
13:26 viki m: multi infix:<∈> (\n, Range \r) { n ~~ UInt and n ~~ r }; my \ℕ = 1..∞; say 42+9i ∈ ℕ;
13:26 camelia rakudo-moar b1c41b: OUTPUT«False␤»
13:26 viki m: multi infix:<∈> (\n, Range \r) { n ~~ UInt and n ~~ r }; my \ℕ = 1..∞; say 42.5 ∈ ℕ;
13:26 camelia rakudo-moar b1c41b: OUTPUT«False␤»
13:26 viki m: multi infix:<∈> (\n, Range \r) { n ~~ UInt and n ~~ r }; my \ℕ = 1..∞; say 42 ∈ ℕ;
13:26 camelia rakudo-moar b1c41b: OUTPUT«True␤»
13:27 viki There we go.
13:27 awwaiid m: multi infix:<∈> (Int \n, Range \r) { n ~~ r }; my \ℕ = 1..∞; say 42 ∈ ℕ
13:27 camelia rakudo-moar b1c41b: OUTPUT«True␤»
13:27 awwaiid er
13:28 awwaiid m: multi infix:<∈> (Int \n, Range \r) { n ~~ r }; my \ℕ = 1..∞; say 42+9i ∈ ℕ
13:28 camelia rakudo-moar b1c41b: OUTPUT«Cannot resolve caller infix:<∈>(Complex, Range); none of these signatures match:␤    (Int \n, Range \r)␤  in block <unit> at <tmp> line 1␤␤»
13:28 viki m: my \ℕ = subset :: of UInt where 1..∞; say 45+5i ~~ ℕ
13:28 camelia rakudo-moar b1c41b: OUTPUT«False␤»
13:29 viki m: my \ℕ = subset :: of UInt where 1..∞; say 45 ~~ ℕ
13:29 camelia rakudo-moar b1c41b: OUTPUT«True␤»
13:29 viki :)
13:29 awwaiid nice
13:30 awwaiid is the 1..∞ adding any value over UInt there?
13:30 viki Oh, I guess not :D
13:30 viki awwaiid++
13:30 awwaiid maybe zero?
13:30 viki Oh, right
13:42 JimmyZ joined #perl6
13:48 skids joined #perl6
13:50 nicq20 joined #perl6
13:51 nicq20 Hello \o
13:52 pmurias masak: yes, node.js seems to have a very wild west approach in general
13:52 DrForr o/
13:53 moritz pmurias: would you be willing to write a blog post on nqp-js/rakudo-js for the perl 6 advent calendar?
13:58 perlpilot moritz++  that would be excellent IMHO
14:03 wisti joined #perl6
14:04 awwaiid what... zoffix became viki now? You just like to reset my context all the time! I need state damnit to shortcut assumptions -- purely functional conversations are not efficient!
14:06 viki tehee
14:08 awwaiid I would have taken yesterday's conversation about disabling flicker failing tests quite differently, for example. On the one hand I would have given much more weight to someone I recognized as an active contributor and non-stranger, on the other hand I would have felt much more comfortable being direct about my observatons and experiences. Lame I tell you. LAME. But that's fine. Break my world. BREAK IT GOO
14:08 awwaiid D
14:08 * awwaiid switches over to paying attention at $day-job
14:09 mst awwaiid: when I'm not sure I /whois since he's still @perl6.party
14:09 mst though at this point I've got a fairly good mental index of which nicks turn out to be tie()ed to Zoffix
14:09 awwaiid makes sense. My irc skillz and instincts could be improved :)
14:09 mst I've been an op for over ten years, my alt spotting spidey senses have been built up by a decade of idiocy
14:09 awwaiid hehe
14:10 viki :D
14:10 mst in this case, they're being used for something more pleasant
14:10 mst but it's still the same basic set of instintcs
14:10 khw joined #perl6
14:10 perlpilot mst: don't give him hints about what to change though.   Next thing you know we'll be talking 5 different nick that are all Zoffix and we won't be able to tell.
14:10 perlpilot :-)
14:11 awwaiid I want to see those 5 talk to themselves in a constructive way. Imagine the collaboration potential!
14:11 awwaiid I of course expect 5x the PRs
14:12 moritz you want a DDoS on github?
14:12 nicq20 How do I know that everyone here isn't Zoffix already?
14:12 awwaiid indeed. How do any of us know.
14:12 moritz nicq20: maybe you are Zoffix!
14:12 perlpilot Any nick I don't recognize, I immediately assume is Zoffix.  It's worked well so far :)
14:12 awwaiid haha
14:13 mst perlpilot: many years ago when we were both younger and stupider I played hide and seek with zoffix over a channel ban; I'm reasonably confident I can spot him even if he's trying to stay cloaked ;)
14:14 kurahaupo__ joined #perl6
14:14 mst new nick + similar speech patterns + similar areas of knowledge is generally quite sufficient
14:15 moritz .oO( cogney accept helps! )
14:15 nicq20 mst: Plus the UL may help
14:15 nicq20 *URL
14:15 mst I meant even if he'd changed the hostmask
14:22 perigrin moritz: cockney?
14:27 pierre__ joined #perl6
14:38 Xliff mst: So you are "on" to The Zoffix Collective?
14:39 Xliff Heck! We might as well just cave and call it what it really is.
14:39 mst hah
14:39 Xliff Resisting The Zoffix is futile.
14:39 nicq20 Xliff: Hivemind?
14:39 * arnsholt had actually forgotten that Zoffix is the base name
14:39 Xliff nicq20: Close. Up the geek index by 20.
14:39 arnsholt At this point it's just "that guy"
14:40 Xliff arnsholt: Look, if one of his nicks is "locutus", I'm gone.
14:44 yoleaux joined #perl6
14:45 pierre__ joined #perl6
14:45 * [Coke] loves the code archeology of knowing when someone did a cut and paste because of the shared typos.
14:45 user9 joined #perl6
14:53 japhb Xliff: Patrick Stewart is a 6er?  I'm all for it!
14:54 japhb Although at this point I've seen the "mild shock" meme template so many times it's about the second thing I think of when I think of him now.
14:59 Xliff japhb: To reduce such an illustrious career to a simple image.... sad....
15:01 Lucas_One joined #perl6
15:01 huajie-hu joined #perl6
15:06 masak [Coke]: I once saw phylogenetic techniques being applied to a bunch of chain emails. you could basically topo-order them by looking at where typos and changes were introduced.
15:07 ilmari is it solipsistic in here or is it just zoffix?
15:07 yoleaux 3 Nov 2016 12:23Z <tbrowder> ilmari: please check my WIP module at github.com/tbrowder/Misc-Utils-Perl6 for proposed module names shown in the table in the README. comments, please.
15:09 kyclark joined #perl6
15:09 cdg joined #perl6
15:09 viki .oO( zofflipsism )
15:10 viki The theory that only Zoffix exists :P
15:10 ilmari and we are all a figment of their imagination
15:10 cdg joined #perl6
15:10 ilmari s/a figment/figments/
15:10 ilmari i english gud
15:11 viki Zoffix cogitet, ergo sum
15:13 Rawriful joined #perl6
15:17 huajie-hu joined #perl6
15:18 huajie-hu zzz
15:19 viki xxx
15:20 nicq20 yyy?
15:20 viki 🦋🦋🦋
15:20 pmurias moritz: I'll think about it, if I get rakudo.js to a (semi-)presentable state I'll try to do that
15:20 nicq20 Oops, ccc
15:20 brillenfux joined #perl6
15:24 moritz pmurias: ok, thanks
15:24 moritz pmurias: IMHO it would be worth it writing about it even if it's not semi-presentable, just to get more publicity for the project
15:29 huajie-hu joined #perl6
15:30 zacts joined #perl6
15:31 kyclark How can I turn off any output buffering?  In Perl 5, it’s $| =1.
15:31 ufobat joined #perl6
15:31 [Coke] multis or multies ? (I prefer the former)
15:32 viki [Coke]: the latter. And it's the correct English.
15:32 [Coke] https://docs.perl6.org/language/5to6-perlvar - "currently autoflush is not implemented in Perl 6"
15:32 kyclark Ah, thanks.
15:32 [Coke] viki: except that "multi" is a "word" in Perl 6 lingo.
15:33 [Coke] but ok, multies is fine. one less thing to change here. Danke.
15:34 viki [Coke]:oh, i confused the rule for -y ending nouns.
15:36 viki kyclark: I'm not seeing any buffering, at least when printing to STDOUT
15:36 kyclark I’m working on a little game that refreshes the entire screen. It seems laggy.
15:36 kyclark I’ll post in a minute
15:36 kyclark bouncy balls!
15:38 wamba joined #perl6
15:39 * [Coke] ponders adding more code words from perl 6's src file to the doc spell checker to a) future proof it, and b) allow us to spell check the src comments. Probably just not worth it.
15:39 [Coke] s/src file/src dir/
15:50 kyclark OK, here’s a bouncy ball game: http://pastie.org/10955904
15:50 kyclark It seems shaky because of output buffering (I think).  Overall, it’s working well, but I’d love feedback.
15:51 [Coke] kyclark++
15:51 kyclark I wanted to write a Pong, but I have no idea how to capture keystrokes
15:52 viki You need to turn off shell buffering and then capture via $*IN
15:52 vike joined #perl6
15:52 * viki recalls doign something like that but totally forget the codes
15:52 moritz $*IN.getc?
15:53 moritz or does that still require an enter/return?
15:53 [Coke] getc is still buffered, someone just wrote that up for the docs.
15:54 viki moritz: yeah, it's $*IN.getc, but you still have to tell the shell to not buffer
15:54 viki kyclark: your game works fine on my screen.
15:54 viki kyclark: by "lag", do you mean the jerky motion of the ball? That's just 'cause you're moving it by character and not by pixel
15:55 moritz viki: some nasty stty invocation, maybe?
15:55 kyclark Yes, I guess that is what I mean.  Just jumpy.  Of course my kids think it looks really primitive, but they gave me a thumbs-up just the same.
15:55 kyclark I took inspirado from the Perl 6 Game of Life and Forest Fire games.
15:56 [Coke] https://docs.perl6.org/routi​ne/getc#Buffering_terminals
15:56 kyclark Can anyone advise on how to turn off the shell buffering to capture single keystrokes?  It was a question I posed the other day, too.
15:56 [Coke] section right after that talks about the issue with combiners.
15:57 kyclark Is it a call to “stty” to unbuffer?
15:58 viki fiwiw, there's a program called unbuffer
15:58 viki sudo apt-get install expect-dev
15:59 tbrowder morning #perl6
15:59 viki noon, tbrowder
15:59 mspo that's only for pipes
15:59 tbrowder good noon, viki
16:00 viki oh, OK, they I may have used something elese
16:01 mspo set stty_init "-opost"
16:01 mspo it's a sh + tcl script you can probably borrow from
16:01 viki Didn't work
16:02 tbrowder i would like to have a hash inside a sub that is static for the life of the program, but i don't think that's currently possible.  i can have a file scoped hash, but is there a better way to minimize its exposure?
16:02 viki tbrowder: state
16:02 viki m: sub foo { state $x = 42; dd $x++ }; foo; foo; foo; foo ;
16:02 camelia rakudo-moar 2ef2fd: OUTPUT«42␤43␤44␤45␤»
16:03 tbrowder ah, thanks, i was looking for static...great!
16:03 mst m: { my %x := (foo => 'bar'); sub foo ($x) { %x{$x} } } dd foo('foo')
16:03 camelia rakudo-moar 2ef2fd: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Strange text after block (missing semicolon or comma?)␤at <tmp>:1␤------> 3foo => 'bar'); sub foo ($x) { %x{$x} } }7⏏5 dd foo('foo')␤    expecting any of:␤        infix␤        infix stopper…»
16:03 viki Hm...    stdbuf -i0 -o0 -e0 perl6 -e 'my $c = $*IN.getc; dd $c'    also doesn't work for some reason :/
16:03 mst m: { my %x := (foo => 'bar'); sub foo ($x) { %x{$x} } }; dd foo('foo')
16:03 camelia rakudo-moar 2ef2fd: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    foo used at line 1␤␤»
16:03 viki mst: subs are lexical
16:03 viki by default
16:03 mst oh for crying out loud
16:03 mst yes
16:04 mst I realised that as soon as I saw the error
16:04 viki :)
16:04 cdg joined #perl6
16:06 nicq20 Is it possible to grab the name of a token alternation? Basically get 'bar' from `token foo:sym<bar> { ... }`
16:06 viki nicq20: <sym>
16:08 viki Well, <sym> would match 'bar'
16:08 viki m: say grammar { proto token foo {*}; token foo:sym<bar> { .+? <sym> .+ } }.parse: "meow bar moo", :rule<foo>
16:08 camelia rakudo-moar 2ef2fd: OUTPUT«「meow bar moo」␤ sym => 「bar」␤»
16:09 nicq20 Hmm. I 'm probably just doing something wrong then. :/
16:10 nicq20 viki: Is it possible to use that outside the grammar? Like in an actions class for it?
16:10 viki nicq20: "that" being what?
16:11 viki nicq20: in actions you'd declare multi method foo:sym<bar> ($/) {} that would be called when sym is <bar>
16:12 Sound joined #perl6
16:13 viki m: say grammar { proto token foo {*}; token foo:sym<bar> { { make first *, &?ROUTINE.name.comb: /"<"<(.+)>">"/ } } }.subparse("meow bar moo", :rule<foo>).made
16:13 camelia rakudo-moar 2ef2fd: OUTPUT«bar␤»
16:13 viki ahahaha :)
16:14 cdg joined #perl6
16:14 nicq20 viki: What I'm trying to accomplish is grab the "name" of the rule/token from inside an actions class. If I need to make a method for each alternation, that's fine. I'm just being lazy really.
16:15 viki nicq20: what's in $<sym> ?
16:15 nicq20 viki: From within TOP
16:16 timotimo right, if you match <sym>, you should also have a $<sym>
16:17 viki nicq20: I kinda figured the :sym stuff was precicely so you could have multiple separate action methods. So I don't think I udnerstand your laziness approach. If you aren't using multi action methods, why use :sym at all and not an alternation?
16:18 nicq20 From in TOP, I was doing `method TOP($/) { make: $<thing><sym>.Str }` but that does not return anything.
16:18 viki nicq20: did you match for <sym>?
16:19 nicq20 viki: I am using multiple tokens of the same base-name, but I wanted to be "lazy" about it because there are only three alternations.
16:20 viki nicq20: so why are there three tokens instead of one alternation with three variants?
16:21 viki m: say grammar { rule TOP { $<a>=\d+ $<sign>=<[+-]> $<b>=\d+ }; }.parse("4 + 4", :actions(class {method TOP($/) { make $<sign> eq "+" ?? $<a> + $<b> !! $<a> - $<b> }})).made
16:21 camelia rakudo-moar 2ef2fd: OUTPUT«8␤»
16:21 viki m: say grammar { rule TOP { $<a>=\d+ $<sign>=<[+-]> $<b>=\d+ }; }.parse("4 - 2", :actions(class {method TOP($/) { make $<sign> eq "+" ?? $<a> + $<b> !! $<a> - $<b> }})).made
16:21 camelia rakudo-moar 2ef2fd: OUTPUT«2␤»
16:21 nicq20 viki: Sorry, bad with terminology. :/  Let my try and paste the code somewhere.
16:23 nicq20 viki: http://pastie.org/10955917
16:24 viki nicq20: just use make ~$/
16:25 viki nicq20: oh, wait
16:25 viki nicq20: you want the command to be one of "status"/"check"/"add"?
16:25 nicq20 viki: Right.
16:27 viki nicq20: I don't see that information preserved anywhere when I dump the match object.
16:28 viki In fact, your method command isn't even called
16:28 nicq20 viki: I can make a new method for each one of the `command:sym<stuff>` tokens that returns 'status'/'check'/'add' appropriately. I wanted to know if there was a better way to do it first.
16:29 viki m: say grammar { rule TOP { $<a>=\d+ <sign> $<b>=\d+ }; proto token sign {*}; token sign:sym<plus> { "+" }; token sign:sym<minus> { "-" } }.parse("4 + 4", :actions(class {method command ($/) { dd [ "Here", $/ ] }})).made
16:29 camelia rakudo-moar 2ef2fd: OUTPUT«(Any)␤»
16:29 cosimo joined #perl6
16:29 viki Oh, duh, I'm using <sign> :P
16:30 viki m: say grammar { rule TOP { $<a>=\d+ <sign> $<b>=\d+ }; proto token sign {*}; token sign:sym<plus> { "+" }; token sign:sym<minus> { "-" } }.parse("4 + 4", :actions(class {proto method sign ($/) { dd [ "Here", $/ ] }})).made
16:30 camelia rakudo-moar 2ef2fd: OUTPUT«(Any)␤»
16:30 viki Nope, still ain't called
16:31 nicq20 I can't find anything in the docs about if it is supposed to be or not.
16:32 timotimo it wouldn't surprise me if it actually only calls the one with the "correct" "full" name
16:32 timotimo i.e. including the :sym<...> part
16:32 viki Yeah, I'd expect it to work that way
16:32 araujo joined #perl6
16:33 nicq20 Makes sense. Only call the proto if none of the others match.
16:33 timotimo actually, i think the :sym mechanism is only a thing inside grammars
16:33 timotimo or is that wrong?
16:33 viki m: say grammar { rule TOP { :my $*SYM; $<a>=\d+ <sign> $<b>=\d+ }; proto token sign {*}; token sign:sym<plus> { { $*SYM = "plus" } "+" }; token sign:sym<minus> { { $*SYM = "minus" } "-" } }.parse("4 + 4", :actions(class {method TOP($/){ make "Sym is $*SYM" }})).made
16:33 camelia rakudo-moar 2ef2fd: OUTPUT«Sym is plus␤»
16:34 viki nicq20: another way ^ Though IMO adding each :sym methods in actions is cleaner
16:34 nicq20 Oh, well. I'll just do it manually. :)
16:35 viki m: class { method you:are<wrong> { say "yep" } }."you:are<wrong>"()
16:35 camelia rakudo-moar 2ef2fd: OUTPUT«yep␤»
16:36 timotimo viki: you misunderstood me :)
16:36 timotimo m: class { method you:are<wrong> { say "yep" } }."you"()
16:36 camelia rakudo-moar 2ef2fd: OUTPUT«No such method 'you' for invocant of type '<anon|70393936>'␤  in block <unit> at <tmp> line 1␤␤»
16:36 timotimo ^- that's what i meant by that
16:36 timotimo not the syntax, but the mechanism that'll call those symmed variants for you
16:37 viki In actions? It doesn't call the one without the full name.
16:39 nicq20 I originally got the idea that it would work from this: https://docs.perl6.org/language/grammar_tutorial . At the end of it, the `<sym>` bit is used in the actions class.
16:40 viki nicq20: that works because there's a <sym> token being matched in the grammer
16:40 viki Whereas yours doesn't.
16:40 viki And <sym> is the value of the :sym<...> bit, so that's how you end up being able to retrieve that information.
16:41 viki token foo:sym<whatever> { <sym> } matches text "whatever"
16:41 viki And captures it into the $<sym> capture
16:41 nicq20 Oh, ok. That makes sense.
16:43 MilkmanDan joined #perl6
16:44 [particle] joined #perl6
16:44 viki m: class Foo { proto method speak {*}; method speak:cat<meow> { say "yep" } }.speak
16:44 camelia rakudo-moar 2ef2fd: OUTPUT«Use of uninitialized value of type Any in string context.␤Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.␤  in block <unit> at <tmp> line 1␤Cannot resolve caller speak(Foo); none of these signatures match:…»
16:45 viki tehe
16:46 nicq20 left #perl6
16:47 setty1 joined #perl6
16:50 evalable6 joined #perl6
16:50 bisectable6 joined #perl6
16:50 seatek joined #perl6
16:53 [particle] joined #perl6
16:57 dalek mu: 6dcf602 | (Zoffix Znet)++ | misc/perl6advent-2016/schedule:
16:57 dalek mu: Book Dec 24.
16:57 dalek mu: review: https://github.com/perl6/mu/commit/6dcf602133
17:05 hankache joined #perl6
17:07 hankache yello *
17:07 viki lo lo
17:07 hankache hiya viki
17:07 japhb 255,255,127
17:13 mattp_ joined #perl6
17:17 silug joined #perl6
17:21 Tonik joined #perl6
17:21 viki TIL a magpie is not a pie :o
17:23 viki .oO( a magpie pie )
17:26 timotimo magpies are the kind of bird who'd say "pickle pea! pump-a-rum!"
17:27 pierre_ joined #perl6
17:32 huf what
17:33 timotimo https://www.youtube.com/watch?v=7MlHmCpnJIU - watch out, memes
17:35 huf wow. what is this wonderful thing please
17:35 timotimo http://darksouls3.wiki.fextralife​.com/Pickle+Pee,+Pump-a-Rum+Crow
17:37 viki huuu https://www.wired.com/2016/11/googles-c​hrome-hackers-flip-webs-security-model
17:37 viki .seen pmuchad
17:37 yoleaux I haven't seen pmuchad around.
17:38 viki .seen pmichaud
17:38 yoleaux I saw pmichaud 15 Sep 2016 01:34Z in #perl6: <pmichaud> m: my $input = '(\d\d\d)';  my $m = 'a 123' ~~ /$0=<$input>/; say $m
17:38 viki We need to stort out HTTPS on rakudo.org
17:39 viki "Starting in January, Chrome will flip the web’s security model: Instead of warning users only about HTTPS-encrypted sites with faulty or misconfi­gured encryption, as Chrome currently does, it will instead flag as “not secure” any unencrypted sites that accept a username and password or a credit card."
17:41 timotimo well, we don't ask for username/password on rakudo.org
17:41 viki We actually do.
17:42 viki "Meta" column, bottom right.,
17:42 timotimo we know the risks when we log in there
17:42 DrForr letsencrypt is decent to set up.
17:43 viki What does us knowing anything have to do with Chrome actively listing our site as unsecure?
17:45 nowan joined #perl6
17:46 DrForr I woukd at one time hace been more circunspect, but now I see it as simple scsre tactics.
17:48 viki Because no one MIMed your traffic with your knowledge, not because of how easy it is to do :)
18:02 ale1ster joined #perl6
18:14 labster joined #perl6
18:22 viki Challenge for the day :) https://www.wechall.net/challenge​/training/prime_factory/index.php
18:22 viki A tiny 1-liner in Perl 6 :)
18:27 Rawriful joined #perl6
18:35 nicq20 joined #perl6
18:35 huf joined #perl6
18:35 nicq20 Hello o/
18:39 canopus joined #perl6
18:40 grondilu joined #perl6
18:42 viki \o
18:43 xinming joined #perl6
18:43 firstdayonthejob joined #perl6
18:47 domidumont joined #perl6
18:48 viki wow
18:48 viki m: my @l = "A".."Z"; dd @l[(1, 2, (10, 11), 3), (3, 4, 5)]
18:48 camelia rakudo-moar 2ef2fd: OUTPUT«(("B", "C", ("K", "L"), "D"), ("D", "E", "F"))␤»
18:48 viki TIL you can shape results using indexes like that
18:49 timotimo viki: i'd think it'd only warn as soon as it asks for username/password
18:49 timotimo viki: and no normal user will try to log in without having credentials
18:50 cdg joined #perl6
18:59 timotimo we're still bursting a whole bunch of cpu usage every few minutes to update testers.perl6.org
19:01 nicq20 Huh, didn't know that was a thing.
19:02 timotimo i'd love someone to write up a tiny thing that only does the hard work when there has been new stuff since the last update
19:04 timotimo also, the reports seem kind of b0rked? all show up as N/A
19:09 viki m: say "meow" ~~ 0
19:09 camelia rakudo-moar 2ef2fd: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5meow' (indicated by ⏏)␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
19:09 harmil_wk m: class Foo is Hash { has $.blah = 0 }; say Foo.new.blah.perl
19:09 camelia rakudo-moar 2ef2fd: OUTPUT«Any␤»
19:09 harmil_wk I have a feeling I'm doing something I should know better than to do...
19:09 viki Was that meant to explode? I kinda would want it to return False.
19:10 [Coke] viki: seems like that's missing a try somewhere, yah.
19:10 viki harmil_wk: Hash has .perl method
19:10 [Coke] m: say pi ~~ 0
19:10 camelia rakudo-moar 2ef2fd: OUTPUT«False␤»
19:10 [Coke] m: say "pi" ~~ 0
19:10 camelia rakudo-moar 2ef2fd: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5pi' (indicated by ⏏)␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
19:10 harmil_wk viki: I'm not sure I understand...
19:10 viki s: Hash.new, 'perl', \()
19:10 SourceBaby viki, Sauce is at https://github.com/rakudo/rakudo/b​lob/2ef2fdb/src/core/Hash.pm#L206
19:11 viki harmil_wk: oh, wait, neverf mind :}
19:11 harmil_wk I wasn't calling .perl on hash, though
19:11 viki Yeah, I've just realized that
19:11 viki s: Hash, 'new', \()
19:11 SourceBaby viki, Sauce is at https://github.com/rakudo/rakudo/​blob/2ef2fdb/src/core/Map.pm#L12
19:11 viki Ah, there we go :)
19:13 viki s: Mu, 'new', \()
19:13 SourceBaby viki, Something's wrong: ␤ERR: Cannot resolve caller sourcery(Mu, Str, Capture); none of these signatures match:␤    ($thing, Str:D $method, Capture $c)␤    ($thing, Str:D $method)␤    (&code)␤    (&code, Capture $c)␤  in block <unit> at -e line 6␤␤
19:14 bstamour joined #perl6
19:14 harmil_wk I'm sorry, but it has to be said: you can't Mu new review...
19:14 harmil_wk :-)
19:14 firstdayonthejob joined #perl6
19:15 viki m: use nqp; class Foo { has $.blah = 0; method new { self.bless: :42blaz } }.new.blah.say
19:15 camelia rakudo-moar 2ef2fd: OUTPUT«0␤»
19:15 viki m: use nqp; class Foo { has $.blah = 0; method new { self.bless: :42blah } }.new.blah.say
19:15 camelia rakudo-moar 2ef2fd: OUTPUT«42␤»
19:15 viki m: use nqp; class Foo { has $.blah = 0; method new { nqp::create(self) } }.new.blah.say
19:15 camelia rakudo-moar 2ef2fd: OUTPUT«(Any)␤»
19:15 harmil_wk oh really...
19:16 viki harmil_wk: what I'm seeing is nqp::create(self) doesn't set the defaults and that's what the Map's .new method is doin'
19:16 [Coke] all the default logic is in the bootstrap file in rakudo, so that makes sense.
19:16 harmil_wk Yeah, that seems highly counterintuitive. At the very least, a warning (probably error) should result if your defaults are going to be ignored.
19:17 viki We can't warn about every possible usage without slowing the runtime down to a screetching halt
19:17 viki m: use nqp; class Foo { has $.blah; submethod BUILD (:$!blah = 42) {} }.new(:72blah).blah.say
19:17 camelia rakudo-moar 2ef2fd: OUTPUT«72␤»
19:18 viki m: use nqp; class Foo { has $.blah; submethod BUILD (:$!blah = 42) {} }.new.blah.say
19:18 camelia rakudo-moar 2ef2fd: OUTPUT«42␤»
19:18 viki m: class Foo is Hash { has $.blah; submethod BUILD (:$!blah = 42) {} }.new.blah.perl.say
19:18 camelia rakudo-moar 2ef2fd: OUTPUT«Any␤»
19:19 viki mother...
19:19 sufrostico joined #perl6
19:19 * lizmat resists the urge to answer
19:19 [Coke] is there rakudo only code that demonstrates the issue? or do you have to (as viki did above), "use nqp" and then an nqp opcode?
19:19 harmil_wk My original code that derived from Hash
19:19 harmil_wk m: class Foo is Hash { has $.blah = 0 }; say Foo.new.blah.perl
19:19 camelia rakudo-moar 2ef2fd: OUTPUT«Any␤»
19:19 viki lizmat: what's the answer?
19:19 viki I mean, answer to what
19:20 lizmat to your cry for help: "mother..."  :-)
19:20 viki m: class Foo is Hash { has $.blah; method new { self.bless: %_ } }.new.blah.perl.say
19:20 camelia rakudo-moar 2ef2fd: OUTPUT«Too many positionals passed; expected 1 argument but got 2␤  in method new at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
19:20 viki Ah :)
19:20 harmil_wk lizmat: heh
19:21 viki m: use nqp; class Foo { has $.blah; method new { self.bless: |:42blah, |%_} }.new(:72blah).blah.say
19:21 camelia rakudo-moar 2ef2fd: OUTPUT«72␤»
19:21 viki m: use nqp; class Foo { has $.blah; method new { self.bless: |:42blah, |%_} }.new.blah.say
19:21 camelia rakudo-moar 2ef2fd: OUTPUT«42␤»
19:22 viki There. I win.
19:22 harmil_wk My point is that "class Foo is ::($x) { has $.blah = 0 }" will only work if $x is a class that doesn't do what Hash does... that feels like a very difficult-to-detect bug from the user's side.
19:22 [Coke] Yup. I would say that should either work or, if it can't, throw an error asap that it can't work.
19:23 harmil_wk I'll rakudobug it for the record.
19:23 viki I forcee that will result in severe de-optimization.
19:24 viki And what about classes that don't even do the .new business?
19:24 viki IMO, if you're going to base a class off a gut class, it's your job to familiarize yourself with its workings.
19:25 viki m: class Foo is DateTime { has $.blah = 0 }.new.blah.say
19:25 camelia rakudo-moar 2ef2fd: OUTPUT«Cannot call Foo.new with no parameters␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in any  at gen/moar/m-Metamodel.nqp line 3096␤  in block <unit> at <tmp> line 1␤␤»
19:25 viki m: class Foo is DateTime { has $.blah = 0 }.now.blah.say
19:25 camelia rakudo-moar 2ef2fd: OUTPUT«0␤»
19:25 wisti joined #perl6
19:26 viki m: class Foo is Set { has $.blah = 0 }.new-from-pairs("x").blah.say
19:26 camelia rakudo-moar 2ef2fd: OUTPUT«(Any)␤»
19:27 viki m: class Foo is Nil { has $.blah = 0 }.new.blah.say
19:27 camelia rakudo-moar 2ef2fd: OUTPUT«Nil␤»
19:27 viki m: class Foo is Array { has $.blah = 0 }.new.blah.say
19:27 camelia rakudo-moar 2ef2fd: OUTPUT«(Any)␤»
19:27 viki m: class Foo is Complex { has $.blah = 0 }.new.blah.say
19:27 camelia rakudo-moar 2ef2fd: OUTPUT«(Any)␤»
19:27 viki etc
19:31 viki Here's a good one:
19:31 viki m: class Foo is SetHash { has %.elems = :42meows }.new.elems.say
19:31 camelia rakudo-moar 2ef2fd: OUTPUT«{}␤»
19:31 viki m: class Foo { has %.elems = :42meows }.new.elems.say
19:31 camelia rakudo-moar 2ef2fd: OUTPUT«{meows => 42}␤»
19:31 viki So you need to know what you're doing when you're inheriting from core stuff.
19:31 samcv hmm from-json($json-string).WHAT.say => (Hash). but if i do: my Hash %hash = from-json($json-string), i get typecheck failed
19:32 viki Seems a flimsy idea too.
19:32 samcv Type check failed in assignment to %hash; expected Hash but got Array
19:32 viki samcv: is it a constant by any chance?
19:33 samcv which one?
19:33 harmil_wk Here's the problem I have: EVERYTHING is derived from something core. What happens when I use a module and derive from a class in that module that happens to derive from Hash or Set or whatever... Should I ever use defaults or are they just too uncertain to function?
19:33 viki samcv: constant %hash or my %hash?
19:33 samcv it's a my
19:34 viki star: use JSON::Fast; my %hash = from-json Q|{"foo": true}|; dd %hash
19:34 camelia star-m 2016.04: OUTPUT«Hash %hash = {:foo}␤»
19:34 ugexe you are typing your hash
19:34 samcv i'm sing json tiny
19:34 viki star: use JSON::Tiny; from-json Q|{"foo": true}|.WHAT.say;
19:34 camelia star-m 2016.04: OUTPUT«(Str)␤Input (4 characters) is not a valid JSON string␤  in sub from-json at sources/9B467EEF9267A777BB53BAA2F19BE2C9D756BEED (JSON::Tiny) line 59␤  in block <unit> at <tmp> line 1␤␤»
19:34 ugexe %hash is already a hash, Hash %hash is not the same thing
19:34 viki star: use JSON::Tiny; from-json(Q|{"foo": true}|).WHAT.say;
19:34 camelia star-m 2016.04: OUTPUT«(Hash)␤»
19:34 samcv ah ok ugexe
19:35 samcv so i don't need to specify a type?
19:35 viki You can if you want to.
19:35 timotimo Hash %foo is "a hash where the elements are Hash"
19:35 ugexe depends on your requirements, but it *sounds* like you don't need to
19:36 viki my Int %hash = :42foo
19:36 viki m: my Num %hash = :42foo
19:36 camelia rakudo-moar 2ef2fd: OUTPUT«Type check failed in assignment to %hash; expected Num but got Int (42)␤  in block <unit> at <tmp> line 1␤␤»
19:36 viki m: my Int %hash = :42foo
19:36 camelia rakudo-moar 2ef2fd: ( no output )
19:36 samcv thanks timotimo
19:37 samcv so i could do my Str %hash if i wanted to make sure all of them were strings or something?
19:38 viki harmil_wk: that's a good question and I don't think there's a certain answer. Guaranteeing some internal layout of core code would restrict development severely, so we can't do that, but without that guarantee, yes, you can't assume defaults.
19:39 viki m: class Foo does Setty { has %!elems }
19:39 camelia rakudo-moar 2ef2fd: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Attribute '%!elems' already exists in the class 'Foo', but a role also wishes to compose it␤at <tmp>:1␤»
19:40 viki harmil_wk: ^ like stuff like this. If we need to create %!whatever attribute in Setty, that does have potential to break someone's code who does Setty and has that attribute defined.
19:40 samcv if i try and do this: %channel-event-data{$e.nick}{'spoke'} = now.Str; i get: Type Array does not support associative indexing.
19:41 viki Also, to note, I wouldn't exactly claim "EVERYTHING is derived from something core", I'd think 95% of classes derive from Any.
19:41 sivoais joined #perl6
19:41 viki samcv: sounds like %channel-event-data{$e.nick} has an Array in it and not a hash
19:41 samcv ah so a hash of arrays
19:42 viki prolly
19:42 ugexe m: sub validate(%hash (Str :$name, Int :$ver)) { %hash }; my %valid = :name<xxx>, :ver<1>; my %invalid = :name(Nil), :ver<fff>; say validate(%valid); say validate(%invalid) # its probably easier to validate your hash like this
19:42 camelia rakudo-moar 2ef2fd: OUTPUT«{name => xxx, ver => 1}␤Type check failed in binding to $name; expected Str but got Any (Any)␤  in sub validate at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
19:42 samcv i guess that makes some sense
19:43 RabidGravy joined #perl6
19:43 viki harmil_wk: though the impact can probably be ameliorated by some sort of convention... like all core attributes and internal methods have some sort of prefix and that would guarantee they don't clash with user code
19:43 * viki contemplates the amount of work that would entail
19:43 ugexe prepend Rakudo::Internals:: to eerything
19:44 harmil_wk viki: Well, that addresses the issue you brought up, but doesn't really address the one I was concerned about. I do agree, though, that using some convention there is wise (and generally practiced in other languages)
19:44 lizmat re subclassability of Hash: we could so something like with Date.new
19:45 lizmat which *is* subclassable
19:45 viki s: Date, 'new', \()
19:45 SourceBaby viki, Sauce is at https://github.com/rakudo/rakudo/bl​ob/2ef2fdb/src/core/Dateish.pm#L28
19:45 viki s: Date, 'new', \("2016-11-11")
19:45 SourceBaby viki, Sauce is at https://github.com/rakudo/rakudo/​blob/2ef2fdb/src/core/Date.pm#L36
19:49 viki m: say class Foo is Date { }.new === Date
19:49 camelia rakudo-moar 2ef2fd: OUTPUT«False␤»
19:50 viki I rescind my previous comments. It does make sense for some behaviour to be expected and the non-setting of attribute defaults with Hash is LTA.
19:50 viki And on that note... 'tis quitting time \o/
19:51 girafe joined #perl6
19:51 masak I just realized that with looping over a hash/dictionary/map, Perl 5, Perl 6, Python 2/3 and Java all have different behaviors.
19:51 masak Perl 5 loops over zipped keys/values in a flat list. Perl 6 loops over pairs as reified objects. Python loops over keys. Java doesn't allow it, and forces you to be more specific.
19:53 samcv hmm it looks like %hash has keys which point to arrays whith only one element, which hold a hash
19:54 samcv er wait, no. a hash of arrays, which hold multiple elements, each of which is a hash
19:55 samcv agh
19:55 harmil_wk viki: have a good one
19:56 firstdayonthejob joined #perl6
19:56 viki samcv, just dump your JSOn on this site and then use the Viewer tab to explore its structure: http://jsonviewer.stack.hu/
19:56 masak I'll also note that of the four languages, only Java and Perl 6 could be said to have reified pairs. though Python compensates well with 2-tuples.
19:57 RabidGravy Anyway I went someway to absolution for spending several days being annoyed by Scala at work by making a Vagrantfile with rakudo
19:58 RabidGravy so arguably I have actually been paid to do Perl 6 stuff today :)
19:59 timotimo neat
20:00 Rawriful joined #perl6
20:01 harmil_wk I think that in general, my feeling is that defaults on attributes isn't a good idea. I hate to be all "there's only one way to do it", but it feels as if defaults on BUILD parameters is the more reliable tool, at least as things stand.
20:03 RabidGravy it depends what the requirement is, no point being absolutist about it
20:11 nicq20 left #perl6
20:14 masak m: class C { has $.x = 18; submethod BUILD($!x = 5) {}; }; say C.new
20:14 camelia rakudo-moar 55b9e9: OUTPUT«C.new(x => 5)␤»
20:15 masak harmil_wk: would you say that your preference has anything to do with the fact that BUILD parameter defaults *override* attribute defaults? :)
20:16 RabidGravy I've always wondered whether that's right, that if there's a BUILD at all the defaults are ignored
20:17 masak here's how I remember it
20:18 masak I was also always wondering/skeptical about whether that's right
20:18 masak but tadzik was the one who put up the fight, and clearly expressed his dislike over the state of affairs
20:19 masak at which point TimToady spoke up, and make it abundantly clear that the way things are is not an accident, and he would *not* change it -- for reasons of performance -- just because it was deemed convenient to do so
20:19 tadzik Aww yiss
20:19 yoleaux 06:51Z <japhb> tadzik: I sent you a PR to add 256-color and 24-bit RGB color support to Terminal::ANSIColor.  Enjoy.  :-)
20:19 masak tadzik: did I get that approximately right?
20:19 tadzik I don't like BUILD eitger
20:19 tadzik Masak: yup
20:20 masak I never did ask follow-ups on the performance rationale, but I *do* trust that TimToady has thought this one through
20:20 tadzik The one from Moose may be improper, but it's useful
20:20 masak maybe the argument would go something like "running one BUILD is way faster than running lots of silly little attribute default thunks"
20:21 masak which I guess I buy
20:23 masak tadzik: what does the one from Moose do that Perl 6 doesn't?
20:23 tadzik japhb: <3, will check it out.after $movie
20:23 tadzik Bbl&
20:23 masak alright :)
20:23 RabidGravy I've got used to it now, but I still occasionally get bitten when I've put defaults in and then decide that I need a BUILD for some reason
20:23 * masak assumes he could get tad zik's attention again by writing his nick, but chooses not to :)
20:24 masak RabidGravy: yes -- that's what bothers me too. in the "wrong code that looks right" department, those attribute defaults look like they would do something, but they all become sitting ducks the moment a BUILD shows up.
20:26 girafe2 joined #perl6
20:26 masak the most cheerful I can say about it is that at least the action-at-a-distance is limited to the same class, because (a) BUILD is a submethod, and (b) one tends to initialize !-twigil attrs, again because of (a)
20:27 ugexe m: role Foo[$a] { has $.a = $a }; my %args = :a<2>; my $foo = Foo[1].new(|%args); say $foo.a # just use roles for all the things
20:27 camelia rakudo-moar 55b9e9: OUTPUT«2␤»
20:28 masak ugexe: I was in the "just use roles for all the things" camp for a long time
20:28 masak ugexe: the place where it falls down is when you start doing multiple inheritance
20:29 masak and you realize that you're dealing with a flat thing, not a hierarchy
20:29 masak I had this happen in a very real way in the 007 project
20:29 arnsholt One feature in SmallTalk I really like is the method call chain syntax
20:29 arnsholt Not sure how it'd be transferrable to a more C-like syntax though
20:29 masak see https://github.com/masak/007/commit/ec​b49fab9e525afb384facf846a863459d3e9bba
20:30 ugexe all you have to do is add method and submethods of new, BUILD, some logic in the body of the role itself to...
20:31 ugexe heh yeah i know it starts to suck pretty fast
20:31 masak arnsholt: could you tell me a bit more about the method call chain syntax, and what you like about it?
20:31 arnsholt It's basically just a syntax to invoke several methods on the same invocant
20:31 masak ugexe: from then on, the rule in 007 was "roles for interface-y types, classes for concrete types"
20:32 masak ugexe: but 007 is now gearing up to do all the MOP stuff in 007 rather than in Perl 6, so that's going away too :)
20:32 arnsholt So in a sense similar to what I think is called "fluent interfaces" (or some such), where methods return the invocant
20:32 masak arnsholt: what's the syntax?
20:32 ugexe i still like class_name[...].new() for things that are a container though
20:33 arnsholt Semicolon instead of period as statement terminator, and statements don't start with an invocant (there being more or less only return statements and method call statements in SmallTalk)
20:34 arnsholt So you can for example do, to populate a hash: "dict := Dictionary new; add: 'foo' -> 1; add: 'bar' -> 2; yourself"
20:34 * masak re-vows to get through http://worrydream.com/EarlyHistoryOfSmalltalk/
20:34 arnsholt Where yourself is a method that returns the object it's called on. Sounds like a silly method, but this is why it's there =)
20:35 masak :)
20:35 arnsholt (For the particular example above theres Dictionary>>with:with: which does the same thing, but that'd be missing the point)
20:35 arnsholt Another absolutely hilarious SmallTalk method is become:
20:36 arnsholt Which takes mutates the instance it's invoked on into the instance passed as an argument
20:36 arnsholt Which is kind of o.O
20:36 masak I've heard about that method
20:36 masak I think I read about it on ward's wiki
20:37 arnsholt Sounds entirely plausible
20:37 arnsholt I haven't had occasion to use it yet, sadly =)
20:41 tushar joined #perl6
20:44 avalenn_ joined #perl6
20:48 AlexDaniel joined #perl6
20:52 TEttinger joined #perl6
21:05 konobi TimToady: I thought you might find this interesting: https://www.kickstarter.co​m/projects/23012359/minima
21:08 * masak discovers a lot of other nice c2.com articles in looking for the one about `become:`
21:14 samcvtest having some issues with variable names with - in them
21:15 samcvtest Variable '%channel-event-data' is not declared, and then before, said something like invalid use of '-' in sink context
21:17 ugexe thats... impressively vague
21:18 samcvtest yeah sorry trying to find it. it could be related to maybe problems in another spot. so i'm investigating
21:19 samcvtest i'm thinking maybe it's not matching a parenthisis or something and misinterpreting the variable..
21:19 samcvtest Useless use of "-" in expression "$fh-3.say( to-json( %.channel_event_data) )" in sink context, oh looks like
21:20 samcvtest wasn't related to the variable, i renamed the variable to use underscores
21:20 samcvtest so it's probably the to-json function
21:20 jnthn $fh-3 would be parsed as infix -
21:20 grondilu timotimo: that typeface is barely readable
21:20 ugexe not really a good idea to use -<number> in a variable name
21:20 samcvtest oh. the filehandle. ugh derp
21:20 grondilu timotimo: sorry meant to address that to TimToady
21:20 jnthn We required alpha after a -
21:20 jnthn *require
21:20 timotimo is ok :)
21:21 Actualeyes joined #perl6
21:21 jnthn (for it to be parsed as a variable name)
21:22 setty1 joined #perl6
21:26 bjz joined #perl6
21:37 RabidGravy oh dear I just looked at the Jenkins job definition xml
21:38 RabidGravy I really wish I hadn't
21:39 RabidGravy only a java programmer could have perpetrated "<com.coravy.hudson.plugins.​github.GithubProjectProperty plugin="github@1.22.4">"
21:39 benchable6 joined #perl6
21:40 committable6 joined #perl6
21:40 MasterDuke_ joined #perl6
21:40 timotimo m)
21:49 ugjka joined #perl6
21:58 RabidGravy it's not even a sane schema
22:06 pierre_ joined #perl6
22:08 seatek joined #perl6
22:28 BenGoldberg joined #perl6
22:33 ale1ster joined #perl6
22:35 tadzik masak: so, in Moose when I do BUILD I can put it there and not put it there and it doesn't impact the rest of the class ocde
22:35 tadzik in P6 when I do BUILD I break attribute initialization in some cases and not in some others
22:36 tadzik and when a new attribute comes in I need to modify the BUILD signature again for attrs to initialize properly
22:37 tadzik I wrote this stupid patch 5 years ago that introduced a method called AFTERPARTY that did all I wanted :P
22:37 timotimo just implement BUILDALL and put callsame at the top
22:37 tadzik I just want to Do Stuff When Everything Is Ready As It Should Be. Could do it in Moose, cannot in P6
22:38 tadzik 'that could work; I assume there's a catch, and a reason why we usually go the overload-new/submethod-BUILD way instead
22:39 perigrin tadzik: obviously the answer is to port Moose to p6.
22:39 * perigrin hides.
22:39 tadzik perigrin: fortunately there's Inline::Perl5 so we don't have to :P
22:39 perigrin :D
22:44 pierre_ joined #perl6
23:08 pierre_ joined #perl6
23:10 ugexe always trick the end user into doing all initialization so its their fault
23:12 konobi TimToady: any idea if there is something else already existing?
23:17 masak tadzik: thank you -- that helped
23:17 masak now all I could ask for is for TimToady to put that into perspective somehow
23:17 tadzik :)
23:18 tadzik I remember talking/arguing with TT over this and coming out as wrong (duh :P)
23:18 masak but giving the TimToady genie any explicit instructions is a fool's errand... right :P
23:18 masak we'll... see what happens
23:18 mst everybody argues with TT and loses, especially when it comes to context
23:19 mst hence DBIC's _rs methods etc.
23:19 * masak .oO( Club Of People Who Argued With TT and Lost )
23:20 MasterDuke_ i think mst had a bunch of comments/suggestions/something about the difference between Moose and Perl 6 a couple weeks ago
23:21 MasterDuke_ in regards to the initialization of attributes
23:22 mst right, basically, as soon as you define a BUILD submethod, perl6 goes "surprise! let's make you type more than raw perl5 OO"
23:22 tadzik yes!
23:23 mst if you duplicate all your attributes as named parameters in it, it goes back to doing mostly the right thing
23:24 mst when I complained about this, TimToady basically said that yes, people had noticed, and what really needed to be done was to have a subroutine for 'do the basic BUILD stuff' you could call anywhere you liked in your custom BUILD (thereby giving you the Moose functionality back -and- control over ordering), but nobody'd come up with a good name for it so it hadn't been implemented
23:25 mst the fact that as a result, for most of the cases I care about, perl6 OO is more typing and requires me to duplicate attribute names and hope I don't typo, is why I'm using perl6 via Inline::Perl6 for stuff but stick to writing my OO stuff in perl5+Moo
23:25 tadzik now that's just crazy
23:25 mst well, that and perl6 has nothing like lazy either
23:25 tadzik nodnod
23:25 mst so basically perl6 OO is inferior to Moo for 99% of my use cases
23:26 * mst just wants grammars, I'll wait for the rest of the language to catch up to perl5
23:26 timotimo wow
23:26 masak I'd love for p6 to have a good lazy story
23:26 masak I 100% agree with mst that that's currently missing
23:27 mst basically, perl6's BUILD is actually (in my head) POPULATE, i.e. slot population
23:27 mst I'd like there to be two submethods
23:27 mst one for overriding slot population
23:28 mst and one for the much more common case that Moo(se) provide
23:28 ttkp6 joined #perl6
23:28 mst given Moo/Moose's more featureful attributes, I've honestly never wanted to override slot population that way anyway
23:30 masak I don't know about all y'all, but this sounds like something that could be tried out in a branch
23:30 mst I'd be happy to play with it if somebody did
23:31 mst but when TimToady says "yeah, we don't have that, we didn't think of a name" and lizmat basically told me she preferred positional constructors and manual population in BUILD, I just went back to writing the OO parts in perl5 since that already has all the features I needed
23:31 mst esp. given http://p3rl.org/Function::Parameters to give me typed signatures
23:32 masak mst: could you perhaps provide some details of what you imagine the two submethods would do?
23:32 mst easy
23:32 mst POPULATE would to what BUILD currently does, i.e. override everything and make you do everything by hand
23:32 mst BUILD would do what BUILD in Moo(se) does, i.e. populate the slots and then let you add whatever logic you want
23:33 mst (names based on my mental model, not intended as recommendations or anything)
23:33 masak ok, at this point I think there's enough info for whoever feels motivated to try it out in a branch
23:33 mst this is, if memory serves, at least the third time I've had this conversation
23:34 masak :)
23:34 mst maybe I need to give a YAPC talk titled "why perl5 OO is better than perl6" to motivate people to change that ;)
23:35 masak heh
23:36 mst not serious. that would be almost as awful as lizmat's "why perl5 is the new perl4" talk in terms of fucking up community relations
23:36 mst a blog post called "things I miss from M*" might not be a terrible plan though
23:41 * mst grumbles
23:41 mst "you stole most of the things Moose did better than your old metamodel, why couldn't you've stolen these too" :P
23:41 perlawhirl joined #perl6
23:45 wamba joined #perl6
23:59 nadim_ joined #perl6

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

Perl 6 | Reference Documentation | Rakudo