»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend!
Set by sorear on 4 February 2011.
00:02 xinming joined 00:17 jeffreykegler joined 00:19 jeffreykegler left
sorear colomon: same here 00:33
00:48 wolfman2000 left, HarryS joined 00:56 nif_ joined 00:57 nif left 01:00 nif_ left 01:03 nif joined
lichtkind TimToady: in S03: "Returns the list on the left unless any of them are EMPTY, " you mean any element? 01:09
01:15 onega joined, onega left
sorear lichtkind: EMPTY is gone 01:17
lichtkind you mean the special word EMPTY? 01:20
or E ?
sorear both. 01:21
lichtkind wha? 01:22
why
i just added it :)
sorear EMPTY and E are part of the Old Iterator Model 01:23
which is still documented in S07, but that's supposed to change
01:26 scott__ joined
lichtkind so it shouldbe deleted out of S03 too 01:31
sorear: thank you 01:32
01:36 havenn joined 01:43 havenn left
lichtkind good night 01:45
01:49 raiph left, lichtkind left 01:50 tokuhirom left, tokuhirom joined 01:55 tokuhirom left 02:09 whiteknight left 02:12 IngisKahn left 02:19 orafu left, orafu joined 02:24 benabik joined 02:35 Chillance left 02:40 vlixes joined
vlixes pernatiy: 02:46
02:46 vlixes left 02:51 conntrack left 02:53 nif left 02:54 nif joined 02:58 nif left 03:13 wolfman2000 joined 03:14 thelazydeveloper left 03:15 envi_ joined 03:18 araujo left 03:33 thou joined 03:34 vlixes joined, vlixes left 03:39 fgomez left, fgomez joined 03:41 envi_ left 03:44 nif joined 03:56 fgomez left, fgomez joined 03:57 IngisKahn joined 04:19 nif left 04:20 nif joined 04:28 nif left 04:43 spaceships left, spaceships joined 04:45 spaceships left 04:51 lestrrat left 04:52 lestrrat joined 05:13 birdwindupbird joined 05:53 lestrrat left 05:54 lestrrat joined 06:00 araujo joined, araujo left, araujo joined 06:15 xinming left 06:34 xinming joined 06:51 tarch joined
dalek ecs: a950494 | moritz++ | S02-bits.pod:
[S02] fix POD error
07:15
moritz S02 says: "In support of OO encapsulation, there is a new fundamental datatype: P6opaque. External access to opaque objects is always through method calls, even for attributes." 07:19
but currently we consider P6opaque not a type in the usual sense, but a representation. Right?
how can we rephrase that to make it clearer?
sorear s/datatype/representation/ 07:20
at the time that was written, we didn't have a distinct name for reprs yet
o/ moritz
moritz \o sorear 07:21
and the "external" refers to from outside the current class, rightß
s/ß/?/
dalek ecs: d689826 | moritz++ | S02-bits.pod:
P6opaque is a data representation, not a type
07:22
moritz sorear++ deserves some credit too 07:23
dalek ecs: 8c10e33 | moritz++ | S02-bits.pod:
[S02] update type object .gist-ification
07:26
07:28 fglock joined
moritz std: my Int|Str $error 07:34
p6eval std 1ad3292: OUTPUT«===SORRY!===␤Multiple prefix constraints not yet supported at /tmp/T0T3VVdFIT line 1:␤------> my Int⏏|Str $error␤Malformed my at /tmp/T0T3VVdFIT line 1:␤------> my Int⏏|Str $error␤ expecting any of:␤ multi_de…
moritz S02/Polymorphic types/ says this should be allowed
should I mark the whole section as conjectural?
or delete it outright?
moritz goes with the former 07:37
dalek ecs: 30713e3 | moritz++ | S02-bits.pod:
[S02] polymorphic types are speculative at best

mark them as conjectural
07:45 sporous left, sporous joined 07:46 sporous left 07:50 sporous joined 08:04 Trashlord left 08:07 Trashlord joined
moritz f [1, 2, 3]; f my @ = 1, 2, 3; sub f (\x) { # how can I check if x will flatten as 3 elements or as 1 in list context? } 08:09
08:10 pomysl left, Trashlord left 08:11 snearch joined
dalek ecs: 80afe38 | moritz++ | S02-bits.pod:
[S02] change a heading

the described behavior really depends on the type, not on the container type
  (that is, @a = 1, 2, 3 and $a = [1, 2, 3] stringify the same way)
08:13
08:14 fsergot joined
fsergot hi o/ 08:17
08:19 Trashlord joined
tadzik o/ 08:19
08:20 Trashlord left 08:21 Trashlord joined
moritz \o fsergot, tadzik, * 08:23
p6: my %h = a => 1, b => 2, 'a b' => 3; sub f { <a b> }; sub g { [<a b> ] }; say %h{ f }; say %h{ g } 08:24
p6eval niecza v15-6-gefda208: OUTPUT«1 2␤3␤»
..pugs: OUTPUT«12␤3␤»
..rakudo 4373f0: OUTPUT«1 2␤1 2␤»
08:29 Trashlord left
moritz I'm pretty sure that niecza++ is right and rakudo is wrong 08:32
08:32 Trashlord joined
moritz std: @ $_ 08:32
p6eval std 1ad3292: OUTPUT«===SORRY!===␤Non-declarative sigil is missing its name at /tmp/bJBzzKomLy line 1:␤------> <BOL>⏏@ $_␤Use of uninitialized value $first in string eq at STD.pm line 66416.␤Use of uninitialized value $first in string lt at STD.pm lin…
dalek ecs: 01ed12c | moritz++ | S02-bits.pod:
[S02] sigils are not available as prefix operators

std and the compilers do not implement it, neither is it use in the spec or the test suilte
08:35
08:36 thou left 08:40 Trashlord left 08:41 snearch left
dalek ecs: f583892 | moritz++ | S02-bits.pod:
[S02] do not use conjectural stuff in unrelated examples
08:41
08:41 Trashlord joined 08:43 NamelessTee joined 08:46 Trashlord left
dalek ecs: 20e3235 | moritz++ | S02-bits.pod:
[S02] delete note on intrinsic hash iterator state

We do try to learn from p5's mistakes. The fact that hashes can be passed to routines without flattening them into a list means that intrinsic iterators would cause way too much action at a distance.
08:46
08:48 Trashlord joined
jnthn morning 08:51
08:56 Trashlord left 08:59 dwierenga left 09:00 dwierenga joined 09:28 fgomez left 09:29 envi_ joined 09:49 fsergot left 09:52 spider-mario joined 09:57 fsergot joined 10:10 fsergot left 10:11 scott__ left 10:33 pernatiy left 10:47 xinming left 10:51 sftp left, sftp joined 11:02 lestrrat left, lestrrat joined 11:11 Trashlord joined 11:15 thelazydeveloper joined 11:16 pernatiy joined 11:32 xinming joined, fsergot joined 12:13 Chillance joined
moritz std: my ($a, $b); ($a, $, $b) = 1..3 12:17
p6eval std 1ad3292: OUTPUT«===SORRY!===␤Unsupported use of $, variable; in Perl 6 please use .join() method at /tmp/RbrBhuZI1y line 1:␤------> my ($a, $b); ($a, $,⏏ $b) = 1..3␤Parse failed␤FAILED 00:00 44m␤»
moritz std: my ($a, $, $b) = 1..3
p6eval std 1ad3292: OUTPUT«ok 00:00 43m␤»
12:18 NamelessTee left, JimmyZ joined
moritz p6: class A { our sub b() { 'A::b' } }; say A::{'&b'} 12:21
p6eval niecza v15-6-gefda208: OUTPUT«sub b() { ... }␤»
..rakudo 4373f0: OUTPUT«Method 'at_key' not found for invocant of class 'A'␤ in method postcircumfix:<{ }> at src/gen/CORE.setting:1190␤ in block <anon> at /tmp/McTNGNVsui:1␤␤»
..pugs: OUTPUT«*** ␤ Unexpected "{'&"␤ at /tmp/Lxwp4JCNDc line 1, column 44␤»
moritz niecza++
12:23 JimmyZ left
moritz niecza: say lines[0] 12:23
p6eval niecza v15-6-gefda208: OUTPUT«Land der Berge, Land am Strome,␤»
12:24 JimmyZ joined, brrt joined 12:26 wolfman2000 left 12:27 brrt left 12:32 hundskatt left
moritz p6: sub st() { 'string' }; say str.uc 12:38
p6eval pugs: OUTPUT«*** No such subroutine: "&str"␤ at /tmp/yRvsK50CQy line 1, column 28 - line 2, column 1␤»
..niecza v15-6-gefda208: OUTPUT«===SORRY!===␤␤Undeclared routine:␤ 'str' used at line 1␤␤Potential difficulties:␤ &st is declared but not used at /tmp/gW0TC6I48c line 1:␤------> sub st⏏() { 'string' }; say str.uc␤␤Unhandled exception: Check failed␤␤ …
..rakudo 4373f0: OUTPUT«use of uninitialized value of type str in string context␤␤»
moritz p6: sub st() { 'string' }; say st.uc
p6eval pugs, rakudo 4373f0, niecza v15-6-gefda208: OUTPUT«STRING␤»
moritz p6: say st.uc; sub st() { 'string' } 12:39
p6eval pugs, rakudo 4373f0, niecza v15-6-gefda208: OUTPUT«STRING␤»
moritz std: say st.uc; sub st() { 'string' }
p6eval std 1ad3292: OUTPUT«ok 00:00 42m␤»
moritz S02 is full of scary stuff. This example above should be forbidden.
"It is illegal for a provisional subroutine call to be followed by a
colon postfix, since such a colon is allowed only on an indirect object,
or a method call in dot form."
pmichaud p6: say st++; sub st() { 'string' } 12:41
p6eval pugs: OUTPUT«*** Can't modify constant item: VStr "string"␤ at /tmp/Kevvd4lZeY line 1, column 5-9␤»
..niecza v15-6-gefda208: OUTPUT«Unhandled exception: Writing to readonly scalar␤ at /tmp/cYbwm0bQZi line 1 (mainline @ 2) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3842 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3843 (module-CORE @ 65) ␤ at /home/p6eval/niecza/lib/…
..rakudo 4373f0: OUTPUT«Cannot assign to a non-container␤ in sub postfix:<++> at src/gen/CORE.setting:1242␤ in block <anon> at /tmp/7AovGytkNF:1␤␤»
moritz that section (S02/Bare identifies/) has other scary stuff 12:42
erm, S02/Bare identifiers/
12:42 NamelessTee joined
pmichaud yes, it does 12:42
moritz like a block about how predeclared unary subs parse an argument list of just one argument 12:43
pmichaud I wonder if any of it is really fossil
moritz I hope most is
pmichaud oh, I'm certain that part is fossil
...although I'm not finding it based on a search for "unary" 12:45
moritz "Based on the signature of the subroutine declaration, there are only four ways that an argument list can be parsed:"
that's the section I'm referring to
it's not very explicit in there, but why list those four ways of parsing signatures when there's no distinction? 12:46
pmichaud yes, I agree. We'll want TimToady to either confirm that it's now fossil or clarify
moritz I'll just swing the sledgehammer since I'm fairly confident it's fossil. If it's not, I won't be mad at TimToady++ for using 'git revert' 12:47
forgiveness > permission and all that :-)
pmichaud moritz++
12:50 mtk joined 12:55 lichtkind joined
lichtkind moin 12:56
12:57 PacoAir joined
pmichaud niecza: class ABC { our sub xyz() { 'xyz' } }; say ABC.WHO.WHAT 13:00
p6eval niecza v15-6-gefda208: OUTPUT«Stash()␤»
pmichaud niecza: class ABC { our sub xyz() { 'xyz' } }; say ABC::.WHAT
p6eval niecza v15-6-gefda208: OUTPUT«Stash()␤»
pmichaud niecza++
rakudo: class ABC { our sub xyz() { 'xyz' } }; say ABC.WHO.WHAT
p6eval rakudo 4373f0: OUTPUT«Stash()␤»
pmichaud rakudo: class ABC { our sub xyz() { 'xyz' } }; say ABC::.WHAT
p6eval rakudo 4373f0: OUTPUT«ABC()␤»
13:00 lichtkind_ joined
pmichaud rakudo-- 13:00
[Coke] drinks a coffee and yawns. 13:01
# 04/08/2012 - rakudo++ ; niecza (95.33%); pugs (39.69%)
"niecza", 20349, 2, 749, 1530, 22630, 24118
"pugs" , 8472, 2, 3151, 1615, 13240, 23979
"rakudo", 21345, 31, 638, 1888, 23902, 24128
p: say 21345*.4-8472
p6eval pugs: OUTPUT«66␤»
13:02 lichtkind left, lichtkind_ is now known as lichtkind 13:05 PacoAir left 13:09 plutoid joined
moritz std: uc\ .lc 13:11
p6eval std 1ad3292: OUTPUT«===SORRY!===␤Unsupported use of bare 'uc'; in Perl 6 please use .uc if you meant $_, or use an explicit invocant or argument at /tmp/2Mz3u2gb2x line 1:␤------> uc⏏\ .lc␤Check failed␤FAILED 00:00 40m␤»
moritz std: sub f() { }; f\ .lc 13:12
p6eval std 1ad3292: OUTPUT«ok 00:00 41m␤»
moritz std: my $foo; .$foo 13:13
p6eval std 1ad3292: OUTPUT«ok 00:00 41m␤»
[Coke] masak, au, moritz: hey, if pugs had "so", we could pretty easily hit the 40% mark. ;) 13:15
moritz [Coke]: I've already tried :/
lichtkind moritz: i heard that EMPTY and E are about to go and i was tempted to remove according pieces of S02 13:16
but its now just out of the tablets
moritz lichtkind: have fun :-)
dalek ecs: 39ac2b0 | moritz++ | S02-bits.pod:
[S02] remove parsing fossils

