Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2009-08-15

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:01 eternaleye I'm very tempted to write a Vim clone in Perl 6 now that Tene++ has Parrot's ncurses module handling colored output
00:02 eternaleye For one thing, syntax hilighting would be very, very nice
00:08 gigabo left #perl6
00:11 cognominal I bet so, and if you do so, make sure to support dynamic highlighting, means when you click on an operator. it displays the operator token(s) in read and the operand in blue. With Perl 6 supporting an indefinite level of precedence, one need that to avoid defensive parentheses
00:12 cognominal s/level of precedence/number of precedence levels/
00:19 hsb joined #perl6
00:54 Tene eternaleye: colored output has worked in rakudo vim for months.
00:56 eternaleye Tene: Do you mean rakudo ncurses?
00:56 Tene Yes.
00:56 eternaleye Also, there was something you fixed in there lately. If it wasn't color, was it unicode?
00:56 rafl joined #perl6
00:56 Tene No, unicode still doesn't work.
00:57 Tene I have some thoughts, but haven't experimented.
00:57 eternaleye hm
00:57 Tene What I mentioned was figuring out how to use 256 colors in it.
00:57 eternaleye Ah
01:17 pugs_svn r27995 | kyle++ | [t/spec] Change "is also" to "augment" (and skip)
01:28 dukeleto i know about the perl6 do { .. }, is there something like perl 5's do 'file.pl' ?
01:32 TimToady evalfile
01:34 dukeleto TimToady++
01:35 Khisanth joined #perl6
01:45 ewilhelm echo 'my $x ||= 8; $x++; say "hello $x";' > hello.pl; ./perl6 -e 'for 1..5 { evalfile("hello.pl") }' # alternates between printing 1 and 9
01:46 ewilhelm the ||= is obviously silly with 'my', but odd behavior
01:48 ewilhelm is evalfile() supposed to have the same lexical semantics as do 'file' ?
01:49 TimToady rakudo is still working out the kinks in their lexicals
01:49 diakopter the lexicals are kinky
01:51 ewilhelm I suppose Symbol '$x' not predeclared in <anonymous> (hello.pl:1) will ruin my bad idea there anyway
01:52 ewilhelm better to read a snippet of code into a string and compile that into a sub probably
02:05 KyleHa Is there anything Perl 6 outputs that's not an error message or warning?
02:06 KyleHa I guess its version info...
02:06 KyleHa I'm thinking that if we created a tree of exception classes, that would be a good place to go all i18n since that's the bulk of the program's self-created output.
02:29 meppl good night
02:31 satrac joined #perl6
02:33 KyleHa phenny tell pmichaud I'm curious to know whether pugs r27987 and r27994 are work in the right direction.
02:34 KyleHa @seen phenny
02:34 lambdabot phenny is in #perl6. I last heard phenny speak 10h 32m 19s ago.
03:00 flipr joined #perl6
03:02 KatrinaTheLamia joined #perl6
03:03 _jaldhar joined #perl6
03:10 zarko joined #perl6
03:13 s1n @seen pmichaud
03:13 lambdabot pmichaud is in #perl6. I last heard pmichaud speak 1d 6h 18m 24s ago.
03:18 TimToady_ joined #perl6
03:18 s1n pmichaud: here's the tentative idea behind the mini-hackathon: http://s1n.dyndns.org/index.php/2009/08/13/perl-6-mini-hackathon/
03:18 s1n pmichaud: i'm going to talk with frew and try to schedule it early next week
03:34 satrac left #perl6
03:47 tak11 joined #perl6
03:53 pugs_svn r27996 | lwall++ | [STD] improve message after map {} @a
04:07 carlin joined #perl6
04:20 tann joined #perl6
04:40 ingy joined #perl6
05:19 zarko left #perl6
05:20 zarko joined #perl6
05:27 kane_ joined #perl6
05:29 tak11 joined #perl6
05:45 orafu joined #perl6
05:51 pugs_svn r27997 | kyle++ | [t/spec] autounfudge
05:52 pugs_svn r27998 | kyle++ | [t/spec] Adjust some skip fudges
06:40 carlin joined #perl6
06:47 molaf joined #perl6
06:59 zamolxes joined #perl6
07:12 morensel joined #perl6
07:17 morensel any regex gurus?:P
07:18 elmex joined #perl6
07:19 morensel rather long regex though
07:28 tak11 joined #perl6
07:46 finanalyst joined #perl6
07:55 morensel left #perl6
08:10 meppl joined #perl6
08:11 zloyrusskiy joined #perl6
08:12 iblechbot joined #perl6
08:37 xinming_ joined #perl6
08:37 xinming_ joined #perl6
08:57 meteorjay joined #perl6
09:01 zloyrusskiy joined #perl6
09:06 rafl_ joined #perl6
09:11 zloyrusskiy joined #perl6
09:12 zloyrusskiy joined #perl6
09:32 xinming_ joined #perl6
09:49 Testlamp joined #perl6
09:52 jan_ joined #perl6
10:07 xinming joined #perl6
10:09 sri_kraih joined #perl6
10:12 xinming joined #perl6
10:18 eMaX joined #perl6
10:19 molaf joined #perl6
10:23 xinming__ joined #perl6
10:38 jnthn hi all
10:39 mberends hi jnthn, it's quiet here
10:39 phenny mberends: 14 Aug 15:35Z <masak> tell mberends t/01-simple.t in the HTTP::Daemon repo says `undef( $daemon )`, but that's a perl5ism, and Rakudo dies on it.
10:39 phenny mberends: 14 Aug 16:02Z <masak> tell mberends HTTP::Daemon crashes when trying to GET /favicon.ico -- http://gist.github.com/167912 -- apparently Parrot has gotten stricter of late with decoding UTF-8.
10:40 jnthn Trust masak to provide delayed-action un-quiet. :-)
10:41 mberends from the backlog I knew this one was pending :)
10:43 beggars joined #perl6
10:47 mberends phenny, tell masak thanks for the warning, I had hit the problem too, the slurp() in send_file needs a :bin<True> argument to fix it
10:47 phenny mberends: I'll pass that on when masak is around.
10:48 mberends masak++ # Destroyer of my complacency this time
10:54 mberends phenny, tell masak for the Web.pm webserver API, the abstraction design follows almost automatically from developing implementations for HTTP::Daemon and an external web server (Apache, Lighttpd etc) side by side. If you have a generic API for the URL dispatcher, then for callbacks construct a Dispatcher object to pass to the web server.
10:54 phenny mberends: I'll pass that on when masak is around.
10:57 sri_kraih_ joined #perl6
11:07 M_o_C joined #perl6
11:19 pugs_svn r27999 | wayland++ | [S02,S16,S32/IO] Added special quoting that creates IO::FSNode objects.
11:19 pugs_svn r27999 | wayland++ | This could still be controversial, but I've gone with the
11:19 pugs_svn r27999 | wayland++ | "Forgiveness/Permission" thing.  If no-one fights it, I'll revise the
11:19 pugs_svn r27999 | wayland++ | Draft IO specs (S16 and S32/IO) to refer to IO::FSNode objects in
11:19 pugs_svn r27999 | wayland++ | appropriate places instead of strings.
11:20 wayland76 Cool, I'm in the top 15 for karma :)
11:24 pmurias joined #perl6
11:24 pmurias wayland76: how can one see the ranking?
11:39 xomas joined #perl6
11:53 wayland76 lambdabot: @karma-all
11:53 lambdabot "ethanbot2"          1454
11:53 lambdabot "moritz"              946
11:53 lambdabot "pmichaud"            624
11:53 lambdabot "lwall"               574
11:53 lambdabot "jnthn"               524
11:53 lambdabot [1847 @more lines]
11:53 wayland76 lambdabot: @more
11:53 lambdabot "pmurias"             452
11:53 lambdabot "masak"               304
11:53 lambdabot "kyle"                247
11:53 lambdabot "azawawi"             241
11:53 lambdabot "ruoso"               168
11:53 lambdabot [1842 @more lines]
11:54 wayland76 lambdabot: @more
11:54 lambdabot "putter"              149
11:54 lambdabot "C/C"                 144
11:54 lambdabot "moritz_"             121
11:54 lambdabot "TimToady"            101
11:54 lambdabot "wayland"              97
11:54 lambdabot [1837 @more lines]
11:54 wayland76 You can also do it via private message: /msg lambdabot etc
11:55 frettled Weird that TimToady++ doesn't have a higher ranking.
11:55 frettled (I know, I know, his alter ego is way up there)
11:55 wayland76 frettled: Add TimToady + TimToady_ + lwall and you get more
11:55 finanalyst joined #perl6
11:55 frettled wayland76: perhaps lambdabot should learn nick aliases?
11:56 wayland76 pmurias is in the top 5 (assuming we don't count ethanbot -- I'm sure that wasn't there recently :) )
11:56 wayland76 Well, it would be nice if it would do that, and also learn that C/C-- should not get more karma :)
11:59 frettled hehe
12:00 frettled For instance, nick equality for \$nick[_]*
12:01 shachaf_ joined #perl6
12:02 nicomen joined #perl6
12:02 Tene joined #perl6
12:03 zamolxes joined #perl6
12:03 PerlJam joined #perl6
12:03 wayland76 While it doesn't show here, it'd be nice if it'd also learn to properly karma eg. (Moritz Lenz)++ :)
12:06 frettled mm
12:07 frettled Who is maintaining the bot?
12:11 masak joined #perl6
12:12 masak rakudo: ((Temporal::DateTime.new(:date(Temporal::Date.new(:year(2010), :month(4))), :time(Temporal::Time.new)).epoch - time) / 86400).ceiling.fmt("%d days left until April!").say
12:12 phenny masak: 10:47Z <mberends> tell masak thanks for the warning, I had hit the problem too, the slurp() in send_file needs a :bin<True> argument to fix it
12:12 phenny masak: 10:54Z <mberends> tell masak for the Web.pm webserver API, the abstraction design follows almost automatically from developing implementations for HTTP::Daemon and an external web server (Apache, Lighttpd etc) side by side. If you have a generic API for the URL dispatcher, then for callbacks construct a Dispatcher object to pass to the web server.
12:12 p6eval rakudo 0d4fe0: OUTPUT«229 days left until April!␤»
12:12 masak ack.
12:12 masak &
12:14 Whiteknight joined #perl6
12:19 jnthn Uff. I wish you could write that more like Temporal::Date.new(:year(2010), :month(4)).subtract(Temporal::Date.Today).days or similar.
12:22 frettled jnthn: or just (Temporal::DAte.new(:year(1020),:month(4)) - Temporal::Date.Today).days ;)
12:24 jnthn Yes, or that.
12:24 jnthn In fact, preferably that.
12:24 frettled My typos are interesting.
12:25 frettled jnthn: btw, my brain struggles a bit every time I see you typing «uff» :D
12:25 * frettled isn't used to seeing that in English-language fora.
12:28 masak my current vision spells (Temporal::DateTime('2010-04-01') - now()).days()
12:28 jnthn frettled: It's not very English-language. :-)
12:28 frettled jnthn: I know, i'ts Norwegian.  :D
12:28 jnthn orly?
12:29 frettled Yet another interesting typo.  Hmm.
12:29 frettled masak: that works, too.
12:29 jnthn That wasn't the language I stole it from. :-)
12:29 jnthn Does it carry the same kind of meaning? (Like, "ouch"-ish"?)
12:30 masak I'd say it means the person is deflated in some way.
12:30 jnthn Yeah, sounds about right.
12:30 jnthn It's in Swedish too?
12:31 frettled It's a complaining onomatopoetic.
12:31 frettled s/ti/i/
12:31 masak jnthn: I think so.
12:31 frettled It's in Danish as well, I think.
12:31 jnthn Heh
12:31 frettled Very Nordic.
12:31 jnthn It's used with similar sentiment in Slovak also.
12:31 frettled But it's also in American English, from the Norwegian immigrants. :)
12:31 masak but the register of the word seems to be in Donald Duck comics or similar.
12:32 iblechbot joined #perl6
12:32 jnthn Though by now has just slipped into my "probably works language-independent" bunch of vocab. ;-)
12:33 jnthn masak: BTW, not sure if I mentioned this before, but Slovak has loaned the Swedish word "skanzen".
12:33 jnthn It's the first Swedish loanword I've discovered. :-)
12:33 jnthn (I'm not sure it's spelt the same though in Swedish.)
12:33 masak "Skansen".
12:34 masak but that's originally a German word.
12:34 arnsholt jnthn: What does it mean in Slovak?
12:34 masak meaning "fortification" or some such.
12:34 jnthn In Slovak it means "open air museum".
12:35 jnthn masak: It means fortification in Swedish too?
12:35 masak jnthn: originally, yes. but nowadays it's mostly a famous open scene in Stockholm.
12:35 jnthn Ah, OK.
12:36 masak it's also a specific part on sailing boats.
12:36 jnthn So maybe a case of "take the name of something and generalize it while loaning it"
12:36 wayland76 And not to be confused with "Nansen" :)
12:36 jnthn More than a direct borrowing.
12:36 arnsholt Or, "loan something without knowing what it really means"
12:37 arnsholt Surprisingly common phenomenon I think
12:37 jnthn Yes, I think so.
12:37 masak cargo culting.
12:38 jnthn Along the lines of e.g. http://en.wikipedia.org/wiki/Vauxhall#Vauxhall.2C_Russian_railway_stations.2C_and_Pushkin
12:38 arnsholt Yah. Unfortunately my etymological dictionary didn't have "skanse" in it, so I couldn't find any aditionaly info on the word
12:54 antiphase joined #perl6
13:00 antiphase joined #perl6
13:06 lucs_ joined #perl6
13:14 JimmyZ joined #perl6
13:19 carlin left #perl6
13:38 cyocum joined #perl6
13:38 PZt joined #perl6
13:38 cyocum rakudo: (rand() * 100) % 6;
13:38 p6eval rakudo 0d4fe0:  ( no output )
13:39 cyocum hummm..
13:39 cyocum rakudo: rand() * 100;
13:39 p6eval rakudo 0d4fe0:  ( no output )
13:41 cyocum rakudo: rand();
13:41 p6eval rakudo 0d4fe0:  ( no output )
13:42 cyocum exit
13:42 cyocum lol
13:43 jnthn cyocum didn't say much ;-)
13:44 diakopter rakudo: say rand
13:44 p6eval rakudo 0d4fe0: OUTPUT«0.730659864683734␤»
13:49 frew joined #perl6
13:53 frew joined #perl6
14:01 frettled rakudo: say rand * 10..15
14:01 frettled (shouldn't work?)
14:01 p6eval rakudo 0d4fe0: OUTPUT«7.526539508990068.526539508990069.5265395089900610.526539508990111.526539508990112.526539508990113.526539508990114.5265395089901␤»
14:01 frettled blimey, it does.
14:02 frettled <3 Perl 6
14:02 frettled rakudo: say (rand * 10..15).perl
14:02 masak joined #perl6
14:02 p6eval rakudo 0d4fe0: OUTPUT«9.67210940159024..15␤»
14:03 frettled That was a bit more surprising.
14:04 masak not more surprising than the other one, I'd say.
14:05 masak infix:<..> has relatively loose priority.
14:05 frettled Hrm, so what did I do wrong in .perl-ing that one, then?
14:06 masak nothing.
14:06 masak that's what it returns.
14:15 wayland76 Maybe you wanted the .ast or something?
14:15 masak hm, any particular reason is returns got/expected diagnostics, and is_deeply doesn't?
14:15 wayland76 Anyway, 'night all :)
14:15 masak wayland76: o/
14:15 masak sleep well!
14:16 wayland76 Well, I try, but I usually make a few mistakes :)
14:16 wayland76 afk &
14:47 Psyche^ joined #perl6
14:54 masak I'm getting an error in t/spec/S12-methods/indirect_notation.rakudo.
14:54 masak anyone else get that?
14:58 dalek rakudo: ada2b41 | masak++ | Test.pm:
14:58 dalek rakudo: [Test.pm] added diagnostics to is_deeply
14:58 dalek rakudo: Also took the opportunity to change the arbitrary $this and $that parameters
14:58 dalek rakudo: to $got and $expected, in line with how &is does it. Also removed one
14:58 dalek rakudo: multi variant in favor of a default parameter value.
14:58 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/ada2b41a8da3f85105eb2d35747cc012dac91ef4
15:06 TimToady wayland76: I really dislike IO::FSNode as a name.  Is there any reason it the notion can't be combined with IO
15:07 masak TimToady: he just went to bed, to make mistakes.
15:08 TimToady ah, so I see.
15:08 TimToady I just have an irrational hatred for names containing the (usually) meaningless word Node
15:09 masak I can empathise with that.
15:09 TimToady and I think IO::FSNode is popping out all over, and ought to huffmanize to IO
15:09 masak I don't know why exactly, but I feel that the current File IO spec is uncharacteristically heavy-weight.
15:10 TimToady "Beware the Turing Tarpit, where everything is possible, and nothing is easy."
15:11 masak right.
15:11 TimToady thought I suspect that is referring more to oversimplified designs than to overcomplexified
15:12 FCO joined #perl6
15:12 eiro joined #perl6
15:13 eiro joined #perl6
15:13 masak looking at something like IO::FileSystems and how it's defined, I find myself mentally giving off about one 'WTF?' per line.
15:13 eiro hello all
15:13 masak s/FileSystems/FileSystem/
15:14 masak eiro: helo
15:16 masak rakudo: class A { sub foo() {} }; class B { my sub foo() {} }
15:16 p6eval rakudo 0d4fe0:  ( no output )
15:16 masak what's the difference between the &foo in A and the &foo in B?
15:19 eiro_ joined #perl6
15:29 jnthn masak: What kind of error gives t/spec/S12-methods/indirect_notation.rakudo?
15:30 jnthn masak: Difference is in scoping.
15:30 jnthn rakudo: class A { sub foo() {1} }; class B { my sub foo() {2} }; say &A::foo(); say &B::foo();
15:30 p6eval rakudo 0d4fe0: OUTPUT«1␤invoke() not implemented in class 'Undef'␤in Main (/tmp/ynFZwCVfNv:2)␤»
15:31 masak jnthn: Cannot use .* when method is a code ref at line 126, near ".sort, 'm-"
15:31 jnthn masak: I think you need to pull.
15:31 masak ok.
15:31 jnthn I only implemented support for that last night.
15:32 Lorn joined #perl6
15:33 jaldhar_ joined #perl6
15:33 masak ah. I had run make, but not make install. :)
15:33 masak will take a while to get used to that...
15:35 FCO joined #perl6
15:39 masak can I use .comb on a string to extract [all occurrences of the apostrophe character, followed by an even number of backslashes]?
15:39 masak s/followed/preceded/, sorry :)
15:43 TimToady yes, but that almost certainly means you should be parsing the string left-to-right instead :)
15:44 masak isn't that what .comb does?
15:45 * masak arrives at /<!before \>[\\]*'/
15:46 TimToady anything with an implied .*? isn't really parsing, in my book
15:46 TimToady but you can get away with it if there are no other escapes
15:47 TimToady as soon as you introduce, say, quotes, you're hosed
15:47 TimToady gotta run
15:47 TimToady afk &
15:47 masak TimToady: I'm writing a CSV parser. this particular regex is just to forbid quotes mid-value.
15:48 masak this is exactly at the point where I introduce quotes.
15:48 nihiliad joined #perl6
16:00 SmokeMachine joined #perl6
16:02 FCO joined #perl6
16:14 jferrero joined #perl6
16:14 kane_ joined #perl6
16:26 Gothmog_ joined #perl6
16:39 TimToady that probably fits into my definition of parsing then
16:39 molaf joined #perl6
16:39 masak TimToady: it might please you to know that I've now refactored my CSV parser to use a grammar.
16:39 masak thanks for the grumpy feedback. :)
16:40 masak (it now looks much nicer, and can already tell commas inside of quotes from commas outside)
16:44 masak jnthn: how hard would it be to implement FIRST {} ?
16:49 jnthn masak: Is that meant to run on the first iteration of a loop only?
16:52 masak jnthn: aye.
16:52 masak rakudo: class A { method slurp($file) { slurp($file) } }; A.slurp("Test.pm") # Parrot bug? :(
16:52 p6eval rakudo 0d4fe0: OUTPUT«too few arguments passed (1) - 3 params expected␤in method A::slurp (/tmp/uNXpXyyyOS:2)␤called from method A::slurp (/tmp/uNXpXyyyOS:2)␤called from Main (/tmp/uNXpXyyyOS:2)␤»
17:01 masak in the interests of release-early, here's a simple CSV parser: http://github.com/masak/cvs/
17:01 masak I'll add it to proto's projects.list, so that people can download it from there.
17:24 jnthn masak: Maybe Parrot bug, if methods are "has"-scoped by default (that is, they don't make a namespace entry).
17:25 masak jnthn: you mean one can call methods that way too?
17:25 masak I thoughts methods were always called with a dot.
17:25 masak s/s//
17:26 jnthn Hmm. I'm not sure that sub dispatch lookup completely ignores Routines in the namespace, be they Method or Sub.
17:26 jnthn It may well be spec'd one way or the other. I forget.
17:27 masak seems I have yet to mentally encompass all the intricacies of dispatch.
17:28 jnthn Same. ;-)
17:28 zloyrusskiy joined #perl6
17:34 masak food &
17:50 jisom joined #perl6
17:57 dukeleto parrot: new 'Random'
17:57 dukeleto good localtime()
18:00 dukeleto just a heads up, the latest Parrot no longer has the Random PMC, so currently Rakudo's src/builtins/any-(num|list).pir are failing to compile with r40560
18:00 dduncan joined #perl6
18:10 ZuLuuuuuu joined #perl6
18:21 iblechbot joined #perl6
18:25 kane_ joined #perl6
18:49 jnthn dukeleto: Any guidance on what Rakudo should do?
18:49 jnthn What replaced Random PMC for getting random numbers?
18:49 dukeleto jnthn: yes, I was attempting to get rakudo to try to use the new parrot revision, but I am running into roadblocks
18:50 dukeleto jhnthn: there is now a rand() and srand() opcode
18:50 dukeleto so you do ' .loadlib "math_ops" ' at the top of any file that wants to use rand/srand (they are dynops)
18:51 jnthn Ah, dynops?
18:51 jnthn OK.
18:51 dukeleto for example, rand $N0 sets $N0 to a random number between 0 and 1 and rand $I0 sets $I0 to a random integer between -2^31 and 2^31
18:51 dukeleto jnthn: dynamically loadable opcodes, i.e. they can be modified without recompiling parrot
18:52 dukeleto jnthn: I have modified the examples/ directory in parrot to use the new dynops, check out examples/opengsl/shapes.pir for a good example
18:53 dukeleto there are also a few other calling conventions, like giving a range: rand $N0, 5, 25 sets $N0 to a float between 5 and 25
18:54 dukeleto it should be a trivial fix in rakudo, but I am trying to get rakudo to use my new parrot without complaining, how do y'all test new versions of parrot with rakudo?
18:55 jnthn Few ways - once is to just svn up the checkout of Parrot that Rakudo makes for you if you, and make sure it installs to the right place etc.
18:56 jnthn You need an installed Parrot to build Rakudo.
18:56 jnthn If you have built/installed an updated version, then it's something like
18:56 dukeleto jnthn: that is what I didn't know
18:56 jnthn perl Configure.pl --parrot-config=path/to/parrot_config
18:56 dukeleto jnthn: you may be interested in looking at this diff to see what changed: https://trac.parrot.org/parrot/changeset/40557/
18:57 dukeleto jnthn: i was trying that incantation and I was getting weird errors, will try make realcleaning everything and trying again
18:57 dukeleto jnthn: this is what I got when I tried the --parrot-config option: gmake: *** No rule to make target `/usr/local/lib/parrot/1.4.0-devel/library/PGE/Perl6Grammar.pbc', needed by `src/gen_grammar.pir'.  Stop.
18:57 dukeleto so it looks like it is still trying to use the installed version. i may just rm -rf it
18:58 jnthn You need to install the Parrot you want to build against.
18:59 dukeleto jnthn: gotcha
19:06 dduncan so, I'm in the process of build/installing the packaged parrot 1.4.0 ... if, since it is more rapidly changing, I use Rakudo from version control, will it run on that parrot or do I need parrot from version control too?
19:07 KyleHa joined #perl6
19:07 dduncan or I could just use July's Rakudo release, but I'm writing a relatively large (over 100K) Perl 6 module now and I'm not sure which Rakudo version has all the features it would want
19:07 dduncan and if none, presumably working on the dev is the most effective
19:07 KyleHa rakudo: try { 1/0 }; say $!.WHAT;
19:07 p6eval rakudo 0d4fe0:  ( no output )
19:08 dukeleto dduncan: a new parrot will be out on tuesday and a new rakudo will be out thursday, so if you wait a bit you may get a bunch more features/bugfixes and you won't be behind an extra deprecation point
19:08 dduncan okay
19:09 dduncan I thought it wouldn't be another 1-2 weeks
19:10 dduncan anyway, I have a goal to port my Set::Relation Perl 5 module to Perl 6 within a week, so you can use all the DBMS-relational operators in Perl 6 apps
19:10 jnthn dduncan: You'll probably run into some issues using current Rakudo on Parrot 1.4.
19:10 dduncan so I'll try packaged Rakudo first perhaps and then upgrade both next week
19:10 jnthn dduncan: I'd either do as dukeleto suggests, or just grab current Rakudo, do perl Configure.pl --gen-parrot, then mame.
19:10 jnthn erm, make
19:11 jnthn And it will probably do the Right Thing and build a Parrot that's known to work with Rakudo for you.
19:11 jnthn But yes, sticking wiht the packaged ones should work too. :-)
19:12 dduncan on a tangent, short-term my plan is to distribute the Perl 6 version on CPAN in the same distro as the Perl 5 version, sort of like a fat-source project ... the Perl 5 version would be in the usual place, and the p6v in a perl6 subdir with its own lib/ and t/
19:12 dukeleto dduncan: perl Configure.pl --gen-parrot will have the least yak holes for you to fall into
19:12 dduncan dukeleto, okay so I'll try that rather than building parrot separately first
19:13 dduncan right at the moment I'm build/installing ICU
19:13 dduncan then I'll try that
19:13 frew joined #perl6
19:13 dukeleto dduncan: I can assure you that the latest rakudo does not work with the latest parrot, 'cause I am the one that removed the Random PMC which makes things go *boom* :)
19:14 jnthn Aye, but --gen-parrot doesn't build latest Parrot. It builds a Parrot revision that we know that Rakudo worked under. :-)
19:14 dduncan jnthn, that's good
19:14 dukeleto jnthn: yes, that is what I was trying to get at
19:15 dukeleto dduncan: don't attempt to "svn up" your parrot directory in your rakudo source directory, it won't work. That is what I was trying to get across
19:15 dduncan okay
19:15 dduncan I understood
19:15 jnthn dukeleto: Thanks for working on patching up Rakudo after the Parrot changes, btw. :-)
19:16 dukeleto jnthn: no prob, i will hopefully have something working once I get past my installed parrot hurdles
19:17 gdickie joined #perl6
19:18 gdickie perl6: say 50;
19:18 p6eval elf 27999, pugs, rakudo 0d4fe0: OUTPUT«50␤»
19:20 mzedeler joined #perl6
19:20 mzedeler Hi everyone.
19:21 jnthn mzedeler: hi
19:21 mzedeler rakudo: my @a; @a.push 1 => 2;
19:21 p6eval rakudo 0d4fe0: OUTPUT«Statement not terminated properly at line 2, near "1 => 2;"␤in Main (src/gen_setting.pm:3390)␤»
19:21 mzedeler I want to push a pair in a list like so, but its not working. Any ideas why?
19:22 Tene rakudo: my @a; @a.push(1 => 2);
19:22 p6eval rakudo 0d4fe0:  ( no output )
19:22 Tene rakudo: my @a; @a.push: 1 => 2;
19:22 p6eval rakudo 0d4fe0:  ( no output )
19:22 Tene you need to use one of those.  You can't just use whitespace.
19:22 jnthn std: my @a; @a.push 1 => 2;
19:22 p6eval std 27999: OUTPUT«[31m===[0mSORRY![31m===[0m␤Confused (two terms in a row?) at /tmp/ajd1Vw8BXX line 1:␤------> [32mmy @a; @a.push [33m⏏[31m1 => 2;[0m␤    expecting any of:␤     bracketed infix␤  infix stopper␤    standard stopper␤ statement modifier loop␤  terminator␤FAILED 00:02 38m␤»
19:22 mzedeler It seems to work with parens...
19:22 jnthn mzedeler: Yes, parens required.
19:22 Tene mzedeler: yes, like I said.  Parens or a colon.
19:22 mzedeler rakudo: my @a; @a.push(1 => 2); say @a.perl
19:22 p6eval rakudo 0d4fe0: OUTPUT«[1 => 2]␤»
19:23 mzedeler ...but is that because the 1 then becomes interpreted as a named parameter?
19:23 Tene std: my @a; @a.push 1;
19:23 p6eval std 27999: OUTPUT«[31m===[0mSORRY![31m===[0m␤Confused (two terms in a row?) at /tmp/PHsy7kxIFp line 1:␤------> [32mmy @a; @a.push [33m⏏[31m1;[0m␤    expecting any of:␤  bracketed infix␤  infix stopper␤    standard stopper␤ statement modifier loop␤  terminator␤FAILED 00:02 38m␤»
19:23 Tene No, it isn't.
19:24 Tene You need parens or a colon for method calls.
19:24 jnthn No, it's just because Perl 6 syntax requires arguments to method calls to follow a colon or be in parens.
19:24 mzedeler Sorry. That was really basic. Hmmm. Still lots to learn.
19:24 mzedeler Thanks!
19:24 mzedeler I'll go back to my code now.
19:24 Tene That's fine.  No problems. :)
19:24 Tene I do that all the time.
19:25 mzedeler There is a lot to learn. Really.
19:25 jnthn For sure.
19:29 dukeleto jnthn: mind taking a gander at this? http://gist.github.com/168433
19:29 dukeleto jnthn: I am having trouble building rakudo with an installed parrot
19:41 jnthn That's...odd. :-/
19:42 masak mzedeler: I'm picking up expecant vibes from people who have heard that you're going to send an email to p6l about nextsame et al.
19:42 masak mzedeler: I'm looking forward to it also.
19:42 mzedeler Hehe. Yes. Will do. Right now I am just writing code to get a better idea about the whole thing.
19:42 mzedeler But I am reading S12 on the side.
19:43 jnthn dukeleto: Does /usr/local/lib/parrot/1.4.0-devel/library/PCT/HLLCompiler.pbc
19:43 jnthn exist?
19:43 jnthn (nextsame) Eek, best get my grant final report in before the spec moves! ;-)
19:43 masak mzedeler: goodie.
19:44 mzedeler jnthn: I am happy with nextsame and friends, but .*, .+ and some other wierd invocation rites really has me scared.
19:44 jnthn mzedeler: .*, .+ and .? do not really interact with nextsame and friends.
19:44 masak jnthn: they don't? o_O
19:45 mzedeler Sounds somewhat strange to me too.
19:45 jnthn masak: $foo.@candidates and $foo.*@things_to_call mean different things.
19:45 masak jnthn: oh, I look forward to understanding in what way. :)
19:45 dukeleto jnthn: no it does not. /usr/local/lib/parrot/1.4.0-devel/library/PCT does not seem to exist
19:46 jnthn The first means "instead of the dispatcher computing the candidate list that we can defer through on nextsame et al, here is the list to use".
19:46 jnthn The second means "I want you to call all of these methods on $foo"
19:47 jnthn If you have $foo.bar and in bar it does a nextsame, that works out just fine. It just defers to the next candidate that the dispatcher finds.
19:47 jnthn $foo.*bar walks through all candidates and individually invokes them.
19:47 mzedeler But what about interactions between $foo.*bar and nextsame?
19:47 jnthn A nextsame in an individual invocation does not influence the outer "todo list".
19:48 jnthn Also, if you're using $foo.*bar and $foo.+bar you really should have written classes that expect to be invoked that way.
19:48 mzedeler Yes, but I guess it will result in many calls to the parent class.
19:48 jnthn Right.
19:48 mzedeler Why do we want that?
19:48 jnthn Hell knows, I didn't spec it, I just implement this stuff. ;-)
19:48 jnthn $foo.?bar is *the* really useful one, IMO.
19:48 mzedeler Sure. I think its a good attitude.
19:48 mzedeler Agreed.
19:49 jnthn .+ and .* to be honest I have yet to find a really good use-case for.
19:49 mzedeler Same here.
19:49 masak but doesn't BUILDALL call BUILD with .* ?
19:49 mzedeler Something much more mundane: I guess this autoextension of arrays is not intended?
19:50 mzedeler rakudo: my @a; say @a.perl; say "Not defined" if not @a[10]; say @a.perl
19:50 p6eval rakudo 0d4fe0: OUTPUT«[]␤Not defined␤[undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef]␤»
19:50 jnthn mzedeler: No, known rakudo bug.
19:50 mzedeler Okay. Thanks.
19:50 mzedeler I'll go back to my binary tree :-)
19:51 jnthn masak: Maybe you could implement it that way *but* it'd be a .*@foo form, since BUILD is descendent, and .* by default is ascendent.
19:51 jnthn Oh
19:52 jnthn And also it's meant to work a bit more like a subcall.
19:52 dukeleto jnthn: chromatic learned me. i wasn't doing a "make install-dev", only "make install"
19:52 jnthn dukeleto: OH!
19:52 jnthn chromatic++
19:52 jnthn :-)
19:53 jnthn mzedeler: I guess with .+ and .* I'd be more convinced of them if I saw a use-case.
19:53 jnthn I guess there's some argument that since we have .? they follow on logically.
19:54 mzedeler I can see that, but just like the eq= operator, some tuples in such logical "cross products" may better be left unimplemented.
19:55 jnthn Aye.
19:55 mzedeler But I understand I have to appeal to higher authorities to change it :-)
19:56 jnthn That's fine, I think it's a discussion very much worth having.
20:07 avi2702 joined #perl6
20:10 unitxt joined #perl6
20:15 mzedeler Have to go. Thanks for the chat.
20:16 molaf joined #perl6
20:20 tak11 joined #perl6
20:35 ZuLuuuuuu joined #perl6
20:38 takadonet1 joined #perl6
20:39 takadonet1 left #perl6
20:47 masak ok, overriding .new:
20:47 masak rakudo: class A { has $.foo; multi method new($foo) { self.new(:$foo) } }; say A.new("OH HAI").foo
20:48 p6eval rakudo 0d4fe0: OUTPUT«Use of uninitialized value␤␤»
20:48 masak I'd have expected the output to be "OH HAI".
20:51 jnthn rakudo: class A { has $.foo; multi method new($foo) { say "here"; self.new(:$foo) } }; say A.new("OH HAI").foo
20:51 p6eval rakudo 0d4fe0: OUTPUT«here␤Use of uninitialized value␤␤»
20:51 masak I smell a bug.
20:52 TimToady masak's looks like an infinite regress to me
20:52 masak oh!
20:52 jnthn I'm not sure why it *doesn't* infinitely recurse in fact...
20:52 TimToady generally a new method should call bless
20:52 masak because of the implicit *%_ ?
20:52 jnthn masak: Right.
20:52 masak TimToady: yes, but I thought I was delgating to Object.new...
20:53 TimToady if you want to do that really, then use nextwith()
20:53 masak ah.
20:53 jnthn rakudo: class A { has $.foo; method new($foo) { nextwith(:$foo) } }; say A.new("OH HAI").foo
20:53 p6eval rakudo 0d4fe0: OUTPUT«too many named arguments - 'foo' not expected␤in method A::new (/tmp/jzORENr8ct:2)␤called from Main (/tmp/jzORENr8ct:2)␤»
20:53 masak jnthn: should that have worked?
20:54 jnthn Hmm
20:54 jnthn rakudo: class A { has $.foo; method new($foo) { say "ok" } }; say A.new("OH HAI")
20:54 p6eval rakudo 0d4fe0: OUTPUT«ok␤1␤»
20:55 jnthn I think so. I'm not quite sure what in tried to call. :-/
20:55 * masak submits rakudobug
20:55 jnthn rakudo: class A { has $.foo; method new($foo) { callwith(:$foo) } }; say A.new("OH HAI").foo
20:55 p6eval rakudo 0d4fe0: OUTPUT«too many named arguments - 'foo' not expected␤in method A::new (/tmp/XsEak2AokJ:2)␤called from Main (/tmp/XsEak2AokJ:2)␤»
20:55 jnthn rakudo: class A { has $.foo; method new($foo) { callwith($foo) } }; say A.new("OH HAI").foo
20:56 p6eval rakudo 0d4fe0: OUTPUT«Method 'foo' not found for invocant of class 'Str'␤»
20:56 jnthn Oh! :-/
20:56 masak seems to be something to do with the invocant...
20:56 jnthn Well
20:56 jnthn Kinda.
20:57 jnthn Hmm. I'm not sure off-hand why that doesn't work.
20:57 masak but it should, so it goes on the RT pile.
20:58 jnthn One of the annoyances of implementing callwith and nextwith is that in the case of them being used to defer to another method, they need to find and pass on the invocant.
20:58 jnthn Whereas in the case of a wrap, they maybe don't.
20:59 masak ah. tricky.
20:59 jnthn Yeah.
20:59 jnthn It'd not surprise me if we have bugs there.
21:05 sri_kraih joined #perl6
21:12 sri_kraih_ joined #perl6
21:12 arthur-_ joined #perl6
21:24 mzedeler joined #perl6
21:25 mzedeler rakudo: my $i = "abc"^.. "def"; print $i.ACCEPTS("abc")
21:25 p6eval rakudo 0d4fe0: OUTPUT«0»
21:25 mzedeler Thats really nice. The range operator is a range constructor and it supports open as well as closed intervals. Wow.
21:25 jnthn :-)
21:27 mzedeler I found that the spec mentions eqv and cmp /subs/ (not infix operators) taking a third canonization closure. They seem to be missing?
21:39 * jnthn didn't know about those.
21:39 jnthn Where in the spec are they? S03?
21:40 mzedeler Yes. See "Comparison semantics".
21:40 mzedeler http://perlcabal.org/syn/S03.html#Comparison_semantics
21:41 mzedeler It may also be me who (again) didn't get the invocation syntax right.
21:42 mzedeler rakudo: say eqv({+$^a}, 1, 2)
21:42 p6eval rakudo 0d4fe0: OUTPUT«Could not find non-existent sub eqv␤»
21:53 mzedeler By the way, I have a somewhat unrelated question: how do I put a range object in an array, and retrieve the range object again? I don't want it to expand.
21:54 mzedeler rakudo: my $i = 1 ^.. 10; print $i ~~ 1; my @a; @a.push($i); say @a.perl;
21:54 p6eval rakudo 0d4fe0: OUTPUT«0[2, 3, 4, 5, 6, 7, 8, 9, 10]␤»
21:54 mzedeler Expected: [1^..10]
22:03 jnthn mzedeler: Ah, I think those functions are just not yet implemented in Rakudo.
22:03 jnthn If you can work out how to write implementations for them in Perl 6, then we can always add them to the setting. :-)
22:04 mzedeler I came to the same conclusion. It seems that I may be able to write them.
22:04 mzedeler Will look into that.
22:04 jnthn mzedeler: You can enclose it as a nested array perhaps
22:04 jnthn rakudo: my $i = 1 ^.. 10; print $i ~~ 1; my @a; @a.push([$i]); say @a.perl;
22:04 p6eval rakudo 0d4fe0: OUTPUT«0[[2, 3, 4, 5, 6, 7, 8, 9, 10]]␤»
22:04 jnthn heh, nope.
22:05 mzedeler But the nested arrays would still expand...
22:05 jnthn yeah
22:05 jnthn So I see.
22:05 mzedeler :-)
22:05 jnthn Maybe something capture-ish...
22:05 mzedeler I can always put them in some kind of opaque container object, but that is a hack.
22:05 jnthn Though I fear that may do the same...
22:05 jnthn rakudo: my $i = 1 ^.. 10; print $i ~~ 1; my @a; @a.push(\($i)); say @a.perl;
22:05 p6eval rakudo 0d4fe0: OUTPUT«0[1^..10]␤»
22:05 mzedeler Wow!
22:05 mzedeler Nice.
22:06 mzedeler A reference?
22:06 jnthn Captures are kinda reference-ish, yes.
22:06 jnthn But a bit more than that.
22:06 mzedeler I have a lot to learn. Thanks for your time.
22:07 jnthn No problem.
22:34 carlin joined #perl6
23:08 szabgab_ joined #perl6
23:22 libnoon joined #perl6
23:58 Limbic_Region joined #perl6

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

Perl 6 | Reference Documentation | Rakudo