pugscode.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 Tene on 29 July 2008.
ruoso Hello! 00:06
lambdabot ruoso: You have 1 new message. '/msg lambdabot @messages' to read it.
ruoso @tell pmurias, memory leaks can eventually cause bugs... it's better to hunt them down... 00:10
lambdabot Consider it noted.
ruoso found out that there is a problem when a mold frame is executed with a slime frame as back... 01:21
ruoso there is some bug in mold that leaves an additional reference to the back frame... 01:22
Khisanth o_O :ratchet is the only flag without a short form? 02:29
moritz_ Khisanth: it's implied in rule { } and in token { } 05:47
rakudo_svn r30947 | moritz++ | [rakudo] make .rindex work on non-strings, closes RT #58644 06:42
r30947 | moritz++ | Patch courtesy by Vasily Chekalkin, bacek++
pugs_svn r22197 | moritz++ | [t/spec] unfudged passing rindex patch for rakudo, added test for index() on 06:43
r22197 | moritz++ | non-Str's
Bierwagen hi 06:46
can anybody help me?
moritz_ if you want Perl 6 help, probably yes 06:47
masak Bierwagen: don't ask to ask, just ask. 06:48
Bierwagen where are the differences between perl and perl 6 06:49
moritz_ there are quite many, I tried to make some points here: perlgeek.de/blog-en/perl-5-to-6/
lambdabot Title: blog | Perlgeek.de Blog :: Category Perl-5-to-6
masak Bierwagen: svn.pugscode.org/pugs/docs/Perl6/Pe...rences.pod
Bierwagen I´m a noob at perl 06:51
masak gotta start somewhere :)
Bierwagen so can anybody say me, whats wrong
rafb.net/p/8nrPqg25.html
lambdabot Title: Nopaste - No description
moritz_ Bierwagen: that's perl 5 code
masak Bierwagen: better to ask at #perl 06:52
Bierwagen oh
moritz_ or #perlhelp or so
Bierwagen ok
thanks
bye
masak Bierwagen: good luck!
moritz_ was never in #perl himself, but heard some stories... scary 06:52
masak yup. 06:53
moritz_ maybe I should have recommended #perlde on irc.perl.org, considering his nick...
too late
masak mm.
Khisanth hmm maybe having %h<foo> the auto quoting version is a good thing after all ... less work for the right pinky :) 07:13
literal hey, I was wondering, will %h<$foo> interpolate? 07:20
moritz_ no 07:21
literal ok 07:21
moritz_ that's what %h{$foo} is for
literal yeah
moritz_ you can use %h<<stuff_with_$ending>> though 07:21
but that only works if $ending doesn't contain spaces, because <<...>> splits on spaces
literal I see 07:22
pugs_svn r22198 | pmurias++ | [smop] mold_frame->back is RELEASEd 07:31
pmurias ruoso: hi 08:08
masak moritz_: shouldn't `m boob` be `m bood` ? :) 08:47
masak is suddenly overcome with relief that the Unicode consortium seemingly consists of sane people 08:47
moritz_ masak: ;) 08:49
masak rakudo: my @x = (1,2,3,4,5); @x.pop while @x.elems > 3; say @x.perl 09:39
p6eval rakudo 30954: OUTPUT[[1, 2, 3]␤]
masak any suggestions for an easier way to get the slice @x[0..2]? :) 09:40
moritz_ implement slices?
masak "easier"
moritz_ I'll apply the patch ;)
masak I'm in user mode now, not implementor mode :) 09:41
moritz_ mode.switch('hacker') 09:42
masak studies Chinese right now
I've written a short script that rehearses words with me 09:43
I need slices because it's more convenient to learn words 10 at a time
oh well. the `.pop while` version works. 09:45
moritz_ pugs: my $x = 5; { my $x = 2; say $OUTER::x; } 09:51
p6eval pugs: OUTPUT[5␤]
moritz_ pugs: my $x = 5; { my $x = 2 * $OUTER::x; say $x }
p6eval pugs: OUTPUT[10␤]
moritz_ pugs: my $x = 5; { my $x = 2 * $x; say $x } 09:52
p6eval pugs: OUTPUT[0␤]
moritz_ wow, all correct
pugs++
masak in a perfect world, should that last one get a warning? 09:57
moritz_ yes 09:58
moritz_ Auzon: did the submission of your code to google work out? 10:33
Juerd Someone requested a p3rl.org redirect but I forgot all about it 10:36
Please repeat :)
moritz_ Juerd: smop to www.perlfoundation.org/perl6/index.cgi?smop 10:37
lambdabot Title: SMOP / Perl 6
moritz_ Juerd: it was pmurias, I think
Juerd Will do; thanks for repeating
Now active 10:38
moritz_ works, thanks 10:39
pmurias Juerd: sorry, forgot to send the email 10:55
Juerd That's okay
I forgot I asked you to 10:56
riffraff hi 11:43
moritz_ hi
smtms win 19 12:02
moritz_ loose 19 12:03
that's life ;) 12:04
pugs_svn r22199 | moritz++ | [t] moved char_by_name.t to spec/ 14:03
r22200 | moritz++ | [t] moved char_by_number.t to spec/ 14:09
moritz_ TimToady: t/syntax/pairs.t uses [,] %hash to interpolate named arguments into a capture - is that still allowed? 14:12
uhm, seems to be used in S03 as an example, so probably yes 14:14
pugs_svn r22201 | moritz++ | [t] moved pairs.t to spec/, fudged a bit, added a test 14:19
rakudo_svn r30966 | pmichaud++ | [rakudo]: spectest-progress.csv update: 158 files, 3288 passing tests 14:26
rakudo_svn r30967 | pmichaud++ | [rakudo]: Fix .kv method on Mapping to not stringify values (RT #58744) 14:32
pugs_svn r22202 | moritz++ | [t] fudged pairs.t for rakudo 14:43
rakudo_svn r30968 | moritz++ | [rakudo] add tests for pairs to spectest_regression 14:56
pugs_svn r22203 | moritz++ | [t/spec] unfudged a test for rakudo 15:01
speckbot r14581 | pmichaud++ | Typo fix "last" -> "list" 15:14
ruoso Hello! 17:33
pmurias, hi
ruoso pmurias++ one less test leaking ;) 17:38
TimToady moritz_: I don't see much use for attaching such extra semantic baggage to [,] anymore. All it will do is confuse people, who are already confused enough by prefix:<|> 18:49
moritz_ aye 18:50
TimToady well, maybe I'd better read S03 first :)
S03 contradicts itself; I'm so suprised... 18:53
but I think [,] has to have "reduce" semantics, which means [,] 1,2,3 has to put 1,2,3 into item context, which implies it means [1,2,3], not \(1,2,3), by current spec 18:54
so I'd go with the interpretation that says [,] @foo is equivalent to [@foo] 18:55
moritz_ anyway, the current semantics don't seem to make much sense
speckbot r14582 | larry++ | inconsistent meaning of [,] noticed by moritz++ 19:03
ruoso I'm having some trouble with the semantics of return values... I mean... in SMOP I have "late context propagation". This means that the method doesn't really predict how its value will be used, but it returns a value that have the appropriate ability to be coerced to the expected contexts... this means that in "my @a = foo()" and "my $a = foo()", the sub foo will work the exact same way... but the runtime will call .List to get the value in list context and 19:05
.FETCH to get the value in item context...
all this looks Ok at first... 19:06
but then you have things like map 19:07
which returns an iterator,
that implements prefix:<=> 19:08
hmm
wait...
ruoso ok... the problem is... 19:08
moritz_ map returns a lazy list, not an iterator
ruoso moritz_, it returns a lazy list if used in list context 19:09
moritz_ ruoso: and in unkown context probably an object that stores the lazy list
ruoso: and that knows how to respond to other contexts 19:10
ruoso moritz_, have you read the wiki page about SMOP and map?
moritz_ ruoso: no
ruoso take a look at it... 19:11
www.perlfoundation.org/perl6/index....p_operator
lambdabot Title: SMOP map operator / Perl 6
ruoso basically, the problem is that postcircumfix:<[ ]> is not very cursor-friendly 19:12
or flow-friendly...
for instance...
if map returns a list and not an iterator, it will be very hard for it to find out when it can discard the items or when it can't 19:13
a lazy list needs to store all the previously-computed-values
an iterator doesn't
thus a lazy list can be constructed using an iterator...
and so can a lazy slice 19:14
PerlJam ruoso: "needs to store" is an optimization
ruoso PerlJam, if the lazy list is being produced from a network flow... 19:15
how do you have an actual list without storing the values?
you can't always re-compute the values
which I presume is what you meant...
the problem is that you can't really know where your data is coming from... 19:16
I think the feed operators stress that concept a lot 19:17
but anyway... 19:18
the map block might return an item or a list
as well as any code block
but eventually, you want to take it as a list, and it is just a single item 19:19
PerlJam ruoso: that's what I was implying ... but I guess at some point you do have to know where your data is coming from. (If you could, how would you query a list for its properties to know what it is and is not capable of?) 19:20
moritz_ so all this complexity because you don't have exceptions? 19:21
ruoso PerlJam, considering all the polymorphism Perl 6 supports, you have to assume you can't infer where the data is coming from...
moritz_, I don't get it... what do exceptions have to do with it?
moritz_ ruoso: they make the "proper" iterating scheme impossible, don't they? 19:22
ruoso moritz_, they do? why?
moritz_ ruoso: because you can't just say "I want the next value" and catch the exception if it doesn't work? 19:23
ruoso moritz_, sorry... I still don't see your point... the semantics I'm proposing presume exceptions in the future, they are not designed in a way to circumvent the absense of exceptions... 19:25
the problem I'm facing is if I should assume that every return is, at first, a list of values...
PerlJam moritz_: I think it's the "i want the next value" that's the problem. (i.e., it's not the exceptional case that gives grief, but the common case) 19:26
ruoso yes...
specially when it's one value, no values or three values
which is a common usage for map
or grep...
PerlJam or any lazy thing :)
ruoso because in list context, that is flattened, but in slice context, you have the return of each individual iteration 19:27
that is the tricky part
and all that also lazy
Khisanth speaking of flattening ... 19:29
moritz_: why do you refer to that as interpolation instead?
moritz_ Khisanth: on the blog? 19:30
Khisanth yes
moritz_ because that's what perl people call it :/
[particle] what if lists are coroutines that yield values?
ruoso considering "my $a = @a" allows you to access the array directly... how do you tell the difference between { my @a = (1,2,3); my $b = @a; $b } and { my @a = (1,2,3); my @b = @a; @b } ? 19:31
Khisanth moritz_: erm perl 6 people?
ruoso [particle], that doesn't solve the problem on how to iterate... only how to implement the iteration...
moritz_ Khisanth: also perl 5 people 19:32
Khisanth has never seen anyone call that interpolation
ruoso neither
moritz_ have you never read the perl documentation? 19:33
perldoc perlop 19:34
search for interpolate
same for various perl\d+delta.pod and perlre 19:35
Khisanth erm that is all for "foo $bar" type stuff in perlop 19:37
moritz_ and it's not what I mean in the blog? 19:38
moritz_ is thoroughly confused
Khisanth I am referring to "By default arrays aren't interpolated in argument lists, so unlike in Perl 5 you can write something like this:" 19:39
moritz_ ah, capture interpolation
in perl 5 there is no such thing
perlcabal.org/syn/S03.html#Argument...erpolating # that's where I got the name from 19:40
lambdabot Title: S03
pmichaud ruoso: my $b = @a; is item assignment, my @b = @a; is list assignment
pmichaud as such, $b does not interpolate into a list, while @b will. 19:41
Khisanth wonders which of the meanings of calling functions with & the author of S03 is referring to 19:44
moritz_ pugs: my $x = (1, 2); say (3, $x, 4).perl
p6eval pugs: OUTPUT[(3, \(1, 2), 4)␤]
moritz_ pugs: my $x = (1, 2); say (3, $x, 4).elems 19:45
p6eval pugs: OUTPUT[3␤]
moritz_ Khisanth: maybe &func(@args) which turns off prototype checking
Khisanth I am aware of that
ruoso pmichaud, right... I get that... but how do I differentiate that in the lowlevel? 19:46
pmichaud ruoso: I haven't completely figured that out myself yet. That's why [1, [2, 3]] isn't working in Rakudo at the moment. 19:47
ruoso should I assume that every return value is a list?
pmichaud well, it acts mostly like an argument list
in particular, return (3,4) and return(3,4) aren't exactly the same. :-) 19:48
(same as say (3,4) and say(3,4) do different things) 19:49
ruoso they do?
:D
moritz_ shouldn't it just return a capture that flattens in list context but not in slice context?
pmichaud moritz: that's my thinking, yes.
in other words, it's the same as any other call semantics, except 'return' is actually doing a "call back to the caller" and passing some arguments 19:50
[particle] that's the cps-way
pmichaud the caller then receives the arguments (conceptually in the form of a capture) and binds thems to the calling parameter list
[particle] return is just call. there is no return.
ruoso SMOP implements it as cps 19:51
[particle] no *distinct* return
ruoso pmichaud, "[1,[2,3]]" is actually a very precise example... how do I differentiate "[1,[2,3]]" from "(1,(2,3))"? 19:52
ruoso considering the first appears as a list of two items even in list context and the second a list of three items in list context 19:53
pmichaud (2,3) is a List
[2,3] is an Array 19:54
moritz_ I think that the first one is actually an array
right
pmichaud [1,[2,3]] is an Array of two elements
(1, (2, 3)) in list context is a List of three elements
ruoso pmichaud, and [1,[2,3]] in List context? 19:55
pmichaud is an Array -- equivalent to [[1,[2,3]]]
(note extra brackets) 19:56
ruoso so the distinction of Array and List is the stopper for the flattening?
pmichaud not completely -- there's something more to it
moritz_ but otoh my @a = 1, 2; my @b = 3; @b.push(@a). Now @b == 3, right?
pmichaud moritz_: I think not. 19:57
I think +@b == 2
pmichaud oops, I'm wrong 19:57
@b == 3 because @a is evaluated in flattening list context
lambdabot Maybe you meant: b52s babel bf bid botsnack brain bug . ? @ v
pmichaud (because .push has a slurpy array parameter) 19:58
moritz_ ok, but @b.push([1,2]) would result in +@b == 2, right?
pmichaud yes.
moritz_ but we push an exaclty equivalent array, aren't we?
pmichaud ruoso: the reason I think there's something more is that even if we say @b is an Array, @b will flatten in list context 19:59
ruoso I think I found the confusing point... 19:59
pmichaud ISTR that TimToady mentioned something about "scalar Arrays", so that [1,2] is a scalar Array, while @b is just an Array
ruoso we have an indecision on how much power the sigil has
pmichaud the sigil determines what the variable is allowed to bind to 20:00
$ can bind to anything. @ binds to things that implement the Positional role. % binds to things that have the Associative role.
ruoso it also implies the potential contexts the variable can be used
@ implies flattening
moritz_ pugs: my @a = [1, 2]; say @a.elems 20:01
p6eval pugs: OUTPUT[1␤]
moritz_ pugs: my @a := [1, 2]; say @a.elems
p6eval pugs: OUTPUT[1␤]
pmichaud pugs: my @a = (1,2); say elems @a; 20:02
p6eval pugs: OUTPUT[2␤]
pmichaud pugs: my @a := [1,2]; say elems @a; 20:02
p6eval pugs: OUTPUT[1␤]
ruoso pugs seems to use Array × List as the key
moritz_ rakudo: my @a := [1, 2]; say @a.elems 20:03
p6eval rakudo 30973: OUTPUT[2␤]
moritz_ rakudo: my @a = [1, 2]; say @a.elems
p6eval rakudo 30973: OUTPUT[1␤]
pmichaud (phone)
moritz_ somewho rakudo's output feels right
ruoso TimToady, is it? 20:04
moritz_ ruoso: they're having their design minutes now, perhaps they'll discuss it on phone
ruoso oh... great... 20:05
rakudo: my @a = (1,2) ; say elems @a;
p6eval rakudo 30973: OUTPUT[2␤]
ruoso just sanity checking ;)
If that's correct... than List is a very special type... 20:06
and I can assume that every item can be seen as a list of a single element... 20:07
with the exception of the magical "List" type, which is the only thing that appears as an effective List
and I think that solves all my questions... 20:08
in SMOP, every value is a read-only scalar of itself and is also a list of itself...
ruoso an Array in List context is also a list of a single element... a "scalar Array" as pmichaud pointed out that TimToady pointed out... 20:13
;)
and that means I have my sanity back :D 20:14
and with that... I should go home &
wknight8111 where is the best source for Perl 6 info? Is it the synopses at this point? 23:34
PerlJam wknight8111: what sort of info do you want? 23:36
literal wknight8111: perlgeek.de/blog-en/perl-5-to-6/ 23:41
lambdabot Title: blog | Perlgeek.de Blog :: Category Perl-5-to-6
wknight8111 yeah, I've read over that entire series 23:43
that's a good source, thanks
Tene synopses and test suite
PerlJam wknight8111: there's also the various perl6 articles on perl.com
wknight8111: but the synopses are best for understanding the way the language should be. 23:44
wknight8111 I'm planning to start writing a book about Perl 6 on Wikibooks, and I want to make sure I'm getting all the best information about it
Tene Synopses and the test suite
wknight8111 yeah, the dreaded test suite. 23:45
PerlJam wknight8111: what Tene said for sure then