6.2.10 released! xrl.us/hxnb | geoffb's column (/. ed): xrl.us/hxhk | pugscode.org | pugs.kwiki.org | paste: feather.perl6.nl:8888/ | www.geeksunite.net
Set by Juerd on 20 October 2005.
eric256_ whistles 01:32
01:32 eric256_ is now known as eric256__ 02:05 eric256__ is now known as eric256
eric256 wow...lively in here. ;) 02:10
anyone know a way to make a loop output colums in HTML::Template? like three even colums of all the items in the loop? 02:13
feather.perl6.nl/~eric256/t_index/ for anyone who is interested... added templating and sub pages for each directory of tests. ;) if only i knew someone with the HTML skills to make it pretty....hint hint. ;) 03:04
buu ?eval my $a; say $a++ for 0..100; 03:47
evalbot_7731 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 undef
buu ?eval my $a="a"; say $a++ for 0..100;
evalbot_7731 a b c d e f g h i j k l m n o p q r s t u v w x y z aa ab ac ad ae af ag ah ai aj ak al am an ao ap aq ar as at au av aw ax ay az ba bb bc bd be bf bg bh bi bj bk bl bm bn bo bp bq br bs bt bu bv bw bx by bz ca cb cc cd ce cf cg ch ci cj ck cl cm cn co cp cq cr cs ct cu cv cw undef
buu Wtf? 03:48
?eval my $a="cw"; say $a-- for 0..100;
evalbot_7731 cw -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 undef
buu I demand a magical decrement.
eric256 you probably wont get it. ;)
demand though you may
buu Why not?!
eric256 i don't remember the specific reason...maybe you will
buu Someone lied to me and said that magical increment could get to 0 03:49
eric256 it would actualy be pretty easy to add in the haskell code if you want
buu When it obviously can't.
eric256 ?eval my $x = '-10'; say($x++) for 0..20;
evalbot_7731 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 undef
eric256 lol. thats not very good. lol
buu What does that have to do with anything?
Ok granted it's weird
But it's completely different 03:50
eric256 no if it had gone up like it should. then it would have gotten to 0
well "0"
buu Yes, but that's not a magical increment
eric256 ?eval my $x = '-'; say($x++) for 0..20;
evalbot_7731 - . / 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 undef
eric256 yes it was
buu ick
No it's not
incrementing numbers is standard ++ behaviour!
eric256 yes it is. i promise. if its a string at all then its magic 03:51
buu Since when has perl cared if your number is surrounded by quotes?
eric256 and -10 ++ usualy equals 11?
always
its a string, ++ on a string doesn't force it to be a number
buu -10 ++ should be 9
er
-9
Like god intended.
eric256 ?eval my $x = '-10'; for 0..10 { $x += 1; say $x; } 03:52
evalbot_7731 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 undef
buu and by god "b"-- should be a
eric256 non magic
?eval my $x = '-10'; for 0..10 { $x++; say $x; }
evalbot_7731 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 undef
eric256 magic
?eval my $x = '-10 hello'; for 0..10 { $x++; say $x; }
evalbot_7731 -10 hellp -10 hellq -10 hellr -10 hells -10 hellt -10 hellu -10 hellv -10 hellw -10 hellx -10 helly -10 hellz undef
buu That's awful.
eric256 lol. not realy.
same things perl5 did
buu I don't care what perl5 did! 03:53
eric256 hehe
either way you can't say you want ++ to be magic, unless the thing inside the string might be a number
buu I don't see why it's so difficult to define a magic -- given the above constraints
eric256 its not difficult..where did you read that?
buu Here
eric256 i even just mentioned it would be quite easy to add to pugs
buu So what's the problem? 03:54
eric256 agreement, standard, like i said i can't remember the last reason why not, but i think its mostly just because no one realy needs it
i would say, if you want it, implement it in pugs.. pretty straight forward to do 03:56
wolverian buu, what's "a"--? 03:58
eric256 ?eval 'z'++
evalbot_7731 Error: Can't modify constant item: VStr "z"
eric256 ?eval my $x ='z'; $x++
evalbot_7731 "z"
eric256 ?eval my $x ='z'; $x++; $x 03:59
evalbot_7731 \"aa"
eric256 that was the reason. thanks wolverian
PerlJam Why is that reason good enough?
Why not just do like perl5 does when you try to increment ";" (for instance)
eric256 didn't say it was ;) just thats the last reason i heard. hehe. what would it be? ''? 04:00
PerlJam eric256: sure, why not.
Same thing for $a = "0000000"; $a--
eric256 PerlJam: i think you would get many different answers. besides i never said we shouldn't. lol people keep trying to put me on that side. i keep saying implement it in pugs. ;) 04:01
?eval my $x =''; $x++; $x
evalbot_7731 \"1"
eric256 ?eval my $x ='1'; $x++; $x
evalbot_7731 \"2"
eric256 ?eval my $x ='0'; $x++; $x
evalbot_7731 \"1"
PerlJam eric256: indeed. Talk is cheap. I'm just entertaining buu's idea for a minute or two before I lose interest :) 04:02
eric256 interesting. ;) anyway i think the reason is just that ++ is pretty DWIM without special rules. -- could do many things at boundaries
buu hrm 04:15
eval: $x=''; $x++; $x
buubot buu: Return: 1
buu eval: $x='z'; $x++; $x
buubot buu: Return: aa
buu eval: $x=';'; $x++; $x
buubot buu: Return: 1
buu heh
eval: $x='-'; $x++; $x 04:16
buubot buu: Return: 1
buu ?eval my $x='-'; $x++; $x
evalbot_7731 \"."
buu Teh weird.
eric256 ?eval:p5 my $x = 5; $x++; $x
evalbot_7731 Can't locate Scriptalicious.pm in @INC (@INC contains: /home/fibonaci/devel/pugs-base/perl5/PIL-Run/lib /home/fibonaci/devel/pugs-base/perl5/PIL-Run/.. /home/fibonaci/devel/pugs-base/perl5/PIL-Run/../Perl6-Value/lib /home/fibonaci/devel/pugs-base/perl5/PIL-Run/../Perl6-Container/lib /home/fibonaci/devel/pugs-base/perl5/PIL-Run/../Perl6-MetaModel /home/fibonaci/devel/pugs-base/perl5/PIL-Run/../Perl6-MetaModel/lib /etc/perl /usr/local/lib/perl/5.8.7
buubot eric256: Error: syntax error at (eval 109) line 1, near "p5 my "
buu er 04:17
whups
eric256 yea
buu Didn't realize your 'eval' involved a colon
eric256 my eval? 04:18
your suppose to be able to eval with different backends.. could be usefull to eval p5 code for comparison too 04:19
buu ?eval:p5
evalbot_7731 Can't locate Scriptalicious.pm in @INC (@INC contains: /home/fibonaci/devel/pugs-base/perl5/PIL-Run/lib /home/fibonaci/devel/pugs-base/perl5/PIL-Run/.. /home/fibonaci/devel/pugs-base/perl5/PIL-Run/../Perl6-Value/lib /home/fibonaci/devel/pugs-base/perl5/PIL-Run/../Perl6-Container/lib /home/fibonaci/devel/pugs-base/perl5/PIL-Run/../Perl6-MetaModel /home/fibonaci/devel/pugs-base/perl5/PIL-Run/../Perl6-MetaModel/lib /etc/perl /usr/local/lib/perl/5.8.7
buubot buu: Return: p5
buu Causing my bot to pick it up
eric256 lol
gotcha
Khisanth you didn't anchor it?
buu I suppose I could change it
Apparently not
eric256 so i could just say eval:5
buubot eric256: Return: 5
eric256 might be considered a feature. i'm assuming buubot is a p5 bot? 04:20
buu yes
buubot: reload
buubot buu: Reloading!
buu ?eval: 42
evalbot_7731 Error: unexpected ":" expecting program
buu eval: 42;
buubot buu: Return: 42
buu Anchored =]
Khisanth eval: kill KILL => 'buu'; 04:22
buu =[
You made it die. 04:23
eric256 eval: duh
buubot eric256: Return: duh
buu Actualy, how does tha twork, I thought kill took a process id?
eric256 ?eval: 5 + 6
evalbot_7731 Error: unexpected ":" expecting program
buu heh
Make up your mind!
eric256 ?eval kill $.
evalbot_7731 Error: unexpected "." expecting "::"
eric256 ?eval kill me
evalbot_7731 Error: No compatible subroutine found: "&me"
buu ?eval kill $$
evalbot_7731 Error: unexpected "$" expecting "::"
buu ?eval kill $?PID
evalbot_7731 Error: Undeclared variable: "$?PID"
buu gives up
SamB ?eval kill $ 04:24
evalbot_7731 Error: unexpected end of input expecting "::"
eric256 eval: kill $$
buubot eric256: Return: 0
buu Two args.
eval: kill 9,$$;
Notice the lack of response.
eric256 kill your own bot.
soo mean
buu I know =[ 04:25
coral oof
buu eval: "Help help I'm being opressed"
buubot buu: Return: Help help I'm being opressed
eric256 you might not want to have him on here. to easy to kill your system with a system command
buu That's what you think
eric256 what? did you regex for a system in the command or something? or does p5 have a safe mode i don't know about? 04:26
coral Safe.pm exists
buu I'm just cool like that =]
eric256 guess you could have used a Safe compartment
Khisanth eric256: trying to kill a line number? :P
buu I don't use Safe though
It didn't look safe =]
eric256 fears for buu's computer 04:27
buu heh
eric256 eval:`start calc`
buubot eric256: Return:
eric256 lol
buu rofls
coral heh
buu It's been beaten on by #perls on two networks now
coral eric256++
buu And the worst anyone managed to do was make it flood a channel =[
Which I fixed
eric256 built your own safe processings for it? 04:28
buu Yeah
eric256 based on? regex?
buu Naw
ulimits mostly
eric256 ahh
coral eval: use threads;
buubot coral: Error: Can't locate threads.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.7 /usr/local/share/perl/5.8.7 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr
eric256 okay. thought it was win box,
coral rats
buu eric256: Er.. no
buu shudders
eric256 now you know why i worried for your saftey
lol
buu What on earth made you think it was windows?
eval: $^O 04:29
buubot buu: Return: linux
Khisanth buu: your name conjures up visions of broken windows!
buu Khisanth: Hurray!
sili_ uhh 04:30
buu is a windows whore. we all know that
buu =[ 04:31
perlmonks.org/?node_id=302287
DEAR MOTHER OF GOD
eric256 is amused that evalbot seems to be quicker than svn bot right now
svnbot6 r7732 | eric256++ | Added templates to the tests cataloge script, and some more output. test it at feather.perl6.nl/~eric256/t_index/ 04:33
coral eval: use CPAN; CPAN->Shell(install('threads')); 04:34
buubot coral: Error: Can't locate CPAN.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.7 /usr/local/share/perl/5.8.7 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/lo
coral rats
Khisanth eval: use Socket;
coral eval: use LWP;
buubot Khisanth: Return:
coral: Error: Can't locate LWP.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.7 /usr/local/share/perl/5.8.7 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/loc
coral aha
Khisanth !
coral Khisanth++
buu eval: socket(foo) or die $!;
buubot buu: Error: Not enough arguments for socket at (eval 109) line 1, near "foo) "
buu shrugs
coral eval: use IO::File; 04:35
buubot coral: Return:
mrborisguy eval: `create hole into system through shell`
buubot mrborisguy: Return:
buu Socket and such are already loaded
You can't do anything remotely useful with them any more
So I didn't bother to disable using them
eric256 if someone with some html/css skillz wants to hack on the templates for the test cataloge, that would be great. ;) 04:36
coral eval: grep { /Socket/ } keys %INC;
buubot coral: Return: 6
coral eval: delete @INC{grep{/^Socket(?::|$)/}}; 04:37
buubot coral: Error: syntax error at (eval 109) line 1, at EOF
dduncan about labels ...
coral eval: delete @INC{grep{/^Socket(?::|$)/} keys %INC};
buubot coral: Return:
coral eval: use Socket;
buu Buubot is also listening in #buubot and in private message for your destructive pleasures.
buubot coral: Return:
dduncan in perl 6, do they look like the perl 5 ones, eg "foo:", or something else?
coral ok, i'll stop
buu shrugs
dduncan I just want to put in something that'll compile, even if it doesn't run yet
buu Feel free to break it
PerlJam dduncan: yes, labels look the same. 04:38
buu But it keeps getting banned when people spam it in channel =[
dduncan the current pugs will compile "next FOO" and "last FOO", but not the "FOO:"
Khisanth buu: that sort of thing gets spammed here already! 04:40
eric256 wonders why anyone ever wants or needs labels. ;)
Khisanth eric256: how else are you going to use goto? 04:41
line numbers?!
dduncan how about in nested loops?
buu Khisanth: Well, yeah
dduncan when you want to use 'next' or 'last' and need to specify which loop you're controlling
buu Khisanth: I wasn't all that worried, I just thought I'd go ahead and point at the alternative methods.
eric256 why would i use goto?
in nested loops i use flags
dduncan I don't use goto 04:42
coral eval: goto: goto goto;
buubot coral: Error: goto must have label at (eval 109) line 1.
eric256 and i've seldom even needed flags
coral eval: GOTO: goto GOTO;
pasteling "dduncan" at 24.108.164.7 pasted "example method using labels" (59 lines, 2.5K) at sial.org/pbot/13906 04:45
dduncan eric256, here's where I want to use labels ... if anyone has an alternate suggestion to do the job which doesn't involve merging the 2 loops into one, speak up
buu coral: For my own edification, what do you think just happened with my bot when you ran that code? 04:51
coral eval/resource limit trap, possibly ignored it altogether, ulimit resource cap, none of the above
buu Heh, yeah, resource limit 04:52
I keep meaning to make it say something when the child gets killed off
sili_ buu: you know what's funny 04:55
buu JESUS 04:56
sili_ buu: the fuckers on topcoder.com were bitching about how hard it would be to safely run external perl, and i basically told them to do what you did, but they kept dribbling
geoffb Juerd, OT ping 05:54
r0nny yo 06:20
does someone know, how to create a class behaves like hash syntax ?
dduncan question: if a BUILD submethod is put in a class, and it doesn't explicitly set a new object's attributes, then will perl 6 automatically set them after BUILD ends ...
my situation is this ... 06:21
r0nny dduncan: afaik default values are undef/0
dduncan I want to have default BUILD semantics, but that I can run a submethod around the same time that takes the same arguments and is just meant to test the arguments for correctness, throwing an exception if not 06:22
is there another special submethod I can define to do this, or does BUILD have to do that?
r0nny hmm
ask teh gurus
im a perl6 beginner, too
dduncan I did read something about traits or something that can be given to attribute definitions, one of whose names is CHECK, but I don't know if that's the route I want to take 06:23
I want to have something that is called once for the new object and can see all the initializer args given to it 06:24
r0nny hmm
yay 06:27
my Deephash is Hash works
eh s/my/class/
Juerd geoffb: OT pong 06:32
geoffb Juerd, I haven't backlogged, so you may have seen this already, but the dovecot problem turned out to have a simple workaround; just ln -s /usr/lib/libz.so.1 /usr/lib/libz.so 06:33
(I thought of you while I was fixing this on my own mail server.)
r0nny is method postfix:<.{}> ($key) correct for creating a new hash access operator ?
Juerd geoffb: Thanks 06:43
geoffb Juerd, np
Juerd r0nny: Probably so, but it feels wrong. Methods don't include the "." usually. 06:44
r0nny: method postfix:<{ }> (*@keys) { ... }
(Certainly two arguments in <>)
luqui Juerd, I think perl 6 fears was a good idea 06:45
Juerd luqui: Thank you
luqui autrijus, ping
Juerd luqui: It'd be great if more people would write responses, but I may be a little impatient :)
luqui I think it's nice because it gives people who need to vent a place to do it, and feel like they've been heard without having to jam it down people's throats 06:46
Juerd Some people who originally complained have seen the list, and decided they were being silly 06:47
dduncan r0nny, I was looking at A12 again and it seems that BUILD will actually do what I want, when you have $.foo or $:foo in the signiture of BUILD, but that it does the default assignments from new() args prior to the BUILD call, rather than after ...
Juerd This by itself took away some fears. Wonderful, I think.
luqui :-)
Juerd It's probably partly because some fears are in contradiction
geoffb Yes, Juerd++ for that
dduncan if this is actually the preferred behaviour, then I may talk to Damian about his Class::Std doing it the same way (currently, it seems to do the default stuff after BUILD is called)
Juerd Obviously: "It will be slow" and "It will not be released" contradict 06:48
And: "Perl 6 will not look like Perl" versus "It will still look like line noise" 06:49
luqui right
dduncan question ... when referring to a named object's private attribute, which syntax is better: "$obj.:foo" or "$obj:foo"? ... Pugs seems to parse both, while when referring to the topic object it only accepts "$:foo" but not "$.:foo" 06:59
Juerd dduncan: It cannot be referred to by object, IIRC 07:01
dduncan: It's $foo, without :, and it has no accessor method. This is fairly new stuff though, I don't know if Pugs already reflects it.
dduncan I'll clarify that the code in question is within the class whose attributes I'm talking about ... 07:02
so privates are visible there 07:03
also, the named objects are ones that belong to the same class as the code in question, or it trusts the code in question
an issue here is that I see an inconsistency with what formats are parseable 07:04
"$:foo" will parse, "$.:foo" will not, ...
"$obj:foo" will parse, so will "$obj.:foo" 07:05
so part of my question is whether "$.:foo" *should* parse or whether its non-parseability is correct behaviour 07:06
Juerd $:foo variables are gone 07:08
dduncan I just want to be able to either use both "$.:foo" and "$obj.:foo" or not be able to use either of them
Juerd If you want externally visible variables, I don't think they can still be private
dduncan these aren't externally visible 07:09
I'm referring to allowed syntaxes for a classes own code to see its own private attrs
is the dot optional, or should it always be used, or should it never be used, when a class references its own privates? 07:10
I'm thinking that it should be possible to always use the dot, even if one can leave it out at times when doing so isn't ambiguous 07:11
Juerd dduncan: When it is used, accessor methods are created. 07:21
dduncan I think I'll defer this discussion until later ... since it may end up being a non-issue ... thanks anyway 07:22
svnbot6 r7733 | juerd++ | ,=response 07:34
wolverian ,=? :) 07:35
Juerd push ;)
This said, I want all of +=, ~=, ++, etcetera, to work on $_ by defaut.
wolverian I've always wanted that.
Juerd We should be able to write ++; instead of ++$_;
wolverian is that postfix or prefix? 07:36
Juerd Prefix
wolverian why?
Juerd Heads.
wolverian :)
Juerd I have very little influence on the coin :)
Hm, no, postfix makes more sense
Because += would also get $_ on the LEFT
I think that's way more useful than having it on the right, at least :) 07:37
wolverian btw, am I right in reading that /foo/ returns a match object?
er
s,match,regex,
Juerd Depends on its context.
wolverian right.
when does it match automatically against $_?
Juerd When used in boolean context, or with ~~, it automatically matches.
wolverian good. thanks. :)
more rationalisation.
Juerd Do note that you may need m// in case of: ($foo) = /(...)/ 07:38
Or you just get a rx// in $foo
wolverian yeah, thought about that too
I guess you can always do my ($foo) = .match(/(...)/); # :) 07:39
Juerd $foo = m/(...)/
wolverian yeah. 07:40
Juerd p6l'ed implicit $_ on mutation 07:44
wolverian you have a knack of suggesting things that you either love or hate. 07:45
s:2nd/you/one must/
Juerd Hm? 07:46
How so?
And does that make the things good or bad? :)
wolverian I think usually your suggestions aren't exactly small - or if they are, they are excessively cute - so people will polarise strongly on the issue
Juerd, it doesn't have a goodness factor per se, besides the fact that it starts discussion. 07:47
(or badness factor.)
Juerd I like to think they're all cute :)
Cuteness is important, because very often, it matches a way of thinking.
wolverian I agree.
Juerd junctions and -> subs are cute in such a way 07:48
Because of their cuteness, they're instantly understood in their respective idiomatic contexts
wolverian I just wish -> was spelled lambda (as in the letter)
Juerd (boolean, and loops)
wolverian (I don't really. but it'd be even cuter.) 07:49
Juerd The arrow makes it cute
I think using -> outside of loops is in many cases bad style.
But "for @foos -> $foo { ... }" is so incredibly cute that a newbie will probably not even notice that -> is a regular prefix op. 07:50
wolverian :) 07:51
Juerd Damian wondered what I was drinking when I suggested using 1c as the ascii equiv. of <cent thingy> 07:55
(It was Amsterdam tap water)