|
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. |
|||
| timotimo | masak: may i ask you to look over my cod | 00:05 | |
| my code? :) | |||
| r: gist.github.com/timo/5819240 | 00:06 | ||
| camelia | rakudo b2072f: OUTPUT«I bought a B of As from T S.{"pattern" => "A", "replacement" => "apple", "terminal" => Bool::False}{"pattern" => "B", "replacement" => "bag", "terminal" => Bool::False}{"pattern" => "S", "replacement" => "shop", "terminal" => Bool::False}{"pattern" => "T", "rep… | ||
| timotimo | maybe it'll be enough to replace the <.ws> with ' '* | 00:07 | |
| hm, i think now i'm matching whitespace where i shouldn't | 00:10 | ||
| er. not matching whitespace where i should, actually | |||
| aaand i made it work :) | |||
| now to make it clever and beautiful | 00:12 | ||
| r: say 1, 2, 3, 4, { @_.pick } ... { * != * }; | 00:14 | ||
| camelia | rakudo b2072f: OUTPUT«1» | ||
| timotimo | r: say 1, 2, 3, 4, { @_.pick } ... { * == * }; | ||
| camelia | rakudo b2072f: OUTPUT«1» | ||
| timotimo | r: say 1, 2, 3, 4 ... { * == * }; | ||
| camelia | rakudo b2072f: OUTPUT«1» | ||
| timotimo | r: say 1, 2, 3, 4 ... { $^a == $^b }; | ||
| camelia | rakudo b2072f: OUTPUT«Not enough positional parameters passed; got 1 but expected 2 in block at /tmp/vd1lKx_irq:1» | ||
| timotimo | oh? i can't have an ending block that gets more than one value passed? | ||
| that's kind of a bummer :( | |||
| masak kinds of comes back to the conversation | 00:22 | ||
| timotimo | at the gist link from above you'll find the current, working version | ||
| masak | oh, seems most problems resolved themselves :) | ||
| timotimo | indeed, .ws was the source of all of my troubles ;) | ||
| masak .oO( in whitespace, no-one can hear you scream ) | 00:35 | ||
|
00:38
benabik joined
|
|||
| masak | nice solution. timotimo++ | 00:50 | |
| bedtime. 'night | |||
|
01:45
BenGoldberg joined
02:19
benabik left
03:49
dmol joined
|
|||
| Teratogen | hello | 04:04 | |
| labster | hello Teratogen | 04:22 | |
| Teratogen | I missed masakism! | 04:23 | |
| darn it! | |||
| labster | I was going to work on my PROMISE and HEX problems a little bit more, but I got distracted by breaking rakudo on windows right before the release date :/ | ||
| We won't have full attention, but you should be able to jump in and do the work. Of course, it's better when masak is awake | 04:24 | ||
| You can take a look here: github.com/masak/workshop | 04:25 | ||
| Teratogen | I am not a Perl 6 person =/ | 04:39 | |
| labster | That's okay. This is a Perl 5 and 6 workshop. | 04:40 | |
| You can do either one you want to do. | 04:42 | ||
| Most of the tests are written in P5, so it's probably easier to do it in 5. | 04:43 | ||
|
06:31
dmol joined
09:11
snearch joined
|
|||
| masak | oh hai #masakism | 10:44 | |
| I'm awake :) | |||
| yes, it's rather fun how the workshop doesn't "take sides" between Perl 5 and Perl 6. it just uses one or the other whenever convenient. | |||
| and doesn't make such a big deal out of it. | |||
| I'm usually quite aware of all the differences between the two languages, but when producing the workshop it didn't feel like they were that far apart. | 10:45 | ||
| * benabik is also amused that he can use the p5 tests with not much more than s/->/./g | 10:46 | ||
| heh -- that's because long before we started going on about "sister languages", we actually considered Perl 5 and Perl 6 to be *the same language*. :) | 10:47 | ||
| lizmat | fwiw, I still consider Perl 1,2,3,4,5,6 to be all Perl | 10:59 | |
| :-) | |||
| masak | so does TimToady, I believe. | 11:02 | |
| as someone who was there when the "sister languages" meme got forged, I know it's there mostly for diplomatic reasons. | 11:03 | ||
| it wouldn't have been needed at all in a perfect world where Perl 6 was developed in three years flat, and superseded all Perl 5 installs across the world. | |||
| lizmat | like the other meme, in time it will die | 11:08 | |
| .oO{does that qualify as an autpun?} | |||
| *autopun | |||
| masak | no, don't think so :) | 11:09 | |
| lizmat | as it requires knowledge about the other Perl meme? | ||
| masak | oh, that one. | 11:16 | |
| still doesn't quite connect for me as an autopun. just mentioning the same thing twice isn't really enough. | |||
| this is an autopun: twitter.com/ditchkelly/status/3239...3091407872 :) | |||
| lizmat | ;-) | 11:19 | |
| timotimo | masak: refering to gist.github.com/timo/5819240 ; do you have a suggestion for something nicer-looking than the nested $beginning and $prev comparison stuff? | 12:08 | |
|
12:16
lizmat joined
|
|||
| masak looks | 12:32 | ||
| timotimo | i was hoping i could use the sequence operator, but the end-point closure would need to take two arguments for it to actually look nice | 12:34 | |
| masak | timotimo: I think you could get rid of beginning by doing 'ENTER $value'. | 12:40 | |
| but it seems that doesn't work right now. | 12:41 | ||
| bringing the issue over to #perl6. | |||
| timotimo | does "seems not to work" mean you tested it? | ||
| masak | yes, of course. this is #masakism :) | 12:42 | |
| timotimo | :3 | 12:48 | |
| masak | FROGGS++ found rt.perl.org/rt3/Ticket/Display.html?id=116102 which is why this doesn't work yet. | 12:50 | |
| seemingly that ticket made the spec clarify that ENTER does leave a value at all. | |||
| hm. or not. | 12:51 | ||
| timotimo | i kind of remember digging into that | 12:56 | |
|
16:31
GlitchMr joined
16:54
dmol joined
|
|||
| masak | I like the fact that there's 26 people in here (and 2 bots) despite the fact that this channel may never again be host to any significant activity whatsoever :) | 17:21 | |
| then again, maybe there is room for a third workshop... | |||
| timotimo | maybe :) | 17:25 | |
| gist.github.com/timo/5819240/revisions ← masak, this is a version I feel confident uploading to rosettacode now; i think it's very pretty now | 17:26 | ||
| maybe i'll do :$verbose = any(@*ARGS) eq "--verbose", though | 17:27 | ||
| yeah, that sounds like a good addition | |||
| that doesn't seem to work o_O | 17:29 | ||
| does MAIN clear out the $*ARGS or something? | |||
| masak looks | 17:30 | ||
| timotimo: I'm wondering if 'rule' shouldn't be a rather than a token. then you could make the <.ws> calls implicit. | 17:32 | ||
| timotimo | is there a way then to "unspace" the spot between terminal rule and replacement string? | 17:33 | |
| masak | yes. just put them together without whitespace in between. | 17:35 | |
| timotimo | i was hoping i could have whitespace in the definition that won't invoke .ws, but that's okay | 17:36 | |
| masak | it feels slightly inelegant (at lines 40..41) to slurp in all the data, and then only loop through things one-by-one. | 17:37 | |
| I mean, it's nice uses of >> and Z but it ends up wasting memory for no real benefit. | 17:38 | ||
| I think I'd've done 'for 1..5 -> $n' instead, to be honest ;) | |||
| timotimo | mhm | ||
| masak | an extra reason for that: | 17:39 | |
| that's the logic you have in your other two MAIN routines *anyway*. | |||
| so you can probably unify things a bit more and not repeat code there. | |||
| timotimo | i could defer to the other main subs, yeah | ||
| and then i could even use dir to find all rule* that have test* files | 17:40 | ||
| masak | or factor out what's there into yet another subroutine. | ||
| but yes. | |||
| beyond that, it looks very nice. timotimo++ | |||
| timotimo | thanks! :) | 17:41 | |
| my $start_value = (try $testfile.IO.slurp.trim-trailing) // prompt("please give a start value: "); # this is pretty cool. | 17:49 | ||
| masak | najs :) | ||
| timotimo | replacing .IO.slurp with .&slurp, yey or nay? | 17:50 | |
| masak | slurp($testfile).trim-trailing, maybe? | ||
| timotimo | mhm | ||
| okay, i've updated the gist and i'll upload it to RC now :D | 17:53 | ||
| masak | \\o/ | 17:55 | |
| timotimo++ | |||
| timotimo | that was a fun task | 17:57 | |
| masak | :) | ||
|
18:25
spider-mario joined
19:53
dmol joined
20:31
moritz left
22:02
dagurval joined
22:38
BenGoldberg joined
23:28
KvH_ joined
23:35
dagurval joined
23:36
census joined,
census left
|
|||