Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2007-08-07

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:00 Blwood when I use a regex inside a given/when : when m:P5/:(\w+)\s+/, I know the (\w+) refers to $0 but how can I do something like : my($var) = $string =~ m/:(\w+)/ in perl5 : O ?
00:00 diakopter from what I can tell, it always picks the first declared method of a given name
00:01 bloonix puh
00:01 bloonix *** No compatible multi variant found: "&set"
00:01 bloonix I dont know why it comes
00:01 bloonix I have only one method called set
00:02 bloonix and if I try to call it with self.set(%p) this error occurs
00:03 TimToady how is set declared?
00:03 bloonix method set (*%p) {
00:05 TimToady you might need self.set(|%p) if you want to pull the pairs out as named args
00:05 TimToady alternately drop the * on the sig
00:05 bloonix thx
00:05 TimToady as it is you're passing a positional hash argument, and *%p isn't seeing anything
00:06 diakopter Daenyth`: nopaste your crapbot.p6 ?
00:06 Daenyth` sec
00:06 Daenyth` I had it above but I tweaked it a bit
00:06 Daenyth` the relevent line is: method readln ($sock = $.socket) {
00:06 TimToady Blwood: not sure quite what you're wanting.  you can still assign the result of a match as a list
00:07 Blwood TimToady, I have a given/when. given $string { when m:P5/:(\w+)/ {  print "$0 blabla"; } }
00:08 Blwood instead of $0 I'd like to use something lik $var
00:08 Daenyth` diakopter: http://sial.org/pbot/26718, line 67 in there is the line I mean.
00:08 lambdabot Title: Paste #26718 from "Daenyth" at 24.91.13.73
00:08 Blwood it's possible to dot my ($var) = $string ~~ regex in perl6, but I don't know how to do it in a givent/when
00:08 Daenyth` ignore the bit at the top
00:13 TimToady Blwood: why not just say "if my $var = m:P5/.../ {...}" instead?  given just sets $_, and // looks at that by default
00:13 TimToady and you can intermix when with other statements
00:14 TimToady there's also a spec'ed when COND -> $x {...} syntax, but I doubt puts does it yet
00:14 Blwood TimToady, be cause I have other conditions in my given statement :s
00:15 TimToady you should also (eventually) be able to say "when / $var := () /" and bind to a predeclared $var from outside, but that also might not work yet
00:15 bsb joined #perl6
00:16 Blwood COND -> $x { ... } would be perfect :)
00:16 Blwood thank you for the informations
00:17 bloonix my $class = 'test'; $class.new doent works :/
00:17 bloonix s
00:17 jjore-w Recently in Perl 5 I wanted to import some functions, mixin-like but let them be closures over some of my lexicals. Is there any Perl 6 accomodation for this sort of thing?
00:17 TimToady that's because classes aren't strings in P6
00:18 bloonix what can I do now?
00:18 jjore-w the real problem was that I had oodles and oddles of parsing and validation methods which shared some common data and the source was too large to navigate.
00:18 TimToady ?eval my $class = 'test'; $::($class).new
00:18 pugsbot_r17185 Scalar.new()
00:19 TimToady ?eval my $class = 'test'; ::($class).new.WHAT
00:19 pugsbot_r17185 ::test
00:19 jjore-w oh shoot. guess I'm running. darn.
00:19 bloonix if I try that I got a lot of errors
00:20 bloonix the begin is: *** Undeclared variable: ("$test",MkPad (padTo...
00:21 pasteling "bloonix" at 87.78.208.180 pasted "#!/usr/bin/pugs class test; us" (24 lines, 2.9K) at http://sial.org/pbot/26719
00:23 TimToady lose the $ before the ::
00:24 bloonix fine
00:29 justatheory joined #perl6
00:30 hkb_zz changed the nick to hakobe
00:36 Daenyth` ?eval return %hash<foo> = True;
00:36 pugsbot_r17185 Error: ␤Unexpected "<foo"␤expecting "::"␤Variable "%hash" requires predeclaration or explicit package name
00:36 Daenyth` ?eval return my %hash<foo> = True;
00:36 pugsbot_r17185 (no output)
00:38 TimToady return from what?
00:38 Daenyth` yeah
00:38 Daenyth` good point
00:38 Daenyth` >.>
00:40 TimToady hakobe: is your name spelled 箱辺 or 運べ or something else?
00:40 jettero joined #perl6
00:40 ozo left #perl6
00:42 Daenyth` "state" seems to be broken
00:42 TimToady how so?
00:43 Daenyth` ?eval sub foo { state $bar = 0; say ++$bar; } for (1..4) { foo() }
00:43 pugsbot_r17185 OUTPUT[1␤1␤1␤1␤] undef
00:44 TimToady yeah, that seems broken
00:45 TimToady ?eval sub foo { state $bar; say ++$bar; } for 1..4 { foo() }
00:45 pugs_svnbot r17226 | bloonix++ | Makefile.PL and Linux.pm for Sys::Statistics::Linux...
00:45 pugs_svnbot diff: http://dev.pugscode.org/changeset/17226
00:45 pugsbot_r17185 OUTPUT[1␤2␤3␤4␤] undef
00:45 lambdabot Title: Changeset 17226 - Pugs - Trac
00:45 TimToady the assignment is not being a pseudo assigment
00:46 TimToady ?eval sub foo { state $bar; START { $bar = 0 }; say ++$bar; } for 1..4 { foo() }
00:46 pugsbot_r17185 OUTPUT[1␤1␤1␤1␤] undef
00:47 TimToady ?eval sub foo { state $bar; FIRST { $bar = 0 }; say ++$bar; } for 1..4 { foo() }
00:47 pugsbot_r17185 OUTPUT[1␤2␤3␤4␤] undef
00:47 TimToady hmm
00:48 TimToady looks like the transition from FIRST to START was not complete
00:48 bloonix enough for today
00:48 bloonix good night people
00:48 Daenyth` night
00:49 TimToady night!
00:49 bloonix bed &
00:58 nipotaway changed the nick to nipotan
00:58 [particle1 joined #perl6
01:14 Blwood I am not quiet sur but, err() function doesn't work always, does it ?
01:14 Blwood sure*
01:15 TimToady what err() function?  do you mean the err infix?
01:15 Blwood for example @*ARGS.shift err die "Usage: $?FILE <arg>\n"; will works if there's no argument but, when I do a connect("somethi,",50) err die " ... $!\n" that won't work
01:16 Blwood will work*
01:16 Blwood I mean I can't fix a personnel error message
01:17 TimToady I wonder what connect returns on failure...
01:17 Blwood "*** getHostByName: does not exist (no such host entry)
01:17 Blwood "
01:18 TimToady looks like it throws an exception when it should just fail
01:18 TimToady that's not a problem with err
01:19 Blwood I have to manage it with try{  } ?
01:19 TimToady unless someone fixes connect...
01:19 Blwood I have the same with open()
01:20 Blwood my $data = open("file",:r) err die "file doesn't exist : $!\n";
01:20 TimToady we'll probably have a lot of modules initially where people say "or die" when they should say "or fail"
01:20 Blwood -> *** file: openFile: does not exist (No such file or directory)
01:20 luqui joined #perl6
01:21 r0bby joined #perl6
01:21 Blwood so it's a bug or do I have to handle this error/exception with a try {   CATCH { }} : s ?
01:22 TimToady my $data = try { open("file",:r) } err die "file doesn't exist : $!\n";
01:22 Blwood oh nice :)
01:22 TimToady again, open shouldn't die, but rather fail
01:23 Blwood and what's the mean of CATCH ?
01:23 TimToady failing to open a file is not all that exceptional
01:23 Blwood yeah you are right
01:23 TimToady CATCH turns the surrounding block into a try, and supplies the exception handling
01:24 Blwood so I cad do a try { open("file",:r) CATCH {  say "something"  }} ?
01:24 Blwood can do*
01:26 diakopter pugs make: Makefile out-of-date with respect to /opt/local/lib/perl5/5.8.8/darwin-2level/Config.pm /opt/local/lib/perl5/5.8.8/darwin-2level/CORE/config.h
01:26 diakopter why would those two paths matter....?
01:29 diakopter <sigh> I guess I shouldn't have so many perls in my PATH :(
01:30 weinig joined #perl6
01:30 TimToady Blwood: yes, but CATCH is subimplemented
01:30 TimToady also, you'd need a semicolon after the open call
01:31 Blwood what do you mean with "subimplemented" :s ?
01:33 diakopter preimplemented?
01:34 Blwood oh right so it's better not to use catch ?
01:44 danga joined #perl6
01:55 Daenyth` foeach is replaced entirely by for, correct?
01:57 TimToady yes
01:57 TimToady for (;;) turns into loop (;;)
01:58 Daenyth` and where I'd do foreach my $foo (@bar), I'd now do for my $foo @bar?
01:59 TimToady no
01:59 TimToady for @bar -> $foo {...}
01:59 Daenyth` ahh
01:59 Daenyth` right
02:00 TimToady -> $foo {...} is an anonymous block with arguments
02:08 Daenyth` What's the best way to remove an item from an array if the item matches $foo?
02:08 Daenyth` for {} and test?
02:09 TimToady usually it's best not to put that element into the array in the first place.  :)
02:10 Daenyth` Well
02:10 Daenyth` I have an arrayref in %.state<channels>, and I add a channel to the array when I join it. I need to be able to remove the channel from the array if the state changes, for example if I get kicked, etc
02:11 TimToady why are you using an array rather than a hash?
02:12 Daenyth` because it's a list? >.>
02:15 Daenyth` oh oh
02:15 Daenyth` hmm
02:15 Daenyth` nevermind.. thought for a moment that any() might help
02:16 Daenyth` I'll just loop through the list
02:17 stevan_ joined #perl6
02:17 TimToady decommuting &
02:17 diakopter !!!!!!!!!!!!!! finally! figured out my makemaker/PERL5LIB/FindBin/Makefile.PL problems...... :D
02:18 diakopter (not that anyone cares) :)
02:18 Daenyth` I care <3
02:18 Daenyth` good for you!
02:18 diakopter Daenyth`: thanks :)
02:20 diakopter ah, the joys of living with Apple's perl5.8.6, MacPorts' perl, and Fink's perl lib dirs....
02:20 Daenyth` heh
02:54 rhr STD allows twigils in sig params, does that ever make sense?  sub foo($*bar) {...} etc.  Should all twigils be disallowed in sigs?
02:58 PerlJam rhr: I believe that they're specced in on purpose.  For instance, I think that constructors given parameters like $.foo will automatically set the corresponding data members for the object.
02:58 PerlJam rhr: perhaps not all of them make sense though  :)
03:04 rhr PerlJam: good point, I'd forgotten that.  I think of $.foo as a sort of fake twigil since it's really a method call, but S02 says it's a twigil.
03:06 rhr I can't see how any of the "real" twigils would ever make sense, though.
03:08 TimToady $!foo is a real twigil that makes sense there
03:09 PerlJam $!foo and $.foo both make perfect sense to me.  $^foo is harmless I think. The only questions (to my mind) are ... would $*foo automatically set the corresponding global?  and $+foo the corresponding contextual var?  and $=foo the corresponding pod var?  etc.
03:09 PerlJam $?foo doesn't seem to make much sense though
03:10 TimToady most of 'em don't make much sense, but it's a semantic constraint rather than a syntactic constraint, and STD is mostly about syntax
03:10 PerlJam But I guess it could be used to hide compiler "hints" for the duration of the sub or to set them or something
03:11 rhr ok, that makes sense
03:12 PerlJam TimToady: Well some people (hi rhr!) are going to want to make semantic sense of it too.  Could the spec say something about that? (even if it's to defer the semantic sensibility until later :)
03:15 TimToady perhaps it just doesn't work under strict :)
03:15 PerlJam Now I'm wondering what, if anything,  sub foo ($.bar) { .. } means ..
03:16 rhr or method foo($!bar) without a has $.bar or $!bar
03:16 TimToady we have thought about allowing methods to be defined inside subs
03:28 weinig_ joined #perl6
03:35 hakobe joined #perl6
04:18 * diakopter whines at all context-free grammars G.
04:21 vel joined #perl6
04:24 justatheory joined #perl6
04:38 deq` joined #perl6
04:49 kanru joined #perl6
05:19 devogon joined #perl6
05:44 luqui_ joined #perl6
05:50 jisom joined #perl6
06:14 masak joined #perl6
06:28 masak @quote lament
06:28 lambdabot lament says: don't call me lambdabot!
06:28 masak :)
06:29 weinig_ changed the nick to weinig
06:31 Aankhen`` joined #perl6
06:38 elmex joined #perl6
06:46 franck___ joined #perl6
06:54 luqui joined #perl6
07:04 dduncan left #perl6
07:16 drrho joined #perl6
07:17 ozo joined #perl6
07:38 franck____ joined #perl6
07:55 Daenyth` can I define what type of variable a specific key in a hash holds?
07:56 masak Daenyth`: you mean a different type from the other keys?
07:56 Daenyth` for example, you can do my Str $foo = 'bar'
07:56 Daenyth` is there any way to define that sort of thing on a per-key basis?
07:56 Daenyth` or only for the entire hash?
07:57 masak Daenyth`: the latter, by my reckoning
07:57 Daenyth` that's what I figured
07:57 masak but I'm not the final authority, the synopses are :)
07:57 Daenyth` oh well
07:57 Gothmog_ per-key? That way you were unable to use a single hashing function for the entire hash... would be possible, but pretty ugly.
07:57 masak true
07:58 flokuehn joined #perl6
07:58 Daenyth` Gothmog_: good point.. hadn't thought of that
07:58 Daenyth` ah well, I'll just let it be dynamic
07:58 Daenyth` no harm in that :)
07:58 Daenyth` pre-optimization root of all evil, etc
08:01 Daenyth` If I have a HoH, I would access it by %foo<bar><baz>?
08:01 Daenyth` or %foo<bar>.<baz>?
08:03 masak Daenyth`: the former, I think
08:03 masak though both probably work, since postcircumfix <> is really just a method call .<>
08:03 masak or something
08:04 Daenyth` or something
08:05 masak Daenyth`: yes, I had the urge to add "or something", because all I know in the matter I've gleaned from synopses and emails during the years
08:05 masak it's not like I'm part of the design team or anything
08:05 Daenyth` I'm sure pugs will barf at me if I do something wrong
08:06 masak Daenyth`: at times, it barfs at me when I do stuff right
08:06 masak pugs is very much a work-in-progress
08:06 Daenyth` hehe
08:06 Daenyth` I like it though
08:06 Daenyth` especially the REPL
08:06 masak yes, it's the best p6 interpreter on the market :)
08:08 buetow joined #perl6
08:09 TimToady_ joined #perl6
08:15 weinig joined #perl6
08:35 daxim_ joined #perl6
08:51 jisom_ joined #perl6
08:58 silug joined #perl6
09:25 toly_ changed the nick to toly
09:43 Psyche^ joined #perl6
09:43 Psyche^ changed the nick to Patterner
09:48 DarkWolf84 joined #perl6
09:49 ruoso joined #perl6
10:11 chris2 joined #perl6
10:26 dwave joined #perl6
10:45 sunnavy joined #perl6
10:47 cognominal_ joined #perl6
11:09 kanru joined #perl6
11:16 pmurias joined #perl6
11:17 pmurias masak: it's the only p6 interpreter on the market, the other implementations are compilers :)
11:20 pmurias it's the most complete one, nonetheless
11:29 kanru joined #perl6
11:32 cognominal_ joined #perl6
11:32 bloonix good morning
11:33 cognominal_ left #perl6
11:33 cognominal_ joined #perl6
11:35 masak bloonix: good day
12:04 devogon joined #perl6
12:12 diakopter pmurias: parrot's perl6 does REPL
12:15 masak oh. I didn't know that -- I guess pugs is still a bit ahead, though
12:16 diakopter hence one item on my todo list being making an evalbot wrapper for it... parrbot_r44020 or whatever
12:17 masak good idea
12:17 masak evalparrot :)
12:17 diakopter along with kmp6bot_rxxxx
12:17 diakopter ?parr 'eval me'
12:17 lambdabot Maybe you meant: arr part yarr
12:18 diakopter ?pugs 'eval me'
12:18 lambdabot http://hackage.haskell.org/trac/ghc/newticket?type=bug
12:18 diakopter ?kmp6 'eval me'
12:18 lambdabot Unknown command, try @list
12:42 nipotan changed the nick to nipotaway
12:56 Aankhen`` joined #perl6
12:59 Aankh|Clone joined #perl6
13:04 stevan_ joined #perl6
13:10 jettero joined #perl6
13:11 jettero join irssi
13:12 masak jettero: you need a slash in front, and an octothorp before 'irssi', like so: "/join #irssi"
13:12 jettero oh, I know.  It was an ordinary typo... I neglected to say: mistell or something similar
13:12 masak oki
13:12 jettero thanks though
13:12 masak :)
13:13 Limbic_Region joined #perl6
13:25 TJCRI joined #perl6
13:25 cognominal_ joined #perl6
13:26 franck___ joined #perl6
13:27 cognominal_ joined #perl6
13:29 Shillo joined #perl6
13:30 DarkWolf84 joined #perl6
13:30 diakopter Shillo: howdy
13:31 Shillo Hi!
13:39 Aankhen`` joined #perl6
13:46 DarkWolf84 hi
13:46 Shillo Hey
13:47 DarkWolf84 ???
13:59 masak DarkWolf84: ¿¿¿
14:01 DarkWolf84 not understand
14:01 masak ok. can I help you in any way?
14:02 Linux\2 heh
14:06 DarkWolf84 I just greet
14:06 DarkWolf84 btw ler vars don't work with last version of pugs
14:06 masak DarkWolf84: yes. by my understandinģ Shillo just greet too, so you needn't feel confused
14:07 DarkWolf84 let*
14:07 masak DarkWolf84: maybe they haven't been implemented yet
14:07 masak did they once work?
14:07 DarkWolf84 my english is bad
14:07 masak not to worry
14:07 DarkWolf84 no not really
14:08 masak the world population seems to have more or less rejected esperanto, so english is what we're stuck with
14:08 masak sorry...
14:08 jhorwitz joined #perl6
14:08 DarkWolf84 I tied last versions and the one in gentoo portage and let and temp vars not work
14:08 DarkWolf84 tried*
14:08 masak well, some things in pugs work, and some don't
14:09 Shillo Yeah, no problem. That 'hey' was a greeting from me. :)
14:10 masak Shillo: yes
14:10 DarkWolf84 I understood
14:11 masak DarkWolf84: if they don't work, it's either because they recently broke or because they're just not implemented
14:12 masak re pugs features, that is
14:13 masak I'm not sure I recall let vars ever working
14:13 DarkWolf84 probably they broke something
14:13 masak but maybe check the tests
14:13 DarkWolf84 ok
14:13 masak t/var/let.t
14:14 DarkWolf84 i'll try
14:14 masak hm, looks to me they were once implemented, or close to implemented
14:15 DarkWolf84 yes
14:15 masak no :todo params hint otherwise, anyway
14:15 masak DarkWolf84: are you experiencing a specific problem not covered by one of the tests?
14:15 DarkWolf84 thats why in the programmers heaven they wrote about this
14:15 masak they did?
14:15 masak where?
14:16 kanru joined #perl6
14:16 DarkWolf84 w8
14:16 masak mm
14:16 DarkWolf84 http://www.programmersheaven.com/2/Perl6-FAQ-Variables#sigils
14:17 masak ah
14:18 masak well, pugs is sort of a moving target
14:18 DarkWolf84 I know
14:18 DarkWolf84 perl 6 is in development
14:18 masak right now when I run the test, pugs thinks `let` is a subroutine
14:19 masak so yes, it's broken :)
14:19 DarkWolf84 mine too
14:19 masak DarkWolf84: would you like to fix the test file?
14:19 DarkWolf84 why not
14:19 masak (that is, at least make it skip the tests or something)
14:20 DarkWolf84 but i know perl5
14:20 masak do you already have a commit bit?
14:20 DarkWolf84 and little perl6
14:20 DarkWolf84 yes
14:20 DarkWolf84 I have
14:20 masak great
14:20 masak then you know the drill :)
14:20 DarkWolf84 well I'll try
14:21 masak :) don't worry, we're running rcs
14:24 charsba__ joined #perl6
14:28 avar joined #perl6
14:28 DarkWolf84 what is rcs?
14:34 masak I meant "revision control system"
14:34 masak svn, svk, darcs etc
14:35 masak they keep a history of changes, and you can recover old revisions easily
14:35 masak it's a time machine for data
14:35 DarkWolf84 subversion
14:35 DarkWolf84 i got it
14:35 masak yes
14:36 masak good, then your commit bit is useful :)
14:45 elmex joined #perl6
14:52 TimToady_ changed the nick to TimToady
14:52 Shillo Hiya!
14:57 Blwood joined #perl6
14:57 masak ?eval map :{ .chr } <71 75 69 74>
14:57 pugsbot_r17185 ("G", "K", "E", "J")
14:57 DarkWolf84 nice
14:58 DarkWolf84 :)
14:58 DarkWolf84 I didn't know this method
14:58 masak yes, p6 is pretty
14:58 masak DarkWolf84: oh, you meant pugsbot?
14:58 DarkWolf84 no
14:58 DarkWolf84 I mean .chr
14:59 TimToady it's just p5's chr() function, really
14:59 TimToady by the way, that syntax is unlike to work in real p6
14:59 TimToady *unlikely
15:00 TimToady better to say
15:00 TimToady ?eval map { .chr }, <71 75 69 74>
15:00 pugsbot_r17185 ("G", "K", "E", "J")
15:00 masak TimToady: ah, ok
15:00 masak just as well, I never liked the colon in that place
15:00 Shillo Oh, Larry... have you read my question on perl6-internals? About junctions?
15:01 TimToady yes
15:01 TimToady not sure I understand the question though
15:01 Shillo Not sure I asked it right, either. ;)
15:01 TimToady Junctions are a type that is outside the Any type
15:02 TimToady and the default argument type is Any, so doesn't match Junction
15:02 Shillo Yes, that's part of what I asked.
15:02 Shillo What about assignments, though?
15:02 Shillo ?eval my $x = 1|2
15:02 pugsbot_r17185 \(1 | 2)
15:02 Shillo $x is Any, in this case.
15:02 Shillo ?
15:03 TimToady $x is just a scalar container, untyped
15:03 [particle1 ?eval my $x = (1|2); say $x.WHAT
15:03 TimToady contents
15:03 pugsbot_r17185 OUTPUT[Junction␤] Bool::True
15:03 [particle1 changed the nick to [particle]
15:03 TimToady yes, you can assign anything to a scalar variable
15:04 Shillo Umm... How about function returns?
15:04 Shillo Any or untyped?
15:04 [particle] ?eval my $x; say $x.WHAT
15:04 pugsbot_r17185 OUTPUT[Scalar␤] Bool::True
15:04 TimToady a function can also return anything it likes, but generally you shouldn't return junctions where they're not expected
15:05 Shillo So that's my question: at the implementation level, when can a compiler assume that it is -not- dealing with a junction?
15:06 [particle] if the compiler assumes it's dealing with Scalar by default, it can always deal with Junction or Any
15:06 TimToady when the variable/parameter's contents are declared as Any or narrower
15:06 diakopter ?eval '/op diakopter'
15:06 pugsbot_r17185 "/op diakopter"
15:07 diakopter ?eval try { '/op diakopter' }
15:07 pugsbot_r17185 "/op diakopter"
15:07 Shillo This makes your function calling convention something like: check each argument for junction-ness, and paralelise, then call
15:07 TimToady no, it just falls out of MMD
15:07 Shillo Which sounds... expensive. At least in the current parrot.
15:07 Shillo Well... That's true.
15:08 TimToady you only have to look at autothreading if the normal MMD dispatch runs out of candidates that don't do junctions
15:08 Shillo OK, got it. :) Although, current parrot doesn't yet support enough MMD for this to work (right?)
15:09 [particle] current parrot mmd impl is a prototype
15:09 [particle] note that the mmd design document is in the draft directory.
15:11 [particle] i'm not sure if parrot mmd can handle this yet... i haven't thought about it enough. if we implement junctions in perl6, i bet this issue will come up sooner rather than later. patches welcome :)
15:11 DarkWolf84 ?eval map {.int},<A B C>
15:11 pugsbot_r17185 (0, 0, 0)
15:11 DarkWolf84 not work
15:12 DarkWolf84 how to get the ascii numbers?
15:12 Shillo Once I locate MMD draft. :)
15:13 Shillo not in docs/pdd/drafts
15:13 Shillo Er, docs/pdd/draft
15:13 TimToady that mmd design document was written before much of S12:857
15:13 TimToady so just refer to S12:857
15:14 Shillo I was looking at pdds, actually
15:14 masak ?eval map { .ord }, <A B C>
15:14 pugsbot_r17185 (65, 66, 67)
15:14 masak DarkWolf84: that way
15:15 masak ('A' is not a number, so '.int' won't convert it right. same in p5)
15:15 Shillo OK, thanks for help. :)
15:15 TimToady ?eval <A B C>\ >>.ord
15:15 pugsbot_r17185 Error: ␤Unexpected ">>."␤expecting "."
15:16 TimToady wish my compose key worked, sigh...
15:16 Shillo ?eval (<A B C>)>>.ord
15:16 pugsbot_r17185 (65, 66, 67)
15:16 masak nice
15:16 TimToady ?eval <A B C>>>.ord
15:16 * Shillo uses bigger hammer.
15:16 pugsbot_r17185 (65, 66, 67)
15:16 TimToady ?eval <A B C>.>>.ord
15:16 pugsbot_r17185 (65, 66, 67)
15:16 Shillo Ooo, nice.
15:17 pmurias joined #perl6
15:18 pmurias diakopter: kmp6? did you mean kp6?
15:19 Shillo [particle]: Found t/pdd15oo/mmd.t, looks like a good ref.
15:19 cognominal_ joined #perl6
15:19 drupek12 joined #perl6
15:24 nferraz joined #perl6
15:30 DarkWolf84 masak, I just marked all let vars with #
15:31 DarkWolf84 Is it fine?
15:31 masak um
15:31 masak not really
15:31 masak the tests themselves are fine
15:31 masak it's pugs that's not in synch
15:32 DarkWolf84 what to do then?
15:32 masak you might need to do something with eval_ok
15:33 masak because right now the problem is that the tests don't even fail because they don't run properly
15:33 masak your goal is to make them run properly and fail :)
15:33 masak I got to go fairly soon
15:33 DarkWolf84 when I marked them they failed
15:33 DarkWolf84 :)
15:34 masak DarkWolf84: yes, well
15:34 masak we want them to succeed when pugs does the Right Thing, too
15:34 DarkWolf84 ok
15:35 DarkWolf84 maybe I have to read doc more carefully
15:35 masak emulate the behavior of some test file that uses eval_ok
15:35 masak I'll find one for you
15:35 DarkWolf84 ok
15:36 Aankhen`` joined #perl6
15:36 masak ah
15:36 masak not eval_ok, but lives_ok
15:37 masak you'll find some at t/var/my.t
15:37 masak line 28
15:37 DarkWolf84 ok
15:37 masak good luck
15:38 * masak shuffles off
15:38 diakopter pmurias - no I meant mp6/kp6 together
15:41 moritz_ re
15:43 crashmatrix Juerd, aaaargh, you are so right in using perl for scripts I would use bash for
15:47 Shillo My favorite first line: /usr/bin/zsh :)
15:47 Shillo Er, with #!
15:47 crashmatrix and a !
15:47 crashmatrix it's hash-bang
15:47 crashmatrix oh, read over it -_-'
15:48 crashmatrix I would use zsh, if it was as widespread as the bourne shell
15:48 moritz_ my favorite first line is 'use v6;'
15:48 * wolverian uses posix sh for scripts
15:48 crashmatrix and my favorite first line is #include <stdio.h>
15:48 wolverian I know, I'm insane.
15:49 moritz_ crashmatrix: then you could help the parrot folks ;)
15:49 pugs_svnbot r17227 | fglock++ | [kp6] Makefile - ignore '.pm~' files
15:49 pugs_svnbot diff: http://dev.pugscode.org/changeset/17227
15:49 lambdabot Title: Changeset 17227 - Pugs - Trac
15:49 crashmatrix moritz_, I didn't quite follow that
15:54 [particle] crashmatrix: http://parrotcode.org needs you!
15:54 lambdabot Title: Parrot Virtual Machine - parrotcode
15:54 melissa joined #perl6
15:55 jettero 4
15:55 jettero (mistell)
15:55 crashmatrix eh, looks interesting
15:56 moritz_ it's coded in C, and the intended target for "the" "final" p6 compiler
15:57 Aankhen`` joined #perl6
15:59 Shillo Got to go. Laters, folks!
15:59 moritz_ see you
16:00 pmurias moritz_: the intended "platform of choice"
16:01 pmurias diakopter: if all goes well, mp6 should die
16:05 diakopter pmurias: oh
16:05 moritz_ pmurias: so kp6 will be able to compile itself? any predictions on how long that might take?
16:06 moritz_ to get there, I mean
16:10 b2gills joined #perl6
16:12 Jamtech joined #perl6
16:17 pmurias i'm not sure, once the captures/signatures/arguments to subroutines & methods work it shouldn't take much
16:17 chris2 joined #perl6
16:17 Pat__ joined #perl6
16:24 buetow joined #perl6
16:34 stevan__ joined #perl6
16:35 moritz_ @seen dmq
16:35 lambdabot I haven't seen dmq.
16:35 moritz_ @seen demq
16:35 lambdabot I saw demq leaving #perl6 1d 25m 2s ago, and .
16:38 cognominal_ joined #perl6
16:41 mst joined #perl6
16:43 mst left #perl6
16:43 mst joined #perl6
16:47 * mst wondering if anybody's had a go at writing p6 rules for p5 syntax
16:47 mst for the fun of trying to use v6-alpha to parse p5 using p6-in-p5
16:47 [particle] brr
16:47 bloonix hi mst
16:47 mst [particle]: I said fun. I never said "sane idea" :)
16:48 bloonix mst: so much sarcasm at tuesday? :)
16:49 justatheory joined #perl6
16:51 penk joined #perl6
17:00 DarkWolf84 I've got the idea
17:00 * DarkWolf84 loves hakin'
17:00 DarkWolf84 :)
17:03 justatheory joined #perl6
17:15 rindolf joined #perl6
17:17 spinclad ?eval my Any $x = (1|2); say $x.WHAT
17:17 pugsbot_r17185 OUTPUT[Junction␤] Bool::True
17:17 spinclad as pugs doesn't implement type checking yet, this makes sense.
17:18 spinclad ?eval my $x; say \$x.WHAT
17:18 pugsbot_r17185 OUTPUT[Scalar␤] Bool::True
17:19 mst left #perl6
17:19 spinclad ?eval my $x; say \$x
17:19 pugsbot_r17185 OUTPUT[␤] Bool::True
17:20 spinclad (unsure if \$x should return the container instead of the contents, if that makes sense)
17:25 devogon joined #perl6
17:25 DarkWolf84 I think that let.t works now
17:26 DarkWolf84 I'll repair temp.t too
17:26 DarkWolf84 and ready to update
17:29 hakobe changed the nick to hkb_zz
17:30 dduncan joined #perl6
17:41 Psyche^ joined #perl6
17:44 daxim joined #perl6
17:53 franck____ joined #perl6
17:55 DarkWolf84 what is the diference between 'ok' and 'is'
17:55 [particle] ok(expr) vs is(actual_value, expected_value)
17:56 DarkWolf84 temp.t is broken too
17:57 Psyche^ changed the nick to Patterner
18:11 franck___ joined #perl6
18:22 IllvilJa joined #perl6
18:23 jisom joined #perl6
18:24 franck____ joined #perl6
18:26 weinig joined #perl6
18:32 jisom joined #perl6
18:32 yahooooo joined #perl6
18:37 lumi joined #perl6
18:45 DarkWolf84 I'm dine with repairing temp.t and let.t but I'm not sure wheter they r fine
18:45 [particle] commit them, and mention in the commit log that you'd like somebody to review them.
18:46 DarkWolf84 ok
18:46 [particle] (descriptive commit messages)++
18:47 Aankhen`` svn ci -m 'it is time. mwahaahahahahahahaa.'
18:53 feb left #perl6
19:01 breinbaa1 joined #perl6
19:04 DarkWolf84 ok
19:04 DarkWolf84 i make last check
19:14 DarkWolf84 make realclean don't cear all files
19:15 DarkWolf84 like some made from make smoke
19:17 pugs_svnbot r17228 | lwall++ | Must check for terminators before assuming "if" etc. are modifiers, pmichaud++
19:17 pugs_svnbot diff: http://dev.pugscode.org/changeset/17228
19:17 lambdabot Title: Changeset 17228 - Pugs - Trac
19:26 pugs_svnbot r17229 | lwall++ | require statement-ending ; after non-line-final } consistently
19:26 pugs_svnbot diff: http://dev.pugscode.org/changeset/17229
19:26 lambdabot Title: Changeset 17229 - Pugs - Trac
19:32 pugs_svnbot r17230 | darkwolf++ | little canges in t/var/let.t & t/var/temp, need to check
19:32 pugs_svnbot diff: http://dev.pugscode.org/changeset/17230
19:32 lambdabot Title: Changeset 17230 - Pugs - Trac
19:33 DarkWolf84 I'm ready
19:33 DarkWolf84 T need someone really to check this
19:33 DarkWolf84 I need someone really to check this
19:37 DarkWolf84 I'm not sure whether theese files r fine
19:38 DarkWolf84 coz that is my first change in test files
19:38 q{-oo-}p joined #perl6
19:43 moritz_ DarkWolf84: looking...
19:43 moritz_ let.t looks fine
19:46 moritz_ there are two unnecessary whitespaces changes, but apart from that it looks clean
19:46 moritz_ DarkWolf84++
19:46 DarkWolf84 :)
19:46 DarkWolf84 allright
19:47 DarkWolf84 second commitment and one step close to perl6 :)
19:48 moritz_ DarkWolf84: did you add yourself yet to AUTHORS?
19:48 DarkWolf84 yeah
19:48 moritz_ good ;)
19:48 DarkWolf84 last commitment
19:49 Blwood how can we help in the pugs project ?
19:49 DarkWolf84 Imade simple tcp server then
19:49 moritz_ Blwood: what languages do you "speak"?
19:49 moritz_ Blwood: programming languages, that is
19:51 Blwood moritz_, C, perl , js, php and some base of asm
19:51 moritz_ Blwood: you can mostly help with perl and C
19:51 moritz_ Blwood: if you want to do some C stuff you could help with parrot, the virtual maschine designed for perl
19:52 moritz_ Blwood: see http://www.parrotcode.org/
19:52 lambdabot Title: Parrot Virtual Machine - parrotcode
19:52 Blwood and with perl stuff ?
19:52 moritz_ Blwood: if you want to do some perl coding, you can help with v6.pm, Pugs::Compiler::Rule, mp6 and kp6
19:53 moritz_ or support our infrastructure, like modularizing the test suite
19:54 Blwood and how can I do that, I mean is there a plan, a group ... ?
19:55 moritz_ first of all read here for different possibilities to help: http://www.perlmonks.org/?node_id=628746
19:55 lambdabot Title: Getting Involved with Perl 6
19:56 Blwood okay
19:56 moritz_ the refacturing of the test suite is not really good planned, you can read old discussions on that topic (for example on p6c and in the IRC logs), and contribute your own ideas
19:57 moritz_ the basic problem is that other implementations can't parse as much syntax as pugs can, so they can't run a good deal of the test suite
19:58 weinig joined #perl6
19:59 moritz_ if you are into perl5 programming, you could help diakopter++ with his project to create evalbots for the different implematations
20:00 Blwood "Port p5 modules to p6." that sounds good for me
20:01 weinig_ joined #perl6
20:02 Blwood to help in test suite, basically it's to write test when we find a bug ?
20:02 moritz_ and it's a good start to learn p6 more thoroughly
20:03 moritz_ Blwood: not only that... split it into more files, some with more advanced features, so that ones with simpler features can be run by kp6 and p6-on-parrot
20:05 Blwood well I think first I'll learn p6 more thoroughly and how the community works on #perl6.
20:05 moritz_ the last part is easy - we talk when we feel like, and what we want to ;)
20:05 Blwood yeah :)
20:07 jettero joined #perl6
20:11 moritz_ I'd also recommend to subscribe p6c and p6l, they're fairly low traffic
20:12 moritz_ except when TheDamian and Mark Overmeer start to discuss POD ;)
20:14 [particle] ?eval "you must join parrot"
20:14 pugsbot_r17185 "you must join parrot"
20:16 moritz_ [particle]: I always try to send you coders as soon as somebody mentions C, but it doesn't work all the time ;)
20:16 [particle] thanks :)
20:16 [particle] i figure i need to use subliminal messages from time to time, and pugsbot is as good as it gets here :)
20:17 moritz_ but it's good if you promote parrot here as well (I think we are in quite different time zones, and $job takes consumes most of my time)
20:17 moritz_ send parrotbot here! ?parrot .print "You MUST join parrot"
20:17 [particle] hee
20:18 moritz_ or perhaps ?pir
20:19 [particle] someday soon maybe we'll have ?perl6
20:19 moritz_ for p6-on-parrot?
20:19 [particle] yep.
20:19 [particle] or ?nqp
20:20 moritz_ http://ars.userfriendly.org/cartoons/?id=19991007&amp;mode=classic ;)
20:20 lambdabot Title: UserFriendly Strip Comments
20:29 moritz_ anyway, bed &
20:33 Blwood_ joined #perl6
20:37 flokuehn joined #perl6
20:40 DarkWolf84 why pugscc not work
20:40 DarkWolf84 It gives me some wierd message
20:40 DarkWolf84 and do not compile
20:41 DarkWolf84 pugs: XXX
20:46 yahooooo joined #perl6
20:51 buetow joined #perl6
20:55 ron_ joined #perl6
21:02 Blwood joined #perl6
21:04 Daenyth` Is there a block I can put inside a given{} which will be run in every case where the default{} block is NOT run?
21:09 justatheory joined #perl6
21:18 buetow joined #perl6
21:30 rhr Daenyth`: I think if you put the default block at the top, anything after that but before any when will be run whenever the default isn't run
21:31 Daenyth` ahh
21:31 Daenyth` tricksy
21:31 Daenyth` the way I had it set up before, I was prepending a little bit to the output if my bot didn't know how to handle a server line... except that printing the line from the server AFTER the whens meant that it printed the response before printing its input!
21:37 melissa joined #perl6
21:41 PerlJam Daenyth`: $flag = 0;  given $blah { ... default { $flag = 1; } }  if $flag == 0 { say "The default wasn't run" }
21:42 Daenyth` right, but I would also need that to run before it runs any blocks from a when
21:42 PerlJam oh, you need some premonition then?  "Run the following code if the default won't be selected"  ?
21:42 Daenyth` yes
21:43 Daenyth` is that possible?
21:43 Daenyth` hmm, interesting note: it seems as though if you put a  default block before when blocks in a given, pugs dies silently
21:43 diakopter sure, a subroutine that's called from each non-default case :P
21:43 Daenyth` that's ugly :(
21:44 PerlJam Daenyth`: you're asking for something ugly.
21:44 Daenyth` suppose so
21:44 PerlJam Daenyth`: you could reproduce the given block
21:45 Daenyth` ?eval given 1 { default { say 'default' } when 1 { say 1 } }
21:45 pugsbot_r17185 OUTPUT[default␤] Bool::True
21:45 Daenyth` hrm
21:45 Daenyth` odd...
21:45 Daenyth` ?eval given 1 { default { say 'default' } say 'foo'; when 1 { say 1 } }
21:45 PerlJam OR you could make all of your whens call the same subroutine which outputs whatever (and then does its own version of given)
21:45 pugsbot_r17185 OUTPUT[default␤] Bool::True
21:45 PerlJam or you could rely on MMD to handle the proper calling.
21:45 Daenyth` strange.. my pugs just dies
21:45 rhr ah, yes default can't predict the future :(
21:47 PerlJam Daenyth`: how many whens do you have and what do they look like?
21:47 Daenyth` several
21:47 Daenyth` and more to come
21:47 Daenyth` mostly regexs
21:47 Daenyth` pastebinning
21:47 Daenyth` implementing a crappy IRC bot
21:48 PerlJam Daenyth`: or, since the problem seems to be that your when block are outputting something, just have them set a variable to be output later.
21:48 PerlJam s/block/blocks/
21:49 Daenyth` I'll most likely just have them all call a function
21:49 Daenyth` since I'll most likely be doing that anyway
21:49 Daenyth` ie, when /:\S+ PRIVMSG (\S+) :(.*)/ { handle_privmsg( $0, $1 ) }
21:50 pasteling "Daenyth" at 24.91.13.73 pasted "When I run the following code, pugs closes itself with no output at all. Version: 6.2.13 (r17219)" (131 lines, 2.9K) at http://sial.org/pbot/26729
21:52 PerlJam Daenyth`: I'd just stick a sub call in the appropriate places.
21:52 Daenyth` another interesting note: when I sent lines to the server with "\d015\d012", it failed, but it works when I send lines with "\r\n"
21:55 rhr contrary to what I said previously, default at the top never makes sense.  default depends on previous whens breaking out to do its thing (it's really a no-op)
21:56 Daenyth` ohh... I know why it's not printint output
21:56 Daenyth` printing^
21:56 Daenyth` $debug is false so my default {} block printed nothing, and then it never got to the WHEN to handle server PING and the connection timed out
21:57 Daenyth` forgot to set debug true
21:57 Daenyth` lol
21:58 ozo joined #perl6
22:00 DarkWolf84 ?eval say b0111
22:00 pugsbot_r17185 Error: No such subroutine: "&b0111"
22:00 DarkWolf84 ?eval say "\b0111"
22:00 pugsbot_r17185 OUTPUT[0111␤] Bool::True
22:01 Daenyth` <Daenyth`> another interesting note: when I sent lines to the server with "\d015\d012", it failed, but it works when I send lines with "\r\n"
22:01 Daenyth` Does anyone know about that?
22:01 Daenyth` They *should* be the same thing
22:01 Daenyth` is \d not properly implemented yet?
22:02 Daenyth` ?eval say 'true' if "\d015" eq "\r"
22:02 pugsbot_r17185 undef
22:02 DarkWolf84 ?eval say 0xffffff
22:02 Daenyth` ?eval say 'true' if "\d012" eq "\n"
22:02 pugsbot_r17185 OUTPUT[16777215␤] Bool::True
22:02 pugsbot_r17185 undef
22:02 Daenyth` hrm :|
22:02 DarkWolf84 sry
22:03 DarkWolf84 ?eval 0o755
22:03 pugsbot_r17185 493
22:03 DarkWolf84 works
22:03 Daenyth` ?eval say "\d015"
22:03 pugsbot_r17185 OUTPUT[␤] Bool::True
22:04 Daenyth` ?eval print "\d015"
22:04 pugsbot_r17185 OUTPUT[] Bool::True
22:04 Daenyth` ?eval print "\d012"
22:04 pugsbot_r17185 OUTPUT[] Bool::True
22:04 DarkWolf84 is there any way to print numbers in binary or hex context
22:04 Daenyth` I don't know
22:04 Daenyth` ?eval print asc("\d012")
22:04 pugsbot_r17185 Error: No such subroutine: "&asc"
22:04 Daenyth` err
22:04 Daenyth` hrm
22:05 DarkWolf84 ?eval 24.bin
22:05 pugsbot_r17185 Error: No such method in class Int: "&bin"
22:05 DarkWolf84 yeah
22:05 DarkWolf84 it's not it
22:06 DarkWolf84 I have to check the synposises
22:07 Daenyth` ohh
22:07 Daenyth` it's not decimal 015, 012
22:07 Daenyth` it's octal
22:07 Daenyth` ?eval say 'true' if "\o015" eq "\r"
22:07 pugsbot_r17185 OUTPUT[true␤] Bool::True
22:08 * Daenyth` does the Eureka dance
22:08 Daenyth` I should have checked my ascii table sooner :(
22:12 DarkWolf84 ?eval 42.WHAT
22:12 pugsbot_r17185 ::Int
22:12 DarkWolf84 It's beter to make unicode table
22:12 DarkWolf84 :)
22:13 DarkWolf84 perl6 uses unicode
22:13 Daenyth` yeah yeah
22:13 DarkWolf84 J
22:13 Daenyth` how do I input unicode in vim?
22:14 DarkWolf84 I think i has native unocode support
22:14 DarkWolf84 unicode*
22:14 DarkWolf84 like nano
22:14 DarkWolf84 or emacs
22:14 Daenyth` right but
22:14 Daenyth` how do I input it
22:14 Daenyth` my keymap isn't set up for it
22:14 DarkWolf84 the only way is from char table
22:15 Daenyth` What's a good keymap if I'm used to us qwerty?
22:15 DarkWolf84 my keyboard uses latin and cyrilic characters
22:16 Daenyth` actually
22:16 Daenyth` do you know of any gui program that's like a combined showkeys and xmodmap?
22:18 rhr with vim you can do the control-k thing, :help digraphs
22:18 DarkWolf84 for characters that can't type with keyboard I use Gucharmap
22:18 Daenyth` rhr: thanks
22:18 Daenyth` I should hack my keymap to use AltGr, but I'm too lazy
22:18 Daenyth` I'll go look for a gui keymap control program
22:20 DarkWolf84 a keymap changing program
22:20 DarkWolf84 heh
22:20 DarkWolf84 I use that is in gentoo by default
22:20 Daenyth` xmodmap is painful to use
22:21 Daenyth` I mean.. I can
22:21 Daenyth` but it's annoying
22:21 Daenyth` especially if I want to fiddle on a large scale
22:21 Daenyth` DarkWolf84: what do you use?
22:21 dduncan left #perl6
22:21 DarkWolf84 for gui only X libs for keyboard
22:22 Daenyth` ?
22:22 Daenyth` What's the name of the program?
22:22 DarkWolf84 or gnome keyboard program
22:22 DarkWolf84 w8
22:23 DarkWolf84 at the moment I use that thing from gnome
22:23 cognominal_ joined #perl6
22:25 thoughtpolice joined #perl6
22:26 DarkWolf84 It's called just keybard preferencies
22:26 DarkWolf84 maybe gnome keyboard preferencies
22:27 Daenyth` if it's a menu entry, right click and do properties, see where the .desktop file is, and see what it launches?
22:27 DarkWolf84 ok
22:27 DarkWolf84 it's on my panel
22:27 DarkWolf84 gnome-keyboard-properties
22:28 DarkWolf84 that's it
22:28 Daenyth` thanks
22:28 DarkWolf84 kde has it's own
22:28 DarkWolf84 and xorg has its own too
22:29 weinig joined #perl6
22:29 DarkWolf84 but for me is dificult to use it
22:29 DarkWolf84 or maybe I'm lazy
22:30 DarkWolf84 I mean that in xorg
22:42 DarkWolf84 ?eval :2<111>
22:42 pugsbot_r17185 7
22:42 DarkWolf84 ?eval say 5.:2
22:42 pugsbot_r17185 Error: ␤Unexpected ":2"␤expecting ".", "\187", ">>", "=", "^", operator name, qualified identifier, variable name, "...", "--", "++", "i", array subscript, hash subscript or code subscript
22:42 DarkWolf84 oops
22:44 Limbic_Region joined #perl6
22:51 DarkWolf84 maybe there is no num2hex or num2bin in the spec
22:56 Juerd crashmatrix: Perl is the ultimate versatile sysadmin automation tool.
22:56 Juerd Some languages are nicer for application programming, but nothing beats it for sysadmin stuff.
22:56 Juerd In unix, that is ;)
23:01 melissa joined #perl6
23:01 jjore-w unless Python does.
23:02 jjore-w it's interesting to see linux distros replacing their stuff that used to be shell or perl or whatever with piles of python programs.
23:03 DarkWolf84 I like perl amd make programs for my needs
23:04 Blwood Python is a tab killer : |
23:04 DarkWolf84 tab killer?
23:05 Blwood yeah in Python you have to indent your code
23:05 crashmatrix Juerd, as I figured out today, bash script just grow incredibly complex syntax wise, for relatively simple tasks
23:05 crashmatrix so yes, I should probably start learning Perl asap :)
23:06 DarkWolf84 perl golfing is good
23:06 DarkWolf84 :)
23:12 melissa joined #perl6
23:42 melissa joined #perl6
23:46 pugs_svnbot r17231 | lwall++ | line-final curlies are now forgiving of rules that eat whitespace (pmichaud++)
23:46 pugs_svnbot r17231 | lwall++ | current whitespace from/to positions now kept in current match status object
23:46 pugs_svnbot r17231 | lwall++ | the ws token now automatically returns success if recalled at $.ws_to position
23:46 pugs_svnbot diff: http://dev.pugscode.org/changeset/17231
23:46 lambdabot Title: Changeset 17231 - Pugs - Trac
23:55 pugs_svnbot r17232 | lwall++ | context args typed to StrPos, and arglist's arg now positional
23:55 pugs_svnbot diff: http://dev.pugscode.org/changeset/17232
23:55 lambdabot Title: Changeset 17232 - Pugs - Trac

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

Perl 6 | Reference Documentation | Rakudo