The topic for #perl6 is: pugscode.org/ planetsix.perl.org/ | nopaste: sial.org/pbot/perl6 | pugs: [~] <m oo se> (or rakudo:, kp6:, elf: etc.) (or perl6: for all) | irclog: irc.pugscode.org/
Set by TimToady on 25 November 2008.
00:16 vixey left, Lunchy left 00:21 Lunchy joined 01:02 smg joined 01:06 justatheory joined
pugs_svn r24135 | putter++ | [elfish/rx_on_re] Setting up to run rx_on_re/t/ through STD_blue. It doesn't yet run, as elfblue can't yet compile the rx_on_re source files (unlike elf_h). 01:19
r24135 | putter++ | [elfish/STD_blue] elfblue now uses STD_blue for eval(), and is still compiled in a single fast (STD_red-based) step.
01:23 alester_ joined 01:28 mncharity left 01:46 exodist_ left 02:00 justatheory left 02:12 Limbic_Region left 02:30 stephens left 02:55 johnjohn101 joined, rhr left 03:00 rhr joined 03:12 alc joined 03:20 Psyche^ joined 03:22 Patterner left, Psyche^ is now known as Patterner 03:28 drbean_ joined, eternaleye joined 03:36 araujo left 03:39 drbean left 03:58 drbean joined 04:02 araujo joined, elmex_ joined 04:05 drbean_ left 04:17 elmex left, elmex_ is now known as elmex 04:56 adc_penner joined 04:59 araujo left 05:02 elmex left 05:19 adc_penner left 05:28 drbean left 05:32 drbean joined 05:37 drbean_ joined 05:43 drbean left 05:59 drbean joined 06:07 drbean_ left 06:09 johnjohn101 left 06:23 justatheory joined
TimToady @tell mncharity at the moment gimme5's goal is only to support (a) bootstrap and (b) making sure everything in t/ parses somehow; viv was intended to go beyond that 06:24
lambdabot Consider it noted.
06:33 drbean_ joined 06:34 alech left, alech joined 06:35 alester_ left 06:46 drbean left 06:56 ashizawa joined 07:12 ejs joined 07:43 justatheory left 07:50 ejs left 07:53 mtrimpe left 07:55 pbuetow joined 07:56 masak joined 08:06 iblechbot joined 08:31 ejs joined 08:33 DemoFreak joined, smallfish joined 08:34 DemoFreak left 08:36 DemoFreak joined 08:37 pbuetow left 08:42 ejs1 joined, kane_ joined 08:43 [particle] left 08:51 ejs left 08:54 masak left 09:05 vixey joined 09:18 ChrisDavaz joined 09:19 smallfish left 09:24 alc left 09:29 ChrisDavaz left, ChrisDavaz joined 10:05 [particle] joined 10:21 ruoso left 10:25 ruoso joined 10:35 elmex joined 10:41 justatheory joined 10:53 justatheory left 11:12 donaldh joined 11:21 ChrisDavaz left 11:32 ashizawa left 11:37 iblechbot left 12:02 iblechbot joined 12:12 Lorn joined 12:30 drbean_ left 12:51 DemoFreak left 13:22 smg left 13:35 aindilis left, aindilis joined 13:36 zamolxes joined 13:41 ruoso left 14:04 masak joined
masak re Darren Duncan's question on p6l: I don't anticipate that Blob creation through literals will become such a common thing to do, and thus it will not require its own quoting construct or the like. I think a conversion of some sort will do just fine. 14:09
couldn't &pack create Blobs, given the right params, for example? 14:10
14:11 sjwalters joined 14:17 ruoso joined, adc_penner joined
PerlJam masak: well, *humans* certainly won't do it. But we may write programs that do so, in which case, conversion functions are just fine. 14:17
masak yes. 14:18
I'm writing a reply to that effect now.
PerlJam masak++
ruoso Hello!
masak ruoso: saluton! 14:19
PerlJam I remember reading something a while back about the interaction between :nth() and :x(), but I can't find it in S05. Right now i'm of the opinion that :nth(), :x(), and :global should be mutually exclusive.
any comments?
(or pointers)
masak doesn't think that :nth and :x should be mutually exclusive
PerlJam masak: so, what should m:nth(3):x(5)/foo/ match? 14:21
or, how can you simultaneously match the 3rd thing and 5 times?
masak the 3rd, 6th, 9th, 12th and 15th foo in a string. 14:22
PerlJam okay, that's actually what I thought I read in S05 at some point, but I don't see it. 14:23
masak I'm not looking for it, but ISTR I read it too at some point.
14:32 gbacon left 14:35 adc_penner left 14:36 adc_penner joined
ruoso masak, I've just sent a message to p6-l about the "literal values for types" issue... basically saying "you won't need that" ;) 14:37
masak good. I agree. 14:38
14:38 adc_penner left 14:39 adc_penner joined
rakudo_svn r33441 | pmichaud++ | [rakudo]: spectest-progress.csv update: 227 files, 4689 passing, 10 failing 14:40
r33441 | pmichaud++ | Failure summary:
r33441 | pmichaud++ | S12-methods/default-trait.t aborted 6 test(s)
r33441 | pmichaud++ | S12-methods/multi.t aborted 4 test(s)
masak rakudo: class A { method WHAT { "B" } }; A.new.WHAT.say 14:42
p6eval rakudo 33440: OUTPUT[Bā¤]
masak cackles evilly
pmichaud we don't handle .WHAT properly yet. 14:43
masak pmichaud: but that is correct! :)
pmichaud (p6l literals): I don't agree with dduncan's premise that there have to be clean/terse mechanisms for every fundamental type.
masak: no, it's actually wrong.
A.new.WHAT.say # 'A'
masak pmichaud: re literals: nod
pmichaud A.new.'WHAT'.say # 'B'
masak pmichaud: re WHAT: WHAT? :)
pmichaud: I just redefined .WHAT, shouldn't Perl 6 let me do that? 14:44
ruoso masak, .WHAT is a macro
pmichaud yes, but to access that method you have to use ."WHAT"
masak aha.
pmichaud because... what ruoso said.
masak had forgotten that 14:45
masak files rakudobug, then
pmichaud rakudo currently cheats and treats .WHAT as a normal method call, but that will go away at some point.
I think there's already a rakudobug?
masak oh.
masak checks
ruoso pmichaud, are you confortable with the idea of .WHAT returning a canonical type even when the object is implemented by a lowlevel type?
pmichaud I don't understand "canonical" versus "lowlevel" 14:46
ruoso meaning...
[1,2,3].WHAT being "Array" even if it's implemented by LowLevelCompatIntArray
*LowLevelCompactIntArray 14:47
or when that is a really common case...
LowLevel123CompactIntArray
which is a constatn
pmichaud as a P6 programmer, I would expect [1,2,3].WHAT =:= <1 2 3>.WHAT
ruoso constant
pmichaud if that's not true, then it's confusing.
ruoso pmichaud, wouldn't you prefer to do that test as
[1,2,3].WHAT ~~ <1 2 3>.WHAT 14:48
pmichaud or, I should say: [1,2,3].WHAT =:= [<1 2 3>].WHAT (since <1 2 3> is actually a List)
I expect two simple arrays to give me the same protoobject in response to .WHAT .
masak no, there's no such ticket AFAICS 14:49
pmichaud masak: you're correct, no such ticket.
masak files
pmichaud masak: it's hard for me to remember what's been discussed as an issue versus what's filed as a ticket. :-)
I knew that there had been some .WHAT tickets filed :-)
masak that's why we should always file everything.
pmichaud masak: agreed. :-)
masak makes it easier.
14:50 gbacon joined
masak pmichaud: btw, is there a time frame for user-defined operators in Rakudo? 14:51
pmichaud masak: could be very quick, actually.
masak neat!
pmichaud we have most of the pieces in place.
there would be some caveats -- they'd all end up being global. 14:52
(until we have full-fledged LTM parsing)
14:52 smg joined
ruoso pmichaud, in which cases do you expect to do identity check on the return of the .WHAT of different objects? 14:53
and why isn't '~~' sufficient? 14:54
pmichaud ruoso: I'm simply saying that a Perl 6 programmer expects an Array to be an Array unless we've specifically declared it to be something else. 14:58
an implementation can choose to optimize underneath, but to the programmar it should look the same.
*programmer
ruoso but my point is that while Perl 6 supports strong typing, it's much more abstract than other languages... 14:59
that meaning that identity type on the return of .WHAT is something that doesn't fit well into the picture
pmichaud it fits fine in my worldview. 15:00
15:01 Exodist joined
pmichaud I haven't seen anything on p6l or in the spec that contradicts the notion that .WHAT on any array gives me back the Array protoobject. 15:01
I haven't see anything that contradicts what you're saying either, which is why I fall back to "what I expect as a Perl 6 programmer".
15:01 mncharity joined
pmichaud when/if the spec changes, I'll update my worldview accordingly. 15:02
masak as do we all.
(unless the rare cases when the change is a cause for hitting the streets and rallying against it, of course) 15:03
s/unless/except for/
mncharity TimToady: fyi, STD appears to not parse p5's (?-x) . (?i-xi) works, but yuck. 15:11
lambdabot mncharity: You have 2 new messages. '/msg lambdabot @messages' to read them.
mncharity re gimme5 goal, thanks. 15:13
15:13 alester left
pmichaud here's an example where I would be surprised by .WHAT not preserving identity 15:14
sub foo(::T $x, T $y) { ... }
foo([1,2,3], [<1,2,3>])
mncharity TimToady: err, rephrasing, STD appears to not parse p5's (?-x) . (?i-xi) parses, but m/:P5 (?i-xi)a ?b/ still reports the quantifier to a, not space. 15:15
pmichaud sorry: foo([1,2,3], [<1 2 3>]) 15:17
15:17 alester joined
pmichaud afk for a bit 15:19
ruoso pmichaud, (Note that ::T is not required to contain Dog, only a type that is compatible with Dog.) 15:21
mncharity sigh. system bio talk or hack? sooo need mobile computes. it should be talk _and_ hack. :) 15:26
masak: re third person, now definitely STD bugfixing. 15:30
masak 哈哈
mncharity (question was, given a third person, what would I ask them to work on) 15:31
masak nod
mncharity new question is what is 哈 :)
mncharity googles...
masak it's Chinese fore "haha"
s/fore/for/
mncharity ahhhh
masak I think, if I use it often enough, it will catch on in the western world :)
mncharity 哈哈 15:32
it's like lol, but harder to type. :)
masak there's something immediately right about using hanzi for onomatopoetic things
mncharity: not that hard to type :) I just write "haha" over here. 15:33
mncharity shudder. CPAN is going to become a very scary place...
masak Emacs++
mncharity: how so?
mncharity re emacs, what input method? re how so, all the, err, lack of taste in choice and use of language features, will have a new unicode dimension to expand in. 15:35
masak mncharity: the input method (in LEIM) is called chinese-py-punct 15:36
mncharity: re lack of taste: as long as people goof off in Acme::, it's fine with me :)
s/in Acme/chiefly in Acme/ 15:37
15:37 adc_penner left
mncharity re chinese-py-punct, oooh, that's nifty. 15:39
masak mncharity: indeed. not as nifty as I would like, though. 15:41
I'm still on the lookout for the perfect input method, and I already know that a Pinyin-based one isn't it 15:42
it doesn't allow me to type hanzi that I don't know how to pronounce
and frankly, that's most of them. 15:43
15:44 IRSeekBot joined 15:48 kanru left
pmichaud ruoso: how about....? 15:51
my $x = [1,2,3];
my $y = [<1 2 3>];
say $y ~~ $x.WHAT; # do $x and $y have the same type?
ruoso they have types that are "compatible" 15:52
so $y ~~ $x.WHAT is true
15:52 kanru joined 15:53 ejs1 left
ruoso that's why I argue about using '~~' in type checking, and not =:= 15:53
pmichaud so, Array ~~ LowLevelCompactIntArray, then ?
we do use ~~ in type checking.
your original question then was simply about how protoobjects stringify? 15:54
ruoso the stringification is a side issue
pmichaud so, Array ~~ LowLevelCompactIntArray, then ? 15:55
ruoso hmm... no..
pmichaud then $y ~~ $x.WHAT wouldn't be true, would it?
how about $y.WHAT ~~ $x.WHAT ?
ruoso hmm... ok... 15:56
it wouldn't be true 15:57
but... 15:58
it depends on what you're trying to do with: $y.WHAT ~~ $x.WHAT
I mean
it sounds wrong if we understand that .WHAT should return "the canonical type" 15:59
but it sounds right if we understand that .WHAT should return "the actual type"
pmichaud except there's nothing that tells me that [1,2,3] is anything but an Array.
i.e., I expect the type of [...] to be an Array. 16:00
ruoso There's nothing telling it is
16:00 eternaleye left
pmichaud well, there's lot of stuff that says it's an array 16:00
there's nothing that says "there are special types of array"
unlike Hash, where we do have special types of hashes explicitly mentioned
ruoso pmichaud, er... actually there is...
16:01 adc_penner2 joined
ruoso perlcabal.org/syn/S09.html#Compact_arrays 16:01
lambdabot Title: S09 16:02
pmichaud none of those are using circumfix:<[ ]>
in each of those cases (as far as I can tell) the programmar has explicitly said "I want an array of this type."
so yes, I _would_ expect their types to be different.
16:02 adc_penner2 left
pmichaud *programmer # been working on too many grammars lately :-( 16:03
so far we've been talking about the case of [1,2,3], which I see as being the same as Array(1,2,3)
PerlJam how does one get a list of available "types" from within perl 6? 16:04
ruoso but... is Array really a class? or is it a Role? 16:05
16:06 rindolf joined
moritz_ yes :-) (one of those) 16:06
sjwalters heh
moritz_ ruoso: since roles are auto-generated from classes and vice versa, is that really so important?
16:06 stephens joined
ruoso it is in the sense that if it's a class it provides an implementation, if it's a role, there's a chance it only documents an API 16:07
pmichaud either way, I expect [<1 2 3>].WHAT to give me a protoobject
and if I do:
sub foo(::T $x, T $y) { say $x.WHAT ~~ $y.WHAT } 16:08
foo([1,2,3], [<1 2 3>])
sorry -- got that backwards.
trying again:
sub foo(::T $x, T $y) { say $y.WHAT ~~ $x.WHAT } 16:09
mncharity masak: re pinyin, nod
pmichaud foo([1,2,3], [<1 2 3>])
I expect to always see "true", because the type constraints have already guaranteed me that $x and $y are of the same "type"
ruoso pmichaud, of "compatible" types
not the same
which means that dending on the order you make the ~~ 16:10
it might return true or false
PerlJam I'm going to guess that there is no way to know what "types" perl6 knows about.
pmichaud in this case I'm constrained that $y is a "compatible type" with $x.
ruoso PerlJam, that's a pretty fair assumption
moritz_ ruoso: TimToady answered that question on p6l (with respect to numbers, I think), and his answer was roughly "the implementor may cheat, but the cheat shouldn't be exposed via .WHAT or .HOW", at least not for built-in types
I think the thread title was "rakudo test miscellania" 16:11
pugs_svn r24136 | putter++ | [rx_on_re] Move ast nodes into package IRx1.
pmichaud how about: 16:13
sub foo(::T $x, $y) { say $y ~~ T; }
PerlJam ruoso: but wouldn't that be a useful thing? any(@types) ~~ $thing.WHAT --> junction of "types" that are "type compatible" with $thing.
pmichaud foo([1,2,3], <[1 2 3]>);
or even 16:14
sub foo(::T $x, $y) { given ($y) { when T { ... }; ... } } 16:15
grrrr. 16:16
foo([1,2,3], [<1 2 3>]);
(I'll get this right yet :-)
ruoso well... if you consider you're not typing ::T, you'll get whatever type $x has 16:17
pmichaud ...not typing ::T ? 16:18
ruoso as in ... (Array ::T $x, $y)
pmichaud ::T *is* a type.
it's the type of $x
moritz_ speaking of which... since subroutine params are read-only, will sub foo($x) { say $x.WHAT }; foo(<a b c>) print 'List' instead of 'Array'? 16:19
ruoso exactly, the signature is not typing it... $x is
masak though `Array ::T $x` should be legal syntactically
moritz_ I mean if it's bound read-only, it doesn't have to be autopromoted from List to Array
ruoso masak, that's an example from the spec
except TimToady like Dogs
masak :) 16:20
pmichaud right, the ::T is declaring 'T' to be a lexical corresponding to the type of $x
ruoso so the question is whether '$y ~~ $x.WHAT'
or back to
pmichaud I'm not constraining the type of $x -- I'm just declaring that "whatever type $x is, call that T" 16:21
ruoso [<1 2 3>] ~~ [1,2,3].WHAT
and if the signature was 16:23
:(Array ::T $x, $y)
it would only constraint the type of $x to be an Array...
but T would still contain the specific type of $x
pmichaud no
oh, yes.
what you have is correct -- T is the specific type of $x 16:24
ruoso (to be in the sense of $x ~~ Array)
pmichaud and $x is constrained to be an Array.
and with :(Array ::T $x, T $y)
$x has to be an Array
$y has to be ~~ T
ruoso $x has to .^does(Array)
and $y has to .^does(T)
pmichaud yes, that's a good way of saying it. 16:25
In Rakudo we do everything in terms of smart match, so
$x ~~ Array
$y ~~ T
where T is the type of $x (we use $x.WHAT)
ruoso but you can't say that Array ~~ $x.WHAT
you can only say that $x.WHAT ~~ Array 16:26
pmichaud correct. $x could be a subclass of Array.
ruoso exactly,
pmichaud it's not clear to me that [1,2,3] should be an instance of a subclass of Array
most p6 programmers would not expect that.
ruoso that's my point...
and the question whether Array is a class or a Role 16:27
pmichaud we know that Array is a class.
because we can have instances of Array.
16:28 yves joined
pmichaud but I think the class/role distinction isn't significant in the examples we're looking at. 16:28
ruoso in this specific examples not... 16:29
and probably the Array type is less subject to such specificics
*specifics
the List type probably provides us better examples
since it's read-only
and since it's a value 16:30
does (1,2,3).WHAT ~~ <1 2 3>.WHAT ?
I think it doesn't
at least I think it would be sane if it didn't 16:31
pmichaud but very few p6 programmers would expect it to be false.
at least based on current reading of the spec.
how about:
my $x = 1; ($x, 2, 3).WHAT ~~ <1 2 3>.WHAT ? 16:32
ruoso the point I'm trying to make is not about the types themselves...
but on the assumption about the use of $x.WHAT in type checking 16:33
pmichaud ...this isn't type checking?
ruoso it is... 16:34
but what does it mean to ask if: $x.WHAT ~~ $y.WHAT 16:35
?
pmichaud we're asking if the type of $x does the type of $y 16:36
ruoso so if we assume that (1,2,3) can be of a different type than <1 2 3>
which is a pretty fair assumption
pmichaud I'm saying that's not an assumption a typical p6 programmer would make 16:37
ruoso where both ~~ List
pmichaud there's _nothing_ in the spec that indicates that (1,2,3) and <1 2 3> produce different types of List.
or that (1,2,3) is a different sort of List from ("1", "2", "3") 16:38
ruoso I'm aware of that, the spec currently assumes .WHAT should return the canonical type
pmichaud even without respect to .WHAT
a p6 programmer tends to expect (1,2,3) and ("1", "2", "3") to return the same kind of List.
such that ("1", "2", "3") ~~ (1,2,3).WHAT 16:39
[particle] so how do you get the actual implementation type?
moritz_ rakudo: say try { 1 + undef }
p6eval rakudo 33441: OUTPUT[Use of uninitialized valueā¤1ā¤]
[particle] as opposed to the programmer-friendly type? 16:40
ruoso [particle], there isn't one
*way of getting it, I mean
[particle] yet.
ruoso in SMOP we have .^!instanceof
which returns the actual implementation typye
whch might be the object itself
pmichaud anyway, I have to run some errands. 16:41
ruoso I think it would be very nice if we could relax the spec in the sense to allow the implementation to have specific implementations
pmichaud you understand my point that the notion of "lowlevel types" being exposed to the programmer leads to some counter-intuitive results for the typical p6 programmer.
ruoso in a way that
PerlJam I would expect (1,2,3) to produce a different type of List than 1..3
pmichaud 1..3 is a Range.
1..3 is not a List. 16:42
ruoso pmichaud, 1..3 .^does(List) indeed
[particle] .WHATSWHAT
16:42 sri_kraih joined
PerlJam let me repharse then :) 16:42
I would expect (1,2,3) to produce a different type of List than (1,2,=$foo) 16:43
pmichaud 1..3 does List? are you sure?
[particle] no, it's Range
ruoso I think you can do
@a = 1..3;
lambdabot Maybe you meant: activity activity-full admin all-dicts arr ask . ? @ v
ruoso or even
pmichaud ruoso: that's 1..3 in list context
@a = 1..3 is the same as @a = list(1..3)
lambdabot Maybe you meant: activity activity-full admin all-dicts arr ask . ? @ v
ruoso List $a = 1..3;
but one way or another 16:44
moritz_ @shutup :-) 16:45
lambdabot Unknown command, try @list
ruoso I think it would be nice if the spec was relaxed to allow that (1,2,3).WHAT to be different than <1 2 3>.WHAT
pmichaud I leave that for TimToady to decide. Would ($x,2,3).WHAT be different from (1,2,3).WHAT also?
ruoso probably, since (1,2,3) can be represented as a compact int list 16:46
PerlJam ruoso: Earlier when I was asking about what types that perl6 knows about, I was thinking that you were asking the wrong question :)
ruoso: (1,2,3).WHAT shoudl be the same as <1 2 3>.WHAT, but there should be a way to know all of the "compatible types"
How do we notate "array of string" or "array of int" ? 16:48
is that a function of .WHAT?
or something else?
pmichaud I don't think Range ~~ List.
[particle] maybe .WHAT returns a capture 16:49
ruoso perl6: my $a = 1..3; say $a[0];
p6eval elf 24136: OUTPUT[Can't use string ("1E0") as an ARRAY ref while "strict refs" in use at (eval 119) line 4.ā¤ at ./elf_f line 3861ā¤]
..rakudo 33442: OUTPUT[get_pmc_keyed() not implemented in class 'Range'ā¤current instr.: '_block11' pc 67 (EVAL_14:28)ā¤]
..pugs: OUTPUT[1ā¤]
moritz_ PerlJam: `my Int @a is Array' says that the container type is Array, and the elements are Ints
[particle] programmer-friendly name in the scalar slot, array of all compatible types in array and hash slots
pmichaud pugs is wrong there.
Ranges cannot be subscripted.
[particle] ah, crap. dentist &
ruoso pmichaud, they can't? 16:50
PerlJam moritz_: I know that, but how do you ask the object that?
moritz_ PerlJam: sorry, misread your question... dunno
ruoso moritz_, indeed 'my Int @a is Array' is a type constraint...
pmichaud S03:1799: Note that, unlike assignment, binding replaces the container,
so the following fails because a range object cannot be subscripted:
@natural := 0..*; # bind a Range object @natural[42] = "Life, the Universe, and Everything"; # FAILS
lambdabot Unknown command, try @list
ruoso pmichaud, ok... you were trying to write to it
16:50 sri_kraih_ left
ruoso that should fail 16:51
since it's not an Array
pmichaud no, that's not what the spec says.
PerlJam pm: no, I think it fails because a Range generates immutables. :)
pmichaud "a range object cannot be subscribed"
"a range object cannot be subscripted"
it's explicitly there that it fails because of subscripting the range object, not because range objects are immutable.
PerlJam @x may be bound to an object of the Array class, but it may also be bound to any object that does the Positional role, such as a List, Seq, Range, Buf, or Capture. The Positional role implies the ability to support postcircumfix:<[ ]>.
lambdabot Maybe you meant: . ? @ v
pmichaud also, I don't think Range objects are immutable, because we can .pop a Range
PerlJam (straight from S02) 16:52
pmichaud PerlJam: yes, the spec is inconsistent.
PerlJam pm: no, the Range object isn't mutable, but things it generates are.
er, isn't immutable
ruoso "Lists are lazy in Perl 6, and the slice lists are no exception. In particular, things like range objects are not flattened until they need to be"
pmichaud PerlJam: doing .pop on a Range changes the range.
PerlJam pm: sure, that just changes what it generates 16:53
pmichaud no, it actually changes the .to value
it would also change the output of .perl 16:54
16:54 araujo joined
pmichaud either that, or this is some strange definition of 'immutable' 16:54
PerlJam Hmm. Now I think we're saying the same thing. you can change a Range, but once it has been iterated, you can't change the values that the Range generated because they are immutable. 16:55
pmichaud no, that's not what I'm saying.
See S03:2867
PerlJam looks
pmichaud $range = 1..^42.5;
$front = $range.shift; # $front = 1, $range = 2..^42.5
$back = $range.pop; # $back = 41.5, $range = 2..^41.5
I'm not talking about $range inside of a lazy list
I'm talking about the range itself.
16:56 justatheory joined 16:57 mncharity left
ruoso pmichaud, I think the "a range object cannot be subscripted" is over-generalized 16:57
pmichaud ruoso: I think you may be correct there. 16:58
ruoso: I just know what I read in the spec. :-)
ruoso in that specific case, It seems to mean that a Range is not an Array
meaning that it can't store individual item
but I don't think it means that you can't use $range[42] as an rvalue 16:59
pmichaud fair enough. I'm willing to grant that this particular part of the spec is incorrect. That doesn't imply that a Range does List, though -- it just implies that Range does Positional
ruoso hmm... 17:00
what does List implements that Positional doesn't?
pmichaud I don't know. 17:01
and I'm fairly sure that Range will end up being mutalbe
er, mutable.
PerlJam the spec is sparse on Positional 17:02
ruoso hmm...
ok... Positional defines only postcircumfix:<[ ]>
while List also defines .Iterator()
moritz_ ruoso: no .elems in Positional? 17:03
ruoso moritz_, S02 seems to imply that
PerlJam maybe I'm being a pedant right now, but the spec only says that Positional implies postcircumfix<[ ]>, it doesn't say that that's the *only* thing it implies. 17:04
ruoso well, I'm assuming it has an API that is smaller than List's
pmichaud why?
17:04 xuser left
moritz_ ruoso: perhaps, but I think not *that* small 17:04
ruoso pmichaud, why would we need it otherwise? 17:05
pmichaud because we might have objects that does Positional but aren't List
'List' is the "generic list of things"
moritz_ ruoso: the @ sigil implies Positional, and the average user wants to call .map on anything with that sigil
pmichaud .map is on Any :-) 17:06
ruoso was assuming List is a Role
moritz_ pmichaud: yes, but .map on non-Positional types only does one execution of the closure
ruoso moritz_, not really
pmichaud I would think that .map is totally unrelated to Positional.
ruoso .map is related on how it implements .Iterator() 17:07
pmichaud ...what ruoso just said.
moritz_ and you mean it's the same for .join, .chars, .grep etc.? 17:08
pmichaud yes.
ruoso certainly
pmichaud I just got through fixing some of the code in Rakudo that was trying to do things via positionals instead of iterators.
Unfortunately there's a fair bit more.
use.perl.org/~pmichaud/journal/37967 17:09
lambdabot Title: Journal of pmichaud (6013)
ruoso pmichaud, I presume you've seen S07 already 17:10
pmichaud ruoso: not completely, no.
ruoso: I'm waiting for TimToady to comment on it. I really tend to stay out of the "what should be" conversations and focus on the "what is" stuff.
PerlJam Wait ... I thought the reference to S07 was a typo. What's S07 now? Just the iterator spec?
pmichaud S07: iterators and laziness 17:11
masak PerlJam: I was as confused as you a couple days ago.
pmichaud I do wish we'd be consistent about ".Iterator" versus ".iterator", though.
masak apparently, @Larry are re-using S-numbers.
pmichaud same for ".List" and ".list"
although changing ".list" now is going to cause a fair number of headaches in Rakudo and PCT 17:12
17:12 donaldh left
pmichaud (because a lot of code depends on it.) 17:12
ruoso pmichaud, I'm assuming .Iterator falls into the same category as .Str
as I would expect on .List
pmichaud ruoso: yes, I see the parallel.
ruoso: but that's not the way the spec was written originally, and there's a lot of code now expecting ".list", ".item", and ".hash" 17:13
ruoso hmm... but it's already accepted that it should be .List now
pmichaud it is?
was that announced/placed into the spec somewhere?
is there an irc conversation for it?
ruoso I'm not sure... I've just been assuming that for a while 17:14
moritz_ pmichaud: S13 says that coercion to a type is done by calling .Type, iirc
pmichaud moritz_: I agree, that's what it says.
moritz_: I also know that there are still instances of ".list" in the specs
ruoso I'd consider that as specbug
moritz_ pmichaud: I think there are multiple such aliases, like .true for .Bool
pmichaud moritz_: and that I explicitly heard from TimToady that the method forms of "list( )", "item( )", and "hash( )" were .list, .item, and .hash 17:15
it's possible that there is both ".list" and ".List"
but I'd like to see this mentioned explicitly somewhere.
17:15 ejs joined
PerlJam ruoso: I've been under that same assumption for a while too (I thought timtoady said so on p6l or here) 17:16
pmichaud even STD.pm uses ".item"
ruoso hmm
well..
that requires clarification from TimToady indeed
moritz_ is there even an 'Item' type?
pmichaud there was at one point. 17:17
S10 mentions one.
as does S12.
I don't mind if we go ahead and treat .list/.hash/.item as coercions (and switch them to the uppercase forms), but let's please get it documented somewhere or otherwise "blessed" as official. 17:18
ruoso I just hope TimToady can backlog all this discussion
pmichaud because there's a boatload of code that was built on the previous versions that has to be deprecated, and sooner would be better. 17:19
it also begs the question of whether there's a difference between list(...) and List(...) 17:20
ruoso indeed... for some reason I'm using an even different nomenclature for item
which is .FETCH() and .STORE()
I think I took that from an lvalue example in S12 17:21
and I think that was related to .BIND() as well 17:23
ruoso lunch & 17:24
pmichaud same here -- errands and lunch.
moritz_ it's more like supper time here
supper & 17:25
17:28 meppl joined 17:36 masak left 17:42 _smg joined, lizsac joined, smg left, _smg is now known as smg 17:43 lizsac_ left 17:44 pbuetow joined 17:57 lizsac left, bsdperl left 18:00 schmalbe joined, lizsac joined 18:02 bsdperl joined 18:09 pbuetow left 18:17 jrockway_ joined 18:18 jrockway left
pugs_svn r24137 | putter++ | [STD_blue] Prune untagged Match tree nodes. Switched the /a?/ IR style from elf_h's to rx_on_re's (to be unified later). 18:24
r24137 | putter++ | [rx_on_re] New elf with STD_blue and rx_on_re. rx_on_re/t/ can be run against it. /abc/ is reaching IR.
18:24 rindolf left
thei0s am I correct that this perlgeek.de/blog-en/perl-5-to-6/23-...ml#Parsing is outdated and perl6 should also allow if(..) and for(..) (without whitespace)? as far as I can see both rakudo and pugs interpret it right 19:06
lambdabot Title: blog | Perlgeek.de Blog :: Quoting and Parsing, tinyurl.com/59bax4 19:07
thei0s rakudo: my @l=1..Inf; 19:12
p6eval rakudo 33443: OUTPUT[Use of uninitialized valueā¤]
thei0s rakudo: my @l=1..*;
p6eval rakudo 33443: OUTPUT[get_integer() not implemented in class 'Whatever'ā¤current instr.: 'parrot;Range;!to_test' pc -2040733 ((unknown file):-1)ā¤]
19:15 mtrimpe joined, justatheory left 19:18 armagad joined 19:25 DemoFreak joined 19:28 Lorn_ joined 19:29 Lorn left 19:33 schmalbe left 19:35 DemoFreak left 19:38 mj41_ joined, DemoFreak joined 19:53 mj41 left 20:03 Lorn_ left 20:07 ejs left 20:09 donaldh joined 20:10 apeiron left 20:11 apeiron joined, zamolxes left
pugs_svn r24138 | hinrik++ | [util/perl6.vim] don't need whitespace before <=> 20:27
20:31 kane_ left 20:34 LearningPerl joined
LearningPerl hi 20:34
I keep getting
CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers.
Some help please
20:34 adc_penner2 joined
moritz_ LearningPerl: this is the Perl 6 developer's channel, not the place for getting Perl help 20:34
LearningPerl I keep getting
moritz_ LearningPerl: perlmonks.org might help you 20:35
LearningPerl Thanks, already on there IRC channel
Any others you recommend?
moritz_ #perlde on irc.perl.org if you happen to speak German ;)
LearningPerl lol 20:36
Can't speak German 20:37
Except through google translate
moritz_ well, perlmonks.org (the website) is really good if you invest some time in asking the question properly
20:41 adc_penner2 left
LearningPerl moritz 20:42
Would you mind helping me out?
(if you're not to busy)
20:43 adc_penner2 joined
moritz_ LearningPerl: on perlmonks.org, sure 20:44
thei0s you probably forgot to print "Content-type: text/html\n\n"
or your application segfaults 20:45
moritz_ or one of 100 other possible reasons, for which there are many appropriate channels to discuss
thei0s yes :)
LearningPerl moritz and thei0s: Here is my file: paste.viaweb.biz/p/14 20:46
(with Perl syntax highlighting)
(and line numbers)
Please tell me where I went wrong and how to fix it. 20:47
Thanks in advanc
e
thei0s LearningPerl: as far as I can see this is not even perl6 code.. so ignoring the fact that this is a development channel, this has lost nothing on #perl6.. go to #perl on any other irc network or sth... 20:49
LearningPerl ok 20:51
(got it to work just now BTW)
20:58 zamolxes joined
LearningPerl Do you need to do the my thing for arrays as well as scalars? 20:59
ruoso LearningPerl, in Perl 6 you do, by default 21:01
LearningPerl and in Perl5?
thei0s this is the development channel for a new programming language called Perl6, not help channel for Perl5
LearningPerl Can you please just answer my question with a 'yes' or a 'no'
(sorry if I sound rude, have been up for to long studying perl) 21:02
thei0s did they ban you from #perl or what?
ruoso LearningPerl, sorry if we sound rude, but this is not the topic on this channel
moritz_ there's not always a single yes-or-no answer that's also correct
pugs_svn r24139 | hinrik++ | [util/perl6.vim] conditionals need whitespace to the right 21:03
LearningPerl thei0s: Unfortunately, yes, they did
moritz_ then you can still ask on perlmonks.org 21:04
we're not '#perl in not-banned'
ruoso and there's also #perlhelp iirc
moritz_ and irc.perl.org, with lots of helpful channels
LearningPerl #perlhelp iirc 21:10
???
ruoso later & 21:12
21:12 ruoso left
LearningPerl Well if there's anyone left here that's willing to help 21:13
paste.viaweb.biz/p/15
it's a .cgi file
21:17 xuser joined 21:18 Jedai left, Jedai joined
buu Oh god. 21:26
21:28 smg left
thei0s is or will in Perl6 be a build-in function that does the same as Perl5 Data::Dumper module? it comes handy when debugging things 21:38
moritz_ thei0s: .perl
rakudo: say [2, 3, '3'].perl
p6eval rakudo 33448: OUTPUT[[2, 3, "3"]ā¤] 21:39
thei0s nice, 10x
literal rakudo: .perl 21:40
p6eval rakudo 33448: RESULT["undef"]
21:40 LearningPerl left 21:43 masak joined 21:51 alexi5 joined
thei0s rakudo: "abcd" ~~ m/(bc)/; say $/.perl; 21:52
p6eval rakudo 33448: OUTPUT[{}ā¤]
21:53 iblechbot left
thei0s is there a way that something like this would print out what it matches? 21:53
pugs: "abcd" ~~ m/(bc)/; say $/.perl; 21:55
p6eval pugs: OUTPUT[Error eval perl5: "if (!$INC{'Pugs/Runtime/Match/HsBridge.pm'}) {ā¤ unshift @INC, '/home/evalenv/pugs/perl5/Pugs-Compiler-Rule/lib';ā¤ unshift @INC, '/home/evalenv/pugs/third-party/Parse-Yapp/lib';ā¤ eval q[require 'Pugs/Runtime/Match/HsBridge.pm'] or die $@;ā¤}ā¤'Pugs::Runti...
PerlJam thei0s: that looks buggy to me. 21:56
moritz_ thei0s: it's one of the rakudo limitations. there's a PIR thing for matching the match, though
21:58 zamolxes left 21:59 zamolxes joined, alexi5 left 22:18 adc_penner2 left
literal rakudo: say $?ROUTINE 22:18
p6eval rakudo 33448: OUTPUT[Lexical '$?ROUTINE' not foundā¤current instr.: '_block11' pc 11 (EVAL_13:13)ā¤] 22:19
moritz_ buu: our buubot in #perlde doesn't respond anymore... are you the person to talk to? 22:20
buu Yes.
moritz_: Which network?
moritz_ so consider yourself being talked to ;-)
buu: irc.perl.org 22:21
22:22 buubot joined, japhb left 22:25 japhb joined
masak what's buubot supposed to do, anyway? 22:26
pmichaud rakudo doesn't understand .perl on Match objects yet.
(conclusion from earlier .list versus .List conversation, etc.)
moritz_ masak: for example eval perl 5 code
masak ooh
moritz_ buubot: eval: scalar localtime
buubot moritz_: "Tue Dec 2 22:32:09 2008"
pmichaud I've decided for the time being that .list, .hash, .item are the method forms of list context, "hash" context, item context, while .List and .Hash really mean "coerce to a List/Hash". In many cases they're equivalent, but the lower-case forms focus on context, while the uppercase forms focus on coercion. 22:27
moritz_ that sounds sane. 22:28
pmichaud for .iterator/.Iterator, one could argue it either way.
$foo.Iterator really isn't "coerce to an iterator" as much as it is "build an iterator for $foo". However, that's somewhat consistent with the way we think of .Str as meaning "construct a Str representation of the invocant". 22:29
[particle] is there an Iterator type now?
pmichaud ruoso and S07 wants there to be one; I suspect there is one, or an Iterator role that has lots of iterator types. 22:30
beyond that I can't say until some piece of the design gets TimToady's blessing. :-) 22:31
pugs_svn r24140 | moritz++ | [docs] S07 is now Iterators. Fixed in syn_index.html. 22:33
22:35 hercynium left
pugs_svn r24141 | moritz++ | [docs] fix typo in syn_index.html 22:45
22:45 ryanc joined 22:49 ruoso joined
ruoso [particle], pmichaud, Iterator is a Role, no doubt of it, and each List can provide its own private and specific implementation 22:52
[particle] ruoso, then $foo.Iterator looks wrong to me 22:53
i'd expect $foo.get_iterator or something, as a method named 'Iterator' in a role named 'Iterator' is confusing 22:54
ruoso it still fits in the same category as .Str IMHO
[particle], the Iterator role doesn't have a .Iterator method
List does 22:55
moritz_ [particle]: it returns something that fits to the type Iterator, I think that's close enough
22:58 smg joined
pmichaud if it helps, think of prefix:<~> and Str being analogous to prefix:<=> and Iterator 23:00
however, @(...) corresponds to .list, not .List 23:01
so, perhaps it doesn't quite work out there. 23:02
ruoso that surprised me today... I really expected that to be .List
pmichaud it's been .list for a very long time.
ruoso so I was told... 23:04
pmichaud anyway, time to take kids to a basketball game.... bbl
ruoso pmichaud, [particle], btw... svn.pugscode.org/pugs/v6/mildew/Map.pm is a sketch of some ideas about S07 23:13
23:19 masak left, DemoFreak left 23:21 donaldh left 23:22 thei0s left
pugs_svn r24142 | putter++ | [elfish/rx_on_re] Preparing for the switch to emitting code instead of subs. 23:32
r24142 | putter++ | [elf_h] Readd a special function to inline p5. Use is strongly discouraged.
23:36 Exodist left 23:38 SamB joined
pugs_svn r24143 | lwall++ | [t/spec] comments.t missing opening { 23:43
23:45 zamolxes left 23:55 bsdperl left 23:57 pnu left, pnu joined 23:59 aindilis left, aindilis joined, bsdperl joined