parsing is now a lot more regular than it used to be. Std, rakudo and niecza already worked that way, it is only the spec that still had the old irregularities
lichtkind moritz: thanks but i still fighting with my rakudo patch getting less and less fun
13:17 wolfman2000 joined 13:18 skids joined 13:19 lichtkind left
dalek ecs: f5d00a5 | moritz++ | S02-bits.pod:
[S02] tiny wording update

we do not call arrays stored a scalar "array ref" anymore
13:20
13:21 [particle] left 13:26 [particle] joined 13:27 JimmyZ left
pmichaud locally: 13:29
> say (1,2,6 ... *)[10]
Unable to decude sequence
> say (1,2,6 ... *).elems
Inf
this differs from current nom: 13:30
r: say (1,2,6 ... *)[10]
p6eval rakudo 4373f0: OUTPUT«Nil␤»
pmichaud r: say (1,2,6 ... *).elems
p6eval rakudo 4373f0: OUTPUT«Inf␤»
pmichaud okay, that part remains the same-ish (because of laziness) 13:31
13:31 JimmyZ joined
pmichaud anyway, locally I've written sequence to produce an infinite sequence of failures when it cannot deduce the sequence 13:31
still not sure that's.... correct.
moritz what about stringification of such a sequence? 13:32
dalek ecs: 025f410 | moritz++ | S02-bits.pod:
[S02] remove fossil from the times we had "want"
13:33
pmichaud it's still stringifying to "..." because of laziness.
otoh, we get
13:33 lichtkind joined
moritz can't we just reify the first, say, 8 or 10 items, and stringify them plus a ... ? 13:34
because '...' alone is very unhelpful
pmichaud I agree
moritz even <LAZY LIST> would be more helpful than ...
pmichaud would we reify the next 8 or 10 items on each stringification, though?
moritz sorry, I meant to say we stringify the first 8 or 10 items 13:35
and reify as necessary
pmichaud yes, I understood that
my point being:
my @a = 1 .. *;
say ~@a; # produces "1 2 3 4 5 6 7 8 ..."
but now the first eight elements of @a have been reified, so 13:36
say ~@a; # produces "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ..."
i.e., do we always reify the first N items of any lazy component we encounter?
moritz I wouldn't say so 13:37
pmichaud so, what's the deciding factor?
moritz just do self[^10] ~ ' ...' or so
(and check that self[^10] actually returned 10 items; if not, no need to add the '...' }
pmichaud I don't think it quite works that way. Let me check. 13:38
moritz we do store reify elements
pmichaud that's not what I'm referring to
moritz self.gimme(10) < 10 ?? self.join(' ') !! self.[^10].join(' ') ~ ' ...' 13:39
pmichaud .join is the part that does the '...'
lichtkind is a gimme some sort of official method?
moritz pmichaud: then maybe we need a (possibly private) low-level join that isn't that smart 13:40
pmichaud currently .join works by stringifying all of the list elements and pushing them into a ResizableStringArray
moritz or a join with an item count limit that disregards laziness
13:41 Trashlord left 13:42 Trashlord joined
pmichaud what do we do with a list that has 15 elements and then a lazy component? Do we leave the lazy component alone? 13:43
moritz yes
pmichaud so, if we had
[Coke] p: say 1...2
p6eval pugs: OUTPUT«*** ␤ Unexpected "2"␤ expecting operator, ":", "," or term postfix␤ at /tmp/iImo2stOFT line 1, column 9␤»
pmichaud say ~(<a b c d e f g h i j k l m n o>, 1, 2, 6 ... *) 13:44
you'd be okay with "a b c d e f g h i j k l m n o ..." as the result?
moritz yes, though it would probably be even better include all reified elements 13:45
13:45 Trashlord left
pmichaud that would be all of the reified elements of the sequence, though. 13:45
that's kind of my point.
moritz so, restart: include all already reified elements, and reifiy more only if less then 8 have been reified
pmichaud so, actually, it would've come out as "a b c d e f g h i j ..." 13:46
[Coke] I dislike that the gist is changing all the time here.
s/all the time/at all/ , really.
13:46 Trashlord joined
pmichaud keep in mind that sequences reify one element at a time, including for the elements on the lhs list. Either that or we don't use gather/take to generate sequences. 13:47
or we have to do something else really bizarre-ish
if I have
my $seq := (< a b c d e f g h i j k l m n o>, 1, 2, 6 ... *);
then at this point, $seq has zero reified elements 13:48
when I request
moritz well, we can always call @result.gimme($lhs.elems) before leaving the sequence operator
pmichaud as long as $lhs.elems isn't infinite, yes.
moritz correct
but there's no need to lazify parts of the return list that have already been eagerly evaluated 13:49
pmichaud I don't follow that statement.
moritz which we do in order to determine the generator
pmichaud we determine the generator lazily, though. 13:50
i.e., we determine the generator at the point where it's needed, not a-priori
and the whole sequence is a gather/take loop, which implies laziness on each element 13:51
(i.e., there's one take per element)
I suppose it could be written such that it returns the equivalent of (@lhs, gather/take) instead of a single gather/take that also handles the @lhs elements, but that feels odd-ish 13:53
13:53 thelazydeveloper left
pmichaud regardless 13:53
going back to stringification, given
say ~(< a b c d e f g h i j k l m n o >, 1, 2, 6 ... *) 13:54
even if we .gimme the lhs, we end up with a stringification of "a b c d e f g h i j k l m n o 1 2 6 ..."
I guess that might be okay.
moritz +1 13:55
(sorry, got called away) 13:56
r: say (1, 2, 3 ... 1).perl
p6eval rakudo 4373f0: OUTPUT«(1,).list␤»
pmichaud I'm just not very keen on saying that the @lhs of a sequence should be eagerly evaluated at the time the sequence is created, though.
moritz if the LHS already is eager, why not? 13:57
pmichaud you mean if it's already reified
so, really @return.gimme(@lhs.gimme(0))
instead of @lhs.elems
moritz yes
in your example it's a literal; there's no point in making a literal lazy 13:58
pmichaud well, the sequence operator doesn't always know that it's getting a literal
13:58 bluescreen10 joined
moritz right 13:59
but if it does, Nicholas Clark has argued (and I agree with it) that we should deduce the sequence as early as possible, in order to fail as early as possible
pmichaud sure, but that's a totally different area of code --
moritz which means compile time for literal LHSs
pmichaud I'm not sure I agree with that, even if this example. 14:00
colomon moritz++
pmichaud I mean, just from an API perspective I'm not sure how that should be handled. 14:01
moritz the compiler checks if the LHS is constant-foldable, and if yes, passes a named argument to sub SEQUENCE 14:02
(just one possibility)
pmichaud yeah, I'm not sure I like that approach, unless we're doing that for all operators
moritz in your absence we had some more discussion on constant folding and purity of operators 14:03
pmichaud because it's really a call to infix:<...> that is being generated, not a call to SEQUENCE
just to be clear, I agree fully with the notion of detecting errors as early as possible (more) 14:04
moritz and it seems that TimToady++ is in favor of assuming that things that look pure (like infix:<+>) can be assumed to be pure, even if technically a .Numeric call trigged by infix:<+> might be impure. My point is that we try to embrace constant folding on a rather broad scale 14:05
pmichaud it's not entirely clear to me that constant arguments should turn a lazy operator into a more eager one
if I have my $b = 6; say (1, 2, $b ... *).[1]; 14:06
it will compile and run just fine
you're saying that
say (1, 2, 6 ... *)[1]
should produce a compile-time exception
moritz correct
if somebody wants (1, 2, $b ... *).[1] to return 2, they can write 2 right away 14:07
pmichaud well, the .[1] could be an expression
colomon wants to note that his previous moritz++ was for spec cleanups and had nothing to do with this discussion, which hadn't actually appeared on his IRC client for some reason.
moritz but it's almost certainly a programming error to write a sequence whose autodeduction fails 14:08
14:08 Trashlord left
moritz even if only early elements are acceessed 14:08
pmichaud anyway, I'm willing to table the constant folding discussion for now... that's really not the point of the ticket nor what I'm interested (or able) to solve at the moment.
moritz ok
pmichaud the ticket would have the same failure mode even if the lhs were held in @list
reifying 10 elements of an infinite list for stringification sounds a bit much to me 14:09
I could probably live with 8.
moritz I'm not really attached to the number 10
pmichaud would 4 be too few?
moritz I just want to note that stringification is an eager operation by nature 14:10
pmichaud oh, I know that well.
but "eager" currently stops in the face of infinity.
moritz but only where we can detect that infinity
so it's not something you should rely on
pmichaud combine that with what you just wrote above about stringification and you get what we have now 14:11
moritz for example (1, 2, 4 ... 7) is infinite but not detected as infinite
r: say ~(1, 2, 4 ... 7)
pmichaud and stringification doesn't stop in that case
because it's eager
p6eval rakudo 4373f0: OUTPUT«(timeout)»
moritz anyway, I'd be fine with 4 too, though I'd like 6 or 8 better
only time will tell what a sensible number is, and it'll be easy to change later 14:12
do whatever you see fit
colomon: glad you like my spec cleanup
pmichaud yes, the spec cleanups are excellent. moritz++
moritz colomon: I didn't even mean to do one, I just planned to skim some specs and take notes about how slushy/solid the different parts are 14:13
dalek ecs: ac1d1b1 | moritz++ | S02-bits.pod:
[S02] update hash binding wording

remove the sentence about binding slurpy hashes in a signature, because they are not really bound in the same way that ::= or := binds
ecs: c0582b7 | moritz++ | S02-bits.pod:
[S02] putting an IO object is list context does not return all lines

it is a far too common operation, and would make handling of IO objects much harder. Rather be explicit if you want its .lines
14:15
colomon moritz: polishing the spec is important work that most of us ignore unless an issue smacks us in the face. :) 14:16
I'm starting to think that sequence deduction is something that's going to be frowned upon by "Perl 6 Best Practices"... 14:17
pmichaud oh, I doubt that. I think it's very useful an elegant in the common cases. 14:18
*and
moritz well, I can imagine advise like "only use automatic sequence deduction for literal left-hand sides" or so
[Coke] errs on the side of cheating when running pugs spec tests.
moritz time will tell
14:19 thou joined
colomon The thing is, WhateverCodes make explicit generators clean and elegant too. And if you always use them, you don't have to worry about a host of special rules. 14:21
r: say 1, 1, 2, 4 ... 16
p6eval rakudo 4373f0: OUTPUT«1 1 2 4 8 16␤»
colomon r: say -1, 2, 4 ... 16 14:22
p6eval rakudo 4373f0: OUTPUT«unable to deduce sequence␤ in method Str at src/gen/CORE.setting:8203␤ in method Stringy at src/gen/CORE.setting:674␤ in method join at src/gen/CORE.setting:1059␤ in method Str at src/gen/CORE.setting:4862␤ in method gist at src/gen/CORE.setting:5156␤ in sub …
colomon r: say 2, 4 ... 16
p6eval rakudo 4373f0: OUTPUT«2 4 6 8 10 12 14 16␤»
moritz r: say -1, 2, -4 ... -16
p6eval rakudo 4373f0: OUTPUT«-1 2 -4 8 -16␤»
colomon I guess there aren't that many different cases. :) 14:24
moritz ok, I'm done with S02
except the note that S02/Properties/ might need some wording updates
at least I haven't seen anybody in #perl6 talk about "properties" when talking about traits and runtime mix-ins 14:25
pmichaud traits/runtime mixins used to be called properties 14:26
moritz and S02 still calls them that way
pmichaud as in they were a special type of property
moritz it also contains gems like
"Properties are accessed just like attributes because they are in fact
attributes of some class or other, even if it's an anonymous singleton
class generated on the fly for that purpose. "
afaict all interesting stuff with traits and mixins goes through methods these days 14:27
but I'm not sure what exactly was meant when that paragraph was written, so I'll leave it be
14:29 nif joined
moritz though I am tempted to swing the sledge hammer a final time on S02 :-9 14:30
geekosaur there was a point when mixing stuff into a class generated anonymous singleton classes 14:32
dalek ecs: 67e83a4 | moritz++ | S02-bits.pod:
[S02] remove section on "Properties"

