Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2007-08-06

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:36 nekokak joined #perl6
00:59 nipotaway changed the nick to nipotan
01:09 torz joined #perl6
01:19 zamboni9 joined #perl6
01:19 zamboni9 left #perl6
01:20 dduncan joined #perl6
01:22 cls_bsd joined #perl6
01:54 hakobe changed the nick to hkb_aw
02:58 apeiron left #perl6
03:39 maskd left #perl6
03:56 Teratogen joined #perl6
03:56 Daenyth` does have syntax files for p6?
03:56 Daenyth` does vim^
03:59 demq joined #perl6
04:20 Daenyth` left #perl6
04:40 weinig joined #perl6
04:57 kanru joined #perl6
05:13 devogon joined #perl6
05:24 vel joined #perl6
05:34 weinig joined #perl6
05:47 moritz_ @tell Daenyth` yes, see http://svn.pugscode.org/pugs/util/perl6.vim
05:47 lambdabot Consider it noted.
05:53 hcchien joined #perl6
06:11 BooK joined #perl6
06:22 szbalint_ joined #perl6
06:23 cognominal_ joined #perl6
06:24 * Tene was hacking on a mud in p6/pugs today.
06:24 Tene Very nice and simple.
06:36 Aankhen`` joined #perl6
06:41 sunnavy_ joined #perl6
06:48 dduncan left #perl6
06:49 sunnavy_ changed the nick to sunnavy
06:59 buetow joined #perl6
07:12 Daenyth` joined #perl6
07:12 szbalint joined #perl6
07:24 Aankh|Clone joined #perl6
07:31 kane__ joined #perl6
07:48 Aankhen`` joined #perl6
07:48 SS joined #perl6
08:13 pnu joined #perl6
08:22 franck___ joined #perl6
08:24 knewt joined #perl6
08:30 Daenyth` using pugs, how would I make say append \r\n rather than \n?
08:30 lambdabot Daenyth`: You have 1 new message. '/msg lambdabot @messages' to read it.
08:33 Blwood joined #perl6
08:36 SS left #perl6
08:38 flokuehn joined #perl6
08:39 Daenyth` Is there any clean way to do that or would I just say "foo\r"?
08:40 rfordinal_ changed the nick to rfordinal
08:40 szbalint according to the spec there isn't a specific variable you can set to do it, but I guess there are different, other ways to accomplish it
08:40 Daenyth` alright
08:40 Daenyth` thanks
08:40 Daenyth` still a step up from print "foo\r\n" :P
08:42 rhr it should probably be set per-filehandle (certainly not a global var like p5).  sockets should probably use \r\n by default...
08:42 Daenyth` that would be a smart way to do it
08:43 rhr something like $fh.newline("\r\n")
08:44 Gothmog_ Hm, and \r\n might not be correct, you have to use \015\012 to be sure.
08:47 pasteling "Daenyth" at 24.91.13.73 pasted "Is this right?" (11 lines, 166B) at http://sial.org/pbot/26684
08:49 Tene I'm getting segfaults when trying to match a rule.
08:49 Tene The segfault goes away if I bring it out of a thread.
08:49 Tene The segfault also goes away if I use m:Perl5// instead of m//
08:54 Gothmog_ Tene: File a test. I think that's the established way to report a bug.
08:54 Blwood joined #perl6
08:54 Tene Yeah, it is.
08:55 Tene Don't quite have time to reduce to a test case tonight, though, so leaving a note for myself.
09:02 Daenyth` What is $! called now?
09:08 cognominal_ joined #perl6
09:09 Blwood http://perlcabal.org/syn/S​04.html#Exception_handlers
09:09 lambdabot Title: S04
09:09 Daenyth` thanks
09:13 Daenyth` Did "use warnings;" change? I don't seem to have warnings.pm
09:13 Daenyth` with pugs
09:14 Daenyth` or am I missing something
09:15 Blwood I am very new to perl6 but I think there's no warnings module
09:15 Daenyth` hm
09:15 Daenyth` alright
09:21 Daenyth` On some of the docs it says I can "use Perl5:foo', but when I try it fails saying it can't find the module in @*INC.. What's the best way to handle that? I didn't see any of the scripts listed modifying @*INC
09:21 Tene pugs -I/path/to/libs
09:21 Tene is one way
09:21 Daenyth` alright, lemme try that...
09:24 pasteling "Daenyth" at 24.91.13.73 pasted "It still says that it can't find it; "use Perl5:IO::Socket"" (11 lines, 742B) at http://sial.org/pbot/26686
09:25 Daenyth` ohh
09:26 Daenyth` hmm
09:26 Daenyth` I think I may know why..
09:26 Daenyth` yup
09:26 Daenyth` nevermind, ignore that paste
09:26 Blwood what was the problem ?
09:26 Daenyth` there's no Socket.pm; you have to specify IO::Socket::INET
09:27 Daenyth` at least with my install
09:27 Blwood oh right :)
09:27 Gothmog_ And what is /usr/lib/perl5/current/i686-li​nux-thread-multi/IO/Socket.pm, then? :P
09:27 Blwood by the way if you want to work with sockets perl6 has some built-in functions
09:28 Daenyth` hmm
09:28 Daenyth` I'll look into those too then
09:28 Daenyth` Gothmog_: err.. >.>
09:28 Blwood you have some examples in pugs/examples/network/
09:28 Daenyth` except now it's using perl5's strict.pm
09:28 Daenyth` hmm
09:28 Daenyth` fun stuff
09:29 Gothmog_ Pugs does not parse and run Perl5 by itself, but uses perl5...
09:29 Blwood another think but not sure I think than perl6 uses strict pragma
09:29 Gothmog_ afaik
09:30 Gothmog_ strict is on by default in Perl6.
09:30 Blwood :)
09:30 Gothmog_ Except in the command line, that is.
09:30 Daenyth` yes
09:30 Blwood Gothmog_, any idea about my Class { } problem :o ?
09:31 Daenyth` wow, the built in socket functions look nice :3
09:31 Daenyth` Blwood: thanks
09:31 Blwood have a look at http://perlcabal.org/syn/S16.html and the examples in the directory :)
09:31 lambdabot Title: S16
09:32 Daenyth` Is it ok to have a method connect in my class?
09:32 Blwood I think no
09:32 Gothmog_ Why not?
09:32 Blwood cause there's already a connect() function
09:32 Daenyth` Gothmog_: because there is a connect() builtin
09:33 Gothmog_ So, don't define a sub, but a method.
09:33 Gothmog_ So you call $yourobject.connect()
09:33 Daenyth` oh ok
09:33 Daenyth` that's what I intended to do in the first place
09:33 Daenyth` lol
09:33 Gothmog_ And it is not ambigous.
09:33 Gothmog_ +u
09:33 Daenyth` I think I'll just name it newconn() for better human-readability
09:34 bsb joined #perl6
09:34 Gothmog_ I would prefer connect.
09:37 Daenyth` Do I need to "connect() or die", or will the exception system handle that for me, assuming I don't provide any CATCH blocks?
09:37 Gothmog_ Blwood: What's the problem? self.drink() should work fine, afaik.
09:39 Blwood when I try self.drink in my class I have a bif error " *** Undeclared variable: ("$__SELF__",MkPad (p ..." :(
09:39 Blwood big*
09:39 Gothmog_ Daenyth`: If an exception is thrown and you don't catch it, I suppose that your program will die. But that may depend on the type of exception... read the synopsis, I don't know exactly.
09:39 Daenyth` alright
09:39 Daenyth` I'm also using fatal;, so that will probably force it
09:43 pasteling "Blwood" at 81.247.186.228 pasted "Error with self.drink" (17 lines, 3K) at http://sial.org/pbot/26689
09:47 pasteling "Daenyth" at 24.91.13.73 pasted "Ambiguous error message" (69 lines, 1.4K) at http://sial.org/pbot/26691
09:49 Daenyth` Is it breaking because of the way I'm setting $.socket?
09:51 ruoso joined #perl6
09:52 Gothmog_ I'm not sure about that, but you're using hashes the wrong way. It's %hash<foo>, not %hash{foo}.
09:52 Gothmog_ gtg
09:52 Daenyth` ah
09:52 Gothmog_ Bye!
09:52 Daenyth` that could be it
09:52 Daenyth` thanks for the help
09:52 Gothmog_ np
09:52 Blwood both are correct I think
09:53 Blwood < > is just a qw like
09:53 Daenyth` hmm
09:53 Daenyth` nope, same error
09:53 Daenyth` hrm
09:53 Blwood try True instead of true ?
09:54 Daenyth` ahh
09:54 Daenyth` that made the error go away
09:54 Daenyth` now to the next one :)
09:54 chris2 joined #perl6
09:55 Blwood btw why quote $.socket = connect( "$.server", $.port ); ? :o
09:55 Blwood connect($.server, $.port) works fine
09:55 Daenyth` err
09:55 Daenyth` don't I want a filehandle for it?
09:56 Blwood yeah but you don't have to quote $.server
09:56 Daenyth` or something
09:56 Daenyth` I'm not sure
09:56 Daenyth` oh
09:56 Daenyth` habit
09:56 Daenyth` passing a string as a parameter I always quote it
09:57 dwave joined #perl6
09:57 Daenyth` it also occurs to me that the $bot.readline wouldn't work, because $bot itself isn't a filehandle
09:58 Daenyth` What's the right way to refer to $.socket?
09:58 Blwood $bot is an object not a filehandle
09:59 Daenyth` yes
10:00 Daenyth` but $bot's $.socket is
10:00 Daenyth` What's the right way to refer to it
10:00 Blwood while my $line = readline($.socket)
10:01 Daenyth` how would that work with multiple instances of the class?
10:02 Daenyth` that while loop will eventually be put inside the class {}, but for right now I just want to try and get what I have working
10:02 Daenyth` well, connected at any rate
10:02 Daenyth` lol
10:02 Blwood Well I am not sure, but when you do $bot.readline it is supposed that readline is a method of your object. Maybe you can write a method that return de filehandle and then readline it : / ?
10:03 Blwood the*
10:03 Daenyth` yeah..
10:03 Daenyth` I'm sure there's another way to do it... oh well. My first implementation doesn't have to be stylistically perfect :P
10:04 Blwood yeah I think there's another way to do it too :(.
10:05 Blwood I have also some problems with class in perl6 (self.method ...) so I am not the best person that can help you :s.
10:05 Daenyth` method readline ($sock = $.socket) {
10:05 Daenyth` return readline( $sock );
10:05 Daenyth` }
10:05 Daenyth` that should do it
10:05 Blwood yeah
10:05 Blwood but why not :
10:05 Blwood method readline {
10:05 Blwood return readline( $.socket );
10:05 Blwood }
10:06 Daenyth` in case I want to specify a filehandle other than $.socket
10:06 Blwood ah okay
10:06 Daenyth` eventually it will have more than one
10:06 Daenyth` I'm trying to plan for it now
10:06 Daenyth` ;)
10:10 Daenyth` print $sock "$message\d015\d012"; keeps making it barf
10:10 Daenyth` I can't figure out why
10:10 Linux\2 joined #perl6
10:11 wolverian print $sock: ...; # if this is perl 6 :)
10:11 Daenyth` ahh
10:11 Daenyth` thanks :)
10:11 IllvilJa joined #perl6
10:12 Daenyth` that was it
10:12 Daenyth` very non-useful error messages on it
10:12 bsb left #perl6
10:15 pasteling "Daenyth" at 24.91.13.73 pasted "*** Missing invocant parameters in '&Crapbot::connect': 0 received, 1 missing" (65 lines, 1.3K) at http://sial.org/pbot/26692
10:16 Daenyth` I'm sure it's something silly again
10:16 Blwood yeah connect() is a built-in function.
10:17 Blwood rename it and it'll work
10:17 Daenyth` you think..?
10:17 Daenyth` I'll try it
10:17 wolverian huh. it should work anyway.
10:17 Daenyth` hmm
10:18 Daenyth` I changed the name and now I get a differant error\
10:18 Gothmog_ Missing invocant is a useful error message, isn't it?
10:18 Daenyth` *** getHostByName: does not exist (no such host entry)
10:18 wolverian but, yes, it's apparently resolving connect() to the method, which is wrong
10:18 Daenyth` maybe If I did &Main::connect?
10:18 Daenyth` or somesuch
10:18 wolverian or something like that, yeah
10:18 Daenyth` is that the correct syntax?
10:18 wolverian it's a pugsbug, feel free to add a test for it
10:19 Daenyth` I don't know how
10:19 wolverian do you have commitbit?
10:19 Daenyth` no
10:19 Daenyth` I'm new to perl6
10:20 Daenyth` I also wouldn't know how to write a test for it
10:20 Blwood bbl (lunch :o)
10:22 Daenyth` *** getHostByName: does not exist (no such host entry) <<-- now what does this mean..? I know the address is valid
10:25 Daenyth` !ping
10:25 devbot6 pong
10:31 Daenyth` it also fails when I specify the ip address
10:38 didie_p6 joined #perl6
10:38 Daenyth` hi
10:38 didie_p6 Hello Daenyth` from a perl 6 irc bot
10:38 Daenyth` hrm
10:42 Blwood Daenyth`, so you resolved the problem ?
10:42 Daenyth` nope
10:42 Daenyth` that was differant code, from examples/
10:42 Daenyth` I'm trying to figure out where my glitch is
10:43 Blwood mm
10:43 Blwood when you dump $.server you can see that it's empty
10:44 Blwood try my $bot = Crapbot.new( nick => Crapbot, server=>%botconfig<server> ...
10:44 Daenyth` I was about to say, yeah
10:44 Blwood it should work now
10:44 Daenyth` but it should be setting it by default if I don't specify...
10:45 Daenyth` unless I misunderstand?
10:46 Blwood mm
10:46 Blwood you have to declare your hash in the class maybe ?
10:46 Daenyth` ok, well now it "runs"
10:46 Daenyth` hmm
10:46 Daenyth` could be scope..
10:47 Daenyth` I wish we had warnings.pm :/
10:47 Blwood yeah
10:47 Blwood I think if you declare your hash in the class it should work
10:47 Daenyth` well..
10:47 Daenyth` hmm
10:47 Daenyth` yeah
10:48 Daenyth` I'll fiddle with it I suppose
10:48 Daenyth` well, here's one wierd thing
10:48 Daenyth` oh..
10:48 Daenyth` hmm
10:48 Daenyth` hang on
10:49 agentzh_ joined #perl6
10:49 Daenyth` yeah, that's it
10:51 Daenyth` ok
10:51 Daenyth` it's not setting them even with the hash inside
10:51 Daenyth` I think it's another bug maybe
10:51 Daenyth` hmm
10:52 Daenyth` inside the class it just doesn't see any of those
10:52 Blwood :s
10:53 Daenyth` as far as I can tell anyway
10:53 Daenyth` well, for now I can specify things...
10:53 Blwood yeah I see that too
10:53 Blwood weird
10:54 Daenyth` has $.umodes is rw = %botconfig{'umodes'}; is the right syntax?
10:55 Daenyth` I mean.. should be
10:56 wolverian %botconfig<umodes> would work too, but yes, I think that should work.
10:56 Gothmog_ I don't think that {'umodes'} is a valid hash subscript, but <umodes> is.
10:56 Blwood yeah %botconfig{'umodes'} is ok, but <umodes> is better
10:57 Blwood how the eval bot work :s ?
10:57 Blwood works*
10:57 Daenyth` pretty simple really
10:57 Blwood ?eval
10:57 Daenyth` oh, you mean how do you use it
10:57 Daenyth` lol
10:57 Blwood yeah I know now :p
10:57 Daenyth` ?eval: foo
10:57 Daenyth` eval: foo
10:57 buubot Daenyth`:  foo
10:57 pugsbot_r17185 Error: ␤Unexpected ": foo"␤expecting "::"
10:59 Gothmog_ ?eval say "Hello, world"
10:59 Daenyth` is the perl6.vim file wrong?
10:59 pugsbot_r17185 OUTPUT[Hello, world␤] Bool::True
10:59 Daenyth` it highlights "wait" and not "sleep"
10:59 Daenyth` but pugs tells me wait isn't a command
10:59 Blwood ?eval my %hash = (a => "bla", b => "bli"); say %hash{'b'};
10:59 pugsbot_r17185 OUTPUT[bli␤] Bool::True
11:02 Daenyth` ?eval my %hash = (foo => 'bar'); class baz { $.quoz = %foo<bar>; method quux { say $.quoz; } } baz.new; baz.quux
11:03 pugsbot_r17185 Error: ␤Unexpected "<bar"␤expecting "::"␤Variable "%foo" requires predeclaration or explicit package name
11:03 Daenyth` ok, why does this give me an error when my pugs was silent
11:03 Daenyth` oh wait
11:03 Daenyth` ?eval my %hash = (foo => 'bar'); class baz { $.quoz = %hash<foo>; method quux { say $.quoz; } } baz.new; baz.quux
11:03 pugsbot_r17185 Error: No such method in class Scalar: "&quoz"
11:04 Daenyth` ?eval my %hash = (foo => 'bar'); class baz { has $.quoz = %hash<foo>; method quux { say $.quoz; } } baz.new; baz.quux
11:04 pugsbot_r17185 Error: Class prototype occured where its instance object expected: baz
11:04 Daenyth` ?eval my %hash = (foo => 'bar'); class baz { has $.quoz = %hash<foo>; method quux { say $.quoz; } } my $quuux = baz.new; $quuux.quux
11:04 pugsbot_r17185 OUTPUT[␤] Bool::True
11:04 Daenyth` but null string
11:04 Daenyth` >.< took me long enough...
11:05 Blwood no clue :(
11:05 Daenyth` It's one of two things
11:05 Daenyth` it's either an unintended bug in pugs, or it's intentionally out of scope at assignment time
11:06 Daenyth` I think it's a bug
11:09 Daenyth` ok well
11:09 Daenyth` I'm done for tonight
11:09 Blwood tonight ?
11:10 Blwood it's 1:08pm in my country :)
11:10 Daenyth` 7 am here
11:10 Daenyth` >.>
11:10 Daenyth` bedtime
11:10 Daenyth` gnight
11:10 Blwood lol
11:10 Blwood good night
11:16 Aankhen`` joined #perl6
11:28 lambdabot joined #perl6
11:30 nipotan changed the nick to nipotaway
12:07 Azure-BOT joined #perl6
12:24 daxim_ joined #perl6
12:25 daxim_ changed the nick to daxim
12:34 HiTech69 joined #perl6
12:38 ron__ joined #perl6
12:47 DarkWolf84 joined #perl6
12:49 iblechbot joined #perl6
13:01 cognominal_ joined #perl6
13:02 cognominal_ left #perl6
13:03 cognominal_ joined #perl6
13:03 stevan_ joined #perl6
13:09 Shillo joined #perl6
13:09 Shillo Hi all
13:20 diakopter Shillo: hi
13:22 Shillo Nice. Someone's awake. :)
13:27 jhorwitz joined #perl6
13:27 Blwood hi :)
13:32 DarkWolf84 hi
13:37 TJCRI joined #perl6
13:39 Shillo Hey
13:47 nperez joined #perl6
13:49 Southen joined #perl6
13:51 cognominal_ joined #perl6
13:51 DarkWolf84 :)
13:56 tlb joined #perl6
14:07 kanru joined #perl6
14:11 hkb_aw changed the nick to hakobe
14:18 thepler joined #perl6
14:18 drupek12 joined #perl6
14:21 drupek12 joined #perl6
14:29 fridim joined #perl6
14:29 fridim hi
14:37 devogon joined #perl6
14:39 [particle1 hello
14:39 [particle1 changed the nick to [particle]
14:39 fglock joined #perl6
15:05 buetow joined #perl6
15:25 moritz_ hi
15:30 diakopter moritz: I committed those evalbot changes
15:30 moritz_ diakopter: thanks, I saw it...
15:30 moritz_ diakopter: sadly they don't fix the problem for me :(
15:31 vel joined #perl6
15:31 moritz_ still the same error message about Invalid username [n=<SubBloc]
15:34 diakopter which irc network are you connecting to
15:34 moritz_ freenode
15:34 TimToady ?eval constant %hash = (foo => 'bar'); class baz { has $.quoz = %hash<foo>; method quux { say $.quoz; } } my $quuux = baz.new; $quuux.quux
15:34 pugsbot_r17185 OUTPUT[bar␤] Bool::True
15:35 moritz_ now I try irc.perl.org
15:36 moritz_ same error
15:37 TimToady @tell Daenyth` the problem is that the assignment to the hash happens after the class is parsed and so when the class is being parsed %hash<foo> isn't found.  Changing "my" to "constant" fixes it because it makes the initialization of the hash happen at compile time.
15:37 lambdabot Consider it noted.
15:38 Linux\2 hi
15:39 moritz_ hi Linux\2
15:39 TimToady @tell Daenyth` but arguably it's a bug because the pseudoassignment to the has is supposed to capture a closure.  that's not really pugs's fault though, because the spec used to be wrong there.
15:39 lambdabot Consider it noted.
15:40 Linux\2 ah, moritz_ :D
15:41 diakopter moritz: what command line are you trying
15:41 moritz_ diakopter: pugs evalbot.pl pugseval irc.perl.org:6667
15:45 diakopter moritz_: try   pugs evalbot.pl pugseval irc.freenode.net 900
15:45 Blwood Does someone know how to call a method inside a class :( ? http://sial.org/pbot/26689
15:45 lambdabot Title: Paste #26689 from "Blwood" at 81.247.186.228
15:46 moritz_ Blwood: the problem is that self points to an instance if you are inside a method...
15:47 moritz_ Blwood: but you haven't created an instance yet
15:47 Blwood moritz_, what do you mean with instance ?
15:47 moritz_ ?eval class Drinker { has $.name; method drink {say "$.name drinks"}}; my $d = Drinker.new; $d.name="Simon"; $d.drink()
15:47 pugsbot_r17185 OUTPUT[Simon drinks␤] Bool::True
15:47 Blwood ah yes
15:48 Blwood but it's not possible to use a method in the class itself ?
15:48 moritz_ there is, but it can't use self (afaict), and no member variables
15:49 Blwood and how can I do that :) ?
15:49 moritz_ ?class foo { our $count = 1; our sub s { say $count++ }} foo.s()
15:49 lambdabot Unknown command, try @list
15:49 diakopter moritz_: try   pugs evalbot.pl pugseval irc.freenode.net 900 '#perl6'
15:49 moritz_ ?eval class foo { our $count = 1; our sub s { say $count++ }} foo.s()
15:49 pugsbot_r17185 OUTPUT[0␤] Bool::True
15:50 moritz_ diakopter: trying...
15:50 moritz_ Blwood: if you call them 'has' and 'method', they are tied to an instance (= object)
15:50 moritz_ Blwood: there's more (and more accurate) information in S12
15:51 moritz_ diakopter: same result :(
15:51 Blwood moritz_, okay thanks for help. I'll try
15:51 diakopter moritz_: can you nopaste it again?
15:52 pasteling "moritz_" at 84.148.46.253 pasted "evalbot won't connect" (15 lines, 1K) at http://sial.org/pbot/26693
15:53 moritz_ Blwood: if the synopsis is too heavy stuff for the start, you could look into t/oo/ for examples
15:54 Blwood moritz_, good idea, I'll have a look, thank you :)
15:55 moritz_ today I had nothing to do at $work (for one, two hours or so), so I started to translate S05
15:55 moritz_ I got as far as the first 8% or something
15:56 TimToady ?eval class foo { my $count = 1; method s { say $count++ } }; foo.s; foo.s
15:56 pugsbot_r17185 OUTPUT[0␤1␤] Bool::True
15:56 TimToady no problem
15:56 moritz_ what was my problem? using our instead of my?
15:56 [particle] why is $count zero?
15:57 diakopter moritz: are you sure evalbot.pl is identical to what's in the pugs repo?
15:57 vel joined #perl6
15:57 moritz_ diakopter: I changed the default hostname I think
15:57 TimToady not using "method" when you mean method
15:57 diakopter svn diff?
15:57 moritz_ diakopter: I reverted it, now trying again
15:58 Blwood TimToady, yeah but I want to call the method s inside the class
15:58 TimToady a method that doesn't look at instance attributes is semantically a class method
15:59 TimToady Blwood: $.s should work for that
15:59 TimToady or self.s
15:59 TimToady oh way, not instance
15:59 TimToady then foo.s
15:59 TimToady or $?CLASS.s maybe
16:00 moritz_ diakopter: svn revert doesn't change anything
16:00 TimToady hmm, maybe ::?Class.s
16:00 moritz_ diakopter: I mean regarding the output/behaviour
16:00 TimToady not sure what pugs implements there
16:00 diakopter moritz: what r is your pugs?
16:00 * Linux\2 runs after TimToady to get a signed book :P
16:01 moritz_ diakopter: r17098
16:01 spinclad 'wot r ur pugs?'
16:01 moritz_ diakopter: should I compile a newer one?
16:01 TimToady ?eval class foo { my $count = 1; method s { say $count++ }; ::?CLASS.s }
16:01 pugsbot_r17185 OUTPUT[0␤] Bool::True
16:01 TimToady ?eval class foo { my $count = 1; method s { say $count++ }; ::?CLASS.s; ::?CLASS.s }
16:01 pugsbot_r17185 OUTPUT[0␤1␤] Bool::True
16:01 TimToady ?eval class foo { my $count = 1; method s { say $count++ }; $.s; $.s }
16:02 pugsbot_r17185 OUTPUT[0␤1␤] \Bool::True
16:02 diakopter moritz: yeah, I'd try that... but I didn't think this workaround introduced any regressions...
16:02 [particle] a reference to Bool::True?
16:02 spinclad odd that it starts at 0.  is {1} evaled too late here too?
16:02 moritz_ spinclad: probably
16:02 TimToady ?eval class foo { my $count = 1; method s { say $count++ }; say self }
16:02 pugsbot_r17185 OUTPUT[␤] Bool::True
16:03 TimToady hmm, should start at 1
16:03 spinclad ?eval class foo { my $count = 1; method s { say $count++ }; say self.s }
16:03 pugsbot_r17185 OUTPUT[0␤1␤] Bool::True
16:04 spinclad huh.  0 _and_ 1 ?
16:04 TimToady o_O
16:04 spinclad ?eval class foo { my $count = 1; method s { say $count++ }; say self.s; say self.s }
16:04 pugsbot_r17185 OUTPUT[0␤1␤1␤1␤] Bool::True
16:05 moritz_ spinclad: s returns and says $count(++)
16:05 spinclad ROFL
16:05 TimToady say inside the method
16:05 spinclad silly me
16:05 moritz_ spinclad: if you say s, and s say's again...
16:05 diakopter ?eval my $count; class foo { $count = 1; method s { say ++$count }; say self.s }
16:05 pugsbot_r17185 OUTPUT[2␤1␤] Bool::True
16:06 TimToady something's screwy with the class scope, I guess
16:06 spinclad say returns 1 always...
16:06 TimToady well, that's venturing on MO-land, so maybe it will fix automatically at some point
16:06 spinclad so the 2 is right this time
16:07 TimToady yes, I think
16:07 diakopter ?eval my $count; class foo { $count = 1; method s { ++$count and $count.say }; say self.s }
16:07 pugsbot_r17185 OUTPUT[2␤1␤] Bool::True
16:08 TimToady pseuod-assignment to my should happen pretty much identically to a real assignment
16:08 TimToady so maybe something's up with scoping
16:09 spinclad ?eval my $count; say $count++
16:09 pugsbot_r17185 OUTPUT[0␤] Bool::True
16:09 TimToady ?eval my $count = 1; say $count++
16:09 drupek12 joined #perl6
16:09 pugsbot_r17185 OUTPUT[1␤] Bool::True
16:10 spinclad at any rate that's wherefrom the 0
16:10 TimToady maybe pugs used to treat "my" as a class attribute declaration, and puts it in the "wrong" place.
16:11 TimToady spinclad: except there's "= 1' in there that is getting ignored
16:11 diakopter ?eval my $count; class foo { $count = 1; method s { $count = 5 and "hu$count".say }; say "hi"~self.s ; say "ho$count"; }
16:11 TimToady possibly assigning it to the wrong place because of old spec damange
16:12 pugsbot_r17185 OUTPUT[hu5␤hi1␤ho5␤] Bool::True
16:12 TimToady *damage
16:12 spinclad right, i just meant that once it's ignored, the ++ gives 0.
16:12 TimToady *nod*
16:16 TimToady ?eval class foo { say self.HOW }
16:16 diakopter post/pre ++ really is always returning '1'
16:16 pugsbot_r17185 OUTPUT[<obj:Class>␤] Bool::True
16:16 moritz_ ?eval my $a=5; $a++
16:16 pugsbot_r17185 5
16:16 moritz_ ?eval my $a=5; ++$a
16:16 pugsbot_r17185 6
16:16 TimToady ?eval class foo { say self.WHAT }
16:16 pugsbot_r17185 OUTPUT[Scalar␤] Bool::True
16:17 TimToady that's bogus
16:18 diakopter ?eval class foo { my $count = 2; method s { $count = 5; "hu $count ".say }; say "hi "~self.s~" "; say "ho $count "; }
16:18 pugsbot_r17185 OUTPUT[hu 5 ␤hi 1 ␤ho 2 ␤] Bool::True
16:18 diakopter weird
16:18 Gothmog_ "hi" is followed by the return value of say, diakopter
16:18 diakopter right, oh
16:19 spinclad why did $count revert to 2?
16:20 spinclad (difference from last time: placement of 'my')
16:21 TimToady looks like the $count inside the method is a different $count maybe
16:21 spinclad ah: because the ' = 2' got evaled late?
16:21 TimToady ?eval class foo { my $count = 2; method s { say $count }; self.s }
16:22 pugsbot_r17185 OUTPUT[␤] Bool::True
16:22 TimToady spinclad: that could also be the case
16:22 TimToady ?eval class foo { my $count = 2; method s { say $count }; self.s }; self.s
16:22 pugsbot_r17185 OUTPUT[␤] Error: No such method in class Scalar: "&s"
16:22 spinclad ?eval class foo { method s { say $count }; self.s }
16:22 pugsbot_r17185 Error: ␤Unexpected " };"␤expecting "::"␤Variable "$count" requires predeclaration or explicit package name
16:22 TimToady ?eval class foo { my $count = 2; method s { say $count }; self.s }; foo.s
16:23 pugsbot_r17185 OUTPUT[␤␤] Bool::True
16:23 TimToady no, not just late; must be the wrong $count
16:24 spinclad but without the 'my ...' it complains...
16:24 spinclad ?eval class foo { my $count = 2; method s { say $count }; self.s }
16:24 pugsbot_r17185 OUTPUT[␤] Bool::True
16:24 spinclad ?eval class foo { method s { say $count }; self.s }
16:24 daxim joined #perl6
16:24 pugsbot_r17185 Error: ␤Unexpected " };"␤expecting "::"␤Variable "$count" requires predeclaration or explicit package name
16:25 TimToady ?eval class foo { our $count = 2; method s { say $count }; self.s }; foo.s
16:25 pugsbot_r17185 OUTPUT[␤␤] Bool::True
16:26 spinclad the method's view of $count is early...
16:26 TimToady ?eval class foo { our $count; $count = 2; method s { say $count }; self.s }; foo.s
16:26 pugsbot_r17185 OUTPUT[␤␤] Bool::True
16:26 TimToady ?eval class foo { my $count; $count = 2; method s { say $count }; self.s }; foo.s
16:26 pugsbot_r17185 OUTPUT[␤␤] Bool::True
16:27 TimToady ?eval class foo { my $count; $count = 2; say $count.WHICH; method s { say $count.WHICH }; self.s }; foo.s
16:27 pugsbot_r17185 OUTPUT[2␤␤␤] Bool::True
16:28 TimToady ?eval class foo { my $count; $count = 2; say $count.WHERE; method s { say $count.WHERE }; self.s }; foo.s
16:28 pugsbot_r17185 Error: No such method in class Int: "&WHERE"
16:28 spinclad ?eval my $count; say $count.WHICH
16:28 pugsbot_r17185 OUTPUT[␤] Bool::True
16:29 spinclad ?eval my $count = undef; say $count.WHICH
16:29 pugsbot_r17185 OUTPUT[␤] Bool::True
16:29 spinclad ?eval class foo { my $count; $count = 2; say $count.WHAT; method s { say $count.WHAT }; self.s };  foo.s
16:29 pugsbot_r17185 OUTPUT[Int␤Scalar␤Scalar␤] Bool::True
16:30 spinclad ?eval my $count = undef; say $count.WHAT
16:30 pugsbot_r17185 OUTPUT[Scalar␤] Bool::True
16:30 spinclad bogon
16:31 spinclad well, not here, maybe; but the source of the bogon's identity
16:34 spinclad time for a source dive to catch a pugs bug
16:37 bloonix good evening
16:37 * Linux\2 shoots a paper ball at bloonixle
16:37 spinclad 'afternoon, bloonix
16:39 justatheory joined #perl6
16:39 bloonix :)
16:39 bloonix I have a problem
16:40 bloonix and cannot find a answer
16:40 Aankhen`` joined #perl6
16:41 bloonix I read different /proc files to collect statistics and I can read all files except some of /proc/sys/fs/...
16:41 pasteling "bloonix" at 87.78.223.119 pasted "system("cat /proc/sys/fs/file-" (12 lines, 186B) at http://sial.org/pbot/26700
16:44 moritz_ what's the semantics of file-nr?
16:44 moritz_ btw the p6ish way to read files is 'for =$fh -> $line { say $line }'
16:45 bloonix while my $line = $fh.readline works as well. is that bad?
16:46 moritz_ readline autochomps, so the loop will exit at empty lines
16:46 * moritz_ once fell into that trap
16:46 bloonix moritz_: the same result with your example
16:46 moritz_ pugs -e 'my $f="/proc/sys/fs/file-nr"; for =$f -> $a { say $a }'
16:46 moritz_ 2249    0       50119
16:46 bloonix it read just the first number
16:46 moritz_ funny
16:47 bloonix but I need all 3 columns
16:47 bloonix if I read /proc/uptime, /proc/stat or other files I have no problem
16:48 moritz_ if I just iterate over the file name, I get the desired result
16:49 moritz_ opening it as a file doesn't work :(
16:49 bloonix moritz_: how do you do it?
16:49 moritz_ 18:46 < moritz_> pugs -e 'my $f="/proc/sys/fs/file-nr"; for =$f -> $a { say $a  }'
16:49 moritz_ 18:46 < moritz_> 2249    0       50119
16:49 bloonix maybe its a workaround for me until it works
16:49 bloonix I test this and it doesnt work
16:50 bloonix ah
16:50 bloonix without open() ?
16:51 moritz_ aye
16:52 weinig joined #perl6
16:53 [particle] hrmm, would `cat` be something like =(@?ARGS>>.glob).say ?
16:54 bloonix I just use cat to show how file-nr looks
16:54 [particle] yes, i'm thinking about a platform-independent cat written in perl 6. it's not directly related to your question.
16:54 spinclad well, it's the shell doing the globbing
16:54 [particle] NOT ALL SHELLS GLOB :P
16:55 moritz_ [particle]: all good shells do ;)
16:55 spinclad true.  does your cat do the globbing then?
16:55 [particle] yes, but we have perl because not all shells are good.
16:55 moritz_ [particle]: but on unix it's wrong to do "manual" globbing
16:55 [particle] why is it wrong? will it double-glob?
16:55 moritz_ at least if you have files containt *, ? etc.
16:55 [particle] ick.
16:56 [particle] okay, so a unix way to do cat would be =(@?ARGS).say ??
16:56 spinclad think so
16:56 [particle] er, make that >>.
16:57 moritz_ or just .say for =<>;
16:57 [particle] how might you conditionally call a method?
16:57 moritz_ [particle]: with 'if'?
16:57 [particle] oh, nicer. i wonder if the fish will glob for you on windows
16:58 moritz_ we should assume that, yes ;)
16:58 moritz_ s/assume/spec/ ;-)
16:58 [particle] the equivalent doesn't on perl 5
16:58 moritz_ hrm
16:58 [particle] i mean, you still need to test the os
17:00 moritz_ I don't do any coding under windows... do you usually filter @ARGV through glob?
17:00 [particle] it's like if (@ARGV) { @what = ($^O eq 'MSWin32') ? <@ARGV> : @ARGV; ... }
17:02 [particle] is there a noop method i can call?
17:02 spinclad i might consult POSIX on what a shell should do, and follow that, and infuriate users of toy OS's like $MS
17:03 diakopter ?eval my $c = 5; class foo { method c { $c } method s { $.c++; return $.c } $.s; } say foo.new.s;
17:03 pugsbot_r17185 OUTPUT[7␤] Bool::True
17:03 [particle] =(@?ARGS>>.{$?OS eq 'MSWin32' ? glob : noop)>>.say
17:03 [particle] =(@?ARGS>>.{$?OS eq 'MSWin32' ? glob : noop})>>.say #oops
17:04 spinclad can't you use different shells under the same $?OS ?
17:04 [particle] yes, on unix.
17:05 [particle] or cygwin, etc.
17:05 diakopter check this out:
17:05 diakopter ?eval class foo { my $c = 5; method c { $c } method s { $.c++; return $.c } $.s; } say foo.new.s; say foo.new.c; say foo.new.s; say foo.new.c;
17:05 pugsbot_r17185 OUTPUT[2␤2␤3␤3␤] Bool::True
17:05 [particle] i don't know of a globbing shell on mswin32
17:05 PerlJam pasteling: bash  :-)
17:06 diakopter either foo.new gets reused, or $c escapes foo...?
17:06 spinclad [particle]: bash
17:06 [particle] bash on windows native? never heard of it.
17:06 Gothmog_ I don't think that cat should glob, independent of the OS.
17:06 diakopter or 'class' does not get its own scope.
17:07 Gothmog_ cygwin is native, isn't it?
17:07 spinclad (bash): would need a few shims...
17:07 weinig_ joined #perl6
17:07 [particle] no, cygwin reports $^O eq 'cygwin'
17:07 [particle] it's a different platform
17:07 Gothmog_ Hrm.
17:07 moritz_ what about that "new" windows power shell?
17:08 moritz_ iirc that's a .net thingy
17:08 [particle] i don't know about 'monad'
17:08 moritz_ does this glob?
17:08 diakopter TimToady: any ideas on the ?eval above?
17:09 spinclad ?eval class foo { my $c = 5; method c { $c } method s { $.c++; return $.c } $.s; } say foo.new.s;  say foo.new.c; say foo.new.s; say foo.new.c;
17:09 pugsbot_r17185 OUTPUT[2␤2␤3␤3␤] Bool::True
17:09 diakopter spinclad: see, the 5 is not used at all...
17:10 diakopter or...
17:10 spinclad ?eval class foo { has $.c = 5; method d { $.c } method s { $.d++; return $.d } $.s; } say foo.new.s;  say foo.new.d; say foo.new.s; say foo.new.d;
17:10 pugsbot_r17185 OUTPUT[6␤5␤6␤5␤] Bool::True
17:10 moritz_ ?eval class foo {my $c = 3; say $c }
17:10 pugsbot_r17185 OUTPUT[3␤] Bool::True
17:10 moritz_ that's correct, I think
17:11 spinclad diakopter: right, we found out earlier that, inside method, it doesn't see the '= 5' part of the my
17:11 diakopter a class's block gets executed both at declaration and at .new() ?
17:12 spinclad it looks to me like the my gets half-cloned or something at the method boundary
17:12 spinclad pugsbug
17:13 moritz_ ?eval class foo { my $c; say $c; }; foo.new
17:13 pugsbot_r17185 OUTPUT[␤] foo.new()
17:13 moritz_ ?eval class foo { my $c = 3; say $c; }; foo.new
17:13 pugsbot_r17185 OUTPUT[3␤] foo.new()
17:13 moritz_ diakopter: only at declaration time
17:13 moritz_ diakopter: which is the instatantiation time of the metaclass
17:13 spinclad ?eval class foo { my $c = 3; method d { say $c } }; foo.new.d
17:13 pugsbot_r17185 OUTPUT[␤] Bool::True
17:13 spinclad same as
17:14 spinclad ?eval class foo { my $c = undef; method d { say $c } }; foo.new.d
17:14 pugsbot_r17185 OUTPUT[␤] Bool::True
17:16 spinclad ?eval class foo { has $.c = 5; method d { $.c } method s { $.c++; return $.c } $.s; } say foo.new.s;  say foo.new.d; say foo.new.s; say foo.new.d;
17:16 pugsbot_r17185 OUTPUT[6␤5␤6␤5␤] Bool::True
17:16 diakopter (which seems right)
17:16 spinclad right
17:17 spinclad bug for my or our, not has
17:17 spinclad ?eval class foo { our $c = 5; method d { $.c } method s { $.c++; return $.c } $.s; } say foo.new.s;  say foo.new.d; say foo.new.s; say foo.new.d;
17:17 pugsbot_r17185 Error: No such method in class Scalar: "&c"
17:17 spinclad ?eval class foo { our $c = 5; method d { $c } method s { $.d++; return $.d } $.s; } say foo.new.s;  say foo.new.d; say foo.new.s; say foo.new.d;
17:17 pugsbot_r17185 OUTPUT[2␤2␤3␤3␤] Bool::True
17:18 [particle] joined #perl6
17:18 diakopter ?eval class foo { my $c; $c = 3; say $c; method s { $c = $c + 1; say "hi $c " } $.s } foo.new.s;
17:18 pugsbot_r17185 OUTPUT[3␤hi 1 ␤hi 2 ␤] Bool::True
17:18 diakopter ?eval my $c; class foo { $c = 3; say $c; method s { $c = $c + 1; say "hi $c " } $.s } foo.new.s;
17:18 pugsbot_r17185 OUTPUT[3␤hi 4 ␤hi 5 ␤] Bool::True
17:19 weinig joined #perl6
17:20 spinclad ?eval my $c = 3; class foo { say $c; method s { $c = $c + 1; say "hi $c " } $.s } foo.new.s;
17:20 pugsbot_r17185 OUTPUT[3␤hi 4 ␤hi 5 ␤] Bool::True
17:21 spinclad with $c coming from an outer scope, it's ok
17:21 diakopter spinclad: same for my last eval above... $c = 3 inside foo
17:22 diakopter 3,4,5
17:22 spinclad yes, the $c is still from an outer scope.
17:22 aman_ joined #perl6
17:28 bloonix hmmm
17:28 bloonix how could I do:
17:28 bloonix for (split /\s+/, <$fh>) in p6 ?
17:29 avar for split /\s+/, *$fh { ... } ?
17:30 Gothmog_ for =$fh>>.split(/\s+/) { ... } ?
17:30 bloonix for $fh.readline.split(rx/\s+/)
17:30 Gothmog_ Dunno, just guessing. :)
17:30 bloonix that runs
17:31 TimToady if you're splitting on whitespace you probably want .comb instead
17:31 bloonix $string.split.comb ?
17:31 bloonix or $string.comb?
17:31 TimToady $string.comb
17:31 bloonix *arg*
17:31 [particle] let's not split hairs
17:32 TimToady when you comb you comb *for* something rather than telling it what *not* to match
17:32 TimToady ?eval "  foo bar baz  ".comb
17:32 pugsbot_r17185 (Match.new(␤  ok => Bool::True, ␤  from => 2, ␤  to => 5, ␤  str => "foo", ␤  sub_pos => (), ␤  sub_named => {}␤), Match.new(␤  ok => Bool::True, ␤  from => 1, ␤  to => 4, ␤  str => "bar", ␤  sub_pos => (), ␤  sub_named => {}␤), Match.new(␤  ok => Bool::True, ␤  from => 1, ␤  to => 4, ␤  str => "baz", ␤  sub_pos => (), ␤  sub_named => {}␤))
17:33 spinclad .comb(<hair>) ?
17:33 spinclad .comb(/<hair>/) ?
17:33 bloonix what is equivalent with ${var} in p6 ?
17:33 TimToady @hair.comb(/<nits>/), more like
17:33 lambdabot Unknown command, try @list
17:34 spinclad that's one fine-toothed comb
17:34 [particle] well, usually when you're combing hair, you want the hair to remain
17:34 Gothmog_ ?eval "  foo bar baz  ".comb.perl.say
17:34 pugsbot_r17185 OUTPUT[(Match.new(␤  ok => Bool::True, ␤  from => 2, ␤  to => 5, ␤  str => "foo", ␤  sub_pos => (), ␤  sub_named => {}␤), Match.new(␤  ok => Bool::True, ␤  from => 1, ␤  to => 4, ␤  str => "bar", ␤  sub_pos => (), ␤  sub_named => {}␤), Match.new(␤  ok => Bool::True, ␤  from => 1, ␤  to => 4, ␤  str => "baz", ␤  sub_pos => (), ␤  sub_named => {}␤))␤] Bool::True
17:34 TimToady bloonix: how do you want to use it?
17:34 Gothmog_ Hrm.
17:34 TimToady do you mean "var" literally as an identifier?
17:34 bloonix p5: print "Hello ${var}iable"
17:34 bloonix $var is the variable
17:35 TimToady print "Hello {$var}iable
17:35 TimToady closures interpolate
17:37 diakopter [particle]: depends if you're using the comb to untangle or delouse....?
17:37 TimToady well, in Perl comb defaults to combing the words out of your hair.  :)
17:38 TimToady that is, default of .comb is .comb(/\S+/)
17:38 TimToady and it's really not terribly different from m:g/S+/
17:38 Gothmog_ ?eval my @a = <Hello world>; ">>{@a.join(", ")}<<".say
17:38 pugsbot_r17185 OUTPUT[>>Hello, world<<␤] Bool::True
17:38 [particle] .comb(/<ws>/)
17:39 [particle] grr, forgot the !
17:39 Gothmog_ ?eval .say for "foo bar baz".comb
17:39 pugsbot_r17185 OUTPUT[foo␤bar␤baz␤] undef
17:41 TimToady ?eval .say for "foo bar baz".comb(/\S/)
17:41 pugsbot_r17185 Error in perl5 regex: << [^\s] >> ␤'require' trapped by operation mask at (eval 26) line 1.␤␤Error in perl5 regex: << [^\s] >> ␤'require' trapped by operation mask at (eval 29) line 1.␤␤Error in perl5 regex: << [^\s] >> ␤'require' trapped by operation mask at (eval 32) line 1.␤␤Error in perl5 regex: << [^\s] >> ␤'require' trapped by operation mask at (eval 35) line 1.␤␤Error in perl5 regex: << [^\s] >> ␤'require' trapped
17:41 TimToady oh yeah, evalbot mislikes character classes still
17:42 TimToady problem is apparently that the P5 implementation needs to require files for Unicode support, and require is not considered a safe operation
17:43 TimToady ?eval .say for "foo bar baz".comb(/<!ws>/)
17:43 pugsbot_r17185 OUTPUT[␤␤␤␤␤␤] undef
17:44 bloonix sprintf('%i', 4 / 3) says:
17:44 TimToady ?eval .say for "foo bar baz".comb(/<!before <ws>>./)
17:44 bloonix pugs: Printf.printf: bad formatting char i
17:44 pugsbot_r17185 OUTPUT[f␤o␤o␤ ␤b␤a␤r␤ ␤b␤a␤z␤] undef
17:46 TimToady apparently Haskell doesn't support the %i synonym for %d
17:46 Gothmog_ ?eval .say for "foo bar baz".comb(/<alpha>/)
17:46 pugsbot_r17185 *** Cannot parse regex: <alpha>␤*** Error: ␤undef
17:46 TimToady or maybe it's a pugsbug
17:47 bloonix okay, it shouldnt be a problem to use %d
17:47 TimToady ?eval .say for "foo bar baz".comb(rx:P5/[a-zA-Z]/)
17:47 Psyche^ joined #perl6
17:47 pugsbot_r17185 OUTPUT[f␤o␤o␤b␤a␤r␤b␤a␤z␤] undef
17:47 TimToady ?eval .say for "foo bar baz".comb(rx:P5/[a-zA-Z]+/)
17:47 Gothmog_ Hum.
17:48 pugsbot_r17185 OUTPUT[foo␤bar␤baz␤] undef
17:48 Gothmog_ :)
17:48 TimToady ?eval .say for "foo bar baz".comb(rx:P5/[[:alpha:]]+/)
17:48 pugsbot_r17185 OUTPUT[foo␤bar␤baz␤] undef
17:49 TimToady ?eval .say for "foo bar baz".comb(rx:P5/\w+/)
17:49 pugsbot_r17185 OUTPUT[foo␤bar␤baz␤] undef
17:49 TimToady ?eval .say for "foo bar baz".comb(/\w+/)
17:49 pugsbot_r17185 Out of memory!
17:49 bloonix it seems that the modulo operator doesnt work :/
17:49 TimToady woot
17:49 bloonix ?eval 5 % 2
17:49 pugsbot_r17185 1
17:50 Gothmog_ Seems to work correctly. :)
17:50 bloonix ?eval my $x = 5; $x % 2
17:50 pugsbot_r17185 1
17:50 bloonix wtf
17:50 bloonix okay, my false
17:51 bloonix *** Can't modify constant item: VRef ...
17:51 bloonix I used ($s) instead of ($s is copy)
17:59 Psyche^ changed the nick to Patterner
18:03 dduncan joined #perl6
18:13 hakobe changed the nick to hkb_zz
18:16 IllvilJa joined #perl6
18:19 rindolf joined #perl6
18:26 cauchy joined #perl6
18:54 Tene I'm working on trimming down this segfault to an isolated test case...
18:54 Tene http://allalone.org/test.pl
18:56 Tene Before I go any more, can someone try running that and connecting to it to confirm that it segfaults on other systems?
18:56 Tene Oh, I could try on feather.
18:57 Tene Yeah, it segfaults when run on feather.
19:00 Blwood my $port = @ARGS[0] // 1370; ?
19:01 Blwood @ARGS[0] works :o ?
19:01 lambdabot Unknown command, try @list
19:01 Blwood I thought it was @*ARGS[0]
19:01 Tene Actually, looks like it still segfaults withotu all that socket stuff.
19:01 Tene updated version up
19:04 Aankhen`` joined #perl6
19:05 Tene ?eval my $thr = async { my $m = 'hello' ~~ m/h/; };
19:05 pugsbot_r17185 (no output)
19:06 Tene ?eval my $thr = async { my $m = 'hello' ~~ m/h/; say $m.perl };
19:06 pugsbot_r17185 (no output)
19:07 Tene Looks like that's all it is.
19:09 PerlJam Blwood: @ARGS is a short-hand for $*ARGS;  (The * is only there to signify that you really and truly do mean the global variable rather than some local variant)
19:09 PerlJam er, s/$*ARGS/@*ARGS/
19:13 TimToady Tene: you're probably getting interaction between threads and Perl 5
19:14 Tene TimToady: where does Perl 5 come into that example?
19:14 TimToady PerlJam: @ARGS should not work under strict, since failover from the current package to GLOBAL is not the default
19:15 TimToady pattern matching is done with PCR
19:15 Tene Ahh.
19:15 TimToady same reason evalbot gets upset about character classes
19:16 PerlJam TimToady: good to know.  These are the details I don't remember since I don't have a language compiler to remind me of them  :)
19:16 PerlJam TimToady: btw, are stricture and warnings both on by default?
19:17 TimToady supposed to be
19:17 Tene So, no pattern matching with threads?
19:17 PerlJam oh good.  
19:18 drrho joined #perl6
19:18 TimToady Tene: you might get away with :P5 matches if it uses pcre (not sure)
19:18 Tene :/
19:19 TimToady that's why I keep asking for someone to write a real regex engine in Haskell, but no takers so far...
19:20 [particle] anybody wanna convert pir to haskell?
19:20 TimToady would help greatly with the STD bootstrap as well...
19:20 TimToady just port parrot to haskell and you're done.  :)
19:20 [particle] you'll get pge for free :)
19:21 TimToady or haskell to parrot :)
19:21 moritz_ just do C in haskell ;)
19:21 diakopter TimToady: http://www.nondot.org/sabre/Projects/HaskellLexer/
19:21 lambdabot Title: The Haskell Dynamic Lexer Engine
19:21 diakopter by the creator of llvm, no less
19:29 diakopter that dynamic lexer might be helpful... obviously its Regex module is not complete enough to be 'real', but it could be a good start...
19:29 bloonix what happends on "for =$file" if $file is not IO ?
19:29 bloonix I dont understand it
19:30 bloonix my $file = '/foo/bar'; for =$file ... works, but why?
19:31 PerlJam bloonix: because that's what unary = is defined to do ?  :)
19:32 bloonix read from a handle?
19:32 TimToady = iterates an iterator.  the iterator for Str treats it as a filename, I think
19:32 bloonix but $file isnt a handle
19:32 daxim joined #perl6
19:33 PerlJam bloonix: I think you're getting hung up on one particular world view.
19:33 PerlJam bloonix: think MMD.
19:33 bloonix MMD? :)
19:34 moritz_ multi method dispatch
19:34 TimToady prefix:<=>($io) doesn't have to call the same function as prefix:<=>($string)
19:35 PerlJam heh ... it would be "interesting" to type variables based on their name.
19:35 PerlJam hungarian notation in the flesh!
19:35 bloonix the thing is that Im not able to readline from /proc/sys/fs/file-nr - as example - but Im not able to execute die() if "for =$file" doesnt works
19:36 bloonix I would like to work with "open() or ..."
19:36 moritz_ PerlJam: we do it all the time... if the name starts with a '@', it's an array ;)
19:36 bloonix is that a current bug?
19:36 PerlJam moritz_: heh.
19:37 TimToady open or should work fine, as long as you use the p6 syntax and not the p5 syntax
19:37 PerlJam moritz_: yeah, I was thinking more fortranish though.  
19:37 TimToady open in p6 returns the handle rather than taking it as the first arg
19:37 TimToady (doesn't have all the options of p5's open yet, either)
19:37 bloonix TimToady: but Im not able to read the file from the handle with "for =fh" because I get only the first sign
19:38 PerlJam my $io_thingy === my IO $thingy    # would be "interesting"  :)
19:38 TimToady =$fh
19:38 TimToady there are no bareword handles anymore
19:39 bloonix http://sial.org/pbot/26700
19:39 lambdabot Title: Paste #26700 from "bloonix" at 87.78.223.119
19:39 moritz_ TimToady: try pugs -e 'my $f = open("/proc/sys/fs/file-nr"); say =$f' on your platform
19:39 moritz_ TimToady: doesn't work for me as well
19:40 bloonix it reads only "6"
19:40 moritz_ it prints only the first char that head -n1 /proc/sys/fs/file-nr prints
19:41 bloonix some files works, some not
19:41 Daenyth` What is the correct way to refer to a class variable? If class foo { has $.bar; }, how would I refer to it?
19:41 lambdabot Daenyth`: You have 2 new messages. '/msg lambdabot @messages' to read them.
19:42 Daenyth` TimToady: thanks for clearing up my bug
19:42 moritz_ Daenyth`: I think it's foo.bar
19:42 Daenyth` I didn't know about the constant keyword :)
19:42 TimToady bloonix: looks like a bug
19:43 TimToady well, at least this works: pugs -e 'say "/proc/sys/fs/file-nr".slurp'
19:44 Daenyth` ?eval: class foo { has $.bar = 'baz'; } my $quoz = foo.new; say $quoz.bar
19:44 pugsbot_r17185 Error: ␤Unexpected ": class"␤expecting "::"
19:45 TimToady ?eval class foo { has $.bar = 'baz'; } my $quoz = foo.new; say $quoz.bar
19:45 pugsbot_r17185 OUTPUT[baz␤] Bool::True
19:45 Daenyth` oh
19:45 Daenyth` haha
19:46 TimToady Daenyth`: I wouldn't call that a class variable.  "has" declares instance attributes
19:46 moritz_ Daenyth`: if you want a _class_ variable, it's class foo { my $bar }
19:46 Daenyth` I'm not very good at OO.. I'm just starting to play with it now
19:46 Daenyth` Can you point me at something that would help clarify the difference?
19:47 moritz_ Daenyth`: read "Objekt Orient Software Construction" by Bertrand Meyer ;)
19:47 TimToady in general, I'd avoid class variables for now; you usually don't want them
19:47 Daenyth` so use has for now?
19:47 TimToady use objects as objects, not classes
19:48 Daenyth` I don't follow
19:48 TimToady a class describes a set of objects, not an object
19:48 Daenyth` I'm pretty sure that's what I want
19:48 TimToady without a new, there is no object
19:48 TimToady and, in fact, in Perl 6 there's no type "Class" per se
19:49 Daenyth` Oh by the way, last night I found what looks like a bug. I have no clue how to write a test for it though
19:50 Daenyth` if you define a class method with the same name as a builtin method, it won't work
19:50 Tene Daenyth`: explain more.
19:50 Daenyth` hang on and I'll pastebin my code
19:50 Daenyth` actually
19:50 Daenyth` you know what
19:50 TimToady I thought I sent messages about that through lambdabot...
19:51 Daenyth` let me try one thing, I may be wrong.. I had a bug that I didn't know about before when I got that error
19:51 Daenyth` TimToady: not that one
19:51 Daenyth` and thank you for the help on that
19:51 TimToady what, *another* bug!!!?!??!
19:51 TimToady how can that be?  :)
19:51 Daenyth` hmm strange
19:52 TimToady btw, easiest way to learn to write tests is to look at some that are already like the one you want
19:52 Daenyth` I tried using the constant thing you told me about, and it said undeclared variable
19:52 Daenyth` so it's still trying to figure out the class before the %botconfig
19:52 TimToady what version of pugs are you using?
19:52 Daenyth` sec
19:52 Daenyth` 6.2.13
19:52 TimToady which revision (the rXXXXX number)?
19:53 Daenyth` where do I find that
19:53 Daenyth` pugs --version doesn't say
19:53 TimToady then it's probably about 9 months out of date
19:53 Daenyth` aha
19:54 Daenyth` I think I might have done it through cpan.. not sure
19:54 Daenyth` lemme check
19:54 TimToady recommend you use the latest and greatest by checking out directly from http://svn.pugscode.org/pugs
19:54 Daenyth` I'll uninstall this version
19:55 TimToady we were going to turn a 6.28 release several months ago but audreyt got very sick and is still recovering
19:55 TimToady and you'll want a commit bit eventually
19:56 Daenyth` how would I remove something installed via cpan
19:56 TimToady you're the daenyth of that name at gmail?
19:56 Daenyth` yes
19:56 Daenyth` The one and only :P
19:56 Daenyth` Where have you seen me before?
19:57 TimToady google
19:58 Daenyth` ?
19:58 weinig joined #perl6
19:58 TimToady I googled for daenyth, and as you say, you're the one and only, so it was easy
19:58 Daenyth` aha
19:58 Daenyth` yeah
19:58 Daenyth` most the one and only...
19:58 Daenyth` mostly^
19:58 TimToady I'd mention you live in MA, but you'll think I'm a stalker...
19:59 Daenyth` It's information I've made no effort to hide
19:59 Daenyth` if it wasn't linked to my name you'd see it in my hostmask
19:59 TimToady do you prefer Daenyth or daenyth for your project handle?
19:59 Daenyth` Daenyth I suppose
20:00 Daenyth` I'm dissapointed about the uniqueness of my name though.. someone took it and used it on WoW
20:00 Daenyth` I suppose I can take that as flattery, but what's worse is someone also used my name in some slash-fic :/
20:01 Daenyth` that one is.. not cool
20:01 Casan joined #perl6
20:01 TimToady mail sent.  it's customary to add your name to AUTHORS as first checkin to make sure it all works right
20:01 TimToady welcome aboard
20:01 Daenyth` thanks
20:04 pjcj_ joined #perl6
20:08 Daenyth` so if I added pugs through cpan Perl6::pugs, how would I remove it?
20:08 rgs joined #perl6
20:08 devogon_ joined #perl6
20:09 DarkWolf84 !eval < a b c >
20:09 devbot6 DarkWolf84: Error: "eval" is not a valid command.
20:09 DarkWolf84 ! < a b c >
20:09 devbot6 DarkWolf84: Error: "<" is not a valid command.
20:09 DarkWolf84 ! < a b c >.say
20:09 devbot6 DarkWolf84: Error: "<" is not a valid command.
20:09 [particle] ?eval < this way >
20:09 DarkWolf84 hah
20:09 toly_ joined #perl6
20:09 SCalimlim joined #perl6
20:10 DarkWolf84 o yeah i forgot
20:10 integral joined #perl6
20:10 lidden joined #perl6
20:10 DarkWolf84 ?eval < a b c >
20:10 TimToady joined #perl6
20:10 JarJarBinks joined #perl6
20:10 awwaiid joined #perl6
20:10 DarkWolf84 ?eval < a b c >. say
20:10 DarkWolf84 ?eval < a b c >.say
20:11 DarkWolf84 not work
20:11 Daenyth` the bot got netsplit
20:12 TimToady I guess I'm back
20:13 DarkWolf84 will It be safe to innstall cvs version of pugs?
20:13 DarkWolf84 install*
20:13 TimToady where are you finding a cvs version of pugs?
20:13 TimToady pugs is natively svn
20:14 DarkWolf84 i mean svn
20:14 Daenyth` TimToady: if I installed pugs with cpan Perl6::pugs, how would I remove it?
20:14 TimToady we tend not to install currently
20:14 TimToady what kind of OS are you on?
20:14 Daenyth` archlinux
20:14 DarkWolf84 i'm on gentoo linux
20:15 rgs joined #perl6
20:15 TimToady I just make a symlink of pugs from /usr/bin into my build directory instead of installing
20:15 TimToady otherwise you're always running the wrong pugs...
20:16 Daenyth` mmm
20:16 REPLeffect joined #perl6
20:16 TimToady if you have the source directory, a "make uninstall" might work
20:16 Daenyth` alright..
20:16 Daenyth` lemme see if I do
20:16 Daenyth` where would cpan put that? I haven't had to remove anything from it before
20:17 TimToady otherwise go out and remove the bin/pugs lib/Pugs-6.2.13 (or rename)
20:17 TimToady probably in /usr/local
20:17 Daenyth` ok
20:17 TimToady but maybe in /usr
20:17 TimToady the locate or slocate might find them
20:18 Blwood joined #perl6
20:18 Daenyth` /root/.cpan it seems
20:18 Daenyth` alright
20:19 TimToady some CPAN packages are notably unsuccessful in uninstalling themselves...
20:19 TimToady don't know about this one
20:19 Daenyth` this one is also :|
20:19 Daenyth` so remove /usr/bin/pugs and /usr/lib/pugs-etc?
20:20 TimToady or Pugs-etc
20:20 Daenyth` yeah
20:20 TimToady then just compile a new one and run it from your build directory (or symlink it, as I said)
20:21 broquaint joined #perl6
20:21 Daenyth` yeah
20:21 Daenyth` alright
20:21 bcmb_ changed the nick to bcmb
20:21 Daenyth` so remove /usr/lib/perl6?
20:22 DarkWolf84 no evalbot :(
20:22 Blwood Is it possible to declare a method protected/public/private ?
20:22 TimToady don't know about that; mine only contains metamorph.pl
20:23 TimToady there is no protected
20:24 TimToady the syntax for private methods hides them from the outside world completely, so they're completely independent of public methods
20:24 bcmb Daenyth`: you can safely remove /usr/lib/perl6
20:24 Blwood and we declare them like this : method somethin is private ?
20:24 Daenyth` yeah
20:24 Daenyth` installing svn
20:25 Daenyth` be there soon
20:25 Blwood Daenyth`, do you use debian ?
20:25 Blwood there are unofficial pugs .deb files
20:27 TimToady Blwood: you can, but since it's called with $obj!foo you can just declare it as method !foo
20:27 Daenyth` arch
20:27 Daenyth` doesn't really help me much :P
20:27 [particle] my method i_am_a_private_method ()
20:27 TimToady not sure whether pugs implements private methods yet
20:27 TimToady since they're really just subs in disguise
20:27 Daenyth` there's no warnings.pm or anything like that, right?
20:28 TimToady warnings are supposed to be on by default
20:28 Daenyth` hmm
20:28 TimToady but pugs doesn't do everything p5 does in that regard yet
20:28 Daenyth` wierd
20:28 Daenyth` yeah
20:28 TimToady and warnings, unlike in p5, are really just resumable exceptions, so to suppress them in a dynamic scope you just use an exception handler
20:29 TimToady we don't have a framework for lexical warnings yet
20:29 TimToady but presumably it'll resemble p5
20:29 TimToady s
20:29 TimToady p5's
20:29 Daenyth` ugh
20:29 Daenyth` my ghc version is .1 version short
20:29 Daenyth` sigh
20:30 Daenyth` took forever to compile
20:30 DarkWolf84 mine to
20:30 DarkWolf84 I'm waiting now
20:30 Daenyth` is 6.6.1 svn?
20:30 Daenyth` or is my package out of date
20:31 DarkWolf84 i get the source from http://www.haskell.org/ghc/download_ghc_661.html
20:31 lambdabot Title: GHC: Download version 6.6.1
20:31 Daenyth` ah, it's out of date
20:32 Daenyth` checked the arch website, ghc is flagged as old
20:32 Daenyth` here we go again...
20:32 Blwood TimToady, how we can know what's implemented in pugs and what's not ? Is there a file ? (apart from the changelog file)
20:32 diakopter joined #perl6
20:32 [particle] spec.pugscode.org
20:33 [particle] the synopses have links to the tests associated with the text
20:33 TimToady Blwood: and the test matrix: http://m19s28.vlinux.de/iblech/stuff/pugs-s​mokes/pugs-smoke-6.2.13-r17216-linux-normal​--1186354417-8050--18706-17503-1203-1965-73​7-46--129bc295efbff4772bed2e924b8dda81.html
20:33 [particle] note, this is not done for all tests
20:33 lambdabot Title: TAP Matrix - Sun Aug 5 22:56:05 2007 GMT, http://tinyurl.com/29telr
20:34 Blwood oh cool thank you :)
20:35 TimToady that's just one of them, look in http://m19s28.vlinux.de/cgi-bin/pugs-smokeserv.pl for the rest
20:35 lambdabot Title: Pugs Smoke Reports
20:36 pugs_svnbot joined #perl6
20:37 Blwood So if I understand this page : ttp://tinyurl.com/29telr countains all the test ?
20:37 Blwood tests*
20:37 Blwood and pugs will work 100% when all these tests are 100% ?
20:37 TimToady that's what a "make smoke" produces
20:38 TimToady well, more like 200%, since we only have 18,000 tests so far, and probably need about twice that...
20:38 TimToady :)
20:38 Blwood ah so we need to write tests ?
20:38 pasteling "pugsbot_r17185" at 193.200.132.135 pasted "Pugs build failure" (6 lines, 278B) at http://sial.org/pbot/26708
20:38 Blwood when we find a bug or something ?
20:39 pugsbot_r17185 joined #perl6
20:39 TimToady that's what we do instead of all the heavy-handed bug reports that some projects use :)
20:39 diakopter ?eval 'hi'
20:39 pugsbot_r17185 "hi"
20:39 TimToady yay
20:40 diakopter ?eval "what's a character class?"
20:40 pugsbot_r17185 "what\'s a character class?"
20:40 Blwood TimToady, yeah it's a nice idea
20:40 DarkWolf84 ?"hello".say
20:40 lambdabot Unknown command, try @list
20:40 TimToady I blame audreyt
20:41 DarkWolf84 ?"hello"
20:41 lisppaste3 joined #perl6
20:41 lambdabot Unknown command, try @list
20:41 diakopter ?eval "hello".say
20:41 pugsbot_r17185 OUTPUT[hello␤] Bool::True
20:41 DarkWolf84 ?eval "hello".say
20:41 pugsbot_r17185 OUTPUT[hello␤] Bool::True
20:41 DarkWolf84 right
20:41 DarkWolf84 ?eval < 1 2 3 >.say
20:41 pugsbot_r17185 OUTPUT[123␤] Bool::True
20:42 Blwood ?eval ("hey" xx 2).join(" ! ").say;
20:42 pugsbot_r17185 OUTPUT[hey ! hey␤] Bool::True
20:42 DarkWolf84 ?eval < 1 2 3 > xx2
20:42 pugsbot_r17185 Error: ␤Unexpected "xx2"␤expecting operator
20:42 DarkWolf84 ?eval < 1 2 3 > xx 2
20:42 pugsbot_r17185 ("1", "2", "3", "1", "2", "3")
20:42 DarkWolf84 work
20:42 szbalint joined #perl6
20:42 SCalimlim joined #perl6
20:43 Blwood I like perl6 synthax :)
20:43 Daenyth` It feels a lot cleaner than perl5
20:43 TimToady me too, but I'm known to be prejudiced in the matter
20:43 Daenyth` or maybe it's just the fact that I have barely any code and my coding style has improved...
20:43 DarkWolf84 for me too it's much easier
20:44 Blwood mm don't know if it's much easier
20:44 Blwood much easier becomes python :(
20:44 DarkWolf84 for classes it's easier
20:44 DarkWolf84 no bless
20:44 DarkWolf84 :)
20:44 Blwood yeah classes are really cleaner
20:44 Daenyth` perl5 was the reason I never learned OO >.>
20:44 Blwood haha
20:45 TimToady me too  :)
20:45 Daenyth` I must say, I'm very impressed
20:45 Daenyth` anxiously awaiting the final release
20:45 Blwood everything is object in perl6. isn't it ?
20:45 [particle] parrot finally made me learn oo
20:45 TimToady if you scratch it hard enough
20:45 [particle] ?eval 4.say
20:45 pugsbot_r17185 OUTPUT[4␤] Bool::True
20:46 TimToady ?eval 4.WHAT
20:46 pugsbot_r17185 ::Int
20:46 Southen joined #perl6
20:47 DarkWolf84 I read somewere that some functions like err are already in perl5.9
20:48 [particle] yep, and smartmatch aka given/when, and more
20:48 Blwood err ?
20:48 [particle] defined-or
20:48 TimToady though undoubtedly their smartmatch semantics will turn out to diverge from P6's...  :(
20:49 Daenyth` I'm probably abandoning perl5 the day perl6 comes out
20:49 TimToady which will make it interesting to translate 5.10 to 6
20:49 [particle] luckily that's not my job :)
20:49 TimToady you can still make a good living programming COBOL, I hear...
20:50 Daenyth` What would happen if you coerce a string into an array?
20:51 [particle] i heard lawyers write cease and desist letters in cobol
20:51 TimToady ?eval Array("string")
20:51 pugsbot_r17185 Error: No such subroutine: "&Array"
20:52 TimToady ?eval "string" as Array
20:52 pugsbot_r17185 Error: ␤Unexpected "as"␤expecting operator
20:53 Blwood is there a forum around perl6 on the web ?
20:54 Daenyth` yay.. Now I get to wait for ghc 6.6.1 to compile
20:54 Daenyth` sigh
20:55 Daenyth` longest ./configure I've ever seen...
20:55 [particle] once you have 6.6.1 compiled, it'll compile 6.8 much faster ;)
20:55 Daenyth` heh
20:59 ozo joined #perl6
20:59 jhorwitz_ joined #perl6
21:12 BillyMac joined #perl6
21:13 stevan_ joined #perl6
21:14 BillyMac Hello
21:16 BillyMac I am interested in helping out...
21:17 bcmb BillyMac: you may want to look at  http://www.perlfoundation.org/p​erl6/index.cgi?getting_involved
21:17 lambdabot Title: Getting Involved / Perl 6
21:18 Daenyth` I wish ghc would hurry up and compile
21:18 Daenyth` boo@out-of-date-package
21:20 BillyMac Thanks; I got here from: http://svn.pugscode.org/pugs/docs/01Overview.html
21:20 lambdabot Title: Pugs Apocryphon 1
21:21 BillyMac it simply says: ask :)
21:21 diakopter BillyMac: how would you like to help?
21:21 Daenyth` (1) Donate soul
21:21 Daenyth` >.>
21:21 jjore-w joined #perl6
21:21 BillyMac nope, already sold that...
21:22 BillyMac other thoughts?
21:22 Daenyth` hmm
21:22 Daenyth` firstborn child...?
21:22 Daenyth` You could also try to find bits perl6 code that should run but don't
21:22 BillyMac neither first nor second before my life; sorry
21:23 BillyMac now we're getting somewhere...
21:24 diakopter BillyMac: do you have subversion commit credentials?
21:24 BillyMac I have started to get the bits and pieces for Pugs to build on my system; no
21:24 diakopter (if you don't, PM me your email address and preferred svn username)
21:25 BillyMac OK
21:26 diakopter BillyMac: invitation sent!
21:27 cognominal_ left #perl6
21:27 cognominal_ joined #perl6
21:28 weinig joined #perl6
21:28 BillyMac Thanks, I'll check for it now
21:31 Daenyth` ARG
21:31 Daenyth` ghc compile failed
21:31 Daenyth` after waiting half an hour
21:31 diakopter BillyMac: as Daenyth said, finding untested specs and use cases and writing tests for them is very needed.  Especially for the portions of the specs that TimToady hasn't finished yet. :) (That should help motivate him to write them up) ;)
21:31 Southen joined #perl6
21:31 Daenyth` collect2: ld returned 1 exit status
21:31 Daenyth` <<ghc: 175706608 bytes, 37 GCs, 1050836/2002448 avg/max bytes residency (2 samples), 19M in use, 0.02 INIT (0.00 elapsed), 0.94 MUT (5.62 elapsed), 0.09 GC (0.12 elapsed) :ghc>>
21:31 Daenyth` make[2]: *** [GHC/Base.o] Error 1
21:32 Daenyth` ;_;
21:32 TimToady you can't use a precompile one?
21:32 Daenyth` my package is out of date
21:32 BillyMac OK, those the items so noted in make test?
21:34 Daenyth` ok
21:34 Daenyth` wow
21:34 Daenyth` I did not see the "binary packages" link on the ghc site
21:34 Daenyth` I win :(
21:38 BillyMac Would you be able to suggest one to get me pointed in the right direction, please?  Then I can go off and investigate in order to speak more intelligently the next time around :)
21:38 TimToady BillyMac: see earlier discussion at http://moritz.faui2k3.org/irclo​g/out.pl?channel=perl6#i_76825
21:38 lambdabot Title: IRC log for #perl6, 2007-08-06
21:38 BillyMac Will do. Thanks!
21:39 TimToady particularly the links to the test matrix
21:40 nnunley_ joined #perl6
21:40 BillyMac OK; back when I have been through that information...
21:40 spinclad joined #perl6
21:41 Daenyth` so for ghc if I do "make in-place" it would just put the binary whereever I exploded the package
21:41 Daenyth` ?
21:47 TimToady presumably
21:48 Daenyth` alrighty
21:53 weinig_ joined #perl6
21:57 pugs_svnbot joined #perl6
21:59 Yaakov joined #perl6
22:10 Limbic_Region joined #perl6
22:18 Daenyth` hmm
22:19 nekokak_ joined #perl6
22:20 Daenyth` If the maintainer updates ghc to 6.6.1, I might be able to make a pugs-svn package for archlinux's AUR repository
22:20 Daenyth` Not sure; I've never made an arch package before, but it seems pretty simple
22:21 Daenyth` How far am I in the compile if I'm at: [ 57 of 109] Compiling Pugs.AST.Internals.Instances ( src/Pugs/AST/Internals/Instances.hs, dist/build/Pugs/AST/Internals/Instances.o )
22:22 Daenyth` is that 109 the total make's, counting everything?
22:23 TimToady 109 is end of building pugs object files.  does a bit of stuff in subdirs after that
22:23 TimToady and builds precompiled Prelude and Test
22:23 TimToady but those don't take a long time
22:23 Daenyth` alright
22:25 Schwern joined #perl6
22:29 Blwood if I declare an attribute rw in a Class, can I change its value in the programm ?
22:29 pugs_svnbot r17221 | bloonix++ | some code fixes
22:29 pugs_svnbot diff: http://dev.pugscode.org/changeset/17221
22:29 Daenyth` pretty sure that's the point of declaring it rw
22:29 lambdabot Title: Changeset 17221 - Pugs - Trac
22:29 Daenyth` @source
22:29 lambdabot not available
22:30 pugs_svnbot r17222 | bloonix++ | new modules
22:30 pugs_svnbot diff: http://dev.pugscode.org/changeset/17222
22:30 lambdabot Title: Changeset 17222 - Pugs - Trac
22:30 bloonix oops
22:30 bloonix svn++
22:31 Daenyth` @help
22:31 lambdabot help <command>. Ask for help for <command>. Try 'list' for all commands
22:31 Daenyth` @list
22:31 Blwood Daenyth`, yeah I thought the same but : http://pastebin.com/d3f20227 doesn't work :(
22:31 lambdabot http://www.cse.unsw.edu.au​/~dons/lambdabot/COMMANDS
22:31 Daenyth` $.pseudo = "otherguy";
22:31 pugs_svnbot r17223 | bloonix++ | test files for Sys::Statistics::Linux::*
22:31 pugs_svnbot diff: http://dev.pugscode.org/changeset/17223
22:31 lambdabot Title: Changeset 17223 - Pugs - Trac
22:32 Daenyth` shouldn't that be $drinker.pseudo?
22:33 Blwood Daenyth`, doesn't work :(
22:33 araujo joined #perl6
22:33 Daenyth` error message?
22:34 Blwood "*** No such method in class Bool: "&pseudo"
22:35 Daenyth` hrm
22:36 DarkWolf84 strange
22:36 pugs_svnbot r17224 | bloonix++ | kicked shebang from 13FileStats.t
22:36 pugs_svnbot diff: http://dev.pugscode.org/changeset/17224
22:36 lambdabot Title: Changeset 17224 - Pugs - Trac
22:47 DarkWolf84 is there something like perldoc in pugs
22:47 DarkWolf84 ?
22:48 bloonix http://perlcabal.org/syn/
22:48 lambdabot Title: Official Perl 6 Documentation
22:48 TimToady Blwood: that's because you have a spurious .drink after the .new
22:48 Daenyth` is ghc needed to run pugs or only to compile it?
22:49 TimToady so $drinker is the result of the say
22:49 TimToady only to compile, I think, though not sure what libs it might link
22:50 Daenyth` ok
22:50 Daenyth` hmm
22:50 Daenyth` I'm reading up on how to make a package
22:51 Daenyth` I won't be able to make a working one until the ghc package is updated though
23:00 pugs_svnbot r17225 | lwall++ | better handling of statement- and arglist-ending curlies as EXPR terminators
23:00 pugs_svnbot diff: http://dev.pugscode.org/changeset/17225
23:00 lambdabot Title: Changeset 17225 - Pugs - Trac
23:04 pasteling "Daenyth" at 24.91.13.73 pasted "Unexpected "\\" expecting operator or "}" at crapbot.p6 line 43, column 29" (71 lines, 1.4K) at http://sial.org/pbot/26717
23:06 vel joined #perl6
23:06 dduncan to whom it concerns, Pugs doesn't parse this yet: grammar MuldisD:ver<0.3.0>:auth<cpan:DUNCAND>;
23:07 dduncan but it does parse the form: grammar MuldisD-0.3.0-cpan:DUNCAND;
23:08 dduncan I prefer the named form
23:09 bloonix how can I test if a routine exists in another namespace? I search the equivalent for UNIVERSAL::can($package, $sub);
23:09 dduncan one moment ...
23:09 TimToady Daenyth`: you need .print: rather than just .print  (or use parens around the arg)
23:09 Daenyth` aha, thanks
23:10 Daenyth` hmm
23:10 dduncan bloonix, look up .meta in Synopsis 12
23:11 dduncan or ...
23:11 TimToady the metaclass would be .HOW these days
23:12 Daenyth` TimToady: by the way, making my %hash constant didn't work. I'll just pass it as parameters to new() for now I suppose
23:12 TimToady but if it's in a package you can just use defined &FOO::bar
23:12 TimToady you don't want "my constant", but just "constant"
23:13 Daenyth` ok, alright..
23:13 Daenyth` let me try that then
23:13 TimToady constant isn't a type, it's a scope (compiler scope)
23:13 dduncan bloonix, I was going to look up how I was doing that already, but now I'm not sure that I try that anymore
23:13 Daenyth` Is there any comprehensive guide for perl5 users switching to 6? Similar to perl5's "pitfalls for perl4 users", etc
23:13 dduncan but probably .HOW is the way to go, whenever that works
23:14 dduncan not sure implemented yet
23:14 TimToady depends on MO upgrade
23:14 dduncan yes
23:14 bloonix dduncan: I hope so. until it works I use a workaround
23:14 TimToady Daenyth`: nothing comprehensive, probably several out-of-date starts
23:15 TimToady by one reckoning, the synopses are precisely that comprehensive guide
23:15 Daenyth` it's just a little difficult having it spread all over
23:16 Daenyth` ?eval constant $foo = 'foo'; constant %bar = ( bar => "$foo" ); say %bar<bar>;
23:17 pugsbot_r17185 OUTPUT[␤] Bool::True
23:17 Daenyth` hrm
23:17 Daenyth` strange, on mine it barfs...
23:17 rhizo for %h.kv -> $k, $v {  #  hm, wonder why not  %h.each ?
23:18 rhizo it's more in English, and goes well with .keys and .values
23:18 TimToady it's hard to have something comprehensive that is not also big
23:19 TimToady Daenyth`: that's a known bug with constant
23:19 Daenyth` alright
23:19 Daenyth` I'll just hardcode the string for now I suppose
23:19 TimToady in fact, I wrote the test in the test suite for that bug.  :)
23:20 Daenyth` Is there any guide on how to write tests?
23:23 Daenyth` for a socket filehandle, I would want to declare my $sock is IO = connect(foor, bar)?
23:23 TimToady see pod in pugs/blib6/lib/Test.pm
23:23 Daenyth` thank you
23:25 TimToady probably don't want "is IO" there
23:25 TimToady "is" on a variable declaration is like a P5 tie
23:25 Daenyth` ok
23:25 TimToady if you just want to say what $sock holds, say "my IO $sock"
23:25 Daenyth` so rather I would do: has $.socket; $.socket is IO = connect()?
23:26 TimToady you don't want that "is IO" either.  "has IO $.socket;"
23:26 Daenyth` ah, ok
23:27 TimToady "is" is really only for declarations of container types and ISA relationships
23:28 TimToady (pugs mostly ignores the type declarations at this point)
23:28 Daenyth` for an array that will contain only strings, would I do has Str @array;?
23:28 TimToady yes, it's the type of each element
23:28 Daenyth` alright
23:28 Daenyth` :)
23:31 dduncan fyi, my first cut at a complete, and successfully compiling, but otherwise untested, Perl 6 grammar can be seen at http://utsl.gen.nz/gitweb/?p=Language-MuldisD;​a=blob_plain;h=3153702fa06e707337a90bcfbde1131​0dc806733;f=lib/Language/MuldisD/Grammar.pod
23:31 lambdabot http://tinyurl.com/33hvb5
23:32 lumi joined #perl6
23:34 Daenyth` TimToady: if you define a method with the same name as a builtin, it breaks
23:34 TimToady dduncan: your use of parentheses around literals seems odd
23:34 Daenyth` is that a known bug?
23:35 dduncan the parenthesis indicate a capture, afaik
23:35 TimToady paste?
23:35 Daenyth` sec
23:35 dduncan TimToady, am I not supposed to indicate captures in a grammar?
23:36 dduncan eg, what the resulting tree has in it?
23:36 diakopter Daenyth`: 'make soon' produces a ./pugs that's more than sufficiently fast... and finishes building far earlier.
23:36 TimToady I guess it's okay.
23:36 dduncan or if you mean my having some nested parens in one place, that may be due to my being unsure how many are needed
23:36 Daenyth` diakopter: what's the cost of doing that?
23:37 TimToady just most grammars end up returning typed objects so you don't need string discriminators in $0, is all...
23:38 TimToady Daenyth`: runs a little slower.  I always just do the normal make myself because my machine's not too slow
23:38 pasteling "Daenyth" at 24.91.13.73 pasted "Cannot name a class method the same as a builtin" (97 lines, 2K) at http://sial.org/pbot/26718
23:38 dduncan with my grammar, I'm assuming that all returned object payloads will be Str, which I further process to derive an actual type
23:38 Daenyth` TimToady: that code has a lot of junk in it irrelevant to the problem
23:38 dduncan is that abnormal?
23:38 Daenyth` I can produce a cleaner example if you'd like
23:44 TimToady that's very odd
23:45 TimToady try it with "method connect () {" instead?
23:45 Daenyth` k
23:46 dduncan also keep in mind that, while I used a Perl 6 grammar there, that file is more meant to be representative ... it could very well be a grammar for Muldis D under Perl 6, but I may have to define the grammar in some other way for Muldis D hosted over Parrot, or Perl 5, or whatever ...
23:47 Daenyth` *** No compatible multi variant found: "&connect"
23:47 dduncan also, the grammar is kept simple on purpose, expecting some post-processing of the parse tree, partly so it is easy to write a parser without using any non-core modules
23:47 Daenyth` maybe declare it as multi method connect () {
23:47 Daenyth` ?
23:47 TimToady no, yours is an ordinary method
23:48 dduncan eg, I'd want to be able to parse that Muldis D under Perl 5 using just Perl 5 regexes
23:48 TimToady it's complaining about not finding the builtins because the types don't match
23:48 Daenyth` types of what?
23:48 dduncan hence, eg, escaped quotes in strings are spelled \q rather than \', so any literal ' actually are string delimiters
23:49 dduncan anyway, what I showed you should be going on CPAN later today
23:50 TimToady type of args to the builtin connect
23:50 Daenyth` hmm
23:50 TimToady so something about server,port isn't matching up
23:50 Daenyth` is connect expecting connect( string, int )?
23:51 TimToady should be
23:51 Limbic_Region I saw a Haskell book in Borders the other day - it was on sale for $55
23:51 * Limbic_Region did not buy it
23:51 Daenyth` heh
23:51 Limbic_Region besides the price, it focused on hugs not ghc
23:52 Limbic_Region not that there should be a huge difference
23:53 TimToady print out the values of $.server and $.port before?
23:53 Daenyth` they were correct
23:53 Daenyth` I cut them out of the paste but I did $bot.dump right before $bot.connect
23:54 Daenyth` I renamed the function for now
23:54 TimToady well, try renaming your method and see if it's interfering somehow, I guess
23:55 Daenyth` it works when I rename it
23:55 Daenyth` on to the next bug...
23:55 Daenyth` 99 bugs in the code, 99 bugs in the code, fix one bug, compile it again, 100 bugs in the code....
23:55 TimToady okay, something's screwed up in the MMD dispatcher then
23:56 TimToady connect() should not be calling .connect()
23:56 Daenyth` I now get *** Undeclared variable: ("$__SELF__", 15~ lines of barf)  at crapbot.p6 line 61, column 32-40
23:56 Daenyth` line 61 is method readln
23:57 Daenyth` $bot.newconn; works, it's when I call $bot.readln that it dies
23:57 diakopter yes, the MMD has been broken for (50..300).any revisions

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

Perl 6 | Reference Documentation | Rakudo