Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2008-05-08

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:12 felipe joined #perl6
00:25 cls_bsd joined #perl6
00:27 r0bby joined #perl6
01:09 pmichaud TimToady: in regexes, is a colon followed by a word character always considered a modifier?
01:10 pmichaud i.e., / \d+:abc /  parses as / [\d+] :abc /  and not  / [\d+:] abc /
01:10 pmichaud (I think I asked this once before and got that answer, but want to reconfirm before committing to code.)
01:11 BinGOs_ joined #perl6
01:16 BinGOs_ joined #perl6
01:16 felipe joined #perl6
01:16 BinGOs joined #perl6
01:16 pravus joined #perl6
01:16 ting joined #perl6
01:16 diakopter joined #perl6
01:16 Gothmog_ joined #perl6
01:16 yath joined #perl6
01:16 [particle1 joined #perl6
01:17 pmichaud oops, that's a bad example, since +: is a token
01:17 pmichaud so...
01:18 pmichaud <xyz>:i /   parses as / [<xyz>] :i /   and not / [<xyz>:]  i /   ?
01:23 japhb joined #perl6
01:30 fredlaforge joined #perl6
02:52 cotto joined #perl6
03:12 Psyche^ joined #perl6
03:30 justatheory joined #perl6
04:27 armagad joined #perl6
04:40 Psyche^ joined #perl6
04:45 Eevee_ joined #perl6
04:53 alester_ joined #perl6
04:56 eternaleye joined #perl6
04:59 `nipra joined #perl6
05:00 syle this perl6 stuff gonna be good? or is c/c++ still gonna beat the shit out of it for eventloop performance and such?
05:24 alanhaggai joined #perl6
05:29 alanhaggai_ joined #perl6
05:32 spinclad definitely good.  i also note that your two questions are unrelated.
05:32 meppl joined #perl6
05:37 TimToady pmichaud: that's correct
06:18 masak joined #perl6
06:27 carl_masak joined #perl6
06:29 masak joined #perl6
06:39 zamolxes_ joined #perl6
06:49 syle give control over freeing memory, i can't stress this enough
06:50 syle i cannot build a big app without that control
06:50 masak syle: well, the general trend goes towards abstracting away memory management in programming languages
06:51 syle i understand this , but that is for simple applications under 5 thousand lines of code
06:51 masak I understand that your argument is that need of control is related to code size
06:51 masak not sure I agree
06:52 masak just as optimization has been successively delegated to compilers, memory management has been successively delegated to GCs
06:52 syle i understand free it self is expensive, but if i set my own counters to free memory after so much memory allocation, is it so much to ask?
06:53 elmex joined #perl6
06:53 masak however, since you have very fine control over your VM (Parrot), you should most likely be able to reach into it and do such things
06:53 masak ...I think
06:54 syle thats a cop out, write the free routine and make everyone happy
06:54 masak but we're not quite there yet where anyone can guarantee that
06:55 masak syle: can you explain how your request would not affect everyone else
06:55 masak more specifically, people who do not want to care about memory management
06:56 syle people do CARE about memory management in big applications, are you saying perl6 should be some little scripting language incompentent of being used in big applications?
06:56 masak no
06:57 masak I'm saying that many successful programming languages where people do in fact write big applications do not allow manual freeing
06:57 moritz_ syle: they only care because existing garbage collecters aren't good enough (like perl5s ref counting)
06:58 syle on moritz statement yes thats a big factor because of alot of c modules being loaded could keep references and become problematic if the reference has been weakened or not
06:59 syle regardless perl loads alot of c modules etc, and if some asshole c author keeps a reference, we need better control to free that memory
06:59 masak syle: what happens to the reference?
07:00 moritz_ that's the wrong approach. If there is a reference left, it could segfault
07:00 moritz_ the right approach is to make C extensions much easier and safer
07:00 masak aye
07:01 syle well for example, eventlib allows you to remove events, but not destroy them
07:01 moritz_ so that it's very unlikely that something like this happens
07:01 moritz_ Perl 6 won't fix buggy C software for you
07:01 moritz_ it simply can't do that
07:02 masak syle: it's like this: if the Perl 6 design team said "ok, we'll add it" in reply to every request for features, Perl 6 would be a mess.
07:02 masak I'm saying your feature request would mess up Perl 6 a little
07:02 moritz_ I'd say that if it turns out to be needed, somebody will write a module that does it
07:02 syle omg, look, you malloc so much memory for a hash, allow someone to call free on that exact structure, that is not alot to ask
07:03 masak at least until you show me how you can introduce it without also introducing segfaults, and worries for people who don't want to care
07:03 iblechbot joined #perl6
07:03 masak syle: sounds to me you just want Perl 6 to be C, period.
07:03 masak get over it
07:03 syle in a sense yes
07:03 syle i want it to be better
07:04 syle after using hashes , honestly who wants to be stuck using just arrays and scalars
07:04 masak de gustibus not est disputandum -- you think it would be better, 99% of Perl programmers would hate it
07:05 syle well i;d have to ask you what do 99% of perl programmers in your opinion use it for?
07:05 masak Perl?
07:05 masak most things, I guess
07:05 masak including large stuff
07:05 syle cgi, tcp , server apps, client apps, what?
07:05 masak sure
07:05 moritz_ many many CGI and reporting applications
07:05 moritz_ GUI stuff
07:06 moritz_ everything.
07:06 moritz_ I even read about prototyping scanner drivers with perl the other day ;)
07:06 syle i want perl6 to compete with being able to write a tcp server that can compete with c
07:06 masak I disagree with the idea that lack of `free()` would prevent one from writing large-scale applications
07:06 syle otherwise its useless
07:06 masak as moritz_ says, at least wait until you've tried a good GC along with Perl
07:07 masak you'd be surprised
07:07 syle good GC i heard new one is up on google summer of code
07:07 moritz_ syle: most people are quite happy with writing applications in perl that are twice as slow as the C equivalent, but take 1/10 of the time to develop
07:07 masak yes
07:07 syle so thats a big maybe right
07:07 masak syle: it always is with planned code
07:08 masak Java/JVM has developed quite a bit over the years with regards to its GC
07:08 syle moritz: i agree completely, but fuk if it was somewhat close to c at 1/10th of the code, you;d dominate the market wouldn;t you
07:09 masak syle: that's not a sensible argument
07:09 moritz_ syle: at least the part of the world that doesn't hate sigils ;-)
07:09 masak no-one argues that Perl should be unlike C just for the sake of it
07:09 masak it's just unlike C where it's more like Perl :)
07:10 moritz_ and nobody argues that it should be fast
07:10 syle well with processors getting faster, and becomming dual core etc, as long as you can compile it i guess in longrun it will survive is the consensus then right
07:10 moritz_ but most people think that speed shouldn't be top priority these days
07:10 masak however, parallel constructs might be a big win
07:10 masak gotta use those cores
07:11 syle well with async applications , non blocking sockets for example, we are creating more demand on the cpu that memory than ever before
07:11 syle s/that/than
07:12 masak syle: exactly. so forget about your `free()` request :)
07:13 syle however if processors reach a point which i suspect that it becomes overly fast and memory stays as expensive as it is, then can run less perl on one box
07:14 syle i realize with new 8 core cpus, that cpu will become less of an issue, but i have not seen memory drop in price
07:15 syle but regardless there is still issue of i could run the same app with 10 times more threads in c than with perl
07:15 syle i am a strong beleiver perl6 with compete with c, and we in the 20th century can stop using languages with shitty structures
07:15 moritz_ you're speaking about your bad experiences with Perl 5
07:16 moritz_ Perl 6 has taken great care not to fall into the same trap
07:16 moritz_ like much less global variables (so that threads stay light weight)
07:16 syle perl 5.10 remove the byte code, that pissed me off
07:17 moritz_ byte code?
07:17 moritz_ what do you mean?
07:17 masak syle: it's sort of a central assumption in Perl that references cannot dangle. that's why they're _references_, not pointers. if you don't solve that, Perl programmers will simply not be interested.
07:17 moritz_ it still uses byte code
07:17 syle perl -MO=Bytecode,-H,-oa.out blah.pm
07:18 moritz_ well, nobody was able and willing to maintain that
07:18 moritz_ and fix it
07:18 moritz_ if you want it badly, you can get it in shape
07:19 moritz_ and if you maintain it, I'm sure people will use it
07:19 syle ohhh christ, don;t put that on me, i;m already writing an app in perl5 thats over 7 thousand lines and not done yet
07:19 moritz_ but you can't expect volunteers to do exactly what you want
07:19 moritz_ ah, then don't complain
07:19 masak syle: think of it! if you get control of the bytecode, you can add your own `free()`! :)
07:20 syle lol well with parrot i think i can probably export my own free routines anyways
07:20 syle i would just like to see it apart of core
07:20 moritz_ core is totally overrated
07:21 moritz_ in Perl 6 core will be just the things that you need to install new modules
07:21 masak yeah, core is so 1990
07:21 masak Perl 6 is more of a micro-core
07:22 syle ok so standard has changed, usually you have core tree and devel tree
07:23 masak not sure if that's the same nomenclature
07:23 moritz_ devel/maint and core/non-core are orthogonal concepts
07:27 syle Typical anti-egalitarian view
07:28 masak huh?
07:28 masak in what sense?
07:32 Lorn joined #perl6
07:35 eternaleye syle: devel/maint is stability/testedness index, core/non-core is essentiality index
07:35 eternaleye AFAIU, it's only in core if it's needed to install things that aren't in core
07:36 masak however, someone who has different opinions on what should be core is wont to call the division 'anti-egalitarian'
07:39 syle why wouldn't they?
07:41 syle devel/maint is a means to an end regardless
07:48 yewenbin joined #perl6
07:48 syle and while everyone struggles to remember their comp sci debate classes, i;m just stating a free routine would be nice in case new author of GC routine doesn't work out well
07:49 Schwern joined #perl6
07:50 Lorn_ joined #perl6
07:56 eternaleye syle: GC engines are modular and pluggable, feel free to implement one which hooks into the code being executed with free() routines invoking collection
07:58 masak joined #perl6
08:20 Lorn joined #perl6
08:31 Ched- joined #perl6
08:46 pmurias joined #perl6
08:50 pmurias syle: what exactly do you want to be avalible, do you want to force the gc to do garbadge collection or do you want to create dangling pointers and enjoy segfaults
08:52 pmurias ?
08:54 pmurias the perl5 style reference counting dosn't have to eat much more memory than c style manual memory allocation, you just can't avoid having a reference counter on most objects
08:59 pmurias so doing manual memory allocation would help on the small scale only
09:04 masak just the opposite of what syle wanted it for
09:11 cls_bsd joined #perl6
09:15 alanhaggai joined #perl6
09:30 agentz1 left #perl6
09:31 agentzh joined #perl6
09:37 buu joined #perl6
09:55 penk joined #perl6
10:47 pbuetow joined #perl6
11:20 chacha_chaudhry joined #perl6
11:21 chacha_chaudhry left #perl6
12:01 cls_bsd joined #perl6
12:07 riffraff joined #perl6
12:15 pmurias joined #perl6
12:16 rff joined #perl6
12:48 agentzh left #perl6
13:03 meppl joined #perl6
13:06 agentzh joined #perl6
13:16 iblechbot joined #perl6
13:30 moritz_ class Foo { my $a }; class Foo is also { say $a }; # is that allowed?
13:31 moritz_ I mean is "my $a" scoped to the block or to the class?
13:34 pmichaud my is scoped to the block.
13:34 pmichaud to scope to the class, use 'our'
13:34 pmichaud er.
13:34 pmichaud hmmm.  actually, would need our $a in both cases.
13:35 pmichaud that's my guess, anyway.
13:35 moritz_ but then it's not a private variable anymore
13:35 moritz_ our $!a; ?
13:36 pmichaud probably
13:36 pmichaud from S12:      our %!cache is rw;  # generates no public accessor
13:37 moritz_ ah, cool
13:38 moritz_ it would be really useful if I could search the synopsis with queries like <siglil>'!'<identifier>, where <sigil> takes its definitioin from STD.pm ;-)
13:38 pmichaud I just did a search of S12 for ' our '
13:39 pmichaud yes, you're correct, it would be cool.  Someday it will even be possible :-)
13:39 pmichaud when we have the p6-version of 'ack', certainly :-)
13:39 moritz_ aye
13:40 pmichaud afk # appointment
13:48 cmarcelo joined #perl6
14:02 TJCRI joined #perl6
14:08 cls_bsd joined #perl6
14:08 chris2 joined #perl6
14:12 riffraff joined #perl6
14:30 rdice joined #perl6
14:32 Ched- joined #perl6
14:33 Ched- joined #perl6
14:52 kanru joined #perl6
15:05 cls_bsd joined #perl6
15:09 yewenbin joined #perl6
15:09 pugs_svnbot r20390 | moritz++ | [t/spec] changed 'use v6-alpha;' to 'use v6;'
15:09 pugs_svnbot diff: http://dev.pugscode.org/changeset/20390
15:09 lambdabot Title: Changeset 20390 - Pugs - Trac
15:16 pmurias moritz_: is use v6-alpha incorrect?
15:17 moritz_ pmurias: v6-alpha is the perl 6 syntax as we have it today
15:17 moritz_ pmurias: but the test suite should test Perl 6.0.0
15:17 moritz_ pmurias: so there's nothing wrong with using it, but it doesn't belong into the test suite
15:17 [particle] v6-alpha is not legal perl 6 anymore
15:18 moritz_ was it removed from S02?
15:18 cosimo joined #perl6
15:19 moritz_ it's still in S01
15:19 moritz_ (not S02, sorry)
15:20 moritz_ and S11 says The use v6-alpha line also serves as the Perl 5 incantation to switch to Perl 6 parsing. In Perl 5 this actually ends up calling the v6.pm module with a -alpha argument, for insane-but-useful reasons.
15:20 pmurias it is specced in in S11:369
15:20 [particle] ah, hrmm, it is still specced.
15:20 [particle] i thought that had been changed, sorry.
15:28 araujo joined #perl6
15:34 moritz_ is this valid syntax? my %h{'a' .. 'z'} = (1..26);
15:35 moritz_ it's in S29-hash/exists.t, but it looks suspicious to me
15:35 moritz_ (and rakudo chokes on it)
15:36 [particle] i believe it's valid, but rakudo and list assignment are not friends yet
15:36 moritz_ in perl 5 you can't do things like that
15:42 [particle1 joined #perl6
15:46 cjfields joined #perl6
15:56 plaqnet joined #perl6
15:58 masak moritz_: you can't? why not?
15:59 moritz_ masak: because you first have to declare the container (%h) and then assign ( @h{'a' ... 'z'})
16:01 [particle] @$_[...] = (...) for \my %h;
16:01 lambdabot Unknown command, try @list
16:01 [particle] errands &
16:03 masak moritz_: ah, you declare it too. missed that.
16:17 iblechbot joined #perl6
16:17 riffraff left #perl6
16:20 syle joined #perl6
16:23 cls_bsd joined #perl6
16:32 riffraff joined #perl6
16:40 eternaleye joined #perl6
16:41 justatheory joined #perl6
16:54 IllvilJa joined #perl6
16:57 pmichaud (v6-alpha)  TimToady has remarked in the past that "use v6-alpha;" is going away.  I'm guessing he either changed his mind or that the synopses haven't been changed to reflect that yet.
16:59 rff joined #perl6
17:00 [particle] i think the syns are out of date.
17:00 [particle] unless you still want them frozen :P
17:01 pmichaud uhhhhhh.... NO.  :-P
17:01 eternaleye joined #perl6
17:04 eternaleye joined #perl6
17:07 pmurias how much of Perl 6 remains to be speced?
17:07 moritz_ the second 80%?
17:07 moritz_ most of I/O and concurrency is unspecced
17:08 moritz_ iirc there's no formal definition of the hierarchy of the builtin types
17:10 pmurias &
17:13 eternaleye joined #perl6
17:17 cls_bsd joined #perl6
17:17 lisppaste3 joined #perl6
17:22 TimToady that won't be legal, but you'll hopefully be able to say (my %h){'a'..'z'} = 1..26
17:23 TimToady v6-alpha is going away slowly.  :)
17:24 [particle] ah, i had the (accent) on the wrong (syllable).
17:28 [particle] TimToady: thank you for bringing even more cool, grey weather to seattle.
17:29 TimToady you must be confusing Mountain View with San Francisco...
17:30 TimToady Mountain View tends to be short of cool, grey weather, so that's why I'm going to Tokyo, to fetch some more back home...
17:31 penk left #perl6
17:31 TimToady unfortunately Seattle has bribed the prevailing westerlies to blow a little from the south as well, so you're taking more than your fair share of Tokyo weather from us down south
17:32 [particle] i blow and i blow, but the westerlies still prevail :(
17:33 [particle] i miss nepal. at least there, if you didn't like the weather, you had three options
17:34 [particle] 1) walk uphill, 2) walk downhill, 3) wait.
17:35 TimToady well, you could hang-glide downhill, or, depending on the weather, uphill as well
17:36 [particle] :)
17:36 TimToady oh, wait, there's no air there--nevermind...
17:36 TimToady how do they have weather without air, I wonder...
17:36 [particle] ask the old man with enormous wings for a lift
17:39 ispy_ joined #perl6
18:01 pugs_svnbot r20391 | moritz++ | [t/spec] split illegal declaration+initialzation of a hash
18:01 pugs_svnbot diff: http://dev.pugscode.org/changeset/20391
18:01 lambdabot Title: Changeset 20391 - Pugs - Trac
18:04 [particle] moritz++
18:04 [particle] moritz_: have any tuits to add #?rakudo decls to t/spec to make our parsefails less visible?
18:05 moritz_ [particle]: I'm currently going through the parsefails...
18:05 moritz_ [particle]: and I first search for syntax errors, and clear them
18:06 moritz_ [particle]: when I'm done with that I'll take a look at remaining parsefails
18:07 moritz_ but it's a tedious business atm
18:09 [particle] indeed, it is
18:10 [particle] you're starting in s29-hash?
18:10 moritz_ not really, that was a coincidence
18:10 [particle] okay.
18:10 moritz_ but for now I'll look at various S29-* stuff
18:10 [particle] just don't want to step on your toes
18:10 moritz_ allright
18:11 [particle] it should be easy enough to skip most of S29-list, as i bet most of it is due to lack of list context
18:11 [particle] something like #?rakudo emit skip_rest 'no list context'
18:12 [particle] however, you'll still need #?rakudo 999999 skip 'parsefail'
18:12 [particle] ...or somesuch, because code in fudge's emit declaration happens *after* parrot parses
18:12 moritz_ @array.delete doesn't seem to work
18:12 lambdabot Unknown command, try @list
18:13 moritz_ but that's not a parse failure, at least ;)
18:13 [particle] what's @array.WHAT ?
18:13 moritz_ List
18:14 moritz_ which might be the problem
18:14 [particle] hrmm, src/classes/List.pir contains a 'delete' method
18:15 moritz_ it dies with Could not invoke non-existent sub undef
18:15 moritz_ so I won't fudge the test because it fails legitimately
18:15 [particle] yes, that's legit
18:16 [particle] that's a rakudobug
18:18 moritz_ what's the status of calling 'pop @list' instead of '@list.pop'?
18:18 moritz_ I mean in general for those methods that can also be called as sub
18:18 moritz_ s
18:18 moritz_ they seem to cause quite many failures
18:19 [particle] eventually we'll have a role that handles the exporting
18:19 [particle] currently, we have sub wrappers that call the method
18:19 [particle] it's possible some of those wrappers are missing
18:19 [particle] eg:
18:19 [particle] .sub delete :multi('List')
18:19 [particle] .param pmc list
18:19 [particle] .param pmc indices :slurpy
18:19 [particle] .return list.'delete'(indices :flat)
18:19 [particle] .end
18:25 pugs_svnbot r20392 | moritz++ | [spec] S29-array/splice.t: qw(..) is normally <...> now
18:25 pugs_svnbot diff: http://dev.pugscode.org/changeset/20392
18:25 lambdabot Title: Changeset 20392 - Pugs - Trac
18:34 pugs_svnbot r20393 | moritz++ | [spec] fudged S29-hash/delete.t
18:34 pugs_svnbot diff: http://dev.pugscode.org/changeset/20393
18:34 lambdabot Title: Changeset 20393 - Pugs - Trac
18:37 dduncan joined #perl6
18:39 tobeya joined #perl6
18:47 meppl joined #perl6
19:02 pmurias would it be possible to pass additional parameters using the perl5 stack in such a way that they won't end up in @_?
19:02 cjfields joined #perl6
19:04 moritz_ you could use global var instead of the stack
19:04 pmurias figured a way how do what i want withought bring the perl5 stack/xs into the picture
19:06 pmurias moritz_: what i won't is to pass named params seperatly from @_
19:06 pmurias * want
19:07 pmurias in a way that subs which don't support them will ignore them
19:09 alanhaggai_ joined #perl6
19:09 moritz_ pmurias: you could try some evil hackery with a global hash that is indexed by the current sub name, or caller or something like that
19:09 [particle] and use attributes to specify which subs use the global?
19:10 [particle] course, that's not thread-friendly
19:10 [particle] (the global)
19:12 pmurias pugs: sub foo($b) {say $b;}
19:12 exp_evalbot RESULT[\sub :($b) "$_" := "Scalar" #<Scalar:0xb72c7e98>␤          "&?ROUTINE" := "Sub" #<Sub:0xb6604cec>␤          "&?BLOCK" := "Sub" #<Sub:0xb6604cec>␤          "$b" := "Scalar" #<Scalar:0xb72c6b7c> {"&foo" := "Sub" #<Sub:0xb7210f70>, "$_" := "Scalar" #<Scalar:0xb7270d00>␤
19:12 exp_evalbot ..                                               ...
19:12 pmurias pugs: sub foo($b) {say $b;}; foo(b=>3)
19:12 exp_evalbot OUTPUT[3␤]
19:12 pmurias pugs: sub foo($b) {say $b;}; foo(b=>3,c=>5)
19:12 exp_evalbot OUTPUT[*** No compatible multi variant found: "&foo"␤    at /tmp/J8yASCGu1v line 1, column 24 - line 2, column 1␤]
19:13 [particle] rakudo: sub foo($b) {say $b};
19:13 exp_evalbot RESULT[Method 'perl' not found for invocant of class 'Closure'␤current instr.: '_block10' pc 35 (EVAL_12:16)␤called from Sub 'parrot;PCT::HLLCompiler;eval' pc 785 (src/PCT/HLLCompiler.pir:458)␤called from Sub 'parrot;PCT::HLLCompiler;evalfiles' pc 1067 (src/PCT/HLLCompiler.pir:587)␤called from Sub
19:13 exp_evalbot ..'parrot;PCT::HLLCompiler;command_line' pc 1246 (...
19:13 pmurias pugs: sub foo {}; foo(b=>3,c=>5)
19:13 exp_evalbot OUTPUT[*** Named argument found where no matched parameter expected: ("b",Ann (Pos (MkPos "/tmp/Sld6Xsf8DD" 1 20 1 21)) (Val (VInt 3)))␤    at /tmp/Sld6Xsf8DD line 1, column 13 - line 2, column 1␤]
19:13 [particle] heh. that's exp_evalbot getting carried away
19:13 [particle] rakudo: sub foo($b) {say $b}; 1
19:13 exp_evalbot RESULT[1]
19:14 [particle] rakudo: sub foo($b) {say $b}; foo(b => 3)
19:14 exp_evalbot OUTPUT[too many named arguments - 'b' not expected␤current instr.: 'foo' pc 38 (EVAL_12:21)␤called from Sub '_block10' pc 32 (EVAL_12:15)␤called from Sub 'parrot;PCT::HLLCompiler;eval' pc 785 (src/PCT/HLLCompiler.pir:458)␤called from Sub 'parrot;PCT::HLLCompiler;evalfiles' pc 1067
19:14 exp_evalbot ..(src/PCT/HLLCompiler.pir:587)␤called from Sub 'parrot;PCT::HLLCom...
19:14 [particle] rakudo: sub foo(:$b) {say $b}; foo(b => 3)
19:14 exp_evalbot OUTPUT[3␤]
19:15 pmurias [particle]: re thread safety, are perl threads used much?
19:16 moritz_ pmurias: most people try to avoid them wherever possible ;)
19:18 pmurias re passing of named parameters separately, i was trying to do a stupid thing, no wander it has to be done very hackishly
19:18 pmurias * wonder
19:19 * pmurias hates the fact that his spelling suffers horribly when he uses irc :(
19:48 Ched- joined #perl6
20:06 barney joined #perl6
20:06 wknight8111 joined #perl6
20:41 moritz_ rakudo: class A { has $.a; has $.b; }; my $x = A.new(a => 1, b => 2); say $x.a; say $x.b
20:41 exp_evalbot OUTPUT[1␤␤]
20:41 moritz_ b0rked
20:42 [particle] yes, i think rakudo only handles the first Pair
20:42 [particle] not certain though
20:43 [particle] rakudo: class A { has $.a; has $.b; }; my $x = A.new(b => 2, a => 1); say $x.a; say $x.b
20:43 exp_evalbot OUTPUT[␤2␤]
20:43 [particle] so it seems.
20:44 moritz_ should I write a small bug report?
20:45 [particle] sure
21:06 eternaleye joined #perl6
21:11 moritz_ in NQP this is an error if $<foo> isn't a list: for $<foo> { ... }
21:11 moritz_ is there an easy workaround?
21:12 cjfields joined #perl6
21:16 cjfields I saw the same Pair problem the other day (only accepting the first Pair)
21:16 cjfields rakudo: class A { has $.a; has $.b; }; my $x = A.new(:a(1), :b(2)); say $x.a; say $x.b
21:16 exp_evalbot OUTPUT[1␤2␤]
21:16 cjfields class A { has $.a; has $.b; }; my $x = A.new(a => 1, b => 2); say $x.a; say $x.b
21:17 cjfields rakudo: class A { has $.a; has $.b; }; my $x = A.new(a => 1, b => 2); say $x.a; say $x.b
21:17 exp_evalbot OUTPUT[1␤␤]
21:17 moritz_ cjfields: I submitted a bug report for rakudo
21:18 moritz_ cjfields: but good to know that colon pairs work
21:18 moritz_ or whatever their name is ;)
21:18 cjfields pugs: class A { has $.a; has $.b; }; my $x = A.new(a => 1, b => 2); say $x.a; say $x.b
21:18 exp_evalbot OUTPUT[1␤2␤]
21:19 cjfields well, pugs gets it right, but I guess that's no longer maintained  :(
21:19 cjfields moritz_: thanks for submitting that!
21:23 klle joined #perl6
21:37 mncharity joined #perl6
21:45 meppl good night
21:45 moritz_ good night ;)
21:46 meppl ;)
22:02 mncharity pugs: \(4:5,6)
22:02 exp_evalbot RESULT[CaptMeth {c_invocant = IFinite 4, c_feeds = [:MkFeed {f_positionals = [:IFinite 5,IFinite 6:], f_nameds = fromList []}:]}]
22:02 mncharity rakudo: \(4:5,6)
22:02 exp_evalbot OUTPUT[Syntax error at line 1, near "\\(4:5,6)"␤current instr.: 'parrot;PGE::Util;die' pc 120 (runtime/parrot/library/PGE/Util.pir:82)␤called from Sub 'parrot;Perl6::Grammar;TOP' pc 11308 (src/gen_grammar.pir:249)␤called from Sub 'parrot;PCT::HLLCompiler;parse' pc 564
22:02 exp_evalbot ..(src/PCT/HLLCompiler.pir:348)␤called from Sub 'parrot;PCT::HLLCompiler;compile...
22:03 moritz_ what's 4:5 supposed to be?
22:03 mncharity i was wondering that.  but now think it's an invocant of 4, and extra positional args of 5 and 6.
22:04 moritz_ not very intuitive
22:04 moritz_ we had the discussion what $obj.math:{block} means
22:05 moritz_ and it turned out to be parsed as $obj.meth :{block}
22:05 moritz_ so why would a capture be parsed differently?
22:06 lambdabot joined #perl6
22:08 mncharity moritz_: a Capture is a generalized right hand side, and : as a comma-like thing to separate invocant from other args matches the generalized left hand side Signature's similar use for parameters.
22:08 mncharity sub foo($a: $b) { ... }
22:09 mncharity I might not even have been puzzled by it if it had been spaced as  \(4: 5, 6)  ;)
22:10 moritz_ ok, it can't be parsed as \(4 :5, 6) because that's not valid perl 6, right?
22:11 moritz_ pugs: print perl \(4 :5, 6)
22:11 exp_evalbot OUTPUT[CaptMeth {c_invocant = IFinite 4, c_feeds = [:MkFeed {f_positionals = [:IFinite 5,IFinite 6:], f_nameds = fromList []}:]}]
22:11 mncharity TimToady: (1) <capture> uses EXPR which doesn't seem to match '4:5'.  should there be a token infix:sym<:> ( --> Comma) ?
22:18 mncharity re ':5,6', looking...
22:19 justatheory joined #perl6
22:21 mncharity re ':5,6', right, doesn't look like it's a valid parse.
22:22 moritz_ anyway, I'm off to bed
22:22 moritz_ g'night
22:22 PerlPilot joined #perl6
22:22 Juerd_ joined #perl6
22:22 mncharity oh, wait.  \(4 :5, 6)  is valid.  it's (:5,6) which looks like not.
22:22 wolv joined #perl6
22:22 mncharity good night :)
22:23 mncharity wolv: you're... shorter
22:23 mncharity ah, back
22:23 mncharity :)
22:27 * mncharity checks if  multi f() {} is valid... (ie, no 'sub')
22:28 mncharity yep
22:29 mncharity TimToady: (2) plurality_declarator:multi doesn't parse 'multi foo() {}' (ie, implicit 'sub').
22:51 mncharity oh, that was happy.  have parsefail, check STD.pm, notice changes, apply changes, parsefail gone. :)
22:52 Tene nice
22:57 mncharity TimToady: (3) regex_def doesn't seem to handle adverbial modifiers?  'token f :P5 {a}'
23:14 [particle2 joined #perl6
23:16 eternaleye joined #perl6
23:21 mncharity TimToady: (4) fatarrow has a lhs of ident, but STD.pm in several places (and a kp6 test) says 'foo'=>... .  ie, lhs string.  ??
23:33 mncharity low-key happiness.  if (4) is fudged, STD_red accepts kp6's t/kp6/*.t .
23:34 mncharity pugs t/ acceptance is still a mess.
23:34 mncharity acceptance does _not_ imply the parse is correct, or the tree returned is healthy.  it simply means "didn't choke on it".
23:35 wolverian joined #perl6
23:38 Juerd joined #perl6
23:39 PerlJam joined #perl6
23:43 mncharity Are the =kwid ... =cut   pod comments in pugs t/ now all obsolete/invalid?
23:44 mncharity TimToady: (5) lots of pugs t/ tests use a =kwid...=cut construct, which STD doesn't understand.  depreciated?  invalid?
23:46 cjfields joined #perl6
23:47 obra =kwid was ingy's attempt a first cut of pod6
23:47 obra as I understand it, it's been superceded by damian's pod6 spec
23:48 cjfields_ joined #perl6
23:50 mncharity thanks obra
23:51 obra nnn
23:51 obra np
23:51 obra I can't find the conversation I had with particle last week, but I believe current is:
23:52 obra =begin pod
23:52 obra I don't know if a global search and replace is Right or Wrong
23:54 mncharity me neither.  for pugs t/ as "test suite to detect pugs regressions", clearly wrong.  for pugs t/ as "current spec", updating to something is clearly right.  i suspect the first use is already better served by "check out revision x of t/".  and second use is the current intent.  so Right I suspect.
23:55 mncharity I've just kludge a workaround for now.
23:55 mncharity *kludged
23:58 mncharity pugs: int rand 1000
23:58 exp_evalbot RESULT[623]
23:59 mncharity rakudo: int rand 1000
23:59 exp_evalbot RESULT[Method 'perl' not found for invocant of class 'Float'␤current instr.: '_block10' pc 35 (EVAL_11:16)␤called from Sub 'parrot;PCT::HLLCompiler;eval' pc 785 (src/PCT/HLLCompiler.pir:458)␤called from Sub 'parrot;PCT::HLLCompiler;evalfiles' pc 1067 (src/PCT/HLLCompiler.pir:587)␤called from Sub
23:59 exp_evalbot ..'parrot;PCT::HLLCompiler;command_line' pc 1246 (sr...

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

Perl 6 | Reference Documentation | Rakudo