freespectrum.herokuapp.com/workshop...-links.svg -- gist.github.com/masak/5431185 -- logs at olive.undo.it/log?channel=masakism
Set by moderator on 7 June 2013.
03:52 camelia joined, Mithaldu joined 03:55 camelia joined, Mithaldu joined 05:59 dmol joined
Teratogen ok my MASAKISM timer just went off 07:00
is today the day?
labster Today is the day. 07:11
is it 13 hours away now? 07:13
Teratogen drat 07:20
I will probably be asleep =( 07:21
07:33 dmol joined
labster sleep now, wake up later 07:35
11:00 snearch joined
masak yes, it is today \\o/ 11:04
about 5 hours to go
four hours to go. :) 12:00
12:00 benabik joined 12:10 FROGGS joined
FROGGS \\o/ 12:10
masak \\o/ 12:11
masak keeps hacking on his elevator
12:15 dagurval joined
masak er. correction. it's currently 5 hours 35 minutes to go. 12:25
FROGGS (or to sit) 12:28
masak slightly less than 4 hours left. 14:11
Teratogen masak, I am crashing, so I will probably miss it =( 14:12
but thank you for inviting me
14:17 Kelder joined
masak Teratogen: well, if you wake up during the thing, feel free to stop by. 14:19
Teratogen willl do
masak sleep tight.
15:23 FROGGS joined
masak two hours \\o/ 16:01
16:03 dmol joined
Tene Less than one year until countdown. 16:30
masak :) 16:35
something like 85 minutes now.
16:56 dmol joined
masak point of order: here are all the solutions from last time around: gist.github.com/masak/5496294 16:57
should I keep adding to the file in that gist, or create a new file in the same gist, or create a new gist?
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
masak that narrows it down to the first two options :) 17:02
lizmat sorry, option 1 17:05
masak ok :) 17:10
will do so. 17:11
17:12 PerlJam joined 17:14 spider-mario joined 17:17 moritz joined
masak \\o/ 17:17
42 minutes left. :) 17:18
time to spin up the excitement engine slightly.
23 minutes left... 17:27
er, 33.
17:30 timotimo joined
FROGGS both kids are sleeping \\o/ 17:41
masak \\o/ 17:46
14 minutes...
FROGGS 13 on my clock 17:47
masak yes, now it's 13 :) 17:48
17:48 raiph joined
raiph masak: i imagine you might be a bit flustered/annoyed by what i've just done, but it felt right to me: www.reddit.com/r/perl/comments/1go2...l_rivalry/ 17:49
masak raiph: no, that's OK. 17:50
I just hope it won't get us many trolls, but we'll handle that on an as-needed basis. 17:51
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
8 minutes.
7. 17:53
17:55 varnie joined
FROGGS 5 17:55
17:55 Tene_ joined
masak reTene \\o/ 17:55
varnie: greetings. 17:56
varnie hello
masak 4 minnutz.
varnie: something is about to happen here. :)
hm, is freespectrum.herokuapp.com/workshop...-links.svg clickable for someone else? 17:57
it isn't for me.
3 MINNITS
benabik masak: I can click the names
masak oh, nice. then we'll keep it. 17:58
lizmat the nodes cannot be clicked :-(
FROGGS I can click too
masak no census. :(
2 MI.NU.TES
anyone know how we can reach census?
benabik I can't click the nodes either, but the names work.
moritz same here
FROGGS masak: no idea
masak 1 minute 17:59
oh, he's not on the participant list.
all the others are, except tadzik...
oh well.
he'll show up :)
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.
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).
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.
(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
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.
lizmat the past months I've become more involved in Perl 6
18:02 hey joined
masak you certainly have :) 18:02
for those who weren't here last time, there's freespectrum.herokuapp.com/workshop...-links.svg and github.com/masak/workshop to start digging into.
oh, and I will now booby-trap two exercises with PRIZES.
18:02 commondog joined
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.
ok, booby-traps placed. 18:04
if you're still unsure where to start at this point, start at github.com/masak/workshop/blob/master/intro.md 18:05
FROGGS will do
masak or go look at the map. it's the first link in the /topic
benabik Is there a preferred submission method, or just code online somewhere?
masak or talk to me.
benabik: I prefer gists. 18:06
benabik: but any pastebin is fine. helps if it doesn't time out.
I will be keeping a list of submitted solutions at gist.github.com/masak/5496294 18:07
this time I expect not to lag behind on maintaining the list :)
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.
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:08
commondog: greetings. I suppose you're here because of www.reddit.com/r/perl/comments/1go2...l_rivalry/ :) 18:09
commondog: let me know if there's anything I can help with.
masak .oO( on the internet, nobody knows you're a commondog ) 18:11
commondog alright, thanks 18:12
masak oh, and the ELEVATOR task... if anyone reaches that and wants to have a crack at it, let me know. 18:14
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:15
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
(but don't worry, ELEVATOR is not one of the booby-trapped ones.)
hey everybody, check out varnie++'s JAPH: gist.github.com/varnie/5816486 18:22
pretty sleek :)
how's it going for the rest of you? I'm so curious. 18:25
benabik has a simple version of ROMAN that doesn't do the silly subtractive thing. 18:27
github.com/Benabik/masakism/blob/m.../ROMAN.pl6 18:28
Oh, right, gists. I setup a repository by habit. :-/ 18:29
masak that's fine too :) 18:30
looks nice so far.
benabik There's a JAPH in there too, but I did it the boring way. :-P 18:31
masak hehe.
masak tinkers with the elevator, and makes tea 18:44
labster Hi, I'm Brent Laabs, and I'm late to the party.
But since I did this last time, I'll just jump in a bit later down the track. 18:45
masak excellent.
Ayiko last time I had sub to_roman($i) {'III'} as solution for roman (it passed the test), now I expanded a bit: gist.github.com/Ayiko/9ca80fba8027b38d2129 18:54
masak :) 18:55
I added it to gist.github.com/masak/5496294 18:57
Ayiko: a stylistic point: it seems to me lines 14..22 should be out-dented one step. 18:58
Ayiko hrm, gist choked on tabs it seems :s 18:59
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
the only place where I endure it is in Makefiles.
labster is working on PROMISE, and realizing he doesn't understand P5 classes all that well. 19:01
masak labster: please feel free to think out loud here on-channel. 19:02
I think you'll be pleasantly surprised how much assistance you'll get.
Ayiko: www.jwz.org/doc/tabs-vs-spaces.html is a good resource, if you haven't seen it already :)
as is www.amazon.com/Perl-Best-Practices-...596001738/
labster I think I just got used to Perl 6 classes blessing themselves. 19:05
FROGGS masak: ROMAN.pl gist.github.com/FROGGS/2538bd5f6f92283c7f66 19:06
I wanted to do a fancy japh but just wasted time :/
labster fancy JAPHs are important 19:08
masak FROGGS: nice. how does that solution fare with 4 -> IV ? 19:11
FROGGS uhhh 19:12
good point
masak :)
time to write more tests! 19:13
benabik github.com/Benabik/masakism/blob/m.../ROMAN.pl6
FROGGS mehr
meh
masak time to write mehr tests! :P
Ayiko masak: yeah, I'll try to better my life
masak benabik: very nice.
Ayiko and while I'm fixing stuff anyway, I thought to add a MAIN or 2
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 gist.github.com/masak/5496294
labster stubbed out a class with a constructor and stub methods, automatically passed 4 tests. not bad. 19:15
masak you're supposed to write tests that fail, and then pass them :P 19:16
RED-green-refactor :)
19:16 gfldex joined
labster Yeah. It turns it into a game, which is neat. I like games. 19:16
19:16 Ulti joined
masak TDD is the ultimate game. 19:17
I think I will keep playing it all my life.
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 www.openttd.org/en/ :)
masak ooh
benabik masak: That feels like cheating. :-/ 19:19
masak benabik: not if you've spent your own time trying to solve a problem. 19:20
benabik: that's when you're highly receptible for other people's solutions.
gfldex wc sorry 19:21
Ayiko *multi* sub MAIN! why doesn't the error just say that instead of "redeclaration of sub MAIN"
updated roman: gist.github.com/Ayiko/9ca80fba8027b38d2129
masak gfldex: heh, I thought you were making a pun on "TDD/TTD is the ultimate game" :D 19:22
Ayiko: please submit a rakudobug.
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.
masak Ayiko: nice.
benabik But I think any further changes to mine would just be re-writings someone else's solution. Onwards!
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. :)
benabik masak: Feels natural to me, but that's probably my time with Scala where all for loops desugar to maps anyway.
masak they do in Perl 6 as well. 19:25
it's just that I don't like to *rely* on it. :)
gfldex: that is cool.
benabik masak: Is it likely to change? 19:26
PerlJam benabik: doubtful.
masak benabik: no. my point is about readability. 19:27
benabik: I use for loops for their side effects. I use maps for their values.
benabik masak: Ah. Point.
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 :)
masak PerlJam: yes. :) 19:30
benabik heads down the orange track simply because it has ELEVATOR on it. ;-)
masak PerlJam: which tells you something of how old I plan to become :P
benabik: see caveats in the backlog about ELEVATOR: irclog.perlgeek.de/masakism/2013-06-19#i_7220348
benabik masak: You'll either have something interesting by the time I get to it or I'll jump tracks. :-) 19:31
masak deal. 19:33
PerlJam masak: btw, I have ever asked you if you are familiar with codekata.pragprog.com/ ? 19:35
(if you're coming up with interesting stuff for ELEVATOR, just ignore me until that's done ;) 19:36
masak PerlJam: familiar with, grok the concept, did it once on stage with Perl 6 in Oslo :) 19:38
PerlJam: it's a refreshing experience to kata something.
PerlJam masakism keeps reminding me of it. 19:39
lizmat next: masakataism
masak hahaha 19:40
PerlJam: I hadn't consciously made the connection, but I see what you mean.
PerlJam lizmat: heh! 19:41
19:50 raiph joined
timotimo is it going goodwell? 19:55
masak you tell me.
benabik No such method 'tc' for innocent of type 'Str'? 19:59
labster And it will be held on Masakhalin island. 20:00
Okay, how do you store a bit of code and run it later in P5?
masak r: say "foo".tc
camelia rakudo b2072f: OUTPUT«No such method 'tc' for invocant of type 'Str'␤ in block at /tmp/ygSK2YDMO_:1␤␤»
timotimo i have not paid any attention
masak labster: my $bit_of_code = sub { ... }; ... $bit_of_code->(); 20:01
PerlJam labster: my $code = sub { ... }; # unless you mean something else
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 :)
labster no, I just haven't been able to get anything to change between test runs 20:03
(and I had lunch, but that's irrelephant)
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. :-)" -- www.perl6.org/archive/doc/design/apo/A01.html 20:04
also, wow, "It must be able to run in other kinds of virtual machines, such as those supported by Java and C#." 20:05
TimToady++ # prescient
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
Oh, wait. = () seems to work. I think there's a missing clear_messages() in BOT's test 20:09
labster @arr = Array.new()
lizmat r: my @a=1,2,3; say @a.elems; @a=(); say @a.elems # @a=() should work
camelia rakudo b2072f: OUTPUT«3␤0␤»
masak PerlJam: :D
r: my @arr = Array.new(); say @arr.elems 20:10
camelia rakudo b2072f: OUTPUT«0␤»
masak whoa. I expected that to say 1, in fact.
benabik flattening.
lizmat labster: Array.new might lose type information 20:12
r: my Int @a=1,2,3; say @a.elems; @a=Array.new; @a.push: "a"; say @a
benabik masak: I think you need a $channel->clear_messages() at BOT.md:48
camelia rakudo b2072f: OUTPUT«3␤a␤»
labster lizmat: you and your typed containers :P
benabik github.com/Benabik/masakism/blob/master/BOT.pm6 (and .t)
lizmat Types are the future of a Perl that is really performant 20:13
[Coke] anyone else always reading "lobster" ?
lizmat he *is* a bit red, indeed :-)
masak benabik: looking.
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.
benabik masak: I had hoped so, given that I pass the test if I add one there. :-D 20:16
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. gist.github.com/mxey/5496860
benabik: well they were written by a p6er :)
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.
benabik masak: Only have v5.12.4 :-( 20:18
masak oh :/ 20:19
benabik always has a recent perl6, but can't be bothered to update his system perl5.
masak and I guess block packages are 5.16...
benabik Well, it has use v5.16; at the top and I assumed it was for a reason.
[Coke] benabik: perlbrew!
benabik Yeah, without it it dies at the block packages. 20:20
[Coke]: That's like effort. And disk space. And I barely use p5. :-D
masak anyone else want to volunteer for this task?
I'll hand out karma :)
hm, my Perl 5 is too old as well. 20:22
benabik Homebrew doesn't have perlbrew. *tisk* 20:23
20:23 lue joined
masak lue! \\o/ 20:23
lue hello all o/
benabik (It does have perl, but only 5.14)
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?
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:28
masak lue: nope, not in Rakudo. 20:29
lue: in fact, my grant steers way clear of "is parsed".
benabik: (%hash{$foo} // "d'oh") eq $bar
benabik masak: As long as $bar can't be "d'oh"? 20:30
masak right.
that was my next point :)
any sentinel value that can't be a value in the hash.
PerlJam benabik's query is very similar to what I wanted earlier on #perl6 20:31
benabik Updated github.com/Benabik/masakism/blob/master/BOT.pm6 20:32
masak added benabik's bot solution to gist.github.com/masak/5496294
but really, does *no-one* here run 5.16? that's... surprising.
FROGGS 5.14.2 20:33
masak same as what I have here on Linux Mint.
benabik snack&
.oO( BOT snack? )
masak man, now I want to download Perl 5.16 just because it's apparently a very hipster thing to have installed.
FROGGS ohh, hold on 20:34
A sub-shell is launched with perl-5.17.2 as the activated perl. Run 'exit' to finish it.
sounds promising
PerlJam oh, I have perl 5.16.2 installed on this system.
labster okay, everything works but the code running for me. Can someone take a look at PROMISE for me> gist.github.com/labster/5817793
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)
labster by "the code running", I mean that I'm not getting the subs to be called later.
masak lue: great! 20:36
< 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
the code is at gist.github.com/mxey/5496860
lue: note especially lines 124..125: there's a $bot->clear_messages() missing there. 20:38
lue: and I'm not sure how all the tests can pass without it.
lue: so the first question is "do all the tests pass?"
and, after that, "how?" :)
lue will check momentarily...
masak eeegsellent 20:39
FROGGS hmmmm, my brewed 5.17. seems broken 20:40
lue 1..3 20:41
ok 1 - Bot tells channel when module starts failing
ok 2 - Bot keeps quiet when module keeps failing
ok 3 - Bot reports when a module starts passing its test suite again
masak very good, thank you lue. 20:43
it's test 1 that's suspicious.
oh, no, wait! 20:44
benabik! :)
benabik masak! 20:45
masak benabik: I was wrong, and the test wasn't incorrect at all.
lue++ benabik++ mxey++ masak-- :)
benabik: reverting my masak/workshop commit.
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.
Oh!
labster oh well, I'll just give up and move on to the next task.
masak labster: oops, didn't see your request. looking now. 20:48
benabik: maybe we should add something to the instructions to clarify this, though.
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.
masak oh, heh :) 20:50
glad to hear that... :)
benabik "send a message when it starts passing again"
benabik was fooled by the symmetry of the tests. setup/clear/setup/test
masak labster:
Found = in conditional, should be == at labster-promise line 19.
Found = in conditional, should be == at labster-promise line 26.
labster: did you see these warnings?
labster oh... no
dammit 20:51
masak that's an *excellent* warning, by the way. we should have that too.
rn: my $a = 5; say "OH NOES" unless $a = 0
camelia rakudo b2072f, niecza v24-79-gcb6f20b: OUTPUT«OH NOES␤»
masak submits rakudobug
labster: glad to be of service.
lue I haz a JAPH! github.com/lue/masakism/blob/master/JAPH.p6
labster too much SQLthink
PerlJam but what if I *wanted* assignment in my conditional? :)
masak lue++
PerlJam: #OK 20:52
labster should be eq anyway. definitely too much sql
benabik BOT updated to not squawk about initial PASSes. :-)
masak benabik++ 20:53
benabik Simple solution: use PASS as sentinel. :-D
masak haha
lizmat masak #OK ?
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.
masak lizmat: a way to suppress warnings in STD.pm6 and Niecza.
labster: ok, looking more.
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.
the sooner programmers get the message about whitespace, the better :)
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
PerlJam: yes, that's exactly it.
it's mentioned nowhere in the workshop material, but I'll happily tell people in person :)
20:56 snearch joined
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.
varnie okay, here comes my Perl 5 version of "to_roman": 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.
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*
labster here, detabbed just for you: gist.github.com/labster/5817793
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> ?
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
varnie pls keep in mind I am a newcomer in Perl.;)
masak lue: well, Try It And See is a way not to veer too far from reality ;)
PerlJam FROGGS: that's an old C trick, yes.
masak PerlJam, FROGGS: it's called "Yoda conditionals". 20:59
FROGGS I'm not doing this anymore, though
masak "if zero it equals"
FROGGS: me neither.
PerlJam I could never brind myself to write the code that way since my brain never thought about it that way.
s/brind/bring/
masak I could bring myself to it, but I fear it isn't defensible from a readability perspective. too surprising. 21:00
varnie: very clean, very nice.
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 :/)
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)
varnie thanks
masak varnie: basically, the only thing that gave me pause was the 0, 1, 2 in %rel and the $index. 21:01
varnie: hold on, I'll try to put into words why.
varnie yes, I was thinking about it. something like named constants will make it clearer.
masak yeah.
what I expected to see there was 'hundreds', 'tens', and 'ones'.
and then you can loop over those instead. 21:02
but apart from that, looks really neat. varnie++
added solution to gist.github.com/masak/5496294 21:03
benabik Is there a perl6y version of <>? i.e. read contents of command line arguments or STDIN? 21:09
masak benabik: lines()
benabik: or slurp()
depending if you want an array of lines, or a single string.
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␤»
masak r: say slurp.elems
camelia rakudo b2072f: OUTPUT«1␤»
masak r: say slurp.chars
camelia rakudo b2072f: OUTPUT«616␤»
21:12 [Coke] left
benabik hits PLAYLIST and digresses to install panda and JSON::Tiny 21:20
masak :) 21:21
labster: I think the fundamental problem with 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)
labster ok, I'll look at it, though I'm working on HEX now
masak labster: I'm not too happy with HEX. github.com/masak/workshop/issues/11 21:25
labster: keep me posted on what it's like to solve.
labster It seems okay, but it doesn't give you clues on which abstractions to use.
masak right. 21:26
labster The previous one was very much hand-holding on use these abstractions, and this one is wide open.
masak somewhat intentional, but still... maybe too big a step.
labster: while you're working on that one, I'm going to dig into what happened with your Promise. 21:27
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.
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.
masak well, even in Perl 6 using 'my' like that inside a class would be problematic :)
labster Well yes, but there I have "has"
masak right.
you do in Moose too, fwiw... :)
hold on, I'll fix your code. 21:29
labster So I should start with cpanm install Moose then 21:30
masak depends how much energy you want to invest in the p5 object model. 21:31
I for one think it's worth knowing, even though I use Moose a lot.
but YMMV.
labster Well, given that I'm looking to be employed in the P5 world, I really should know this stuff. 21:32
Perl 6 jobs are scarce these days.
masak we're hiring. 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}) { ... )
masak labster: I have your second test passing now. 21:41
labster: planning to make the third test pass, and then hand the code back to you.
labster okay. I've read up on attributes, too.
masak lue: are you sure you're passing a block to eval_dies_ok?
lue uhh... no. I just put an eval_ in front of the sub name :) 21:42
Cannot call 'eval_dies_ok'; none of these signatures match: 21:43
:(Str $code, $reason = { ... })
(guess it needs to be a Str then)
masak labster: the first four tests pass: gist.github.com/masak/5818409 21:45
FROGGS gnight pals, I dont get anything done today... 21:46
benabik Oh, huh. The PLAYLIST example isn't JSON. Bah.
labster that JAPH is just too hard, FROGGS?
FROGGS well, I spend some time on that, then read through all tasks, but it is not my day some how 21:48
o/
masak 'night, FROGGS 21:49
some other day, then.
benabik doesn't think he has time to finish this before wife & kid get home.
masak seems none of the prize booby-traps got triggered this time around. oh well.
benabik :-( 21:50
masak labster: I think it should be fairly easy to get the rest of the tests to pass.
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.
masak labster: yeah. 21:53
labster: are you clear on how Perl 5 "attributes" are simply hash entries?
labster masak: much clearer than I was before, so I think you can consider this workshop a success for me. 21:54
masak \\o/
well, I guess we're winding down now. 21:55
FROGGS, benabik, lizmat, Ayiko, labster, lue, varnie, PerlJam, timotimo, gfldex: I'd like to thank you for your participation. 21:56
you rock.
timotimo hello good people
i missed everything?
PerlJam no, masak ... *you* rock :)
timotimo masak: but i didn't participate :( 21:57
masak timotimo: then join the after-party :D
timotimo sure :)
lue gerne und danke. Once I'm done with ROMAN, it'll probably already be module-quality :P
masak lue: that's the spirit!
well, #masakism is wrapping up, but feel free to do any kind of latecomer questions or send in more solutions or whatever. 22:00
modulo being asleep or AFK, I'll try to handle things as they come in.
labster 2 tests to go for me
masak \\o/ 22:01
timotimo tries to do rosettacode.org/wiki/Execute_a_Markov_algorithm instead of masakism 22:25
masak huh, it's missing a Perl 6 solution. 22:26
looks like a very fit task to solve in Perl 6.
timotimo that's why i'm going to do it :) 22:28
trying to install Rakudo::Debugger first, though
masak timotimo++
timotimo error:imcc:loadlib directive could not find library `perl6_group' - nooooo ;_; 22:31
masak sounds serious. 22:36
timotimo it's been that way for a long time now :/ 22:53
and i don't understand the error at all
masak I don't think I've seen that error before. 22:54
timotimo huh. it would appear that i'm getting a billion of matches for .ws 22:57
masak you're not putting a quantifier after <.ws>, are you? 22:58
timotimo haha, i was
masak :P
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"
masak ah.
23:03 varnie left
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:09
... \\N* should gobble up everything until the end of line, yes? 23:14
my ^ and $ markers were apparently wrong 23:16
oh, duh, i switched ^ and ^^ as well as $ and $$
masak I think you can call them foo:anything_you_want 23:18
timotimo cool :) 23:20
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:23
masak timotimo: this sounds like a job for the action method of the parent node of all the rules. 23:26
but yes, in that method, grepping out the Nils is probably what I would do. 23:27
or, hm. if you do this right I *think* you should be able to separate the things during parsing. not entirely sure.
timotimo i could lift the alteration all the way into the top node and only return $<rule-lines>>>.ast 23:28
i will fret about that later
masak r: grammar G { regex TOP { ^ [<a> || <b>]+ $ }; regex a { a }; regex b { b } }; say G.parse("aaabba")
camelia rakudo b2072f: OUTPUT«「aaabba」␤ a => 「a」␤ a => 「a」␤ a => 「a」␤ b => 「b」␤ b => 「b」␤ a => 「a」␤␤»
masak hrm. 23:29
r: grammar G { regex TOP { ^ [<a> || <b>]+ $ }; regex a { a }; regex b { b } }; say G.parse("aaabba")<a>
23:29 KvH joined
camelia rakudo b2072f: OUTPUT«「a」␤ 「a」␤ 「a」␤ 「a」␤␤» 23:29
masak yeah, there you go :)
r: grammar G { regex TOP { ^ [<a> || <b>]+ $ }; regex a { a }; regex b { b } }; say G.parse("aaabba")<a>.^name
camelia rakudo b2072f: OUTPUT«Parcel␤»
masak r: grammar G { regex TOP { ^ [<a> || <b>]+ $ }; regex a { a }; regex b { b } }; say G.parse("aaabba")<a>.elems
camelia rakudo b2072f: OUTPUT«4␤»
masak \\o/
timotimo hm, how do i .subst with a literal string rather than a regex? 23:31
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
masak shouldn't, really. 23:33
timotimo r: say "foo bar baz".subst("ba", "boo") 23:34
camelia rakudo b2072f: OUTPUT«foo boor baz␤»
masak r: my $string = "a*"; say $string.subst("a*", "OH HAI")
camelia rakudo b2072f: OUTPUT«OH HAI␤»
timotimo interesting
masak literal string substitution.
timotimo oh, does it perhaps thunk the right side?
r: my $_ = {:foo<foo>, :bar<bar>}; "foo bar".subst($_<foo>, $_<bar>);
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>);
camelia rakudo b2072f: ( no output )
timotimo r: $_ = {:foo<foo>, :bar<bar>}; say "foo bar".subst($_<foo>, $_<bar>);
camelia rakudo b2072f: OUTPUT«bar bar␤»
timotimo r: $_ = {:foo<foo>, :bar<bar>}; say "foo bar".subst($_.<foo>, $_.<bar>);
camelia rakudo b2072f: OUTPUT«bar bar␤»
masak no, it doesn't thunk the right side.
how could it, it's just a normal method.
timotimo oh, interesting, i've ended up with a data structure that i did not expect
masak heh. 23:37
timotimo that's what caused the error. now it works.
masak \\o/
23:37 benabik joined
timotimo not sure if the parsing is just ridiculously slow or b0rked/infinilooped/backtrace-exploded? 23:46
yeah, pretty sure it's backtracking more and more each time 23:50
$<pattern>=[\\N+?] <.ws> '->' <.ws> $<terminal>=[\\.]? $<replacement>=[\\N*] - why would that fail to match "_+_ -> 23:51
er, "_+_ -> "
oh, duh
well, not duh
the whitespace after the -> gets swallowed, but perhaps also a newline?
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.
timotimo yeah
masak :r or 'token'
timotimo i want it to parse-succeed ;)
yeah, that made it work immediately 23:54
masak heh. 23:55
timotimo "work immediately" -> "not parse it and break" actually 23:57
masak oh!