it seems that "properties" refer to either traits or run-time mixins with infix but. Both are described much more accurately and less out-of-date in S12 and S14
moritz geekosaur: that's mostly still the case (though I don't know if it's really singleton) 14:33
geekosaur: but the whole blurb about accessing properties as attributes looks totally wrong
geekosaur I think the expected mechanism changed a lot with refinements to the meta object model
moritz if you do $x but True, it mixes in a method named Bool (because True is part of the Bool enum). No new attribute, no attribute access
cognominal jnthn, problems with qbootstrap, not investigated yest, gist.github.com/2343861
14:34 tokuhirom joined
geekosaur it was being viewed as something similar to "but" (not identical to, as you noted) 14:34
14:34 plutoid left
moritz otoh is if you write sub f($x is rw) { }, the 'is rw' trait (which seems to be a "property" too) doesn't mix in anything, it simply sets a single bit in the parameter object 14:34
so I think we're better off without that section 14:35
ok, 13 S02 commits in one day. Not bad :-9
14:36 spider-mario left
tadzik your spelling of "awesome" is funny :) 14:36
moritz :-) 14:37
in S03/Term precedence/, do we really need that many examples? 14:40
"Any literal from S02/Literals, for examples quoted strings or numbers" 14:41
colomon oh no, he's not stopping at S02! ;) 14:42
moritz colomon: should I? 14:43
colomon heck no!
tadzik CODING SPREE
colomon (that's as in, don't stop, moritz++!)
moritz I was really surprised how much cruft I found in S02 14:44
after all we usually cite it as an example of the more stable synopsis
pmichaud I'm getting a spectest failure in S32-exceptions/misc.t -- known? 14:49
throws_like 'sub postbla:sym<foo>() { }', X::Syntax::Extension::Category, category => 'postbla';
14:49 thelazydeveloper joined
moritz yes. My fault somehow. 14:50
sorry about that.
pmichaud hmmmm 14:51
r: say (1,2,6).list.gimme(0)
p6eval rakudo 4373f0: OUTPUT«0␤»
pmichaud r: say (1,2,6).list.gimme(1)
p6eval rakudo 4373f0: OUTPUT«1␤»
pmichaud using @result.gimme(@left.gimme(0)) isn't going to work :-( 14:52
14:52 leprevost joined
dalek ecs: 8639cf5 | moritz++ | S03-operators.pod:
[S03] Rat / Rat also produces a Rat
14:52
ast: e33900b | coke++ | / (11 files):
pugs fudge
gs.hs: 7c322e4 | coke++ | t/spectest.data:
run (fudged) tests
14:53
gs.hs: 83ce35c | coke++ | t/spectest.data:
track failure modes
pmichaud maybe .gimme(*)
moritz pmichaud: that's probably related to the storage of lists which I and masak recently compalined about
pmichaud moritz: you're wanting lists to reify a bit more eagerly than they do now. 14:54
moritz r: say (1, 2, 6).list.DUMP
p6eval rakudo 4373f0: OUTPUT«List<-1505048396>(:items(▶Mu), :nextiter(ListIter<-1505048420>(:reified(▶Mu), :rest(RPA<-1505048448>(1, 2, 6)), :list(List<-1505048396>))))␤»
colomon moritz: actually, shouldn't the division bit explain that Rat is only returned if the result fits in a Rat? 14:55
r: say (1/10000000000000000000000000000000000000).WHAT
p6eval rakudo 4373f0: OUTPUT«Num()␤»
moritz pmichaud: at least I don't see any possible gains from storing List(:items(Mu), :reified($x)) separately from $x
thought that might be related to the flattening thing
pmichaud it is.
$x might have things that flatten 14:56
14:56 birdwindupbird left
pmichaud in this particular case, $x is a Parcel, not a List 14:56
moritz pmichaud: at some point you really must explain how that flattening information is stored 14:57
colomon: probably
pmichaud moritz: by virtue of being (1) Iterable and (2) not in a scalar container
14:58 jaldhar left
moritz pmichaud: which part is or is not in a scalar container? and how do we test that? 14:58
pmichaud the elements of the unreified part of the List 14:59
14:59 PacoAir joined
moritz then I don't see how that's related to having a layer with an empty reified part 14:59
15:00 fsergot left
pmichaud given your example: 15:00
(1,2,6) is a Parcel
(1,2,6) is a List
sorry
(1,2,6).list is a List
we haven't done anything to request that List to reify any of its elements, so its reified part is empty
[Coke] opens a few more tickets on Pugs.hs for masak. 15:04
moritz so if I understand this correctly, in the case of Parcel.list we could construct a List in the first place which has all elements reified
pmichaud Perhaps.
moritz at least if the Parcel is reified
pmichaud Parcel's don't *reify*
all Parcels are already reified.
they're... constant.
moritz then can't we just always do it?
pmichaud when I tried it, bad things happened. 15:05
moritz (construct a flatter list in the first place)
pmichaud ummm, no
(1, 2, @a) has how many elements?
depends on the context.
moritz ok
pmichaud or the way in which it's used
the Parcel itself consists of 1, 2, and @a
moritz but doesn't the .list in Parcel.list already imply a context? 15:06
pmichaud r: my @a = <a b c>; say (1, 2, @a).list.elems
p6eval rakudo 4373f0: OUTPUT«5␤»
moritz r: my @a = <a b c>; say (1, 2, @a)[2]
p6eval rakudo 4373f0: OUTPUT«a␤»
pmichaud if you just put the 1, 2, and @a directly into the reified part, you'd get 3 for .elems 15:07
moritz r: my @a = <a b c>; say (1, 2, @a).list.[2]
p6eval rakudo 4373f0: OUTPUT«a␤»
moritz ok
pmichaud so, reification still involves iteration 15:08
dalek ecs: 228a486 | moritz++ | S03-operators.pod:
Note that infix:</> sometimes does not fit into Rat. colomon++
15:09
pmichaud and we tend to do that lazily.
we can be less lazy by doing .gimme(*), though
so, I'm guessing:
r: say (1,2,3).list.gimme(*)
p6eval rakudo 4373f0: OUTPUT«3␤»
pmichaud r: say (1, 2, 3, 4..*).gimme(*)
p6eval rakudo 4373f0: OUTPUT«Method 'gimme' not found for invocant of class 'Parcel'␤ in block <anon> at /tmp/jA8Goc7xta:1␤␤»
pmichaud r: say (1, 2, 3, 4..*).list.gimme(*)
p6eval rakudo 4373f0: OUTPUT«3␤»
pmichaud so maybe I need @result.gimme(@left.gimme(*))
but that does tend to make @left a little eager 15:10
r: my @a = <a b c>; say (1, 2, 3, @a).list.gimme(*) 15:11
p6eval rakudo 4373f0: OUTPUT«6␤»
15:11 vlixes joined
pmichaud r: say (1,2,3).map(*+2).gimme(*) 15:11
p6eval rakudo 4373f0: OUTPUT«3␤»
dalek ecs: 7ed1788 | moritz++ | S03-operators.pod:
[S03] note that $x div $y == floor($x/$y) does not always hold
15:12
moritz I'm fine with .Str being a bit more eager 15:13
pmichaud .Str is already eager
I don't know what you mean by "more eager"
you mean, as in 'strictly eager' ?
moritz I don't know what you mean by 'strictly eager'
I think we have a problem with terminology here 15:14
pmichaud mostly eager means "evaluate until you think you might have an infinity and then stop"
moritz I'll try to rephrase
pmichaud strictly eager means "evaluate even if you might have an infinity, if you get to a known infinity then fail"
moritz I don't mind .Str being a bit more eager than pmichaud's "eager" 15:15
pmichaud .Str is already eager.
note that what we're really talking about is .join, not .Str 15:16
.Str on a List calls join
moritz so what's the behavior called when we simply go on and on, even if it might be infinite?
pmichaud strictly eager
moritz 17:14 < pmichaud> strictly eager means "evaluate even if you might have an infinity, if you get to a known infinity then fail"
that's not the same
pmichaud what's the difference? 15:17
note there's a difference between "might be infinite" and "known infinite"
1..* is known infinite
moritz well, if I write strictly-eager (1..*).map: .say
it would fail 15:18
with your definition of "strictly eager"
but i can very well imagine cases where we want it to not fail, but simply keep on running
15:18 estrabd left
moritz or is (1..*).map: $something; already "possibly infinite"? 15:18
and not "known infinite"?
pmichaud note that Rakudo doesn't really implement "known infinite" yet.
but I'd conjecture that 1..* would be "known infinite" 15:19
anything involving map is likely to be "possibly infinite"
because it's always possible for the map to contain a 'last'
15:19 estrabd joined
pmichaud s/likely to be/likely to be at most/ 15:20
15:20 nif left 15:21 estrabd left, spaceships joined
pmichaud let's look at what Rakudo does do at the moment 15:21
the .infinite method has three possible return values: False, True, and Mu
False means "I know this list to be finite"
True means "I know this list to be infinite"
Mu means "I don't know if the list is finite or infinite" 15:22
15:22 estrabd joined
moritz r: say (1, 2, 4 ... 7).infinite 15:22
p6eval rakudo 4373f0: OUTPUT«Mu()␤»
moritz r: say (1, 2, { last } ... *).infinite
p6eval rakudo 4373f0: OUTPUT«True␤»
pmichaud the use of whatever star means the programmer has requested the list to be treated as infinite
as known-infinite 15:23
(even if it's not actually infinite)
15:24 estrabd is now known as estrabd1 15:26 estrabd1 left
pmichaud r: say (1,2,3).list.flattens 15:27
p6eval rakudo 4373f0: OUTPUT«Mu()␤»
15:28 estrabd joined
moritz phenny: ask TimToady can we please get rid of S03/Named unary precedence/? Not even std implements sin() as such, there is no list or rule which built-ins should be unary prefixes instead of listops, and back when we had defined() such a prefix in rakudo, it caused quite some confusion. 15:28
phenny moritz: I'll pass that on when TimToady is around.
15:28 estrabd left
masak oh hai, #perl6 15:31
masak is slowly emerging out of Easter offline-hood
moritz oh hai masak
masak: I hope it's OK that I borrowed your sledge hammer without asking first :-) 15:32
15:32 JimmyZ left
masak moritz: absolutely. the more who submit tickets, the better. 15:33
pmichaud these are sledgehammer patches 15:34
moritz masak: I think there's also an unsubmitted rakudobug in today's backlog, kind of as a delayed Easter egg for you :-) 15:35
pmichaud there are probably a couple :)
moritz (I meant the one with %h{<a b>} vs. %h{[<a b>]} 15:36
pmichaud backlogs
moritz p6: my %h = a => 1, b => 2, 'a b' => 3; say %h{[<a b>]} 15:37
p6eval pugs, niecza v15-6-gefda208: OUTPUT«3␤»
..rakudo 4373f0: OUTPUT«1 2␤»
moritz looks like over-eager flattening to me
masak submits rakudobug
moritz++ # for floating it up to the present 15:38
pmichaud p6: my @a = 0..5; say @a[ [2, 3] ]
p6eval pugs, niecza v15-6-gefda208: OUTPUT«2␤»
..rakudo 4373f0: OUTPUT«2 3␤»
15:38 LylePerl left
masak wow, you guys've been... active in the spec department. 15:38
pmichaud I think rakudo might be right here.
15:38 nif joined
pmichaud Since [2,3] is Positional, the result is a slice. 15:38
moritz p6: my @a = 0..5; say @a[ [2, 3], 0 ]
p6eval pugs: OUTPUT«20␤»
..niecza v15-6-gefda208: OUTPUT«2 0␤»
..rakudo 4373f0: OUTPUT«2 3 0␤»
masak pmichaud: I'll note that in the rakudobug. 15:39
moritz pmichaud: I'm pretty sure in this example rakudo is wrong
pmichaud I'm certain rakudo is wrong there.
oh, wait, maybe not
moritz in general [] should never be implicitly flattened
pmichaud well, it's not really being flattened here.
what's happening is that we're getting a slice of (@a[ [2,3] ], @a[0]) 15:40
moritz it's been treated as two elements rathar than one. To me that's flattening
pmichaud r: my @a = <a b c d e>; say @a[ [2, 3], 0 ].perl
p6eval rakudo 4373f0: OUTPUT«(("c", "d"), "a")␤»
pmichaud right
it's not really "flattening"
moritz I'm pretty sure that's wrong too 15:41
pmichaud I'm not sure what "right" would be here.
moritz if it descends into [], then the return value shouldn't flatten
masak .oO( it's not really flattening if it's all true ) :P
pmichaud you're saying that scalar-ness should trump Positional-ness 15:42
moritz yes
well
15:42 LylePerl joined
pmichaud i.e., the fact that something is scalar should prevent it from being treated as a Positional 15:42
moritz I'm not sure it should trump it, but at some level it should be preserved at least
masak I think I agree. 15:43
moritz I find ('c', 'a') and (('c', 'd').item, 'a') acceptable outcomes
TimToady I only like the first
phenny TimToady: 15:28Z <moritz> ask TimToady can we please get rid of S03/Named unary precedence/? Not even std implements sin() as such, there is no list or rule which built-ins should be unary prefixes instead of listops, and back when we had defined() such a prefix in rakudo, it caused quite some confusion.
moritz though currently I think that the former makes more sense, because .[] is not specced as hyper
pmichaud okay, so a Positional (or anything?) in a scalar container shouldn't slice 15:45
TimToady I think only the first makes sense, because a subscript is a LoL, and the second level list is still just a list, and [] doesn't interpolate into it
moritz pmichaud: anything in a scalar container shouldn't slice
p6: say 1 E 2 15:46
TimToady the rules of list interpolation don't change just becuase we're inside [1,2,3; 4,5,6; 7,8,9]
p6eval rakudo 4373f0: OUTPUT«===SORRY!===␤Confused␤at /tmp/onCGs1dB16:1␤»
..pugs: OUTPUT«*** ␤ Unexpected "E"␤ expecting operator, ":" or ","␤ at /tmp/avaB7uzPXn line 1, column 7␤»
..niecza v15-6-gefda208: OUTPUT«===SORRY!===␤␤Two terms in a row at /tmp/XsIFpZUHRM line 1:␤------> say 1 ⏏E 2␤␤Parse failed␤␤»
pmichaud this really doesn't have anything to do with list interpolation, at least not in Rakudo's case. 15:47
moritz std: 1 E 2
pmichaud anyway, I can fix it now.
p6eval std 1ad3292: OUTPUT«===SORRY!===␤Two terms in a row at /tmp/J4AYZnGtxp line 1:␤------> 1 ⏏E 2␤ expecting any of:␤ infix or meta-infix␤ infixed function␤ statement modifier loop␤Parse failed␤FAILED 00:00 41m␤»
dalek ecs: 5bb498e | moritz++ | S03-operators.pod:
[S03] get rid of infix:<E>, which seems to be a fossil.

  lichtkind++
15:50 tokuhirom left, tokuhirom joined, Psyche^ joined 15:51 Patterner left, Psyche^ is now known as Patterner 15:54 tokuhirom left
masak pmichaud: rt.perl.org/rt3/Ticket/Display.html?id=112362 15:56
15:56 nif left
pmichaud masak: testing fix now :) 15:56
(well, waiting for compile to finish) 15:57
masak backlogs
15:58 nif joined
pmichaud locally: 15:58
> my @a = <a b c d e>; say @a[2,3]
c d
> my @a = <a b c d e>; say @a[[2,3]]
c
> my @a = <a b c d e>; say @a[[2,3], 0]
c a 15:59
> my %h = a => 1, b => 2, 'a b' => 3; say %h{[<a b>]}
3
spectesting now
masak pmichaud++ 16:00
moritz: oh, you meant the spec-destroying sledgehammer, not the rakudo-breaking sledgehammer ;) 16:04
masak has too many sledgehammers nowadays
pmichaud how can someone have too many sledgehammers? 16:05
moritz masak: well, not destroying, I hope. Just removing some loose parts :-)
pmichaud: if they don't fit into the bike shed anymore, you have a problem :-)
pmichaud "cruft-removing"
moritz p6: my @a; @a.assign: 1, 2, 3; say @a 16:06
p6eval niecza v15-6-gefda208: OUTPUT«Unhandled exception: Unable to resolve method assign in class Array␤ at /tmp/YS__OqrSFJ line 1 (mainline @ 2) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3842 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3843 (module-CORE @ 65) ␤ at /hom…
..rakudo 4373f0: OUTPUT«Method 'assign' not found for invocant of class 'Array'␤ in block <anon> at /tmp/rdZgpdAQbb:1␤␤»
..pugs: OUTPUT«*** No such method in class Array: "&assign"␤ at /tmp/ocWZZFviX2 line 1, column 8-26␤»
pmichaud moritz: depends on the color of the bikeshed, I think. Besides, you might have enough to completely construct a new bikeshed out of sledgehammers, assuming also that they're the right color.
moritz p6: my @a; @a.STORE: 1, 2, 3; say @a
p6eval rakudo 4373f0: OUTPUT«1 2 3␤»
..niecza v15-6-gefda208: OUTPUT«Unhandled exception: Unable to resolve method STORE in class Array␤ at /tmp/OYYOlFsj63 line 1 (mainline @ 2) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3842 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3843 (module-CORE @ 65) ␤ at /home…
..pugs: OUTPUT«*** No such method in class Array: "&STORE"␤ at /tmp/1CXlfIsbC7 line 1, column 8-25␤»
dalek kudo/nom: f911bae | pmichaud++ | src/core/operators.pm:
Remove unused generate() function.
16:08
kudo/nom: 2c9f46f | pmichaud++ | src/core/Any.pm:
Don't treat scalar Positionals as slices. Fixes RT #112362.
masak if you think of it as "cruft-removing", not "destroying", consider using a different name for the tool you're doing it with than "sledgehammer" :P 16:11
moritz high-power LASER? 16:12
chain saw?
masak :)
[Coke] pickaxe
pmichaud sledgescalpel
+3 scalpel of cruft-removal 16:13
masak pmichaud++ # always makes up the coolest tools
moritz pmichaud++ indeed
pmichaud high-pressure spec washer 16:14
PerlJam a "sledgescalpel" sounds like a katana to me. 16:15
pmichaud spec-katana
moritz pmichaud: did your spectest run with that patch find any passing TODO tests?
pmichaud oh, yeah, it did. in uniq.t
moritz spec-tacular 16:16
maybe deserves more direct coverage
pmichaud yes, I think more direct coverage is appropriate.
afk, lunch
moritz I'll look into it
16:18 sudokode left 16:19 HarryS left
moritz std: sub foo() { }; foo.[] 16:21
p6eval std 1ad3292: OUTPUT«ok 00:00 42m␤»
16:25 HarryS joined
dalek ecs: 392d905 | moritz++ | S03-operators.pod:
[S03] remove postfix parsing constraint
16:26
moritz "If the next item after the list operator is either an infix operator
or a term, a syntax error is reported. "
I'm not allowed to use a term after a listop?
say 1; # forbidden
:-)
std: sub foo() { }; foo+1 16:27
p6eval std 1ad3292: OUTPUT«ok 00:00 42m␤»
moritz p6: sub foo() { }; foo+1
p6eval rakudo 4373f0: OUTPUT«use of uninitialized value of type Nil in numeric context␤» 16:28
..pugs, niecza v15-6-gefda208: ( no output )
moritz p6: sub foo($) { }; foo$_
p6eval rakudo 4373f0: OUTPUT«===SORRY!===␤Confused␤at /tmp/QroLrQ8mF3:1␤»
..niecza v15-6-gefda208: OUTPUT«===SORRY!===␤␤Two terms in a row (listop with args requires whitespace or parens) at /tmp/u8HuGH8Fs_ line 1:␤------> sub foo($) { }; foo⏏$_␤␤Parse failed␤␤»
..pugs: OUTPUT«*** ␤ Unexpected ")"␤ expecting formal parameter␤ at /tmp/XPQAnP1el6 line 1, column 10␤»
moritz well, that's incosistent
if "listop with args requires whitespace or parens" holds, whe isn't foo+1 forbidden? 16:29
dalek ecs: 28401ee | moritz++ | S03-operators.pod:
[S03] update to current parsing reality (postfix after listop)
16:34
16:36 wooden_ left
moritz p6: say (0 && 0).perl 16:37
p6eval pugs, rakudo 4373f0, niecza v15-6-gefda208: OUTPUT«0␤»
moritz p6: say (0 && 0, ).perl
p6eval pugs, rakudo 4373f0: OUTPUT«(0,)␤»
..niecza v15-6-gefda208: OUTPUT«(0, )␤»
moritz S03 says: The C<&&> and C<||> operators are smarter about list context
and return C<()> on failure in list context rather than C<Bool::False>.
The operators still short-circuit, but if either operator would return
a false value, it is converted to the null list in list context so
that the false results are self-deleting.
fossil from the want() days? 16:38
[Coke] suspects he needs to update his spec test runs to do pugs/rakudo/niecza sequentially, not in parallel 16:42
dalek ecs: ebb02bc | moritz++ | S03-operators.pod:
[S03] remove fossil from back when we had want()
16:44
ecs: 7bd51c7 | moritz++ | S03-operators.pod:
[S03] more idiomatic usage of junctions
moritz p6: 1 > 2 > die("never reached") 16:49
p6eval pugs, rakudo 4373f0, niecza v15-6-gefda208: ( no output )
dalek ecs: 9dc9676 | moritz++ | S03-operators.pod:
[S03] fix layout of ASCII table
16:50
lichtkind want is gone? 16:52
moritz long 16:53
removed Mon Jul 27 18:54:44 2009 +0000 16:54
which is almost 3 years ago
lichtkind moritz: missed that , im not always around
and replaced by what?
moritz lichtkind: by objects that react smartly to contextualizers 16:55
lichtkind moritz: thanks 16:57
moritz std: sub foo :($a, $b) { } 17:00
p6eval std 1ad3292: OUTPUT«Potential difficulties:␤ $b is declared but not used at /tmp/SR_eTR5ktx line 1:␤------> sub foo :($a, ⏏$b) { }␤ $a is declared but not used at /tmp/SR_eTR5ktx line 1:␤------> sub foo :(⏏$a, $b) { }␤ok 00:00 41m␤»
moritz this concludes my skimming of S03. 17:02
17:09 jaffa4 joined
jaffa4 hi' 17:09
how to get the enviromental variable in perl 6? 17:10
17:10 nif left
TimToady %*ENV 17:11
sorear good * #perl6 17:12
[Coke] jaffa4: FYI, you can search through the synopses:
www.google.com/search?ie=UTF-8&...e+Synopses
(though to be fair, %*ENV is not immediately obvious from that search) 17:14
# 04/09/2012 - rakudo++ ; niecza (95.33%); pugs (40.08%) 17:15
"niecza", 20350, 1, 749, 1530, 22630, 24118
"pugs" , 8556, 2, 3226, 1635, 13419, 23979
"rakudo", 21345, 31, 638, 1888, 23902, 24128
jaffa4 Is pugs still developed?
benabik It's more developed again than still. 17:16
sorear jaffa4: It's been picked up in the last month or two
jaffa4 SO there are three more developed implementations of Perl 6 at the moment then 17:17
sorear it was only passing like 5% of the spectests at the beginning of the year
[Coke] I'm not sure where that 5% number keeps coming from.
jaffa4 and now is it 40%?
sorear [Coke]: memory 17:18
TimToady that's 40% of what rakudo passes, not 40% of all the tests, I believe 17:19
jaffa4 while (<dic>) , how to translate that? 17:21
TimToady for $dic.lines 17:22
[Coke] sorear: gist.github.com/1476841#file_perl6_pass_rates - line 190
TimToady assuming you did my $dic = open "filename"
17:22 wolfman2000 left
jaffa4 yes, assuming. 17:22
[Coke] anyway, pugs hasn't been under active dev for some time, but au++ has kept it building, which means we can fudge the spec tests so that pugs can run them and we can see what DOES need to be changed/added/removed (a lot) 17:23
TimToady though if you really hate the sigil you can theoretically now do 'my \dic = open...' and then dic.lines
[Coke] (some of that 40% does come from patches to Pugs, rather than spectestfudging) 17:24
TimToady and probably even works in niecza
n: my \foo = $*IN; for foo.lines { .say }
p6eval niecza v15-6-gefda208: OUTPUT«Land der Berge, Land am Strome,␤Land der Äcker, Land der Dome,␤Land der Hämmer, zukunftsreich!␤Heimat bist du großer Söhne,␤Volk, begnadet für das Schöne,␤vielgerühmtes Österreich,␤vielgerühmtes Österreich!␤␤Heiß umfehdet, wild umstritten␤liegst dem Erdteil…
TimToady r: my \foo = $*IN; for foo.lines { .say } 17:25
p6eval rakudo 4373f0: OUTPUT«===SORRY!===␤Malformed my␤at /tmp/HCuZOUHXQH:1␤»
benabik ... What does p6eval attach to $*IN?
TimToady .au national anthem 17:26
sorear .at
TimToady yeah that
sorear .au's would be in English
TimToady I thought it was Strine
jaffa4 This compiles for (<dic>) {, I wonder why 17:28
sorear strange, just checked my email this morning and I seem to have received the entire 20+ message Parrot packaging thread overnight
benabik n: <dic>.perl.say
p6eval niecza v15-6-gefda208: OUTPUT«"dic"␤»
sorear jaffa4: why shouldn't it? (<dic>) is an acceptable if somewhat weird 1-element list literal
[Coke] I'm assuming some of those postings were delayed because <not subscriber>. maybe. 17:29
17:29 nif joined
sorear [Coke]: you didn't start running the comparisons until after pugs had been improved a bit 17:30
17:31 Radium joined
TimToady n: while (<dic>) {...} 17:31
p6eval niecza v15-6-gefda208: OUTPUT«===SORRY!===␤␤This appears to be Perl 5 code at /tmp/xay84Orrk7 line 1:␤------> while ⏏(<dic>) {...}␤␤Parse failed␤␤»
benabik std: for (<dic>) {...} 17:32
p6eval std 1ad3292: OUTPUT«ok 00:00 41m␤»
TimToady 'course, that looks like both P5 and P6 code...
benabik true
17:32 havenn joined
TimToady but we could outlaw that form specially, I suppose 17:33
moritz though the more idiomatic p6 code would be loop { ... }
TimToady std: do {...} while 1;
p6eval std 1ad3292: OUTPUT«===SORRY!===␤Unsupported use of do...while; in Perl 6 please use repeat...while at /tmp/rM5VRcvzvH line 1:␤------> do {...} while 1⏏;␤Parse failed␤FAILED 00:00 41m␤»
TimToady like that is
moritz since <dict>.Bool is always true
benabik "don't iterate over a one element list"?
TimToady with parens
with a single identifier element 17:34
moritz benabik: well, while-iterating a constant, one element list isn't very intelligent
TimToady more interesting would be trying to detect use of globs
moritz: thing is, <HANDLE> inside a for is also somewhat idiomatic P5 17:35
sorear n: say ?<0>
p6eval niecza v15-6-gefda208: OUTPUT«False␤»
TimToady hard to know when to knock the training wheels off the bike... 17:36
17:36 tarch left, tarch joined
sjohnson heh 17:37
sorear I at least was taught very early to always write that while(defined($_ = <HANDLE>)) and never for(<HANDLE>) because the latter takes O(N) space
moritz TimToady: what do you think of my proposal to remove named unary prefix (or at least don't put any operator into that category by default)? 17:42
17:42 tomaw joined
[Coke] seen au? 17:44
aloha au was last seen in #perl6 5 days 4 hours ago saying "rehi pmichaud! \o </timeDilatedConversation>".
TimToady moritz: still thinking about it 17:45
moritz TimToady: ok
TimToady would probably force temp/let to be parsed as pseudo-declarators with pseudo-assignments if we went that direction, since listops are too loose to be the target of an assignment 17:48
and I still wonder whether there aren't a bunch of trig functions that mathematically minded people will think of as unaries 17:49
but I can see the arguments for simplification too
17:49 nif left
jaffa4 What does this do $*ENV{FOO}? 17:51
TimToady calls the FOO function 17:52
diakopter moritz: typo in 392d90
TimToady and then fails to find $*ENV, since it's %*ENV
actually, does that first
or wait, it's dynamic, so no
moritz TimToady: I'm OK with special-casing let and temp, it needs to be more than a simple listop anyway 17:53
TimToady you want %*ENV<FOO>
jaffa4 just wonder what the old syntax does
TimToady fails two ways :)
17:55 Trashlord joined 17:59 sudokode joined 18:14 wolfman2000 joined
moritz TimToady: if we define prefix:<sin>, then 'sin $x' works, but 'sin($x)' stops working, unless we break the rules 18:14
(either the rule that name + () is always a normal sub call, or we provide both &sin and prefix:<sin>, which makes overloading for user defined types harder again) 18:15
18:17 pernatiy left
TimToady this seems to be confusing two different issues 18:17
we might want to unify the parsing of anything that starts with an identifier a bit more than we do 18:18
if prefix:<sin> calls sin() because it's an identifier, then the unariness of it would be independent of the naming issue 18:19
it goes back to that "how keywordy are the keywords anyway?" issue
moritz but then what happens if there's prefix:<sin> and a &sin? 18:20
TimToady and unifying ident parsing might speed up the parser too
in that case you'd either get shadowing or illegal redefinition, I suppose
but anyway, it's not a trivial decision :) 18:21
jaffa4 rakudo: ~[**] 5, 4
p6eval rakudo 4373f0: ( no output )
jaffa4 rakudo: print ~[**] 5, 4
p6eval rakudo 4373f0: OUTPUT«625»
moritz well, the shadowing would lead to different semantics
than you're used to
jaffa4 rakudo: print ~[**] 2,3
p6eval rakudo 4373f0: OUTPUT«8»
jaffa4 rakudo: print ~[**] 2,3,2 18:22
p6eval rakudo 4373f0: OUTPUT«512»
moritz say sin pi, 6; # 06
TimToady wonders how much of a niecza's DFA tables are dedicated to parsing identifiers...
moritz sub sin($x) { $x.sin }; say sin pi, 6 # dispatch failure
that's not very intuitive
jaffa4 TimToady: because?
moritz I think that, independently of identifier unificiation, having some builtins as prefix ops and others as listops is a can of worms 18:23
PerlJam moritz: I 100% agree, fwiw 18:24
TimToady jaffa4: it is not clear to me which thing you're asking about 18:26
jaffa4 my mistake, my question was out of place. 18:28
TimToady why does [**] behave as it does? why do I wonder things? why do I wonder that particular thing? :)
18:29 estrabd joined, brrt joined 18:30 Trashlord left
jaffa4 rakudo: print ~[+] 1,3,4,5 18:31
p6eval rakudo 4373f0: OUTPUT«13»
jaffa4 rakudo: print [+] 1,3,4,5
p6eval rakudo 4373f0: OUTPUT«13»
jaffa4 What does ~ do? 18:32
moritz jaffa4: see S03
TimToady stringifies, but that's redundant with print
PerlJam jaffa4: you should learn about leading ~, + and ? They're quite useful.
18:32 havenn left
moritz and you should read S03. It's very useful. 18:33
jaffa4 You know about the complains that C++ is complicated , what will they about Perl 6? 18:34
not a problem for me, just saying
PerlJam jaffa4: "I'm so glad Perl 6 isn't like C++!" 18:35
TimToady or "I wish Perl 6 ran as fast as C++..."
pmichaud "I wish I could code C++ as fast as I can code Perl 6" :-P 18:36
colomon I wish I could code C++ as easily / tersely as I can code Perl 6.
(That's what I say now.) 18:37
18:37 nif joined
colomon That is to say, C++ lets you do some very powerful stuff, but it invariably takes at least 5x the code it would take to do it in Perl 6. 18:38
PerlJam "Any comparison betwen Perl 6 and C++ fails to do Perl 6 justice"
colomon On the other hand, I wish Perl 6 were as fast as C++. :)
moritz ""Any comparison betwen Perl 6 and C++ fails to do C++ injustice"
PerlJam moritz++ 18:39
pmichaud Perl 6 *is* as fast as C++, it's only the implementations of Perl 6 that are slower.
timotimo :D 18:40
18:41 Araq joined
pmichaud > say ~(1, 2, 4 ... *) 18:42
1 2 4 8 ...
[Coke] moritz: I have a version of so that works for "say so 3", but fails on "ok(so 3,'whee')" with a multi error.
moritz r: use Test; ok(so 3, 'whee') 18:43
p6eval rakudo 4373f0: OUTPUT«===SORRY!===␤Twigil-Variable constants not yet implemented. Sorry. ␤at lib/Test.pm6:3␤»
moritz eeks
[Coke] wow!
pmichaud > say ~(1, 2, 6 ... *)
Unable to decude sequence
moritz [Coke]: then you have probably defined it as a subroutine/listop, not as a prefix
pmichaud++ 18:44
pmichaud fixes typo in exception message
[Coke] moritz: \o/
dalek kudo/nom: 5f7a220 | pmichaud++ | src/core/Exception.pm:
Fix typo: decude => deduce.
18:45
[Coke] $ ./pugs -MTest -e 'ok(so 1,"whee")'
ok 1 - whee
pmichaud however...
> say ~( 1, 2, 6 ... *)
Unable to decude sequence
> say ~(0, 1, 2, 6 ... *)
0 1 2 6 ...
dalek ecs: e8e8192 | moritz++ | S03-operators.pod:
[S03] grammar; diakopter++
tadzik r: say so Cool
p6eval rakudo 4373f0: OUTPUT«False␤»
dalek gs.hs: 2512b2d | coke++ | / (2 files):
Add basic "so" && run spectest
18:48
[Coke] evalbot: rebuild pugs
p6eval: help?
p6eval [Coke]: Usage: <(star|pugs|nqp|b|std|niecza|rakudo|nom|p|n|r)(?^::\s) $perl6_program>
tadzik evalbot rebuild pugs
p6eval OK (started asynchronously)
18:48 birdwindupbird joined
[Coke] ah, thanks. 18:48
moritz won't work. 18:49
the rebuild infrastructure isn't up yet
I really need to do that tonight
[Coke] aw, sadface!
moritz: you added the opcode, but the opcode by itself is only available internally, I think. had to expose it with the second line in github.com/perl6/Pugs.hs/commit/25...8fe9912103 18:51
and I had originally copied the line above with "spre" - your hint led me to "pre".
moritz++
moritz [Coke]: glad it helped :-) 18:54
dalek kudo/nom: 3bd91f5 | pmichaud++ | src/core/Any.pm:
Force .join to reify at least 4 elements of a list (if available).

