Camelia, the Perl 6 bug

IRC log for #masakism, 2013-05-02

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

All times shown according to UTC.

Time Nick Message
00:04 markrtoon joined #masakism
01:09 Sycosys joined #masakism
01:09 Sycosys ahha! i have found people
01:09 labster yes?
01:09 Sycosys Hi
01:09 labster What's up Sycosys?
01:10 Sycosys not much, jsut trying to sort out the G+ python study group
01:10 labster It's 6PM US-Pacific time, but the lesson is pretty much over.  you can still do the work, though.
01:11 labster Oh... this is more of a Perl crowd than a Python crowd.
01:11 Sycosys oh.. odd, i was linked here from a Learn Python the hard way study group
01:12 Sycosys probably not a bad idea to learn perl while im at the whole expand my program language list.
01:12 labster And most of us are asleep because there are a lot of Europeans in the group.
01:12 labster Cool!  Well, I'd be happy to help.
01:14 labster Are you more interested in Perl 5, the well developed language supported on many platforms with like millions of modules on CPAN?  Or in Perl 6, the new language with lots more features and syntactic sugar but it's still under development?
01:14 Sycosys excellent, well can't say i have any questions at the moment seeing as how this is not the Python chat if thought it was. I'll be sure to drop in if/when i dig into perl Thanks :)
01:15 labster We hang out in #perl6 most of the time, if you're interested in that one.
01:15 Sycosys I am stuck between python 2.6 (for work) and python 3 (for everything else)
01:16 labster Yeah, basicallly the same deal in python.  Except we're working on a Perl 5 in Perl 6 mode, where nested blocks can be written in the old language.  In theory, it could be extended to run Python in Perl 6, but no one's worked on the grammar yet.
01:20 Sycosys Well Thank you for your help. I'll be sure to stop in when i get into Perl. Thank you!
01:22 trexy joined #masakism
01:30 FROGGS_ joined #masakism
02:55 cognominal__ joined #masakism
03:10 msimp joined #masakism
03:11 msimp good evening
03:53 shoerner joined #masakism
03:55 shoerner left #masakism
04:25 Psyche^ joined #masakism
04:48 trexy left #masakism
05:07 moritz_ joined #masakism
05:52 spuelrich joined #masakism
06:01 cognominal joined #masakism
06:17 FROGGS_ joined #masakism
06:21 spuelrich left #masakism
07:02 ilbot_bck joined #masakism
07:02 Topic for #masakism is now http://freespectrum.herokuap​p.com/workshop-map-links.svg -- https://gist.github.com/masak/5431185 -- logs at http://olive.undo.it/log?channel=masakism
07:19 camelia joined #masakism
07:46 cognominal joined #masakism
07:50 Farow joined #masakism
08:02 masak so, did some Python people think it was a fun idea to link here from a G+ thread and say it's "Learn Python the Hard Way"?
08:03 lizmat apparently
08:03 masak well, that explains one of the participants yesterday.
08:03 FROGGS well, publicity of us, no?
08:04 masak I thought he was trolling, so I hugged him.
08:04 masak you can find it in yesterday's logs.
08:04 moritz so, how was the workshop?
08:04 lizmat I understand that is a typical Swedish thing to do
08:05 masak moritz: I can only speak for myself; I enjoyed myself greatly.
08:05 masak moritz: people sent in a total of 45 solutions. my brain melted.
08:06 lizmat for me it was less enjoyable, as I got stuck on a "@array.push &foo" thinko  :-(
08:06 masak aww
08:06 lizmat I will not make *that* mistake again soon
08:06 masak I'm thinking we should have a warning or something for that case.
08:06 masak it's really not DWIM what it does right now.
08:08 lizmat perhaps, any other sigil would have done a 2 terms in a row error
08:08 masak yeah.
08:08 lizmat rn: my @a; my $b; @a.push $b
08:08 camelia rakudo 802574: OUTPUT«[31m===[0mSORRY![31m===[0m␤Two terms in a row␤at /tmp/Ikido_R9q4:1␤------> [32mmy @a; my $b; @a.push [33m⏏[31m$b[0m␤    expecting any of:␤        method arguments␤        postfix␤        infix stopper␤        infix or meta-infix␤        statement end␤      â€¦
08:08 camelia ..niecza v24-37-gf9c8fc2: OUTPUT«[31m===[0mSORRY![31m===[0m␤␤Two terms in a row (method call requires colon or parens to take arguments) at /tmp/zI0iJ7eFX0 line 1:␤------> [32mmy @a; my $b; @a.push [33m⏏[31m$b[0m␤␤Parse failed␤␤»
08:08 labster masak:  ONELINERS https://gist.github.com/labster/5497694  And it's the only solution that did the bottom five problems
08:09 masak lizmat: I've encountered the &-interpreted-as-infix problem in connection with some blocks not getting semicolons properly at the end of lines. very frustrating.
08:09 lizmat rn: my @a; sub foo {1}; @a.push &foo
08:09 camelia rakudo 802574, niecza v24-37-gf9c8fc2:  ( no output )
08:09 lizmat rn: my @a; sub foo {1}; @a.push & foo
08:09 camelia rakudo 802574, niecza v24-37-gf9c8fc2:  ( no output )
08:10 masak labster: nice!
08:10 masak lizmat: it violates Least Surprise. so we should do something about it.
08:10 lizmat would there be any way to force whitespace after an infix & ?
08:10 labster It's hard for me to use intermediate variables.  The methods all seem to be like natural language in Perl 6, so I just keep chaining them.
08:12 lizmat or "termize" &[alpha] ?
08:12 labster lizmat: that makes sense
08:14 * masak suggests moving this discussion to #perl6
08:16 masak labster: nice! I added your solution.
08:19 * lizmat will do so after fitness, away for ~2 hours or so
08:51 simbabque_ joined #masakism
09:13 timotimo this enables colors, no?
09:13 timotimo r: 1 + + +
09:13 camelia rakudo 802574: OUTPUT«[31m===[0mSORRY![31m===[0m␤Preceding context expects a term, but found infix + instead␤at /tmp/AlL8Or12WV:1␤------> [32m1 + + +[33m⏏[31m<EOL>[0m␤»
09:13 timotimo hm, no, doesn't
09:14 timotimo #perl6 has +C and -c, but i can't seem to -c this room
09:15 eyck joined #masakism
09:15 timotimo apparently because of the MLOCK in chanserv?
09:31 felher Dumb question, but what does "@array.push &some-sub" even do?
09:34 FROGGS @array.push: &some-sub would push a reference to that sub to the array
09:34 FROGGS but if you forget to type the ":", you make a junction
09:34 FROGGS r: say (@array.push &some-sub).WHAT
09:34 camelia rakudo 802574: OUTPUT«[31m===[0mSORRY![31m===[0m␤Variable '@array' is not declared␤at /tmp/eEk6TNwbsi:1␤------> [32msay (@array.push[33m⏏[31m &some-sub).WHAT[0m␤    expecting any of:␤        method arguments␤        postfix␤»
09:34 FROGGS r: my @array; sub some-sib { }; say (@array.push &some-sub).WHAT
09:35 camelia rakudo 802574: OUTPUT«[31m===[0mSORRY![31m===[0m␤Undeclared routine:␤    some-sub used at line 1. Did you mean '&some-sib'?␤␤»
09:35 FROGGS r: my @array; sub some-sub { }; say (@array.push &some-sub).WHAT
09:35 camelia rakudo 802574: OUTPUT«(Junction)␤»
09:35 FROGGS like: array & some-sub()
09:38 felher FROGGS: ah, a junction, of course. Thanks.
09:52 lizmat this was part of pushing a callback to a queue
09:53 lizmat I should have used parens:
09:53 lizmat rn: my @a; sub foo {...}; @a.push(&foo)
09:53 camelia rakudo 802574, niecza v24-37-gf9c8fc2:  ( no output )
10:05 atroxaper joined #masakism
10:08 atroxaper left #masakism
10:25 cognominal r: my @array; sub some-sub { }; say (@array.push &some-sub).perl
10:25 camelia rakudo 802574: OUTPUT«all([], Nil)␤»
10:27 cognominal r: say(a&b).perl
10:27 camelia rakudo 802574: OUTPUT«[31m===[0mSORRY![31m===[0m␤Undeclared routines:␤    a used at line 1␤    b used at line 1␤␤»
10:27 cognominal r: sub a{}; sub b {}; say(a&b).perl
10:27 camelia rakudo 802574: OUTPUT«all(Nil, Nil)␤»
10:42 GlitchMr r: my @array; sub some-sub { }; say (@array.push: &some-sub).perl
10:42 camelia rakudo 802574: OUTPUT«Array.new(sub some-sub() { ... })␤»
11:29 Spamchecker16 joined #masakism
11:39 Spamchecker16 left #masakism
12:04 dmol joined #masakism
12:58 ajr joined #masakism
13:12 spider-mario joined #masakism
13:16 udprakash joined #masakism
13:16 udprakash anyone here ?
13:17 moritz just us bots
13:18 udprakash cool
13:19 * masak is not here
13:19 masak udprakash: something on your mind? :)
13:22 udprakash this is the learn python study group rite ?
13:22 * PerlJam is not here either
13:23 masak udprakash: do you have an URL saying that it is? I'm curious.
13:23 masak udprakash: (because it isn't)
13:23 PerlJam udprakash: If by "python" you mean "perl", then yes.
13:23 PerlJam :)
13:23 udprakash i was pointed here
13:23 udprakash but never mind, thanks :)
13:24 masak udprakash: no, no, please tell us more! who pointed you, and how?
13:24 PerlJam masak: you probably need to offer a python lesson in exchange  :)
13:25 udprakash why the curiosity Sir ? I am curious
13:25 moritz it's not often that people come to perl events and expect there to be python
13:25 moritz so if that happens, that's curious, don't you think?
13:25 felher /topic Python changed its syntax quite a bit for Python 4.0. Learn more aboute the new Python and its features at http://perl6.org ;)
13:26 udprakash by all means :)
13:26 PerlJam felher: heh!
14:01 cognominal joined #masakism
14:02 masak I swear, the next person who comes in asking for Python, I'm actually gonna teach some Python. :P
14:03 timotimo how much python do you know actually?
14:03 masak I'm not sure. I guess we'll find out.
14:08 bern joined #masakism
14:10 geekosaur came here asking for python? *looks at channel name, goes hmmm*
14:11 masak hmmm!
14:11 geekosaur (pythonista self-awareness?)
14:11 geekosaur :)
14:11 GlitchMr I want JavaScript lessons...
14:12 timotimo the channel name says nothing about python *or* perl
14:12 masak GlitchMr: do the PROMISE exercise! :P
14:12 GlitchMr In JavaScript?
14:12 masak GlitchMr: sure, why not.
14:13 GlitchMr I wasn't serious, but whatever ;-).
14:13 gtodd how about in perl6 but that outputs jscript
14:14 timotimo make it compatible to perlito6 perhaps?
14:15 gtodd Hmm the oneliners task  Program 5 -- print everything between START and END ...
14:15 PerlJam sounds like a good meta-topic for the next #masakism lesson--writing a compiler :)
14:16 GlitchMr HQ9+? Or something more complex than that?
14:18 PerlJam Whatever masak thinks he can muster.
14:19 PerlJam But the presentation should probably be like; do this little task. do that little task. put them together. oh, btw, you're just written a compiler  :)
14:19 gtodd the solutions are so different
14:19 gtodd perl6 -e '$*IN.slurp.comb(/<?after \n?START\n> .*? <?before \nEND\n?>/)>>.say'
14:19 gtodd perl6 -e for lines() { last if m:i/^end$/; next if m:i/^start$/; .say; }
14:19 gtodd perl6 -e '.say if /^ START/ ff /^END/ for lines'
14:20 masak PerlJam: sounds attractive. I'll think about it.
14:20 masak gtodd: fwiw, I had that last one in mind.
14:20 gtodd it's the closest to perl5  perl -ne 'print if /START/../END/'
14:20 masak yeah.
14:21 masak and TimToady++ speculated that we should perhaps change infix:<ff> et al. to smartmatching.
14:21 gtodd mind you there that infernal dot  >.<say
14:21 masak which, to the extent I can predict the implications, I think sounds like a good idea.
14:21 masak gtodd: yeah. the infernal dot is one of the Perl 6 cleanups. I like it, because I agree with the cleanup. YMMV.
14:22 gtodd :-)
14:24 gtodd it  reminds me that say is method being used on an object :-)
14:26 masak if you don't like that, you can always do `say $_ if /^ START/ ff /^END/ for lines'
14:28 gtodd yeah that's what I ended up putting
14:28 gtodd but ... it took me several hours :-D
14:28 pmichaud ehhh, writing a compiler isn't so hard.  I've done tons of them.
14:29 PerlJam pmichaud: so ... you're volunteering to run the next #masakism lesson?   ;)
14:29 gtodd pmichaud: did you get tricked in any of them by doing small tasks ?
14:29 gtodd pmichaud: wait don't answer that
14:30 PerlJam gtodd: I think he was "tricked" into writing 2 perl6 compilers  :)
14:30 pmichaud step 1:  reinforce the walls of your office and/or building to be able to better sustain your head beating against them.
14:30 gtodd :)
14:30 pmichaud actually, 3 or 4 perl 6 compilers.  and quite a number of regex engines.
14:31 PerlJam yeah, 2 was just least upper bound
14:31 pmichaud ...which might actually indicate unsuitability for the task, now that I think of it.  :-)
14:31 pmichaud "Still haven't gotten it right after the 5th try, eh?"
14:32 pmichaud afk again   (housework... sigh :-/ )
14:36 masak pmichaud++ # your regex engines and Perl 6 compilers keep coming out better and better, that's gotta count for something :)
14:37 masak ok, decommuting. if someone turns up asking for Python, be nice to them ;)
14:38 FROGGS we will
14:41 swuecho_ joined #masakism
14:42 PerlJam masak: I'm almost offended that you feel the need to remind us to be nice  ;)
14:56 ajr joined #masakism
14:57 ajr_ joined #masakism
14:58 GlitchMr masak, https://gist.github.com/GlitchMr/5502814
15:30 masak PerlJam: I was talking to everyone else, not you :P
15:31 tadzik "you insensitive clod"
15:31 masak GlitchMr: nice!
15:31 masak GlitchMr: except for one thing. I see you're writing JavaScript in semicolon-less style. stop that immediately. ;)
15:31 GlitchMr Why not? I like semicolon-less style.
15:31 tadzik it's like Go
15:32 masak GlitchMr: then you simply don't know enough about it.
15:32 masak it was a big mistake. it creates horrible logical bugs. it shouldn't be done, ever.
15:32 GlitchMr The only thing that could really happen is paren interpreted as method call.
15:32 masak no, that's not the only thing.
15:33 PerlJam .oO( <@masak> GlitchMr: YOU'RE WRONG! )
15:33 masak but this is not the place to try to convince you.
15:33 PerlJam ;)
15:33 GlitchMr Besides, I have semicolons.
15:33 GlitchMr for (i = 0, length = this.onFulfilled.length; i < length; i++)
15:34 masak ;)
15:35 GlitchMr I also write Python, Ruby, CoffeeScript, and AWK without semicolons.
15:37 GlitchMr Well, and +/- interpreted as operators, but you wouldn't begin code lines with numbers...
15:38 moritz 42 == $answer or die "Wrong answer!"
15:38 GlitchMr I never liked "or die" idiom - I only use it for file handle operations in Perl 5. But that's probably just me.
15:39 FROGGS I dont like them either
15:39 FROGGS and I'd like to omit the last semicolon in a statementlist in PHP
15:39 blkcat oh god semicolon-less javascript.
15:39 blkcat just. say. no.
15:40 FROGGS *cough*, computer said "no"
15:40 GlitchMr Hey, my compiler accepts it
15:40 ajr_ s/semicolon-less// ?
15:40 GlitchMr Spec says it's allowed too.
15:40 GlitchMr allowed.*
15:43 GlitchMr With exception for JavaScript I've contributed to other projects, every single line of JS code I've wrote doesn't use semicolons.
15:45 GlitchMr Semicolons are noise anyway.
15:45 FROGGS just the last one :o)
15:47 GlitchMr std: https://gist.github.com/GlitchMr/5503150
15:47 camelia std 316b40b: OUTPUT«[31m===[0mSORRY![31m===[0m␤Whitespace is not allowed in an operator at /tmp/XI40PtVL_P line 1:␤------> [32msub infix:["\n"][33m⏏[31m($, $) {}[0m␤Parse failed␤FAILED 00:00 42m␤»
15:47 GlitchMr huh?
15:47 GlitchMr I cannot add ASI to Perl 6?
15:49 GlitchMr Actually, where is that error message in STD, anyway?
15:50 GlitchMr n: https://gist.github.com/GlitchMr/5503150
15:50 camelia niecza v24-37-gf9c8fc2: OUTPUT«Potential difficulties:␤  &infix:<␤> is declared but not used at /tmp/L6vR9qqMnu line 1:␤------> [32msub infix:["\n"][33m⏏[31m($, $) {}[0m␤␤84␤Unhandled exception: System.NullReferenceException: Object reference not set to an instance of an object␤  at…
15:51 GlitchMr CursorBase.pmc... ok
15:51 masak GlitchMr: semicolons are useful delimiters, decoupling "lines" from "statements".
15:52 masak GlitchMr: the JavaScript intuiting of missing semicolons is fundamentally broken. writing in semicolon-less style is, to put it bluntly, irresponsible.
15:53 GlitchMr std: https://gist.github.com/GlitchMr/5503150
15:53 camelia std 316b40b: OUTPUT«[31m===[0mSORRY![31m===[0m␤Null operator is not allowed at /tmp/hMTaySxMHH line 1:␤------> [32msub infix:<>[33m⏏[31m($, $) {}[0m␤Other potential difficulties:␤  Pair with <> really means an empty list, not null string; use :('') to represent the null string,␤…
15:53 GlitchMr std: https://gist.github.com/GlitchMr/5503150
15:53 * masak recommends GlitchMr do his exploration of whitespace operators over at #perl6 or in privmsg
15:53 camelia std 316b40b: OUTPUT«[31m===[0mSORRY![31m===[0m␤Null operator is not allowed at /tmp/pRuIFyYUqE line 1:␤------> [32msub infix:[''][33m⏏[31m($, $) {}[0m␤Parse failed␤FAILED 00:00 42m␤»
16:21 timotimo masak: can you make this channel color-compatible or something? :|
16:21 dmol joined #masakism
16:31 FROGGS joined #masakism
16:34 mohij joined #masakism
16:39 masak timotimo: I may have the powers to do so (as registered channel owner), but I don't have the know-how.
16:41 geekosaur https://toxin.jottit.com/freenode_channel_modes see +/-c
16:42 snearch joined #masakism
16:47 * masak looks
16:47 * geekosaur likes toxin as a general reference for IRC stuff, btw
16:48 masak timotimo: we already have +c in here. is there any other action I can take to make your life more color-compatible?
16:49 geekosaur backwards, +c is the problem
16:49 masak oh.
16:49 geekosaur +c is what strips escape and other control chars to disable colors
16:50 masak [freenode] -!- #masakism c ntcslk MODE cannot be set due to channel having an active MLOCK restriction policy
16:50 masak I'm new at this. what should I do?
16:50 timotimo privmsg chanserv for "help" and find the help for the "mode" command, i think
16:50 masak ok.
16:52 geekosaur /msg chanserv set #masakism mlock +nt-slk
16:53 masak done.
16:53 masak I still see (+cnt) in the info line on irssi, though.
16:53 geekosaur and then you should be able to issue that /mode command again
16:53 masak indeed. geekosaur++
16:54 geekosaur right, that doesn't chaneg the mode, just changes what irc will let you do
16:54 masak do I need to revert the MLOCK setting now? should I?
16:54 geekosaur no, you probably want to leave it
16:54 masak ok.
16:54 geekosaur if you'd moved the c to the other side, it might have taken immediate effect (since that would then be a forced turn off)
16:55 geekosaur if you tell it to force back on, chanserv would probably set +c again immediately
16:55 masak ok.
16:58 timotimo r: 1 + + + + + + + + +
16:58 camelia rakudo 639d7f: OUTPUT«[31m===[0mSORRY!​[31m===[0m�Preceding context expects a term, but found infix + instead�at /tmp/0w4eKNyPN1:1�------> [32m1 + + + + + + + + +[33m�[31m<EOL>[0m�»
16:59 timotimo that looks better
17:00 masak \o/
17:35 Cybelechild joined #masakism
17:35 Cybelechild left #masakism
18:21 gco joined #masakism
18:47 gtodd masak: Since it took me all day and errm I have only one gist for the oneliners I am somewhat reticent to put it up :-)
18:47 masak no, go ahead.
18:48 gtodd especially since I was **so** close to solving number the lines in a perl6 ish way
18:48 gtodd and then I saw the other solutions and copied ... but only  one comma :-)
18:48 PerlJam gtodd: never be embarassed about your code or the time it took.  Everyone is on the same journey, just at different places and maybe taking different routes.  :)
18:49 gtodd I had:
18:49 gtodd perl6 -e 'my $num; say "{$num++} $_" for $*IN.lines' < file.txt
18:49 gtodd but wanted to figure out how to use "state" better (I have used it a bit in perl5 but ...)
18:50 gtodd perl6 -e 'say (state $num)++ " $_" for $*IN.lines' < file.txt
18:50 gtodd :-\
18:50 gtodd missing the damn comma for an hour :\
18:51 moritz_ r: say (state $num)++ " $_" for $*IN.lines
18:51 camelia rakudo 639d7f: OUTPUT«[31m===[0mSORRY![31m===[0m�Two terms in a row�at /tmp/0HoH47Twmr:1�------> [32msay (state $num)++ [33m�[31m" $_" for $*IN.lines[0m�    expecting any of:�        postfix�        infix stopper�        infix or meta-infix�        statement end�        statemen…
18:51 moritz_ it points you exactly to the right spot :-)
18:52 PerlJam gtodd: note that you don't even need a named variable
18:52 moritz_ but I know how hard it is to find such stuff sometimes
18:56 PerlJam huh ...  "my" works too.  That's a tad surprising as I'd think it would recreate the var on each iteration.
18:57 timotimo well, there's no curlies. is that what decides it?
18:58 gtodd yeah two terms in a row :-)
18:58 masak PerlJam: nope.
18:58 masak PerlJam: there's no block in that for loop.
18:58 masak masak: and so the var is declared once, and incremented many times.
18:58 gtodd I'm ruining my mind by trying to make perl5 and perl6 seem similar!
18:58 masak er, talking to myself :/
18:58 PerlJam yeah, it's just how my brain is wired to think of "my" in loops.
18:59 gtodd and embarassing private exercise :-)
18:59 masak thunks are explicitly not blocks :)
19:00 PerlJam gtodd: in any case,  say (my $)++ ~ " $_" for lines()' < file.txt
19:01 masak r: say "$(my $a = 42) frogs!"; say $a
19:01 camelia rakudo 639d7f: OUTPUT«42 frogs!␤42␤»
19:01 masak Perl 6 is weeeeeird.
19:02 dmol joined #masakism
19:03 tadzik :)
19:03 moritz_ actually it's very linear :-)
19:04 moritz_ .oO( strangely linear )
19:04 moritz_ .oO( in first approximation, everything is linear )
19:04 gtodd perl6 -e 'say (state $num)++,  " $_" for $*IN.lines' < file.txt    <-- how does one write a similar oneliner using "state" in perl5?
19:05 gtodd perl5 -pe '$_ = "$. $_"' < file.txt is easier :-)
19:05 gtodd if more cryptic/idiomatic
19:08 gtodd PerlJam:  say (my $)++ ~ " $_" for lines()' < file.txt    yes much better and closer  to perl5 -pe '$_ = "$. $_"' < file.txt  :-)
19:09 GlitchMr http://coffeescript.org/#try:console.log%20%22%23{a%20%3D%2042}%2​0frogs!%22%0Aconsole.log%20a
19:09 GlitchMr CoffeeScript
19:10 GlitchMr Works like in Perl 6.
19:11 GlitchMr But unlike Perl 5.
19:11 PerlJam gtodd: note that rakudo (at least) also has a -p option
19:11 PerlJam gtodd: perl6 -p -e 'print (my $)++ ~ " "' < file.txt
19:12 GlitchMr I'm not even sure which behavior is valid. Declaring lexical variable inside quotes is something you shouldn't have to do ;-).
19:12 gtodd PerlJam: yeah ... I wondered if -p was cheating :-)   I never think to use "~" when I want to match everything
19:12 GlitchMr I did it that way
19:13 GlitchMr perl -pe'print"$.. "'
19:13 GlitchMr Surprise. It works!
19:14 PerlJam gtodd: another version that's even closer to what you wrote: perl6 -p -e '$_ = "{(state $)++} $_"' file.txt
19:18 gtodd PerlJam: that almost works in perl5
19:19 PerlJam and if there were a way to define and use your own setting, you could write one such that:  perl6 -SLN -e '' # does what you want  (where -S would be how you switch settings and LN would be the name of the setting (LN == line numbers))
19:19 PerlJam (I'm 1/2 expecting moritz_ or someone to pipe up with "you can do that, but like this instead")
19:20 masak ...or just load a module that overrides &say... :P
19:21 masak or wraps it, more like.
19:21 PerlJam oh, good point
19:21 PerlJam (I still like the provide-my-own-setting idea though)
19:23 masak r: &say.wrap: -> *@x { callwith ++state $ , ". ", |@x }; say "OH"; say "HAI"
19:23 camelia rakudo 639d7f: OUTPUT«1. OH␤2. HAI␤»
19:24 masak would be nice if the effects of that .wrap undid themselves at the end of the block. I think that can be arranged, using LEAVE or something.
19:24 PerlJam maybe with temp?
19:25 masak r: { my $h = &say.wrap: -> *@x { callwith ++state $ , ". ", |@x }; LEAVE { $h.restore }; say "OH"; say "HAI" }; say "out of it!"
19:25 camelia rakudo 639d7f: OUTPUT«1. OH␤2. HAI␤out of it!␤»
19:25 masak \o/
19:27 lizmat according to spec, temp should do that: S06:2906
19:27 gtodd this one I wanted to get to print unless it was  Nil:
19:27 gtodd perl6 -n -e '.split(" ")[2].say' file.txt
19:28 PerlJam though, masak's version is lexical, and temp would not be.
19:29 gtodd anyway here's my one entry for the oneliners ... I will finish all the other problems over the coruse of my life :-)
19:29 gtodd https://gist.github.com/opendevnet/5504709
19:29 PerlJam (maybe)
19:30 gtodd well I guarantee I won't even finish the easy ones :-)
19:30 PerlJam no, masak's would be the same as with temp
19:30 * PerlJam is just crazy today
19:31 PerlJam gtodd++
19:31 masak my version is not lexical. the effects of wrapping &say would survive calling into other blocks.
19:31 masak gtodd: lookings
19:31 masak looking*
19:32 diakopter left #masakism
19:32 masak gtodd: using the -p switch is definitely not cheating :)
19:32 masak gtodd: "Is the eskimo operator ("}{") a perl5-ism?" yes.
19:33 masak gtodd: I wrote some blog posts about why it doesn't work in Rakudo.
19:34 masak gtodd: I'm surprised that 5d works.
19:35 masak (are you sure it does?)
19:35 masak same deal with 5f.
19:35 masak anyway, adding you to the list :)
19:35 masak gtodd++
19:40 ajr joined #masakism
19:41 * PerlJam isn't sure what /START/ .. /END/ does there even
19:42 masak right, exactly.
19:42 masak it feels bogus.
19:46 ajr_ joined #masakism
19:52 ajr_ joined #masakism
20:30 labster Oh masak, just wanted to thank you for mentioning the Seven Stages of a Perl Programmer.  I hadn't seen that before.
20:31 pmichaud I haven't seen it yet.  Where can I see it?
20:31 labster http://jwenet.net/notebook/2005/1075.html
20:31 pmichaud labster++ masak++ # reference
20:32 masak I've known about it for years and I think it's great. :)
20:32 pmichaud I guess I'm at Wizard level by now.
20:33 pmichaud Guru #4:  Writes code that gives even Larry pause.    #  HAHAHAHAHAHAHAHA
20:33 labster I seem to have gone from User to Expert in the last 6 months.   I think a lot of that is Perl 6 magic though -- the language seems inherently easier to understand.
20:34 pmichaud there needs to be a level for "has actually (re)written the regex engine", though.  :)
20:34 pmichaud several people qualify for that these days.
20:35 pmichaud okay, I'm afk again.  busy day today.  :-/
20:35 PerlJam Add a level above.   Deity maybe?  (what would be above wizard?)
20:36 PerlJam (well, below depending on how you look at it)
20:38 labster Archmage would be above Wizard.
20:38 labster Well, in magic terms.  But programming is magic.
21:00 masak it is. a controllable kind of magic.
21:03 labster Just as D&D has illusionists and enchanters, there are OOPers, functionalists, and whatever Lisp is.
21:17 troydm labster: lol
22:33 ohh joined #masakism
23:47 KvH_ joined #masakism

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