Camelia, the Perl 6 bug

IRC log for #masakism, 2013-06-19

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

All times shown according to UTC.

Time Nick Message
03:52 camelia joined #masakism
03:52 Mithaldu joined #masakism
03:55 camelia joined #masakism
03:55 Mithaldu joined #masakism
05:59 dmol joined #masakism
07:00 Teratogen ok my MASAKISM timer just went off
07:00 Teratogen is today the day?
07:11 labster Today is the day.
07:13 labster is it 13 hours away now?
07:20 Teratogen drat
07:21 Teratogen I will probably be asleep =(
07:33 dmol joined #masakism
07:35 labster sleep now, wake up later
11:00 snearch joined #masakism
11:04 masak yes, it is today \o/
11:04 masak about 5 hours to go
12:00 masak four hours to go. :)
12:00 benabik joined #masakism
12:10 FROGGS joined #masakism
12:10 FROGGS \o/
12:11 masak \o/
12:11 * masak keeps hacking on his elevator
12:15 dagurval joined #masakism
12:25 masak er. correction. it's currently 5 hours 35 minutes to go.
12:28 FROGGS (or to sit)
14:11 masak slightly less than 4 hours left.
14:12 Teratogen masak, I am crashing, so I will probably miss it =(
14:12 Teratogen but thank you for inviting me
14:17 Kelder joined #masakism
14:19 masak Teratogen: well, if you wake up during the thing, feel free to stop by.
14:19 Teratogen willl do
14:19 masak sleep tight.
15:23 FROGGS joined #masakism
16:01 masak two hours \o/
16:03 dmol joined #masakism
16:30 Tene Less than one year until countdown.
16:35 masak :)
16:35 masak something like 85 minutes now.
16:56 dmol joined #masakism
16:57 masak point of order: here are all the solutions from last time around: https://gist.github.com/masak/5496294
16:57 masak should I keep adding to the file in that gist, or create a new file in the same gist, or create a new gist?
16:58 masak I'm inclined to just add to that same file, not making much of a distinction between last time and this time as far as the solutions are concerned.
16:58 lizmat I would say: keep the gist
17:02 masak that narrows it down to the first two options :)
17:05 lizmat sorry, option 1
17:10 masak ok :)
17:11 masak will do so.
17:12 PerlJam joined #masakism
17:14 spider-mario joined #masakism
17:17 moritz joined #masakism
17:17 masak \o/
17:18 masak 42 minutes left. :)
17:18 masak time to spin up the excitement engine slightly.
17:27 masak 23 minutes left...
17:27 masak er, 33.
17:30 timotimo joined #masakism
17:41 FROGGS both kids are sleeping \o/
17:46 masak \o/
17:46 masak 14 minutes...
17:47 FROGGS 13 on my clock
17:48 masak yes, now it's 13 :)
17:48 raiph joined #masakism
17:49 raiph masak: i imagine you might be a bit flustered/annoyed by what i've just done, but it felt right to me: http://www.reddit.com/r/perl/comments/1go2ex/p​6_and_p5_are_siblings_and_its_not_all_rivalry/
17:50 masak raiph: no, that's OK.
17:51 masak I just hope it won't get us many trolls, but we'll handle that on an as-needed basis.
17:52 masak raiph: I'm flattered that you refer to me as "Carl", but in a Perl 6 context, I self-identify as "masak" almost always. :)
17:52 masak 8 minutes.
17:53 masak 7.
17:55 varnie joined #masakism
17:55 FROGGS 5
17:55 Tene_ joined #masakism
17:55 Tene_ joined #masakism
17:55 masak reTene \o/
17:56 masak varnie: greetings.
17:56 varnie hello
17:56 masak 4 minnutz.
17:56 masak varnie: something is about to happen here. :)
17:57 masak hm, is http://freespectrum.herokuap​p.com/workshop-map-links.svg clickable for someone else?
17:57 masak it isn't for me.
17:57 masak 3 MINNITS
17:57 benabik masak: I can click the names
17:58 masak oh, nice. then we'll keep it.
17:58 lizmat the nodes cannot be clicked :-(
17:58 FROGGS I can click too
17:58 masak no census. :(
17:58 masak 2 MI.NU.TES
17:58 masak anyone know how we can reach census?
17:58 benabik I can't click the nodes either, but the names work.
17:58 moritz same here
17:58 FROGGS masak: no idea
17:59 masak 1 minute
17:59 masak oh, he's not on the participant list.
17:59 masak all the others are, except tadzik...
17:59 masak oh well.
17:59 masak he'll show up :)
17:59 masak hi, I'm masak. I come from Sweden. I've been doing Perl 5 since about 2001, and Perl 6 since 2005. I love to talk Perl, teach Perl, and learn Perl.
18:00 masak could everyone here just give a short one-line presentation of themselves?
18:00 varnie hi. I am from Russia. I am self-taught Perl programmer (well, newbie at this moment, but I am learning).
18:01 masak nice to meet you, varnie.
18:01 FROGGS I'm FROGGS from germany and I do Perl since 1999. And since 2006 or so I am a fulltime-hacker, mostly PHP at work sadly.
18:02 FROGGS (but it is getting more perly these days)
18:02 * lizmat is from the Netherlands and has been programming in Perl 5 since 1994, and programming for a living since 1977
18:02 * benabik is a PhD student in CS in New York, USA, doing research in parallelism in dynamic languages, with a general interest in language design and implementation.  Worked on Parrot for GSoC for the last two years.
18:02 lizmat the past months I've become more involved in Perl 6
18:02 hey joined #masakism
18:02 masak you certainly have :)
18:02 masak for those who weren't here last time, there's http://freespectrum.herokuap​p.com/workshop-map-links.svg and https://github.com/masak/workshop to start digging into.
18:02 masak oh, and I will now booby-trap two exercises with PRIZES.
18:02 commondog joined #masakism
18:03 FROGGS PRIZES \o/
18:03 masak the first one to hand in an exercise on a booby-trapped exercise wins an Amazon book worth about 20 EUR.
18:04 masak ok, booby-traps placed.
18:05 masak if you're still unsure where to start at this point, start at https://github.com/masak/wo​rkshop/blob/master/intro.md
18:05 FROGGS will do
18:05 masak or go look at the map. it's the first link in the /topic
18:05 benabik Is there a preferred submission method, or just code online somewhere?
18:05 masak or talk to me.
18:06 masak benabik: I prefer gists.
18:06 masak benabik: but any pastebin is fine. helps if it doesn't time out.
18:07 masak I will be keeping a list of submitted solutions at https://gist.github.com/masak/5496294
18:07 masak this time I expect not to lag behind on maintaining the list :)
18:07 masak if anyone feels "oh my, this is way over my head", I can help there too. just talk to me here on-channel or through privmsg.
18:08 masak I haven't had time to prepare a whole track for beginners, but there's certainly space for you in our hearts. and I have some ideas that I'd like to (mwhaha) try on you. :)
18:09 masak commondog: greetings. I suppose you're here because of http://www.reddit.com/r/perl/comments/1go2ex/p​6_and_p5_are_siblings_and_its_not_all_rivalry/ :)
18:09 masak commondog: let me know if there's anything I can help with.
18:11 * masak .oO( on the internet, nobody knows you're a commondog )
18:12 commondog alright, thanks
18:14 masak oh, and the ELEVATOR task... if anyone reaches that and wants to have a crack at it, let me know.
18:15 masak I have some half-finished scaffolding code for it, but nothing publishable yet. but if someone is interested, maybe we could look at it toghether. :)
18:16 masak and if you people don't make enough noise tonight, maybe just maybe I'll have something ready before the four hours are up.
18:16 masak (but don't worry, ELEVATOR is not one of the booby-trapped ones.)
18:22 masak hey everybody, check out varnie++'s JAPH: https://gist.github.com/varnie/5816486
18:22 masak pretty sleek :)
18:25 masak how's it going for the rest of you? I'm so curious.
18:27 * benabik has a simple version of ROMAN that doesn't do the silly subtractive thing.
18:28 benabik https://github.com/Benabik/ma​sakism/blob/master/ROMAN.pl6
18:29 benabik Oh, right, gists.  I setup a repository by habit.  :-/
18:30 masak that's fine too :)
18:30 masak looks nice so far.
18:31 benabik There's a JAPH in there too, but I did it the boring way.  :-P
18:31 masak hehe.
18:44 * masak tinkers with the elevator, and makes tea
18:44 labster Hi, I'm Brent Laabs, and I'm late to the party.
18:45 labster But since I did this last time, I'll just jump in a bit later down the track.
18:45 masak excellent.
18:54 Ayiko last time I had sub to_roman($i) {'III'} as solution for roman (it passed the test), now I expanded a bit: https://gist.github.com/Ayiko/9ca80fba8027b38d2129
18:55 masak :)
18:57 masak I added it to https://gist.github.com/masak/5496294
18:58 masak Ayiko: a stylistic point: it seems to me lines 14..22 should be out-dented one step.
18:59 Ayiko hrm, gist choked on tabs it seems :s
19:00 masak here's my take on the tab key: use it, a lot. here's my take on the tab character: avoid it, a lot.
19:00 masak the only place where I endure it is in Makefiles.
19:01 * labster is working on PROMISE, and realizing he doesn't understand P5 classes all that well.
19:02 masak labster: please feel free to think out loud here on-channel.
19:02 masak I think you'll be pleasantly surprised how much assistance you'll get.
19:02 masak Ayiko: http://www.jwz.org/doc/tabs-vs-spaces.html is a good resource, if you haven't seen it already :)
19:02 masak as is http://www.amazon.com/Perl-Best-Pra​ctices-Damian-Conway/dp/0596001738/
19:05 labster I think I just got used to Perl 6 classes blessing themselves.
19:06 FROGGS masak: ROMAN.pl https://gist.github.com/FR​OGGS/2538bd5f6f92283c7f66
19:06 FROGGS I wanted to do a fancy japh but just wasted time :/
19:08 labster fancy JAPHs are important
19:11 masak FROGGS: nice. how does that solution fare with 4 -> IV ?
19:12 FROGGS uhhh
19:12 FROGGS good point
19:12 masak :)
19:13 masak time to write more tests!
19:13 benabik https://github.com/Benabik/ma​sakism/blob/master/ROMAN.pl6
19:13 FROGGS mehr
19:13 FROGGS meh
19:13 masak time to write mehr tests! :P
19:13 Ayiko masak: yeah, I'll try to better my life
19:13 masak benabik: very nice.
19:13 Ayiko and while I'm fixing stuff anyway, I thought to add a MAIN or 2
19:14 benabik Spent way too much time trying to find a more elegant way to handle the stupid subtracting bit.
19:14 masak benabik: a tip: look at other people's solutions over at https://gist.github.com/masak/5496294
19:15 labster stubbed out a class with a constructor and stub methods, automatically passed 4 tests.  not bad.
19:16 masak you're supposed to write tests that fail, and then pass them :P
19:16 masak RED-green-refactor :)
19:16 gfldex joined #masakism
19:16 labster Yeah.  It turns it into a game, which is neat.  I like games.
19:16 Ulti joined #masakism
19:17 masak TDD is the ultimate game.
19:17 masak I think I will keep playing it all my life.
19:18 masak I saw my grandparents doing crosswords as they got older. I won't do that -- I'll be solving Knuth exercises in Perl 8 :)
19:18 gfldex http://www.openttd.org/en/ :)
19:18 masak ooh
19:19 benabik masak: That feels like cheating.  :-/
19:20 masak benabik: not if you've spent your own time trying to solve a problem.
19:20 masak benabik: that's when you're highly receptible for other people's solutions.
19:21 gfldex wc sorry
19:21 Ayiko *multi* sub MAIN! why doesn't the error just say that instead of "redeclaration of sub MAIN"
19:21 Ayiko updated roman: https://gist.github.com/Ayiko/9ca80fba8027b38d2129
19:22 masak gfldex: heh, I thought you were making a pun on "TDD/TTD is the ultimate game" :D
19:22 masak Ayiko: please submit a rakudobug.
19:23 gfldex i was thinking on pretending as much for a moment
19:23 benabik feller's is nice. `[op] do for` is an idiom to remember.
19:23 masak Ayiko: nice.
19:23 benabik But I think any further changes to mine would just be re-writings someone else's solution.  Onwards!
19:24 masak benabik: I would have used 'map' instead of 'do for'. I don't like to rely on the return values of for loops.
19:24 gfldex cool thing is that one of the guys that makes openTTD is working for the german railway. He's makeing fancy software to build the rail timetable and one could argue he makes the game to test it. :)
19:24 benabik masak: Feels natural to me, but that's probably my time with Scala where all for loops desugar to maps anyway.
19:25 masak they do in Perl 6 as well.
19:25 masak it's just that I don't like to *rely* on it. :)
19:25 masak gfldex: that is cool.
19:26 benabik masak: Is it likely to change?
19:26 PerlJam benabik: doubtful.
19:27 masak benabik: no. my point is about readability.
19:27 masak benabik: I use for loops for their side effects. I use maps for their values.
19:27 benabik masak: Ah.  Point.
19:28 benabik for loops as list comprehensions are useful in Scala, but it uses a lot of lists and has a lot more options than a simple map.
19:28 PerlJam masak: btw, there won't be a Perl 8, Perl will asymptotically approach tau just like pugs :)
19:30 masak PerlJam: yes. :)
19:30 * benabik heads down the orange track simply because it has ELEVATOR on it.  ;-)
19:30 masak PerlJam: which tells you something of how old I plan to become :P
19:30 masak benabik: see caveats in the backlog about ELEVATOR: http://irclog.perlgeek.de/ma​sakism/2013-06-19#i_7220348
19:31 benabik masak: You'll either have something interesting by the time I get to it or I'll jump tracks.  :-)
19:33 masak deal.
19:35 PerlJam masak: btw, I have ever asked you if you are familiar with http://codekata.pragprog.com/  ?
19:36 PerlJam (if you're coming up with interesting stuff for ELEVATOR, just ignore me until that's done  ;)
19:38 masak PerlJam: familiar with, grok the concept, did it once on stage with Perl 6 in Oslo :)
19:38 masak PerlJam: it's a refreshing experience to kata something.
19:39 PerlJam masakism keeps reminding me of it.
19:39 lizmat next: masakataism
19:40 masak hahaha
19:40 masak PerlJam: I hadn't consciously made the connection, but I see what you mean.
19:41 PerlJam lizmat: heh!
19:50 raiph joined #masakism
19:55 timotimo is it going goodwell?
19:55 masak you tell me.
19:59 benabik No such method 'tc' for innocent of type 'Str'?
20:00 labster And it will be held on Masakhalin island.
20:00 labster Okay, how do you store a bit of code and run it later in P5?
20:00 masak r: say "foo".tc
20:00 camelia rakudo b2072f: OUTPUT«No such method 'tc' for invocant of type 'Str'␤  in block  at /tmp/ygSK2YDMO_:1␤␤»
20:00 timotimo i have not paid any attention
20:01 masak labster: my $bit_of_code = sub { ... }; ... $bit_of_code->();
20:01 PerlJam labster: my $code = sub { ... };   # unless you mean something else
20:02 labster I thought it was something like that, so it must be something else that's not working for me.
20:02 masak labster: if you're saying it like that, you wrote too much code between test runs :)
20:03 labster no, I just haven't been able to get anything to change between test runs
20:03 labster (and I had lunch, but that's irrelephant)
20:04 masak PerlJam: "In fact, we probably wouldn't end up converging on a version number of 2*PI as the RFC suggests, but rather on 6.6.6, which would be rather unfortunate.", "So Perl 7 will be the last major revision. In fact, Perl 7 will be so perfect, it will need no revision at all. Perl 6 is merely the prototype for Perl 7. :-)" -- http://www.perl6.org/archi​ve/doc/design/apo/A01.html
20:05 masak also, wow, "It must be able to run in other kinds of virtual machines, such as those supported by Java and C#."
20:05 masak TimToady++ # prescient
20:08 PerlJam When you've been around a while, you start to notice things that maybe other people don't.  And according to Damian, Larry has been around a *long* time.
20:08 benabik How do you empty an array?  I've tried @arr = [], @arr = (), and @arr[*] :delete
20:09 benabik Oh, wait.  = () seems to work.  I think there's a missing clear_messages() in BOT's test
20:09 labster @arr = Array.new()
20:09 lizmat r: my @a=1,2,3; say @a.elems; @a=(); say @a.elems  # @a=() should work
20:09 camelia rakudo b2072f: OUTPUT«3␤0␤»
20:09 masak PerlJam: :D
20:10 masak r: my @arr = Array.new(); say @arr.elems
20:10 camelia rakudo b2072f: OUTPUT«0␤»
20:10 masak whoa. I expected that to say 1, in fact.
20:10 benabik flattening.
20:12 lizmat labster: Array.new might lose type information
20:12 lizmat r: my Int @a=1,2,3; say @a.elems; @a=Array.new; @a.push: "a"; say @a
20:12 benabik masak: I think you need a $channel->clear_messages() at BOT.md:48
20:12 camelia rakudo b2072f: OUTPUT«3␤a␤»
20:12 labster lizmat: you and your typed containers :P
20:12 benabik https://github.com/Benabik/m​asakism/blob/master/BOT.pm6 (and .t)
20:13 lizmat Types are the future of a Perl that is really performant
20:13 [Coke] anyone else always reading "lobster" ?
20:13 lizmat he *is* a bit red, indeed  :-)
20:13 masak benabik: looking.
20:15 labster oh, that's what I was doing wrong... first thing in @_ in a class is always the class itself.
20:15 masak benabik: yes, you're right, it seems. fixing.
20:16 benabik masak: I had hoped so, given that I pass the test if I add one there.  :-D
20:17 * benabik is also amused that he can use the p5 tests with not much more than s/->/./g
20:17 masak heh, mxey's solution doesn't fix this. https://gist.github.com/mxey/5496860
20:17 masak benabik: well they were written by a p6er :)
20:17 masak benabik: if you'd like to help, you could run mxey's code above, and see if it fails or succeds the identified-wrong test.
20:18 benabik masak: Only have v5.12.4 :-(
20:19 masak oh :/
20:19 * benabik always has a recent perl6, but can't be bothered to update his system perl5.
20:19 masak and I guess block packages are 5.16...
20:19 benabik Well, it has use v5.16; at the top and I assumed it was for a reason.
20:19 [Coke] benabik: perlbrew!
20:20 benabik Yeah, without it it dies at the block packages.
20:20 benabik [Coke]: That's like effort.  And disk space.  And I barely use p5. :-D
20:20 masak anyone else want to volunteer for this task?
20:20 masak I'll hand out karma :)
20:22 masak hm, my Perl 5 is too old as well.
20:23 benabik Homebrew doesn't have perlbrew.  *tisk*
20:23 lue joined #masakism
20:23 masak lue! \o/
20:23 lue hello all o/
20:23 benabik (It does have perl, but only 5.14)
20:27 FROGGS masak: sad that v5 doesnt support moose yet :P
20:27 lue macros don't support the wonderful "is parsed" trait yet, do they?
20:28 benabik Is there a shorter way to say %hash{$foo} :exists and %hash{$foo} eq $bar ?  If I skip the exists check I get warnings about using Any as a string.
20:29 masak lue: nope, not in Rakudo.
20:29 masak lue: in fact, my grant steers way clear of "is parsed".
20:29 masak benabik: (%hash{$foo} // "d'oh") eq $bar
20:30 benabik masak: As long as $bar can't be "d'oh"?
20:30 masak right.
20:30 masak that was my next point :)
20:30 masak any sentinel value that can't be a value in the hash.
20:31 PerlJam benabik's query is very similar to what I wanted earlier on #perl6
20:32 benabik Updated https://github.com/Benabik/m​asakism/blob/master/BOT.pm6
20:32 masak added benabik's bot solution to https://gist.github.com/masak/5496294
20:32 masak but really, does *no-one* here run 5.16? that's... surprising.
20:33 FROGGS 5.14.2
20:33 masak same as what I have here on Linux Mint.
20:33 benabik snack&
20:33 benabik .oO( BOT snack? )
20:33 masak man, now I want to download Perl 5.16 just because it's apparently a very hipster thing to have installed.
20:34 FROGGS ohh, hold on
20:34 FROGGS A sub-shell is launched with perl-5.17.2 as the activated perl. Run 'exit' to finish it.
20:34 FROGGS sounds promising
20:34 PerlJam oh, I have perl 5.16.2 installed on this system.
20:34 labster okay, everything works but the code running for me.  Can someone take a look at PROMISE for me>  https://gist.github.com/labster/5817793
20:35 lizmat 5.16.0, but I wasn't paying attention
20:35 lue "This is perl 5, version 16, subversion 1 (v5.16.1) built for x86_64-linux" It's in the "unstable" branch in portage, so I must've needed it for something (I don't recall though)
20:35 labster by "the code running", I mean that I'm not getting the subs to be called later.
20:36 masak lue: great!
20:37 masak < masak> benabik: if you'd like to help, you could run mxey's code above, and see if it fails or succeds the identified-wrong test.
20:37 masak the code is at https://gist.github.com/mxey/5496860
20:38 masak lue: note especially lines 124..125: there's a $bot->clear_messages() missing there.
20:38 masak lue: and I'm not sure how all the tests can pass without it.
20:38 masak lue: so the first question is "do all the tests pass?"
20:38 masak and, after that, "how?" :)
20:38 * lue will check momentarily...
20:39 masak eeegsellent
20:40 FROGGS hmmmm, my brewed 5.17. seems broken
20:41 lue 1..3
20:41 lue ok 1 - Bot tells channel when module starts failing
20:41 lue ok 2 - Bot keeps quiet when module keeps failing
20:41 lue ok 3 - Bot reports when a module starts passing its test suite again
20:43 masak very good, thank you lue.
20:43 masak it's test 1 that's suspicious.
20:44 masak oh, no, wait!
20:44 masak benabik! :)
20:45 benabik masak!
20:45 masak benabik: I was wrong, and the test wasn't incorrect at all.
20:45 masak lue++ benabik++ mxey++ masak-- :)
20:45 masak benabik: reverting my masak/workshop commit.
20:47 masak benabik: the reasoning is something like this: a module passing all its tests is something like a "zero state". a first measurement showing the module passing all its tests is not a state change.
20:47 * benabik blinks.
20:47 benabik Oh!
20:47 labster oh well, I'll just give up and move on to the next task.
20:48 masak labster: oops, didn't see your request. looking now.
20:48 masak benabik: maybe we should add something to the instructions to clarify this, though.
20:49 * masak loves how quickly the hacking on tasks can turn into hacking on the workshop :)
20:49 benabik That is, in fact, what the instructions say when read carefully.
20:50 masak oh, heh :)
20:50 masak glad to hear that... :)
20:50 benabik "send a message when it starts passing again"
20:50 * benabik was fooled by the symmetry of the tests.  setup/clear/setup/test
20:50 masak labster:
20:50 masak Found = in conditional, should be == at labster-promise line 19.
20:50 masak Found = in conditional, should be == at labster-promise line 26.
20:50 masak labster: did you see these warnings?
20:50 labster oh... no
20:51 labster dammit
20:51 masak that's an *excellent* warning, by the way. we should have that too.
20:51 masak rn: my $a = 5; say "OH NOES" unless $a = 0
20:51 camelia rakudo b2072f, niecza v24-79-gcb6f20b: OUTPUT«OH NOES␤»
20:51 * masak submits rakudobug
20:51 masak labster: glad to be of service.
20:51 lue I haz a JAPH! https://github.com/lue/mas​akism/blob/master/JAPH.p6
20:51 labster too much SQLthink
20:51 PerlJam but what if I *wanted* assignment in my conditional?  :)
20:51 masak lue++
20:52 masak PerlJam: #OK
20:52 labster should be eq anyway.  definitely too much sql
20:52 benabik BOT updated to not squawk about initial PASSes.  :-)
20:53 masak benabik++
20:53 benabik Simple solution: use PASS as sentinel.  :-D
20:53 masak haha
20:53 lizmat masak #OK ?
20:54 masak lue: the commented-out code works fine for me. no IntStr support needed.
20:54 labster though that didn't fix my problem about the subs being run -- unless $STATE = "DEFINED" will always be true, so that wasn't the stopper.
20:54 masak lizmat: a way to suppress warnings in STD.pm6 and Niecza.
20:54 masak labster: ok, looking more.
20:55 * lue forgot to trust Perl 6 to convert strings with just a number inside
20:55 masak labster: may I give you too the advice about tab characters? your code looks like crap in my editor.
20:55 masak the sooner programmers get the message about whitespace, the better :)
20:56 * PerlJam hopes the advice is "always uses spaces" (even if you hit a tab key to get them)
20:56 masak lue: it's OK to kvetch about missing features, but not if you haven't tried to run things first :P
20:56 masak PerlJam: yes, that's exactly it.
20:56 masak it's mentioned nowhere in the workshop material, but I'll happily tell people in person :)
20:56 snearch joined #masakism
20:56 masak tab *key* good, tab *characters* bad.
20:56 labster unfortunately, I tend to use my editor in a setting where I need \t characters too.
20:57 varnie okay, here comes my Perl 5 version of "to_roman": https://gist.github.com/varnie/5817963
20:57 masak unless you're in a Makefile, in which case tab characters are good but you're screwed in other ways.
20:57 lue my mind did this --> .oO(Does rakudo support IntStrs? No? Then that quoteword list is gonna error when I try to use strings as numbers) --minutes later--> *facepalm*
20:57 labster here, detabbed just for you: https://gist.github.com/labster/5817793
20:57 masak labster: well, let me question that need, if you don't mind. are you editing Makefiles a lot? can't your editor do literal character insertions, like vim's ^V<Tab> ?
20:58 masak varnie: looking :)
20:58 FROGGS about assignment in condition: that is a reason why one should write:   if 0 == $x ... instead of   if $x == 0
20:58 varnie pls keep in mind I am a newcomer in Perl.;)
20:58 masak lue: well, Try It And See is a way not to veer too far from reality ;)
20:58 PerlJam FROGGS: that's an old C trick, yes.
20:59 masak PerlJam, FROGGS: it's called "Yoda conditionals".
20:59 FROGGS I'm not doing this anymore, though
20:59 masak "if zero it equals"
20:59 masak FROGGS: me neither.
20:59 PerlJam I could never brind myself to write the code that way since my brain never thought about it that way.
20:59 PerlJam s/brind/bring/
21:00 masak I could bring myself to it, but I fear it isn't defensible from a readability perspective. too surprising.
21:00 masak varnie: very clean, very nice.
21:00 lue (my emacs forcibly inserts TABs into Makefiles even when I've disabled them everywhere else, which annoyed me until I learned Makefiles needed specifically TABs :/)
21:00 FROGGS and the reasons why I'm not doing that anymore: 1) the last ==/= typo was in 2007 or so, and 2) it is a bit ugly (like masak mentioned)
21:00 varnie thanks
21:01 masak varnie: basically, the only thing that gave me pause was the 0, 1, 2 in %rel and the $index.
21:01 masak varnie: hold on, I'll try to put into words why.
21:01 varnie yes, I was thinking about it. something like named constants will make it clearer.
21:01 masak yeah.
21:01 masak what I expected to see there was 'hundreds', 'tens', and 'ones'.
21:02 masak and then you can loop over those instead.
21:02 masak but apart from that, looks really neat. varnie++
21:03 masak added solution to https://gist.github.com/masak/5496294
21:09 benabik Is there a perl6y version of <>?  i.e. read contents of command line arguments or STDIN?
21:09 masak benabik: lines()
21:09 masak benabik: or slurp()
21:09 masak depending if you want an array of lines, or a single string.
21:10 masak r: say .substr(0, 5) for lines
21:10 camelia rakudo b2072f: OUTPUT«Land ␤Land ␤Land ␤Heima␤Volk,␤vielg␤vielg␤␤Heiß ␤liegs␤einem␤Hast ␤hoher␤vielg␤vielg␤␤Mutig␤frei ␤arbei␤Einig␤Vater␤vielg␤vielg␤»
21:10 masak r: say slurp.elems
21:10 camelia rakudo b2072f: OUTPUT«1␤»
21:10 masak r: say slurp.chars
21:10 camelia rakudo b2072f: OUTPUT«616␤»
21:12 [Coke] left #masakism
21:20 * benabik hits PLAYLIST and digresses to install panda and JSON::Tiny
21:21 masak :)
21:24 masak labster: I think the fundamental problem with https://gist.github.com/labster/5817793 is the 'my' declarations in Promise.
21:24 lue I feel I might be taking ROMAN a bit too far :P (I'm still writing all the tests, and I haven't even decided how to include the large numbers, e.g. ↀ, so I'm holding off on those)
21:24 labster ok, I'll look at it, though I'm working on HEX now
21:25 masak labster: I'm not too happy with HEX. https://github.com/masak/workshop/issues/11
21:25 masak labster: keep me posted on what it's like to solve.
21:25 labster It seems okay, but it doesn't give you clues on which abstractions to use.
21:26 masak right.
21:26 labster The previous one was very much hand-holding on use these abstractions, and this one is wide open.
21:26 masak somewhat intentional, but still... maybe too big a step.
21:27 masak labster: while you're working on that one, I'm going to dig into what happened with your Promise.
21:27 masak labster: so far all I know is that using lexicals in a package like that, and expecting them to work like object attributes, probably spells trouble.
21:28 masak labster: you're meant to store attributes in a (blessed) hash.
21:28 labster oh, I see.  This is more a matter of me expecting P5 to work like P6 then.
21:28 masak well, even in Perl 6 using 'my' like that inside a class would be problematic :)
21:28 labster Well yes, but there I have "has"
21:28 masak right.
21:28 masak you do in Moose too, fwiw... :)
21:29 masak hold on, I'll fix your code.
21:30 labster So I should start with cpanm install Moose then
21:31 masak depends how much energy you want to invest in the p5 object model.
21:31 masak I for one think it's worth knowing, even though I use Moose a lot.
21:31 masak but YMMV.
21:32 labster Well, given that I'm looking to be employed in the P5 world, I really should know this stuff.
21:32 labster Perl 6 jobs are scarce these days.
21:40 masak we're hiring.
21:40 masak :)
21:40 lue Is there something more safe than eval_dies_ok? It's not helping to stop errors when testing constrained parameters (specifically sub to_roman(Int $num where {$_ > 0}) { ... )
21:41 masak labster: I have your second test passing now.
21:41 masak labster: planning to make the third test pass, and then hand the code back to you.
21:41 labster okay.  I've read up on attributes, too.
21:41 masak lue: are you sure you're passing a block to eval_dies_ok?
21:42 lue uhh... no. I just put an eval_ in front of the sub name :)
21:43 lue Cannot call 'eval_dies_ok'; none of these signatures match:
21:43 lue :(Str $code, $reason = { ... })
21:43 lue (guess it needs to be a Str then)
21:45 masak labster: the first four tests pass: https://gist.github.com/masak/5818409
21:46 FROGGS gnight pals, I dont get anything done today...
21:46 benabik Oh, huh.  The PLAYLIST example isn't JSON.  Bah.
21:46 labster that JAPH is just too hard, FROGGS?
21:48 FROGGS well, I spend some time on that, then read through all tasks, but it is not my day some how
21:48 FROGGS o/
21:49 masak 'night, FROGGS
21:49 masak some other day, then.
21:49 * benabik doesn't think he has time to finish this before wife & kid get home.
21:49 masak seems none of the prize booby-traps got triggered this time around. oh well.
21:50 benabik :-(
21:50 masak labster: I think it should be fairly easy to get the rest of the tests to pass.
21:51 benabik Looks like everyone else just took the example to be code instead of a text format.  ~.~'
21:51 labster At this point, it looks like uncommenting some code, for the most part.
21:53 masak labster: yeah.
21:53 masak labster: are you clear on how Perl 5 "attributes" are simply hash entries?
21:54 labster masak: much clearer than I was before, so I think you can consider this workshop a success for me.
21:54 masak \o/
21:55 masak well, I guess we're winding down now.
21:56 masak FROGGS, benabik, lizmat, Ayiko, labster, lue, varnie, PerlJam, timotimo, gfldex: I'd like to thank you for your participation.
21:56 masak you rock.
21:56 timotimo hello good people
21:56 timotimo i missed everything?
21:56 PerlJam no, masak ... *you* rock  :)
21:57 timotimo masak: but i didn't participate :(
21:57 masak timotimo: then join the after-party :D
21:57 timotimo sure :)
21:57 lue gerne und danke. Once I'm done with ROMAN, it'll probably already be module-quality :P
21:57 masak lue: that's the spirit!
22:00 masak well, #masakism is wrapping up, but feel free to do any kind of latecomer questions or send in more solutions or whatever.
22:00 masak modulo being asleep or AFK, I'll try to handle things as they come in.
22:00 labster 2 tests to go for me
22:01 masak \o/
22:25 * timotimo tries to do http://rosettacode.org/wiki​/Execute_a_Markov_algorithm instead of masakism
22:26 masak huh, it's missing a Perl 6 solution.
22:26 masak looks like a very fit task to solve in Perl 6.
22:28 timotimo that's why i'm going to do it :)
22:28 timotimo trying to install Rakudo::Debugger first, though
22:28 masak timotimo++
22:31 timotimo error:imcc:loadlib directive could not find library `perl6_group'  -  nooooo ;_;
22:36 masak sounds serious.
22:53 timotimo it's been that way for a long time now :/
22:53 timotimo and i don't understand the error at all
22:54 masak I don't think I've seen that error before.
22:57 timotimo huh. it would appear that i'm getting a billion of matches for .ws
22:58 masak you're not putting a quantifier after <.ws>, are you?
22:58 timotimo haha, i was
22:58 masak :P
22:59 * masak : here to help
22:59 timotimo i think i meant to match multiple newlines, but changed "newline" to "whitespace" and forgot to remove the "multiple"
22:59 masak ah.
23:03 varnie left #masakism
23:09 timotimo when i have a proto token foo, do i have to call my other tokens foo:sym<blop> or can i call them foo:anything_i_want?
23:14 timotimo ... \N* should gobble up everything until the end of line, yes?
23:16 timotimo my ^ and $ markers were apparently wrong
23:16 timotimo oh, duh, i switched ^ and ^^ as well as $ and $$
23:18 masak I think you can call them foo:anything_you_want
23:20 timotimo cool :)
23:23 timotimo i have a list of lines, some of them comments, some of them rules. i'd like to have my ast be a list of the rules asts, so i made the comment line rule generate Nil; do i have to .grep out the Nils? i was hoping i could just .list or something to have the nils removed
23:26 masak timotimo: this sounds like a job for the action method of the parent node of all the rules.
23:27 masak but yes, in that method, grepping out the Nils is probably what I would do.
23:27 masak or, hm. if you do this right I *think* you should be able to separate the things during parsing. not entirely sure.
23:28 timotimo i could lift the alteration all the way into the top node and only return $<rule-lines>>>.ast
23:28 timotimo i will fret about that later
23:28 masak r: grammar G { regex TOP { ^ [<a> || <b>]+ $ }; regex a { a }; regex b { b } }; say G.parse("aaabba")
23:28 camelia rakudo b2072f: OUTPUT«「aaabba」␤ a => 「a」␤ a => 「a」␤ a => 「a」␤ b => 「b」␤ b => 「b」␤ a => 「a」␤␤»
23:29 masak hrm.
23:29 masak r: grammar G { regex TOP { ^ [<a> || <b>]+ $ }; regex a { a }; regex b { b } }; say G.parse("aaabba")<a>
23:29 KvH joined #masakism
23:29 camelia rakudo b2072f: OUTPUT«「a」␤ 「a」␤ 「a」␤ 「a」␤␤»
23:29 masak yeah, there you go :)
23:29 masak r: grammar G { regex TOP { ^ [<a> || <b>]+ $ }; regex a { a }; regex b { b } }; say G.parse("aaabba")<a>.^name
23:29 camelia rakudo b2072f: OUTPUT«Parcel␤»
23:29 masak r: grammar G { regex TOP { ^ [<a> || <b>]+ $ }; regex a { a }; regex b { b } }; say G.parse("aaabba")<a>.elems
23:29 camelia rakudo b2072f: OUTPUT«4␤»
23:29 masak \o/
23:31 timotimo hm, how do i .subst with a literal string rather than a regex?
23:31 timotimo it seems a bit like it tries to turn the string i pass into a regex by parsing it according to the P6Regex grammar or something
23:33 masak shouldn't, really.
23:34 timotimo r: say "foo bar baz".subst("ba", "boo")
23:34 camelia rakudo b2072f: OUTPUT«foo boor baz␤»
23:34 masak r: my $string = "a*"; say $string.subst("a*", "OH HAI")
23:34 camelia rakudo b2072f: OUTPUT«OH HAI␤»
23:34 timotimo interesting
23:34 masak literal string substitution.
23:34 timotimo oh, does it perhaps thunk the right side?
23:34 timotimo r: my $_ = {:foo<foo>, :bar<bar>}; "foo bar".subst($_<foo>, $_<bar>);
23:35 camelia rakudo b2072f: OUTPUT«Potential difficulties:â�¤    Redeclaration of symbol $_â�¤    at /tmp/loYBpcZBlG:1â�¤    ------> [32mmy $_ [33mâ��[31m= {:foo<foo>, :bar<bar>}; "foo bar".subs[0mâ�¤Â»
23:35 timotimo r: $_ = {:foo<foo>, :bar<bar>}; "foo bar".subst($_<foo>, $_<bar>);
23:35 camelia rakudo b2072f:  ( no output )
23:35 timotimo r: $_ = {:foo<foo>, :bar<bar>}; say "foo bar".subst($_<foo>, $_<bar>);
23:35 camelia rakudo b2072f: OUTPUT«bar bar␤»
23:35 timotimo r: $_ = {:foo<foo>, :bar<bar>}; say "foo bar".subst($_.<foo>, $_.<bar>);
23:35 camelia rakudo b2072f: OUTPUT«bar bar␤»
23:35 masak no, it doesn't thunk the right side.
23:35 masak how could it, it's just a normal method.
23:35 timotimo oh, interesting, i've ended up with a data structure that i did not expect
23:37 masak heh.
23:37 timotimo that's what caused the error. now it works.
23:37 masak \o/
23:37 benabik joined #masakism
23:46 timotimo not sure if the parsing is just ridiculously slow or b0rked/infinilooped/backtrace-exploded?
23:50 timotimo yeah, pretty sure it's backtracking more and more each time
23:51 timotimo $<pattern>=[\N+?] <.ws> '->' <.ws> $<terminal>=[\.]? $<replacement>=[\N*]  -  why would that fail to match "_+_ ->
23:51 timotimo er, "_+_ -> "
23:51 timotimo oh, duh
23:51 timotimo well, not duh
23:51 timotimo the whitespace after the -> gets swallowed, but perhaps also a newline?
23:52 timotimo and then it's the end-of-string?
23:52 masak I think this is one of those cases where you mostly don't want backtracking.
23:52 timotimo yeah
23:52 masak :r or 'token'
23:52 timotimo i want it to parse-succeed ;)
23:54 timotimo yeah, that made it work immediately
23:55 masak heh.
23:57 timotimo "work immediately" -> "not parse it and break" actually
23:57 masak oh!

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