This should help with infinite lists that currently produce "..."
  -- now it will at least produce the first four elements of such a list.
18:58
pmichaud to me, 3bd91f5 is a code smell, but we'll put it in for now anyway.
18:59 xenu left
moritz pmichaud: why? because it hardcodes a constant? 18:59
pmichaud and 4 is a little arbitrary 19:00
and it doesn't help when the infinite part is more than four elements from the beginning
> say ~(<a b c d>, 1, 2 ... *)
a b c d ...
19:03 havenn joined
dalek ast: a3a3d3d | moritz++ | S02-types/flattening.t:
RT #112362, arrays in hash and array slices
19:06
19:06 wolfman2000 left
pmichaud I will admint that "a b c d ..." is at least a little better than "...", but it still feels misleading. 19:07
*admit
moritz yes, better solutions are always welcome :-)
if we just knew how many items we could reify effortlessly...
pmichaud it also depends on the meaning of "effortless" :-) 19:08
dalek albot: 94851d9 | moritz++ | build.pl:
copy stuff to feather3 after building
19:10
moritz wow, the network connection to feather is really laggy 19:14
tadzik yeah
19:19 brrt left
dalek albot: e6fe2ea | moritz++ | build.pl:
fix thinko
19:21
moritz when I do rsync via ssh, can I surpress the message of the day (motd) that ssh prints? 19:23
s/can/how can/
sorry for off-topic, but necessary for the evalbot stuff
TimToady well, my rsync manpage talks about --no-motd 19:24
moritz ah, nice. 19:25
I've search the ssh manpage so far
pugs: say so 1
p6eval pugs: OUTPUT«1␤»
moritz pugs: say so 1, 2
p6eval pugs: OUTPUT«12␤»
19:25 nif is now known as boy``
dalek albot: ca2838e | moritz++ | sync.pl:
no motd for rsync copying
19:26
19:27 estrabd left, estrabd joined 19:29 estrabd left, sunnavy left, estrabd joined
masak sorear: not writing 'for (<HANDLE>)' is sage advice in Perl 5 -- for exactly the reason you specify. but the reason ceases to hold in Perl 6, and that's why we write it again. :) 19:30
I don't expect that this will be news to you in any way whatsoever.
but it might be for others.
lazy lists makes 'for $fh.lines' the natural idiom in Perl 6.
I realized this back in 2008, while writing November, and submitting dozens of bug reports. 19:31
19:32 tarch left
masak one of my earliest tickets was about using 'while' instead of 'for': rt.perl.org/rt3/Ticket/Display.html?id=57226 19:33
19:35 boy`` is now known as girl``, girl`` is now known as car``
[Coke] recent feather slowness was probably me. (autounfudge pugs dangerous) 19:36
masak p6: class A { my $.x = 7; say $.x }
p6eval pugs: OUTPUT«*** Undeclared variable: ("$__SELF__",MkPad (padToList [("$_",PELexical {pe_type = (mkType "Scalar"), pe_proto = <Scalar:0xf6d87055>, pe_flags = MkEntryFlags {ef_isContext = True}, pe_store = <ref:0xf6d8fbb5>}),("@_",PELexical {pe_type = (mkType "Array"), pe_proto = <Array:…
..niecza v15-6-gefda208: OUTPUT«===SORRY!===␤␤Variable $.x used where no 'self' is available at /tmp/jtk2jdOd09 line 1:␤------> class A { my $.x = 7; say ⏏$.x }␤␤Unhandled exception: Check failed␤␤ at /home/p6eval/niecza/boot/lib/CORE.setting line 136…
..rakudo 4373f0: OUTPUT«===SORRY!===␤Variable $.x used where no 'self' is available␤at /tmp/fO0hUvwsvF:1␤»
masak r: class A { my $.x = 7; say $.x }
p6eval rakudo 4373f0: OUTPUT«===SORRY!===␤Variable $.x used where no 'self' is available␤at /tmp/RPGnuPfYFR:1␤»
masak updates rt.perl.org/rt3/Ticket/Display.html?id=59118
can we talk about this one a bit? I just noticed it's my oldest submitted ticket which is still open. :) 19:37
19:38 havenn left, car`` is now known as nough``
masak please read through the ticket thread if you want to participate. notice that it's about 'my $.a', not 'has $.a'. 19:38
the issue at hand is something like "directly in the class body, what does 'self' mean?"
moritz std: class A { my $.x; say $.x }
p6eval std 1ad3292: OUTPUT«===SORRY!===␤Variable $.x used where no 'self' is available at /tmp/IUpM5zUn4X line 1:␤------> class A { my $.x; say ⏏$.x }␤Check failed␤FAILED 00:00 42m␤»
masak or, hm. maybe the question is not like that. 19:39
somewhere halfway through the thread, the thing about 'my $.b = x($.a)' comes up.
moritz the question is really "why the blody heck do we allow 'my' plus a variable syntax that is tyed to a class, not to a lexical scope?"
it's just wrong(tm) 19:40
masak oh right, moritz and I disagreed on this point last time we talked about it.
now I remember.
we basically have two different self-consistent mental factorings of the solution space.
moritz in your mental model, does the $.x desguar to self.x too? 19:41
masak yes.
can we avoid the question of 'my' and dot syntax for the moment?
it's not essential for the discussion I want to have.
moritz yes, we can, if forget about the ticket too :-)
masak no, the ticket is slightly different.
moritz *if we forget
masak and I believe having 'self' be defined in the class body is defendable, useful, and worthwhile. 19:42
b: class A { say self }
p6eval b 922500: OUTPUT«===SORRY!===␤Symbol 'self' not predeclared in <anonymous> (/tmp/bX8QyJyqVN:22)␤»
masak alpha: class A { say self }
moritz and it would simply be the type object?
masak yes.
moritz TimToady: --no-motd did not work :/ 19:43
masak I believe it was, at some point or other, in rakudo.
moritz motd still printed
masak: I agree that a point can be made for it
masak: though I also want to note that we compose our classes later than we did in the 'alpha' days 19:44
benabik I think --no-motd is only for rsync daemons, not SSH connections.
masak that's a fair point but ultimately not a show-stopper.
'A' is defined from 'class A {' and onwards.
moritz masak: so the chances to get useful behavior out of using 'self' in a partially constructed class
masak: agreed
masak and composition only changes the symbol slightly by doing various hand-wavey fixup thingies. 19:45
moritz ... are lower
like, adding superclasses and roles
masak class A { my $x = 2; my $y = 2 * $x } # perfectly defined
class A { my $.x = 2; my $.y = 2 * $.x } # should also be OK, IMO 19:46
19:46 nough`` is now known as nif
moritz just think about what that implies 19:46
it implies that 'my $.x' installs a public method x
masak right.
moritz and some storage inside the class
so it's not 'my' anymore at all 19:47
it's available from outside the class
masak waitwait.
so are 'has $.x' variables.
"it's not 'private' anymore at all" -- same argument.
look, we're having this discussion again anyway...
:)
moritz yes. That's what 'has' means. But 'my' means 'only available inside this lexical scope'
masak 'has' means "declare me an instance-private container". 'my' means "declare me a scope-private container". 19:48
how you choose to share them by other means is up to you.
binding can break encapsulation too.
so can passing arguments to a routine.
moritz masak: yes, of course we're having this discussion. This discussion comes up every time this ticket is being discussed, because we have some problems implementing stuff that violates principles that hold everywhere else in the specs
well, 'my' is always related to lexcical scopes. 19:49
Except in that one single case
masak I'm not aware what principles those would be. I don't see the inconsistencies you seem to see.
moritz that a 'my' creates something which is very visible from outside the block is declared in 19:50
masak I kinda like the way the spec factors this. I would just like it to be fully consistent in the way this ticket proposes.
moritz: hm, but it's like these are two different axes, and that's why I don't have a problem with it.
moritz: 'has $.foo' = private attr + accessor. 'my $.bar' = lexical var + accessor.
clearly that's the way the things in S12 were meant. 19:51
moritz the difference is that that in 'has $.foo', the accessor is also has-scoped
if we could make accessors in 'my $.x' also lexically scoped, I'd be fine
19:52 Araq left
masak yeah, but we both know that makes no sense. :) 19:52
moritz but then '$.x' would mean different things depending on whether we had 'my $.x' predeclared or not
masak: which is why I'm against that whole thing
masak because you feel it's not a smooth, consistent feature surface.
moritz correct 19:53
I feel it violates the current simplicity of the 'my' declarator
masak yeah. I think I understand your argument -- and I think I did last time, too. 19:54
I basically disagree on that feeling, that it somehow violates the simplicity of 'my'.
moritz I understand yours too, I just don't share them
I guess that, again, we have to agree to disagree
if we could just find a syntax for class attributes that is more coherent with the rest of the design... 19:55
masak I just went off looking for a blog post I wrote years ago. about class attributes. 19:57
that was the day I felt I understood them.
moritz can't we just use has $|foo; to be a class attribute?
masak eek
moritz then it's tied to the class, and not to a lexical scope
masak but this is my point -- and perhaps the core of our disagreement -- I deeply *like* that Perl 6 doesn't have real class attributes.
that it re-uses 'my' (and 'our') for storing things "at class level".
moritz then use class A { has $x } 19:58
masak what? no.
moritz erm, s/has/my/
masak that's just a private attribute without a twigil.
moritz sorry, bad concentration
masak sure, if I don't care about the accessor I will write 'my $x'. of course.
moritz oh, one more thing
masak but it's kinda nice that I can still choose to get the accessor.
moritz how do you assign new values to a 'my $.x' variable? 19:59
masak I think this might be one of the *very* few contientious areas of the spec. we should treat carefully.
in the sense that if you go in and just change something indiscriminately there, we might have an edit war on our hands.
that's not a threat, just an observation. ;)
moritz well, I think it's really a symptom of a more general design problem
masak I genuinely, deeply *like* the way things are factored in the spec. 20:00
I don't think it's a symptom of deeper problems.
I think it's a neat unification/simplification.
the only thing is that I wish that 'self' would be defined and mean 'type object' in the class scope, too.
moritz you can't expect class { my $.x; $.x = 3 } to work, unless you either break how $.x is looked up, or by implicitly generating an rw-accessor
masak oh, troo. 20:01
that's a new point. hadn't thought of that.
I'm fine with that being illegal, though.
moritz so, how would assign a new value to such a variable?
masak shouldn't go assigning to accessors that weren't explicitly made rw. 20:02
moritz: the usual way. at declaration.
that's fine with 'has $.x = 2' too, no?
20:02 vlixes left
jnthn evening from St\o/ckholm 20:02
masak jnthn! \o/
moritz masak: well, but that only gives you a constant. In the case of 'has $.x', you can assign to $!x 20:03
jnthn Wow. It's hard to find an open restaurant here on an Easter Monday evening!
moritz masak: do you want 'my $.x' to generate a '$!x' too, which is looked up specially?
masak moritz: no.
moritz: in the case of 'my $.x', you can assign to $x. 20:04
jnthn my $.x just declares a my $x
masak I really don't see that problem.
jnthn our $.x just declares an our $x
And then it installs an accessor
masak moritz: feels like you're just doing yourself a disservice by refusing to see the parallels here.
moritz masak: no, I just missed that 'my $.x' installed a 'my $x'
ok, then there's only a minor problem remaining
jnthn See declare_variable iirc in Actions.pm, the branch for lexicals.
masak er. 20:05
I've been discussing with you all this time and you've been assuming there's no 'my $x'!?
that... explains a lot.
:)
jnthn ...should I save myself backlogging this conversation? <grin>
masak no, it's still interesting.
moritz well, 'has $.x' also doesn't create an $x
masak I might re-read it now.
*sigh*
moritz: please take a moment to re-adjust your world view.
it really does make sense, I promise! 20:06
20:06 leprevost left
moritz masak: ok, I'll try 20:06
masak thanks.
moritz one more question
if I augment a class, can I assign to $x or $.x somehow?
masak no, it's still a lexical, and the accessor's still read-only. 20:07
in a way, you get lexical scope encapsulation.
that's a feature, not a bug.
jnthn nom: class Foo { my $.x; }; Foo.x = 42; say Foo.x;
p6eval rakudo 3bd91f: OUTPUT«42␤»
moritz ok. So it's not a "proper" class variable
masak hrm.
jnthn readonly, you say? :)
masak moritz: no, and it never was.
jnthn: arguably the accessor should be readonly.
jnthn masak: Arguably.
masak submits an arguable rakudobug
jnthn masak: Wait. 20:08
masak waits
jnthn masak: Let me at least explain why it's the way it is.
moritz ok, back to the original question
jnthn What are you applying the "is rw" trait to in this case?
moritz should we declare self implicitly in the class body?
I'm +0.5 on it
jnthn Well, since it's a my, you've got no attribute meta-object.
masak jnthn: the auto-created method.
jnthn Which is what the rw is normally set on
masak jnthn: just like with an accessor on a 'has' variable.
jnthn masak: What is responsible for installing the accessor? 20:09
masak jnthn: the... ClassHOW?
jnthn masak: The ClassHOW doesn't know about lexicals. Wrong plane. :)
masak: And the ClassHOW doesn't even install the ones for attributes.
moritz Attribute does, no?
jnthn masak: It calls .compose on Attribute, which is in charge of accessor generation.
masak moritz: I feel like, we could disallow it for now and say that 'self' is illegal there, but 10 years down the line when Perl 6.1 is out we would still switch it on and have it mean the type object. 20:10
jnthn I'm kinda -0.5 to self meaning the type object in the class body.
masak jnthn: ok, I see what you mean, and I know lexicals don't have a HOW.
jnthn masak: Yeah. And so the trait would just apply to the variable at the moment.
masak jnthn: well then, what generates the accessor today?
jnthn masak: Currently the actions just generate the PAST::Block that looks it up and code-objectify it and call .^add_method 20:11
masak I'm not so worried about how to make the trait apply to the method. that can always be sugared to DTRT.
jnthn: why are you -0.5 on self meaning the type object?
jnthn: and did you read the RT ticket in the backlog? :)
jnthn masak: Well, it's more that with "has" traits always apply to the Attribute meta-object, and it feels reasonable that traits with "my" should always apply to the container.
masak granted. 20:12
moritz but Scalar knows nothing about the surrounding class
so it has trouble installing an accessor in it, no?
jnthn moritz: Thus why we cook the method up in the Actions rather than have something else do so. 20:13
masak it's just, it feels more important to have 'is rw' latch on to the accessor, because that's what Least Surprise tells us will happen. so I'm willing to inject some magic/sugar there.
jnthn masak: but then *every* trait would latch on to the accessor, not the variable, which is inconsistent with what traits on a "my" always do
Whereas traits on a "has" - whatever the twigil - always latch on to the Attribute.
masak hm. 20:14
jnthn masak: It feels like we get to pick our symmetry. :)
masak when you say "*every*", what set of things are you quantifying over?
jnthn: yes, just like in my discussion with moritz++
jnthn has <variable> <trait>+
Every trait there 20:15
As for your other questoin...
Because has $.x = self # here self does *not* mean the type object, and there's no curlies to indicate the change of scope. It's confusing enough that self exists in the initializer. :)
Without having it mean something else in the surrounding lexical scope. 20:16
masak moritz: ah, here's the blog post: strangelyconsistent.org/blog/i-can-haz-constant
it just had a silly name, so I couldn't grep for it easily ;)
20:16 ashleydev left
masak jnthn: not sure I agree... 'has' scope is special in exactly that way, that it "narrows" the meaning of 'self' from being the type object to being an instance. 20:17
that's what 'has' *does*.
so it's not so much a strange rule or exception, as a logical application of 'has' scoping.
20:18 Radium left
masak so it's not strange to me at all that 'my $x = self' and 'has $.x = self' will have very different views of 'self'. 20:18
jnthn masak: Well, I did only -0.5 it, not -1 :)
masak just like 'my $foo = BEGIN ...' will have a very different view of stuff too.
jnthn nom: class Foo { has $.x, $.y; } 20:19
p6eval rakudo 3bd91f: OUTPUT«===SORRY!===␤Variable $.y used where no 'self' is available␤at /tmp/vX7vvTlKrR:1␤»
jnthn Also, the current rules catch this one. :)
20:19 ashleydev joined
moritz yes, we'd have to give up on that one if we made self the current class 20:19
pmichaud tries to catch up with backscroll... fails
jnthn o/ pmichaud
20:20 Radium joined
masak er. 20:21
lichtkind moritz: how did you the 2 line git commit comment
masak std: my $a, $b;
p6eval std 1ad3292: OUTPUT«===SORRY!===␤Variable $b is not predeclared (declarators are tighter than comma, so maybe your 'my' signature needs parens?) at /tmp/LN0ezudJjd line 1:␤------> my $a, ⏏$b;␤Check failed␤FAILED 00:00 42m␤»
masak look at that parenthetical addendum.
'has' should clearly have something similar.
std: class A { has $.x, $.y; } 20:22
p6eval std 1ad3292: OUTPUT«===SORRY!===␤Variable $.y used where no 'self' is available at /tmp/rgYJMRx2r4 line 1:␤------> class A { has $.x, ⏏$.y; }␤Check failed␤FAILED 00:00 42m␤»
masak TimToady: ^
jnthn masak: Apart from that one *is* an error always. And $.y would not be.
masak jnthn: yeahbut.
jnthn masak: Though, we could probably find a way to make it an error.
masak if you write code like that... :)
jnthn ...somehow...
moritz masak: note that 'has' has a tighter precedence than infix:<,>
20:22 lichtkind_ joined
masak moritz: so does 'my'. 20:22
moritz right
masak so. non-issue. 20:23
just put in a better error message.
moritz lichtkind: with my text editor :-)
lichtkind: also UNIX shell allow you to write multi linux arguments on the command line
git add File.pod
git commit -m 'some message <return><return>rest of message here' 20:24
masak lichtkind: git allows you to write commit comments in $EDITOR.
20:25 Radium left, lichtkind left, lichtkind_ is now known as lichtkind
masak moritz: hm. I just re-read my blog post. it contains less of the insights I've had about 'my $.foo' than I remembered. 20:27
basically it dismisses 'my $foo' as not being enough. I think 'my $.foo' mostly fixes that.
but -- as you point out -- it's not exactly "class-level attributes".
pmichaud I'm sure this doesn't resolve the issue, but one could always do: class A { my $.x; A.x = 3; }
masak it's more "package-level attributes".
pmichaud i.e., we have a way of accessing the class inside of the body without having to use 'self' to do it. 20:28
jnthn $?CLASS.x = 3; # :)
pmichaud that also.
masak that's nice. 20:29
20:30 Radium joined, Radium left, Radium joined
moritz pmichaud: at your convenience, could you please take a look at rt.perl.org/rt3//Ticket/Display.html?id=112148 ? 20:30
masak if you really want to forbid 'self' directly in the class block until everyone realizes that it's a good idea, then so be it ;)
pmichaud it would somewhat bug me to have 'self' in the class block because it would then potentially scope into subs
masak oh!
jnthn pmichaud++ 20:31
masak well, that *is* a valid objection, I think.
that might bother me too.
pmichaud class A { my $.x; my sub foo() { say $.x; } } # huh?
moritz and also
jnthn class A { has $.x; my sub foo() { say $.x; } } # wtf :)
20:31 PacoAir left
masak "Can't access attribute on type object, silly" 20:32
jnthn I didn't put "silly" in the error :P
masak but yeah, it *might* just miss out on useful error messages at compile time.
20:32 bruges left, y3llow left, Radium left 20:34 Radium joined, Radium left, y3llow joined, bruges joined
masak s/silly/sillybear/ # :P 20:35
moritz ok, masak is going to kill me for this...
can't we have SELF in the class to mean $?CLASS? 20:36
moritz runs far and fast
20:36 y3llow left 20:37 y3llow joined
jnthn macro SELF { quasi { $?CLASS } }; # but this'd have to be COMPILING-y I guess... 20:37
20:38 Radium joined, Radium left
masak moritz: :P 20:38
20:39 Radium joined, Radium left, y3llow left
masak moritz-- # I'm not into violence, but here's for general tastelessness :) 20:39
20:39 Radium joined, Radium left, y3llow joined
pmichaud sledgehammers and katana seem to be the meme of the day today 20:39
20:39 Radium joined
masak jnthn: yeah, maybe $?COMPILING::CLASS ? :) 20:39
jnthn Or maybe COMPILING::<$?CLASS> 20:40
20:42 y3llow left
masak or maybe that. 20:42
pmichaud++ # p6c mail to the Debian packagers
20:42 y3llow joined 20:43 birdwindupbird left, Radium left 20:44 Radium joined, Radium left
pmichaud bbl # errand 20:44
20:44 Radium joined, Radium left
lichtkind this .Int is almost like in rebol 20:44
20:45 Radium joined, Radium left, Radium joined, Radium left
lichtkind what is $?COMPILING ? 20:45
20:45 Radium joined, Radium left
masak lichtkind: probably a thinko on my part. 20:45
lichtkind: I liked jnthn++'s suggestion better.
20:46 Radium joined, Radium left, nif left
masak I mean, that's what I meant. 20:46
20:46 Radium joined, Radium left
masak moritz++ # all those spec commits 20:46
20:46 Radium joined, Radium left 20:47 Radium joined
moritz wow, masak has --'ed me. I wonder if that's happened before 20:47
20:47 ChanServ sets mode: +o masak, Radium left
masak moritz: :) 20:47
jnthn I haven't seen masak write moritz-- before
20:48 masak sets mode: +b *!*@117.203.11.193, ChanServ sets mode: -o masak
pmichaud searches the backlog for moritz-- :) 20:48
moritz it has happened! irclog.perlgeek.de/perl6/2011-07-03#i_4052937 20:49
jnthn Oh gee, I thought masak had got his @ out to kick moritz++ for a moment then! :P
masak what am I, a savage? :)
pmichaud moritz++ # just to even things out
afk
moritz masak: if you need to ask... :-)
masak everyone's against me all of a sudden :P 20:50
masak .oO( hmph! can't even de-karma a well-liked community member. nepotism! )
lichtkind masak: but you know what $*Compiling is? 20:57
jaffa4 Is it possible to make an exe using nicze out of perl 6 files?
20:57 NamelessTee left
moritz gist.github.com/2346494 # that's the other result of my trawling through S0{1,2,3} 20:57
20:58 Radium joined, Radium left, Radium joined, Radium left
moritz oh, one more scoping oddity 20:58
20:58 Radium joined, Radium left
moritz S02 says that 'anon sub foo { }' should make &foo available within the blockc 20:58
*block
20:59 Radium joined, Radium left, ChanServ sets mode: +o masak, Radium joined
moritz somehow that sounds both convenient and odd to me 20:59
20:59 masak sets mode: -b *!*@117.203.11.193
jnthn moritz: I think that was a recent additoin rather than fossil, fwiw 20:59
20:59 masak sets mode: +b *!*@117.203.*.*, ChanServ sets mode: -o masak
masak lichtkind: yes, that's just a dynamic variable. 21:00
moritz on indeed, Date: Wed Jan 11 15:31:43 2012 -0800
allow anon name to be used for recursion
so, that "just" needs to be special-cased in the actions somewhere, right? 21:01
masak yeah.
jnthn yeah 21:03
in routine_def
21:06 ggoebel left 21:07 ggoebel joined 21:08 samlh joined 21:09 bluescreen10 left, Radium left
samlh moritz: s/ either// github.com/perl6/specs/commit/2840...20#L0R3069 21:09
21:10 skids left
moritz samlh: thanks 21:10
21:10 NamelessTee joined
dalek ecs: 98a47db | moritz++ | S03-operators.pod:
[S03] grammar fix, samlh++
21:11
ecs: 536a483 | moritz++ | S04-control.pod:
[S04] note one more that &eval does not catch exceptions
21:13
moritz pugs: foo: say "goto"; goto foo; 21:15
p6eval pugs: OUTPUT«goto␤*** No such subroutine: "&goto"␤ at /tmp/8VM9jggNB9 line 1, column 18-26␤»
moritz S04 contains surprisingly little insanity that I was able to detect, compared to S02 and S03 21:18
dalek ecs: 0fe2de0 | moritz++ | S05-regex.pod:
[S05] s:g/Perl6/Perl 6/
21:22
21:23 havenn joined
masak something tells me moritz++ is reading through the synopses, one by one. :) 21:26
21:27 bluescreen10 joined
jnthn masak: i0.kym-cdn.com/photos/images/newsfe...1322693145 :P 21:28
masak :P 21:30
masak is www.google.com/search?tbm=isch&...in+obvious 21:32
Juerd 21:14 < moritz> wow, the network connection to feather is really laggy
moritz: Still?
21:35 daxim left
gfldex in S32 it says "method Str subst(Str $self: Regex $search, Str $replacement);" 21:38
that Str $replacement is a lie 21:39
it's can be a callable too
21:39 tokuhirom joined
gfldex at least in rakudo 21:39
masak r: say "OH HAI".subst(/HAI/, { "YAY" })
p6eval rakudo 3bd91f: OUTPUT«OH YAY␤»
masak r: say "OH HAI".subst(/HAI/, 42) 21:40
p6eval rakudo 3bd91f: OUTPUT«OH 42␤»
masak r: say "OH HAI".subst(/HAI/, (1, 2, 3))
p6eval rakudo 3bd91f: OUTPUT«OH 1 2 3␤»
masak it can be anything, really.
I remember there being an RT ticket about that, which pmichaud++ weighed in on.
that was sort of the first sign for us that many signatures that were spec'd narrowly as a single type should really be casts instead, because that's the way we expect Perl to work. 21:41
ah, here: rt.perl.org/rt3/Ticket/Display.html?id=57756 21:42
heh, PIR :P
21:43 tokuhirom left
gfldex i had a look into Str.pm because rosettacode.org/wiki/URL_decoding#Perl_6 is fairly ugly 21:43
is there no nice way to do that?
masak yeah. that doesn't look very idiomatic. 21:45
the brace style wastes vertical space.
and if there are several regexen referring to each other, why ain't they in a grammar? 21:46
procedural string concatenation is almost always a code smell to me nowadays. 21:47
could easily have been a [~] and a map.
masak attempts a rewrite
jnthn nom: say "http%3A%2F%2Ffoo%20bar%2F".subst(/'%'(<[0..9A..F]>**2)/, -> $/ { chr(:16(~$0)) }, :g) 21:49
p6eval rakudo 3bd91f: OUTPUT«foo bar/␤»
masak right.
I realized that halfway through the rewrite: "waitaminite, all this does is..." what jnthn++ suggests :) 21:50
jnthn nom: say "http%3A%2F%2Ffoo%20bar%2F".subst(/'%'(<[0..9A..F]>**2)/, -> ($ord as Str) { chr(:16($ord)) }, :g)
p6eval rakudo 3bd91f: OUTPUT«foo bar/␤»
jnthn Unpacking ftw :)
masak "as"?
jnthn masak: Coercion.
masak thought "as" was gone
gfldex that's pretty now 21:51
at least for perlist eyes :)
masak gfldex: feel free to replace it on RC.
jnthn masak: Yeah, but nobody does the new syntax yet.
gfldex masak: will do
jnthn masak: and working code on RC for the win :)
masak *nod*
jnthn Unpacking a Match object with sub-signatures is cute though :)
masak aye :) 21:52
jnthn Guess somebody has probably done it before...
21:53 jaffa4 left, havenn left 21:55 havenn joined, havenn left, samlh left
masak 'night, #perl6 22:02
22:04 lexu joined 22:05 brrt joined, lexu left 22:07 lexu joined 22:08 nif joined
lichtkind godd night masak 22:09
sjohnson hey TimToady, OT question: was p5's // operator your idea? 22:11
in case you're curious, i do like it quite a lot
but not sure who to credit for the idea when i rant and rave about it to others
22:12 pomysl joined, pomysl left, pomysl joined, lexu left 22:13 nif left 22:14 nif joined
tadzik ( `ー´) 22:18
jnthn Sleep time...teaching stuff tomorrow... 22:19
No p6 tuits today :(
'night o/
tadzik 'night as well 22:20
22:21 whiteknight joined 22:23 jaldhar joined 22:25 brrt left, brrt joined 22:29 tokuhirom joined 22:30 jferrero left
felher loves MAIN-subs. Are they borrowed from somewhere? 22:37
22:39 [particle] left, jferrero joined
lichtkind felher: what you mean by main sub? 22:43
sjohnson tadzik: :)
lichtkind sjohnson: hai, thanks for following me :) 22:44
22:44 bluescreen10 left
sjohnson lichtkind: following you on what? 22:44
lichtkind twitter 22:45
kephra_lk lk stand for lichtkind and leistungskurs :)
felher lichtkind: if you have a sub MAIN(Str $blar) in a script, perl6 automagically parses commandline arguments of that script and passes that to MAIN. It also checks if you have really supplied exactly one argument (int this case) and auto-generates as usage message for you. Thats what i meant with MAIN-sub :) 22:46
sjohnson lichtkind: i don't think i have you on my twitter account.. i hardly use it 22:47
i hate twitter, to be honest 22:48
i see people addicted to it here at work, like it's crack
i just looked at what the hell they're tweeting about, and it's impossible to understand or follow
lichtkind sjohnson: yes you have to keep it on arms lengths
sjohnson maybe it's the new solitare, as far as wasting time at work
lichtkind :)
sjohnson not to say i hate all social media though, i use facebook here and there 22:49
lichtkind oh its another johnson :)
i like it sometimes ebcause i get to information form certain sources fast
22:49 NamelessTee left 22:50 bluescreen10 joined
lichtkind its also good for my writings + im info junky anyway reading a lot 22:50
sjohnson lichtkind: for sure, i just need to subscribe to actual interesting stuff, i guess :)
lichtkind so it actually saves me time i read much less blogs since twitter
sjohnson yeah, perhaps that's what i need to do
register a news twitter account, so none of my friends whine when they see i haven't added them ;) 22:51
lichtkind sjohnson: yes but the professional twitterer post lots of stuff, and so short before unsubscribe randal schwarz becuase i never wanted know he actually enjoys watching leno
22:51 xinming left
sjohnson :) 22:53
22:53 xinming joined 23:01 brrt left, zipf joined, tyatpi joined 23:03 zipf left
[Coke] thinks blogs.perl.org/users/shlomi_fish/20...-been.html needs some hugs. 23:34
23:47 VXZ left, Chillance left 23:50 xinming_ joined 23:52 xinming left, havenn joined 23:53 jaldhar left 23:55 plobsing left