»ö« 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! | Rakudo Star Released!
Set by diakopter on 6 September 2010.
00:07 rgrau_ left 00:08 alester left 00:12 Psyche^ joined, Psyche^ is now known as Patterner 00:15 ash_ left
TimToady was it something I said? 00:17
00:18 Patterner left
sjohnson p6 was too ahead of our current times 00:22
00:23 thundergnat joined
TimToady they all went off to the future without me? 00:23
am I dead? 00:24
sjohnson yep. they're working on p7
TimToady well, that's okay, then 00:25
sjohnson fwiw, i used some p5 today, and it was very refreshing 00:26
that qw() syntax probably advanced mankind by at least 15 years of technological-time 00:27
especially when you just CTRL-V paste in about 4800 isbn's or other non-space strings that are in your clipboard for quick and dirty parsing.
one could have been burned at the stake for suggesting qw() to a language spec. 20 years ago 00:28
gfldex that could still happen 00:30
sjohnson yep. we're lucky to believe
00:32 risou left
sjohnson err, be alive i mean 00:35
has anyone ever figured out how to simply get p5 to work like PHP
with the <? ?> inline html syntax?
hmm, maybe not the best place to ask that question.
kind of OT
00:41 Helios left 00:42 ascent_ left
diakopter sjohnson: actually I ran across something on CPAN that does that .. quite a few years ago. so I don't remember the name. 00:44
00:47 Helios joined
perigrin_ Mason can be inlined, you can re-define the TT2 delimiters to <? ?> if you want 00:47
there is also Embperl, and Apache::ASP (??) that are much older and I don't know if they're still maintained 00:48
00:48 ascent_ joined
sjohnson i remember installing mod_perl being frustrating and tiresome 00:50
maybe that has gotten easier, too
00:51 thundergnat left 00:52 broquaint left
perigrin_ sjohnson: no, not really 00:54
00:54 perigrin_ is now known as perigrin
diakopter sjohnson: that would depend (like the building/installation of nearly everything) extremely heavily on who's doing the building/installing, and in what environment. 00:54
sjohnson ponders these thoughts 00:56
00:56 Psyche^ joined, Psyche^ is now known as Patterner 01:00 broquaint joined 01:04 Chillance left 01:09 Patterner left 01:16 xinming_ left 01:17 Psyche^ joined, Psyche^ is now known as Patterner 01:18 xinming joined, [particle] left 01:23 cdarroch left, [particle] joined 01:30 Patterner left 01:31 Psyche^ joined, Psyche^ is now known as Patterner 01:38 [particle] left 01:43 sekimura_ left 01:47 whiteknight left, flatwhatson left 01:50 PacoLinux left 01:56 Patterner left, christine joined 02:05 PacoLinux joined 02:13 patspam left, Italian_Plumber left 02:21 Psyche^ joined, Psyche^ is now known as Patterner 02:29 ash_ joined 02:32 Patterner left 02:34 Psyche^ joined, Psyche^ is now known as Patterner 02:37 ash_ left 02:45 Patterner left
diakopter so um 02:46
02:47 Psyche^ joined, Psyche^ is now known as Patterner 02:48 Holy_Cow joined, Holy_Cow left 02:50 bluescreen joined, bluescreen is now known as Guest83031 02:51 Guest83031 is now known as bluescreen10
crythias um? 02:54
diakopter the rwun swu zam anf romnan tucket 02:56
03:00 mdxi joined 03:03 ash_ joined 03:04 Patterner left
ash_ ping moritz_ 03:05
03:10 flatwhatson joined 03:13 Psyche^ joined, Psyche^ is now known as Patterner 03:27 redicaps joined, agentzh joined 03:35 karb joined 03:38 meppel joined 03:42 meppl left, ash_ left, ash_ joined
ash_ try.rakudo.org/?input=say%20%221%20...%C2%AB%22; 03:42
any comments/suggestions? 03:43
that is just an example of unicode working with the try.rakudo.org site
karb ash_: looks good. I personally like smaller fonts 03:46
ash_ smaller where? 03:47
karb on the result screen
ash_ a lot of the styles work highly influenced by perl6.org/ but are not the exact same, so thats the kind of style i was shooting for
(granted i am not a designer by any stretch of the imagination) 03:48
karb ash_: multiple line/statement input works well 03:50
ash_ its sorta a cheat 03:51
there are circumstances where it will not work, its a real perl6 repl running in the backend, so anything that doesn't work in the real repl won't work on the site, so if you do (for instance): if $a { <newline> it considers that a syntax error 03:53
03:53 mfollett joined
karb ash_: when i give the command clear it does not clear any variables i created in the session. Suppose I want to start a fresh program is there any command for clearing the session? 03:53
ash_ exit 03:54
that will kill the current repl, and the backend will restart it on the next request
karb ok 03:55
ash_ dang, this server is a LOT faster than the test server i have been working with, there used to be a 1~2 second delay on each command 03:57
03:57 meppel is now known as meppl 03:58 Patterner left
ash_ if anyone has any difficulties, compatability issues, or any bugs either leave me a message, or if your on github, github.com/moritz/try.rakudo.org/issues would be great 04:02
err, filling out an issue in the issue tracker is what i mean
pmichaud ash_++ # very nice work 04:06
04:07 bluescreen10 left
ash_ i feel like its better than it was (say rand twice doesn't make the output look wrong for instance), but still room for improvements, the next feature will be (hopefully) the tutorial system 04:07
04:08 Psyche^ joined, Psyche^ is now known as Patterner 04:09 plobsing_ left 04:12 Guest82491 left 04:15 tcliou joined, tcliou left 04:16 tcliou joined, mfollett left
ash_ man, i kinda envy macruby, in their current trunk they just added another new feature, they can pass a ruby block to a C program like a C block (the ones that apple added to the gcc and clang compilers), how cool is that 04:18
04:18 Patterner left
ash_ is feather3 alright for anyone else? i am getting timeouts from ssh 04:19
04:21 Schwern joined
Schwern Hi folks. Where are Parcels documented? 04:21
ash_ oh, i put a really long running thing into the repl and it caused the whole server to lag... thats not good
S08 i believe 04:22
perlcabal.org/syn/S08.html
Schwern Oh. Huh. The title went right past my eyes
I'm most interested in a Parcel's behavior to act like a single-element list or a scalar. 04:24
And see if I can backport it to Perl5 with some clever overloading
04:24 tcliou left
ash_ parcels are kinda internal, they aren't something you normally directly manipulate, in my experience anyway 04:26
04:27 Psyche^ joined, Psyche^ is now known as Patterner
Schwern I encountered them when investigating porting pick() to perl5i 04:27
And also wanting things like @array->pop and @array->pop(3) to act sensibly. 04:28
ash_ rakudo: sub foo(|$a) { $a.WHAT }; say foo 1; # lets you directly grab the capture 04:29
p6eval rakudo 19a8b7: OUTPUT«Capture()␤»
ash_ rakudo: my @a = (0, :a<b>); say (|@a).WHAT; # can get to it too 04:31
p6eval rakudo 19a8b7: OUTPUT«Capture()␤»
ash_ i am not sure how to grab the parcel
04:31 gfx joined
diakopter rakudo: 4>>[.say] 04:32
p6eval rakudo 19a8b7: OUTPUT«Any()␤»
diakopter o 04:33
04:33 Patterner left
Schwern What does pick return? 04:36
rakudo: [1,2,3].pick
p6eval rakudo 19a8b7: ( no output )
ash_ rakudo: say (1..6).pick 04:37
p6eval rakudo 19a8b7: OUTPUT«6␤»
ash_ rakudo: say (1..6).pick.WHAT
p6eval rakudo 19a8b7: OUTPUT«Int()␤»
04:38 Psyche^ joined, Psyche^ is now known as Patterner
ash_ it returns an element from the list it was picking from, i don't think its a reference though (its not assignable) 04:38
rakudo: my @a = 1, 2, 3; @a[2] = 6; @a.pick = 3;
p6eval rakudo 19a8b7: ( no output )
ash_ rakudo: my @a = 1, 2, 3; @a[2] = 6; @a.pick = 3; say 'done', ~@a; 04:39
p6eval rakudo 19a8b7: OUTPUT«done1 2 6␤»
04:39 crythias left
ash_ weird, i kinda expected a warning 04:39
04:45 tylercurtis joined
Schwern rakudo: [1,2,3].pick.[0].say 04:45
p6eval rakudo 19a8b7: OUTPUT«3␤»
Schwern That. 04:46
rakudo: [1,2,3].pick.say
p6eval rakudo 19a8b7: OUTPUT«2␤»
Schwern That's what I'm talking about.
04:48 jaldhar joined 04:49 agentzh left
ash_ rakudo: my @a = 1, 2, 3; my $b := @a[2]; $b = 5; say ~@a 04:50
p6eval rakudo 19a8b7: OUTPUT«1 2 5␤»
ash_ rakudo: my @a = 1, 2, 3; my $b := @a[2]; say $b.WHAT;
p6eval rakudo 19a8b7: OUTPUT«Int()␤»
04:50 M_o_C joined 04:53 reedx032 joined
ash_ is $b a parcel in that case? or a capture 04:53
i think a capture
Schwern Ta da! github.com/schwern/List-Parcel/blob.../Parcel.pm
04:54 Patterner left
ash_ well, captures override .[0] to let you access the value its referencing, but you can't do .[1] or any other larger index 04:56
04:57 Psyche^ joined, Psyche^ is now known as Patterner 04:58 reedx032 left
dukeleto when does #phasers happen? 04:59
ash_ Tue 19:00 UTC 05:00
dukeleto that doesn't seem to be in an easily-findable place, just noting. ash_++ 05:01
ash_ i got it from the title of the #phasers channel :P 05:02
dukeleto ash_: :)
05:04 [particle] joined 05:05 Patterner left, ash_ left 05:20 Axius joined
dukeleto I've added #phasers to the Parrot Calendar on parrot.org, so people (like me) can set reminders 05:24
05:30 Psyche^ joined 05:31 Psyche^ is now known as Patterner, mantovani joined
karb which is the correct way to bless: self.bless(*) OR self.bless(self.CREATE) ? 05:31
05:34 [particle] left 05:35 Axius left 05:36 Patterner left
sorear self.bless(*) and self.CREATE do the same thing 05:41
self.bless(self.CREATE) blesses twice
Schwern: the return from pick isn't a parcel; .[0] is defined to be the identity operation on non-lists in Perl6 05:42
sorear is an Implementor and doesn't quite grok parcels yet 05:43
05:47 masak joined
masak oh hai, #perl6! 05:47
karb I checked S12, it says * calls self.CREATE()
masak this looks like a nice task to implement for Rosetta Code: en.wikipedia.org/wiki/Burrows%E2%80..._transform 05:48
karb: in the sense that .bless calls self.CREATE() when it sees a *, yes. 05:49
karb S12 specifies self.CREATE is the "normal" way. Is there an advantage over * ? 05:50
masak it's shorter. 05:53
oh, advantage *over* *. hm. 05:54
self.CREATE is more explicit, and doesn't rely on any hidden magic.
05:57 karb left 05:58 Psyche^ joined, Psyche^ is now known as Patterner 06:02 agentzh joined
dalek ecza: 981e8db | sorear++ | / (5 files):
Optimize subrules further for the non-backtrack case

  ~+30%
06:07
06:09 uniejo joined
sorear my new regex engine is so fast, I can't even find it in the profiler 06:14
so I'm chasing *general Perl6 stuff*
:/
masak "chasing"? 06:15
sorear I'm trying to get niecza competitively fast
so I knock down the biggest stuff on the profile
but the big stuff on the profile is mostly object system and data model stuff that the regex engine doesn't use 06:16
06:16 Axius joined
masak ok. 06:16
why did the specification end up in a repository named 'specs' with a final 's'? sounds like it's not a specification but a pair of glasses... :) 06:19
06:20 Patterner left
moritz_ because it's not one spec document, but many 06:20
good morning
masak good morning. 06:21
I always thought of it as "the specification", singular, but "the synopses", plural.
it's several documents, but they form one specification. 06:22
moritz_ www.perlmonks.org/?node_id=859263 :(
masak :( 06:23
06:23 Psyche^ joined, Psyche^ is now known as Patterner
masak seems easy to fix, though. 06:24
sorear LTA, sure, but ":("? 06:25
moritz_ if people go to perlmonks to ask question about the book, it means that we didn't explain it good enough, didn't make it robust enough etc.
masak it indicates a certain lack-of-robustness that someone'd... what moritz_ said. 06:26
on the other hand, it's good to get that feedback now.
06:27 wtw joined
moritz_ I've added a note about the first example not being robust to whitespace fluctuations 06:27
some weeks ago
but it's not yet in the PDF 06:28
06:29 Patterner left 06:31 svetlins left
tylercurtis token term:identifier in STD is mildly confusing. 06:32
06:32 hlatapie joined
sorear I disagree 06:33
06:34 Psyche^ joined
dalek ok: 6d48a37 | moritz++ | src/basics.pod:
[basics] re-word warning about robustness
06:34
06:34 Psyche^ is now known as Patterner
tylercurtis s/is mildly confusing/mildly confuses me/ 06:34
06:34 justatheory left
masak moritz_: maybe it'd make sense to do a 'next unless $line' at the start of the loop? 06:34
sorear it more than mildly confuses ME. 06:35
tylercurtis Am I a bad person for feeling a little better because of that? 06:36
moritz_ masak: works for me, but would need to be explained properly 06:37
masak: pmichaud is right, we need a chapter about statements 06:39
masak aye.
ok.
TimToady the series refactor has landed 06:40
I guess it still doesn't show up here...
06:41 Axius left, Patterner left
TimToady hmm, I guess the watcher is running a bit slow, but it showed up in perl6/specs anyway 06:43
06:44 cjk101010 joined
TimToady or does the watcher not show your own pushes? 06:44
06:46 hlatapie left
tylercurtis sorear: looking at your action for it in Niecza, it looks as though $/.is_name($<args>.ast) is true for identifiers that are in scope without a sigil? 06:46
$<identifier>.Str, rather. 06:47
TimToady anyway, series refactor is at github.com/perl6/specs/commit/69247...2555e17d8d
sorear tylercurtis: iiuc, it's true for typenames
like Num
also True
snarkyboojum moritz_: the camelia icon in fame-and-profit.html for modules.perl6.org needs updating (probably to github.com/perl6/mu/raw/master/misc...elia32.ico I guess) and I'm guessing that lives in your forked proto/modules.perl6.org repo? 06:59
07:04 synth joined, M_o_C left
masak TimToady: it's customary to leave the second line in a git commit message empty. this makes the message render better in various clients. 07:05
TimToady I wondered why it highlit red...
it also changes color partway through the top line--what does that mean? 07:06
snarkyboojum if it exceeds 72 chars or so? 07:08
sorear yes
conventional formatting is shortmessage, blank, longmessage 07:09
07:09 redicaps left
masak snarkyboojum: 50 chars, methinks 07:09
TimToady: I also learned that convention by observind vim's highlighting :)
s/vind/ving/ 07:10
TimToady ah well, came out fine on the web page, at least...
masak aye.
but it really helps (especially the '50 chars' part) in git log and other similar tools.
TimToady so it's really a title for what follows
snarkyboojum masak: ah - it does appear to be 50 :) 07:11
07:11 amkrankruleuen left
TimToady just something to jog the memory 07:11
snarkyboojum this explained it well - tbaggery.com/2008/04/19/a-note-abou...sages.html
07:12 amkrankruleuen joined
snarkyboojum I think I got that link off masak somehow :) 07:12
masak aye. 07:13
I like to view the shortmessage as a challenge. what did the commit do, in 50 chars or less? :) 07:14
it's like nanoblogging.
snarkyboojum heh
TimToady can I use Japanese? 07:17
masak commit messages are utf-8 per default, so technically yes. 07:18
TimToady I suppose they count the Kanji as double-wide, unlike twitter... 07:19
tylercurtis Yay! I have a Bennu rewrite that can parse "say 1;". And that's about it. Oh, well, it's progress. 07:22
07:23 Guest23195 joined 07:24 amkrankruleuen left
moritz_ is it fast? :-) 07:24
sorear tylercurtis: can it do anything post-parse?
TimToady progress is never fast.
07:25 Guest23195 left, Guest23195 joined
masak many many spectest failures: gist.github.com/569768 07:29
tylercurtis moritz_: it parses "say 1;" slightly faster than rakudo on my machine.
masak some are known recurring baddies. others are new.
tylercurtis sorear: not a thing, yet.
07:31 Axius joined 07:32 azert0x joined 07:34 amkrankruleuen joined 07:37 cmadsen joined, tadzik joined
tadzik good morning 07:37
07:38 foodoo joined
sorear niecza is now within 10% of viv on the JSON::Tiny benchmark 07:40
masak tadzik: morning!
07:41 amkrankruleuen left
dalek ecza: b939063 | sorear++ | / (6 files):
Store non-dynamic lexicals in an array
07:41
07:44 Psyche^ joined 07:45 Psyche^ is now known as Patterner 07:47 tadzik left 07:55 Trashlord left
jnthn Morning, #perl6 07:56
07:57 amkrankruleuen joined
jnthn sorear: "self.bless(self.CREATE)" - does not bless twice. .bless(*) calls .CREATE for you, rather than using what was passed in, that's all. 07:58
masak morning, jnthn
jnthn yayitsmasak! 07:59
jnthn is in Helsingborg for the day
masak yay 08:00
someone asks for a Perl 6 version of a Python script in the first comment at www.reddit.com/r/programming/commen...lly_games/ 08:05
masak tries to produce one
08:06 frooh joined, ashleydev left 08:07 ashleydev joined
sorear \o/ niecza has passed viv 08:10
masak this is what I got: gist.github.com/569803
sorear: wow! cool!
seems to work. 08:11
sorear for 100 repetitions of sample.json, total 60kb, viv: 8.6s user, niecza: 5.1s user
08:11 tadzik joined
tadzik seen alexm 08:11
aloha Sorry, I haven't seen alexm.
sorear 't/JsonTinyG.pl' is the grammar I'm using
pity that what I had to do to benchmark viv makes it impossible to benchmark nqp/rakudo 08:12
dalek ecza: ffb2ed0 | sorear++ | src/ (2 files):
Fix sigspace not respecting :r optimization
08:13
sorear Is there a meaningful distinction between proto regex and proto token? 08:17
moritz_ I don't think so
in rakudo you can add token foo:sym<foo> and regex foo:sym<bar> to the same proto
I like that
and since you have to be explicit about what you want in each candidate anyway, there's no need for the proto to carry such information around 08:18
08:19 tadzik left 08:21 Axius left 08:22 timbunce joined 08:23 timbunce left, timbunce_ joined 08:30 dakkar joined
masak ok, so I made a patch to add 'each' junctions to Rakudo. 08:36
it seems to work, in the sense that it doesn't fail any more spectests than before.
unfortunately, the prototypical use case, @a.each.say, doesn't work.
08:36 gfx left
masak it just prints .perl of the junction. 08:36
so somewhere, I need the each junction to do more dispatch than it does currently. any ideas? 08:37
tylercurtis rakudo: (1 | 2).Str.say;
p6eval rakudo 19a8b7: OUTPUT«any(1, 2)␤»
tylercurtis rakudo: say ~(1|2);
p6eval rakudo 19a8b7: OUTPUT«any(1, 2)␤»
tylercurtis rakudo: say 1|2;
p6eval rakudo 19a8b7: OUTPUT«any(1, 2)␤»
masak right. seems autothreading doesn't happen with .say currently
instead, it stringifies immediately. 08:38
not sure where that happens.
moritz_ rakudo: say ~Mu.^methods 08:39
p6eval rakudo 19a8b7: OUTPUT«so BUILDALL new Bool print say item WALK defined BUILD clone perl WHICH Capture CREATE PARROT bless WHENCE WHERE notdef ␤»
moritz_ there's a Mu.say 08:40
masak ...which only delegates to the sub &say
tylercurtis Which delegates to IO.say;
jnthn which doesn't auto-thread
(because it takes a slurpy array) 08:41
masak oh
jnthn (that's correct, afaik)
masak even with the desired behaviour of the each junction factored in?
08:41 amkrankruleuen left
masak where will the autothreading of .each.say happen? 08:41
08:42 amkrankruleuen joined
tylercurtis IO.say calls IO.print which appears to pass the items directly to Parrot's IO-related PMCs, so I'm guessing the eventual stringification happens somewhere in parrot's guts. 08:43
moritz_ probably through the get_string vtable
jnthn masak: Maybe each auto-threads more eagerly than a typical junction 08:44
(on method calls)
masak jnthn: yes, I suspect so too.
jnthn e.g. maybe it doesn't look up the hierarchy for the method calls
but that's ugly to implement
masak jnthn: it's also interesting to think about how each interacts with all/none and any/one.
jnthn We can do it when we get custom meta-classes.
masak jnthn: my guess is that it's "outside" them all.
jnthn And can override dispatch. 08:45
masak jnthn: it's also interesting to thing about how each interacts with control structures. does it re-run if statements and while loops once for each element?
my guess is yes.
jnthn Well, same as other junctions I guess? 08:47
(rusty on the spec)
masak no, other junctions boolify in if statements and while loops. 08:50
but each doesn't feel like it boolifies.
i.e. `my @a = 1, 2, 3; my @b = 2, 3, 5; if each(@a) == any(@b) { say "yes" } else { say "no" }` would print "no\nyes\nyes" 08:51
"...\n"
sorear ponders how each would fit into niecza's static junctions modle 08:52
masak anyway, stowing my patch for now. it's not many lines that need changing to add it, which is positive.
moritz_ which patch? 08:53
masak the one I prepared to add &each and .each and the 'each' type of Junction.
(it should really be its own type, Each, but I wanted to try this first) 08:54
08:54 kjeldahl joined
tylercurtis Good night, #perl6! 08:56
masak night, tylercurtis!
dream of correctly autothreading exotic junctions :) 08:57
08:57 thebird joined, tylercurtis left
sorear phenny: msg TimToady I need a parameter type which takes 0-infinity arguments, does NOT flatten, and puts them all into scalar context in a Seq or List 08:57
phenny: tell TimToady I need a parameter type which takes 0-infinity arguments, does NOT flatten, and puts them all into scalar context in a Seq or List 08:58
phenny sorear: I'll pass that on when TimToady is around.
moritz_ how do each junctions collapse (or decompose into their eigenstates)?
sorear .Bool 08:59
(canonically)
moritz_ that doesn't make any sense.
09:01 jhuni left
masak .Bool feels high-level to me, which would imply that it's not expemt from autothreading. 09:03
I'd have guessed .so or prefix:<?>
jnthn prefix:<?> calls .Bool, no?
sorear thought all three were synonyms
moritz_ .Bool makes sense for any, all, one, none
but not for each
jnthn I guess maybe each is not really a junction then. 09:04
sorear each should trip on .sink
moritz_ the goal of an each junction is not produce a single boolean
maybe assignment to an array?
masak I don't know what you mean by that. 09:10
sorear I guess .list might work too 09:11
moritz_ masak: what I mean by what?
sorear but, @( each($(@arr1), $(@arr2)) )
masak moritz_: <moritz_> maybe assignment to an array?
moritz_ masak: my @a = each(<a b c>).uc 09:12
masak: the @a = part is assignment to an array :-)
masak I read that as making three single-item assignments to @a
the function of 'each' is to hoist a for loop, encountered in the middle of an expression, up to the statement level. 09:13
moritz_ and I proposed that assignment to an array extracts the eigenstates
masak ...making it a serial version of >>, no?
a bit like &map is. 09:14
moritz_ well, more magical than either
masak I'm not sure I see the utility. I'd prefer 'each' to be consistent across all uses.
smash mornin' everyone
moritz_ each(<a b c>).lc.ucfirst
masak smash: \o
moritz_: that's just a refusal to use map or >> in my view. 09:15
moritz_ masak: well, that's the problem, it can't be consistent across all usages
masak I'm not sure I see why you think so.
moritz_ because you need to have some kind of mechanism to stops its autodistribution 09:16
so whatever that mechanism is, the behavior is *not* consistent across that mechanism and everything else 09:17
just like junctions can't be made to autothread over boolean context, because that's how they collapse
masak I'm lost. I don't drink coffee, but maybe I need to, now.
moritz_ let's start simple
masak sure.
moritz_ each() should be a mechanism to do some operations on each item of the each() construct 09:18
right?
masak absolutely.
09:18 jhuni joined
masak .each.say being the prototypical example. 09:18
moritz_ and in general, you'll want to extract the return values in some form or another, right?
masak no, I don't think so.
moritz_ ah, you only want it for its side effect 09:19
masak I think the occurrence of each translates to several different statements.
@a[0].say, @a[1].say, etc.
each one having the ordinary return value of .say
moritz_ which you don't want to make available to the user
masak sure, just as it's usually available. 09:20
so if you do my $b = @a.each.say; you get a lot of redundant assignments.
and the last one sticks.
moritz_ so you want to limit the effect of .each to the statement level? 09:21
masak but I see what you mean. and no, in my model, the purpose of each is not to make an array of return values available to the user.
yes, 'each' propagates to the statement level.
that's its purpose.
not return values.
there are other good constructs for that already.
moritz_ which makes it not "uniform across all usages", because a possible usage is to ahve multiple statements 09:22
masak well, uniform across all *intended* usages.
moritz_ somebody else will have different intentions than you do.
masak clearly. 09:23
that's why we're having this discussion now.
09:23 daxim joined
masak all I'm saying is that it's *very* consistent to always hoist 'each' up to the statement level. 09:23
moritz_ would like to see some use cases
masak and then explain to people who use it wrongly why they're doing it wrong.
09:24 patrickas joined
patrickas Ola! 09:25
moritz_ \o
patrickas: have you seen the series changes in the spec? 09:26
sorear +1 to limiting each to statement level 09:28
patrickas moritz_ yes I did .... does that mean the current patch is toast ... or can we apply it while waiting for someone to work on the new implementation ? 09:30
moritz_ patrickas: I'm fine with applying it for now 09:31
running a spectest now 09:32
masak TimToady: the 1, *+1 ... { $_ == 9 }, 10, *+10 ... { $_ == 90 }, 100, *+100 ... { $_ == 900 } example in the latest commit, can it also be written 1, *+1 ... 9, 10, *+10, ... 90, 100, *+100 ... 900? can it be written 1, *+1 ...^ 10, *+10 ...^ 100, *+100 ...^ 1000? 09:33
oh; first question already answered by the spec. :)
09:35 jhuni left 09:49 robins is now known as robinsmidsrod
patrickas moritz_: sorry I was on the phone. that's great then. Besides most of the things added in the patch will be useful to implement the new spec, (mostly allowing the first element of the rhs to be a closure) 09:51
10:00 Italian_Plumber joined
patrickas masak: Yesterday, I created a reddit account after years of lurking just to answer the python to perl6 question you mentioned this morning :-) My reply was surprizingly well received. And HIB0U has still not showed up. So all is well ... 10:01
frettled patrickas: URL? 10:02
masak patrickas: oh, it was you :) I only saw your very fine and detailed reply after I had posted mine...
10:02 Schwern left
masak frettled: www.reddit.com/r/programming/commen...lly_games/ 10:02
frettled masak: thanks! 10:03
moritz_ patrickas: that was a very good answer
patrickas Thanks... I always thought I was going to be eaten by trolls the second I post anything on reddit! :-) 10:07
frettled patrickas++ — that workedout well.
10:07 Italian_Plumber left
moritz_ t/spec/S05-transliteration/trans.rakudo and t/spec/integration/real-strings.rakudo both abort before running any test 10:09
patrickas moritz_: Is that related to the seies patch spectest? or in general ? 10:10
moritz_ patrickas: not related - failed that way in my previous spectest run too
patrickas oh ok
10:11 araujo left
dalek kudo: b736c88 | patrickas++ | src/ (2 files):
add ...^ operator
10:17
kudo: 0a93184 | patrickas++ | src/core/operators.pm:
Cleanup as per pmichaud++'s comment
rakudo: 4615073 | moritz++ | src/core/operators.pm:
rakudo: Refactored series operator
rakudo:
rakudo: Conflicts:
rakudo:
10:17 dalek left, dalek joined, ChanServ sets mode: +v dalek
moritz_ it seems I'v got the karma for that commit because I resolved a conflict 10:18
patrickas++ deserves it
patrickas Dalek knows who's the boss ;-) 10:19
ok so I guess now I can git reset --hard rakudo/master and start working on the new spec in a new branch as I should have been doing all along :-) 10:20
colomon dear heavens, that looks like a lot of changes to the series spec! 10:24
moritz_ indeed 10:26
10:26 Patterner left
masak good thing we haven't released Perl 6 yet. 10:27
patrickas on the plus side that means I won't be bugging anyone with what I should be working on next :-) 10:28
frettled masak: for some reason, that statement was ominously close to "release the hounds!"
masak frettled: I guess that's why we're saving it for some very special circumstances. 10:29
patrickas: congratulations, your first unit of torment! :)
masak liked twitter.com/Ne0lite/status/23902228880 10:30
frettled masak: Ugh, I must be slipping, the meme these days is to show a clip of Liam Neeson as a Greek deity, commanding "Release Perl 6"
masak: pretty nice 10:31
But why does Rakudo say "PROFIT!!!" when it's told to say "Hello, world!"? ;)
masak Easter Egg :)
10:31 Psyche^ joined 10:32 Psyche^ is now known as Patterner
masak frettled: for some reason, picturing Liam Neeson as a Greek deity isn't very difficult. 10:32
frettled masak: www.youtube.com/watch?v=IFQvTRBeVp8 (endless repeat, apparently) 10:34
masak frettled: that one is new to me. but it does feel right. 10:36
moritz_
.oO( geek deity )
10:37
frettled I haven't seen the movie (Clash of the Titans), but I guess he needed the money.
moritz_++
Now, can we nettle TimToady into a spoof of that? :D
moritz_ (totally Off-Topic: my thunderbird can't count; It says that Inbox has 1130 new e-mails. The inbox consists of three mail accounts, with unread counts (0, 52, 1)) 10:39
frettled moritz_: nothing in other folders?
masak .oO( "release the butterfly!" )
10:40 Patterner left
frettled Relese Camelia! 10:40
+a
daxim let slip the butter of war! 10:43
10:45 Psyche^ joined 10:46 Psyche^ is now known as Patterner
colomon has to admit to feeling vaguely cheated by the series changes. 10:47
colomon wonders if that is a form of Stockholm syndrome. 10:48
masak jnthn: I'm reading perl.plover.com/classes/typing/notes.html right now. it seems to be pleasant reading for someone who's thinking about type systems. 10:49
colomon: is it just a general feeling of being cheated, or do you miss any of the old features?
colomon It's mostly caused because I (and later patrickas) spent days banging my head against the old system trying to make it work. 10:50
frettled And then someone just went and … fixed it? 10:52
colomon frettled: you have to understand, we had the insanely complex version 95% working. 10:53
and the new change throws out all that work to replace it with something trivial.
frettled I can see how that creates mixed feelings. 10:54
colomon mind you, the new spec is vastly better.
10:54 Mowah joined
jnthn colomon: Welcome to Perl 6 dev. 10:56
colomon the only thing I might miss is needing to write 1, 2, 4 ... * >= 900 instead of 1, 2, 4 ... 900 10:57
jnthn After a couple of years of work to understand multi dispatch, I currently am throwing out most of what I knew of it.
10:57 ruoso left
colomon jnthn++ 10:57
jnthn Which is annoying, even if I have to admit the new spec is sane in ways the old one wasn't.
(It's insane in new ways too of course :-)) 10:58
colomon you know, I think I have a little bit of single malt still hidden away in my desk drawer....
jnthn ;-)
frettled colomon: og glug glug?
jnthn gets back to $dayjobhacking for a bit, and looks forward to having 6model time a little later on today :-)
frettled (alternative to the om nom nom meme)
colomon sip sip sip
I sooooooo cannot afford to glug single malt at this junction in my life. 10:59
10:59 Patterner left, macroron joined
smash something wrong in Test::is i can't debug :\ 11:00
or maybe further down the 'stack' 11:01
11:07 Psyche^ joined, Psyche^ is now known as Patterner
frettled colomon: If not at this junction, when? :D 11:08
colomon frettled: well, first the home repairs need to be finished and paid off... 11:09
11:10 rhebus joined 11:11 Patterner left
rhebus good $time-of-day all 11:11
colomon o/ 11:12
11:12 Psyche^ joined, Psyche^ is now known as Patterner
rhebus i have heard about using ordinary functions as methods -- how does this work? 11:13
say I have a function sub remove-at (@arr is rw, Int $pos) { @arr.splice($pos, 1); return @arr } 11:14
is it possible to call it as @arr.remove-at(3)?
jnthn No
But you can do
@arr.&remove-at(3)
rhebus aaaaah
useful 11:15
so any function can be invoked as a method on its first arg as $arg1.&func(@otherargs) ?
(excluding nullary functions...) 11:16
11:17 Patterner left, Psyche^ joined, Psyche^ is now known as Patterner
smash rakudo: ([1,2]).map({shift $_}); # why is the list being flattened here ? 11:18
p6eval rakudo ea77cc: ( no output )
jnthn yes, though "as a method" means no more than "in a way that looks like a method" 11:19
It's syntactic sugar really for a sub call.
smash rakudo: ([1,2],[3,4]).map({shift $_});
p6eval rakudo ea77cc: ( no output )
smash hmm 11:21
rhebus jnthn++ 11:22
jnthn Note that if you have any kind of code ref in a scalar then $lol.$wtf() also works. 11:23
However, $lol.@cands() is different
frettled How so?
jnthn (S12 has details)
frettled: The latter specifies the candidate list
And nextsame etc will defer through that 11:24
And .* will walk through it.
frettled ooh
jnthn $foo.*@stuff(); # call all the things in @stuff
$foo.+@stuff(); # call all the things in @stuff and die if we don't call at least one thing
11:25 azert0x left 11:26 Italian_Plumber joined
rhebus jnthn++ # language teaching 11:30
the karma syntax is more specific than I previously thought
11:32 azert0x joined 11:34 [synth] joined
smash colomon: just sent you a pull request to add the transpose function to List::Utils, please take a look at it when you have time, thank you 11:35
11:36 synth left
colomon smash++ 11:41
masak sri_++ # blog.kraih.com/actual-perl-marketing 11:42
_sri \o/
colomon smash: do you know if there is now a way to pull directly from your fork, or do I still need to do that stuff with adding your branch to my local checkout? 11:53
11:56 Patterner left
colomon (reads github help) Looks like I still need to do that stuff. 11:57
11:57 Psyche^ joined, Psyche^ is now known as Patterner, tadzik joined 11:58 envi^home joined, sftp joined
pmichaud good morning, #perl6 11:58
moritz_ _sri: do you have a vector graphic version of that book cover? we currently use the .jpg, and in print the letters of the author names are pixeled
tadzik hello 11:59
colomon o/ 12:00
moritz_ rhebus: do you have an updated visitor count for your blog post? 12:01
I'm curious if the 1k visitors I predicted actually came
takadonet morning all 12:02
jnthn morning, pmichaud
12:02 Patterner left
masak morning, pm 12:04
rakudo: sub infix:<$> (@list, $step) { gather for ^$step -> $a { for ^(@list.Int div $step) -> $b { take @list[$_] if $_ < @list given $b * $step + $a } } }; say (^9 $ 3).perl # mingle operator :) 12:05
p6eval rakudo ea77cc: OUTPUT«(0, 3, 6, 1, 4, 7, 2, 5, 8)␤»
masak this one gives the columns in tic-tac-toe.
rhebus moritz_: 2110. or you can see it yourself rhebus.posterous.com/learning-perl-...illy-games
moritz_ ah right, missed the "viewed" number 12:06
rhebus++
rhebus if i blog on perl 6 again, i think i might move to wordpress
posterous is godawful
posterous-- # stupid broken post editor 12:07
[Coke] .
dukeleto added phasers to the google comp.lang.parrot calendar. anyone wants any other vaguely related events added (like the attemtped cpan6 sketch), let him (or me) know. 12:08
masak what does it mean to add phasers to the calendar? 12:09
rhebus masak: add it to perl6/perl6-examples/games/tictactoe.p6 :) 12:10
masak tempting... let's see if someone manages to come up with a shorter way to write the sub first :) 12:11
it seems too long to me.
[Coke] do you know what it means to add an event to a calendar? (esp. a google calendar?)
masak [Coke]: no, I understand that part.
[Coke]: but in which sense are phasers an event? 12:12
[Coke] ok. that's all that is.
masak: #phasers
masak oh!
sorry, I get it now.
rhebus masak: actually, i have written tictactoe.p6 as a series of refinements - and therefore a teaching tool - rather than just the final product
[Coke] \o/
it's just the calendar that's visible off here:
www.parrot.org/
masak also realizes there must have been a #phasers event yesterday, and that he missed it :/ 12:13
12:13 Psyche^ joined
moritz_ there are logs :-) 12:14
masak perusing them currently. 12:15
moritz_ (off-topic again: in the last few weeks there were two scientific paper in the media, which were produced at my workplace: www.nature.com/nphoton/journal/vaop...14_F5.html (covered on slashdot) and www.nature.com/nphoton/journal/vaop...14_F5.html (covered on heise.de) ) 12:17
masak seems #phasers was mostly about why #cpan6sketch hasn't taken off. I think that's a good discussion to have.
moritz_ seems I have more geek neighbours than I knew :-)
12:18 Psyche^ left, Psyche^ joined, Psyche^ is now known as Patterner
masak TimToady: thanks for correcting my LTA hyphen/apostrophe explanation. I will memorize the rule "R2-D2 is street legal, C-3PO isn't" :) 12:21
frettled Oh, lovely.
moritz_ std: R2-D2 12:23
p6eval std 32123: OUTPUT«===SORRY!===␤Undeclared name:␤ 'R2-D2' used at line 1␤Check failed␤FAILED 00:01 114m␤»
12:24 pkkm joined
pkkm Will perl6 be slower than perl5 because of virtual machine? 12:24
moritz_ Perl 5 also uses a virtual machine 12:25
frettled Mu.
moritz_ it's just more tightly coupled with the compiler
12:26 JimmyZ joined
moritz_ so the answer is "no". We don't know yet if p6 is going to be faster or slower than p5, but if it's slower, certainly not because it uses a VM 12:26
frettled …and the tightness of the coupling depends on the Perl 6 implementation.
masak pkkm: Perl 6 is currently much slower than Perl 5. but in many cases, we know why and how to speed it up. it's just that the focus has been on getting it to run rather than getting it fast so far. 12:29
pkkm So will it be faster than Java? 12:30
frettled Mu.
masak pkkm: you should realize that such questions are almost, but not quite, meaningless.
faster with what benchmark?
on what computer? 12:31
and so on.
frettled Will Java ever be faster than Java?
moritz_ will Perl be faster than Forth?
masak also, rest assured that if we are ever given the choice to make Perl 6 faster than Java, we will not hesitate to make it so :)
moritz_ :-)
JimmyZ wonders whether he is faster than perl :) 12:32
moritz_ wonders if a JIT compiler would speed up JimmyZ :-)
JimmyZ or not
frettled For more references, see old (but awful) discussions on whether Java is faster than C, or whether Common Lisp is slower than C, or …
masak pkkm: if all we cared about was runtime speed, we'd all be using assembly or C. but that's not all we care about. 12:33
12:33 Patterner left
frettled masak: or Common Lisp ;) 12:33
JimmyZ doen't want JIT, he maybe want airplane
frettled JimmyZ: and a pony!
masak right. assembly, C, or Common Lisp :)
frettled and surprise.
masak JimmyZ: a JIT airplane, how could would that be? :)
frettled Few things are quicker than surprise. 12:34
JimmyZ masak: that's a good idea.
TiMBuS jump off a building, and build your aircraft before you hit the bottom
12:35 Psyche^ joined, stepnem left
smash colomon: (pull directly) sorry, don't know 12:36
12:37 Psyche^ is now known as Patterner
frettled pkkm: Perhaps a more relevant comparison is the hubbub surrounding the introduction of Perl 5. Perl 5 was appreciated as being more feature-rich, but also a slow mastodont as compared to Perl 4, when looking at the things that Perl 4 was good at. Perl 6 isn't quite there yet, and Perl 6 also has a few more years to go to reach the kind of maturity that Perl 4 had in the early nineties, or Perl 5 has now. 12:38
12:38 stepnem joined
tadzik Perl cannot be faster, Perl implementation can be 12:39
12:39 ruoso joined
masak same thing with early Ruby implementations. hailed as nice, but slow. they've slowly been able to speed some of them up over the years. 12:39
flussence points to the current browser wars, and how slow JS used to be 12:40
PerlJam good morning #perl6
frettled flussence: and still is — Mozilla has decided to avoid the problem by throwing hardware at it. ;)
12:41 yrgd left
masak morning, PJ 12:41
pkkm Often, pretty simple Java programs eat up enormous amount of resources (for example, JDownloader can slow down my Core2Duo @2,66 4GB RAM computer). Perl 5 GUI programs don't behave like that, even if they are much more complex than JDownloader.
frettled Perhaps someone should look into hardware-accelerated Perl 6 operations, throw some of them to e.g. that Apple open source library. 12:42
colomon smash: appears the answer is no. anyway, pulled and pushed. 12:43
smash++
smash colomon: great, thank you 12:44
colomon++
PerlJam Given that the focus has been on correctness rather than speed, we should probably focus on doing cool things where no one cares if they are a little slow.
Then, when the speed improvements happen, everyone will be in even *more* awe :)
12:45 Patterner left 12:46 [synth] is now known as synth
masak PerlJam: that's a good summary of how I currently choose new venues to explore. 12:47
12:47 synth is now known as synths
masak PerlJam: I want my next blog to be in Perl 6, but Rakudo is too slow to serve webpages in any greater quantities. so I'll make a static webpage generator instead. 12:47
12:47 synths is now known as synth, synth left
mathw masak: cool 12:48
frettled masak: It's nicer on the webserver anyway.
PerlJam mathw: exactly! :)
masak I'll package it so that others can use it too.
PerlJam masak++
mathw I was considering using Rakudo to write a CMS, which would chew data files and generate a site
patrickas frettled: That's not try about mozilla ... But I guess you were joking.
masak still a bit unsure how to do with comments.
frettled masak: And if you push a bit of work to the client with AJAX, you can get some pretty nice things out of it anyway.
mathw and then just provide the person who the site is for with a really light Perl 5 interface to edit the data files with
until such time as it's fast enough to do that in Perl 6 12:49
frettled patrickas: www.webmonkey.com/2010/08/fourth-fi...eleration/
mathw masak: meh, comments
nobody needs those :)
masak :)
12:49 Italian_Plumber left
mathw invite people to @ you on twitter if they feel it's important 12:49
patrickas frettled: Their hardware acceleration is orthogonal to their javascript speed improvements.
mathw why would you want it recorded attached to the article?
someone might say something disapproving... :)
frettled patrickas: yes, that was the joke part, because they seem unable to catch up to the competition performance-wise. 12:50
moritz_ then you can delete it :-)
frettled patrickas: both Chrome and MSIE will be applying graphics acceleration.
12:51 Italian_Plumber joined
patrickas frettled: on the v8 benchmarks they are now as fast as apple nitro's implementation 12:51
frettled patrickas: that's wonderful, but they're continuously one generation behind in speed. That is, current Firefox seems to be on par with previous-generation Safari, Chrome et al. 12:52
mathw Chrome are doing hardware graphics too? cool
frettled While V8 may bridge the gap to the current Chrome/Safari speed, that is not so promising, becaus neither Apple nor Google are sleeping in class. 12:53
mathw oddly
frettled It would be really cool if we could have the same kind of competition for implementations of Perl 6.
mathw I've found firefox 4b4 as fast as Chrome on my PC
in qualitative use
moritz_ frettled: indeed :-)
frettled mathw: Firefox 3.6.9 is the current version.
mathw yes I know that
frettled mathw: you need to compare with Chrome 7.
mathw and yes, it is horribly slow
patrickas frettled: but I don't think they *are* comparing to nightly builds of other browsers 12:54
mathw patrickas: the IE team certainly don't publish comparisons against nightlies 12:55
frettled All I'm saying is that it's a bit weird to compare the performance of an upcoming release of one product, with the current stable release of other products.
mathw standard practice
patrickas mathw: I am talking about mozilla
frettled: definetely!
mathw it's handy to be able to compare against something fixed
frettled but ultimately useless 12:56
mathw epsecially if it's a version your potential users have in their hands right now
a marketing trick really
patrickas did chrome have a new release on aug 23?
[Coke] hard to tell when chrome has new releases.
patrickas because in the mozilla comparision chart, chrome had a 10% improvement on that day ... so I assumed they were comparing themselves again moving targets and not assuming the competition is sleeping in class 12:57
frettled patrickas: that may be the day when Chrome 6 was released.
moritz_ continues trolling perlmonks with Perl 6 answers 12:58
frettled no, wait, that was September 2.
12:58 Psyche^ joined
frettled moritz_: URL! :D 12:58
12:58 Psyche^ is now known as Patterner, Kodi joined
frettled patrickas: so either the comparison was against Chrome 5, or against a Chrome 6 beta. 12:58
Kodi How can I get the ability to close RT tickets, so I can mark some outdated issues as resolved? 12:59
phenny Kodi: 07 Sep 17:45Z <moritz_> tell Kodi fyi your patches don't have a proper email address (not problem, but if it's a misconfiguration, you'd might want to know)
patrickas frettled: that's possible. In that case you would be right. 13:00
Kodi moritz_: I figure spambots would get a real email address, because of, e.g., GitHub's web interface.
moritz_ [Coke], pmichaud: can one of you please give Kodi permission to the perl6 RT queue?
[Coke] Kodi: get one of the regulars to vouch for you, and I can enable that.
wow, that was quick.
moritz_ :-) 13:01
pmichaud vouches
I need to bookmark the rt admin url somewhere.
Kodi \me feels vouchsafe. 13:02
Doggone it.
frettled patrickas: www.pcworld.com/printable/article/i...table.html
[Coke] Kodi: rt id?
smash added a possible perl 6 solution for the bead sort task on rosetta code
Kodi [Coke]: Kodi
frettled Opera is still quicker, that's nice. 13:03
[Coke] Kodi: done
13:03 Patterner left
[Coke] pmichaud: I find the URL by going to trac.parrot.org, browse source, find metacommitter guide, go back in time. 13:04
masak moritz_: trolling perlmonks -- url?
[Coke] and I have yet to bookmark the damn thing. doing so at least on this browser...
pmichaud [Coke]: I just did the same
Kodi Works; great.
pmichaud colomon: what url did you obtain? I'm finding the wrong one.
s/colomon/coke # tab fail 13:05
[Coke] rt.perl.org/rt3/Admin/Groups/Membe...l?id=20479
moritz_ masak: www.perlmonks.org/?node_id=859306
[Coke] it says parrot, but we shared admin privs.
masak `thanks.
pmichaud that's the one. thanks.
(also bookmarked)
[Coke] moritz_: is perlmonks insanely slow, or is it just my cxn? 13:06
masak slow here too.
moritz_ [Coke]: perlmonks is slow
masak moritz_: I liked that one. it shows one place where you don't have to load a module to do what the requestor wanted, as opposed to Perl 5. 13:07
13:07 [particle] joined
patrickas frettled: That's .... dissapointing 13:07
13:08 Italian_Plumber left 13:09 javs joined, javs left, javs joined, Italian_Plumber joined
frettled patrickas: it might be the benchmark, but it seems strange that a cherry-picked benchmark touting Chrome as faster would still show Opera as fastest. 13:10
13:10 orafu left, orafu joined
patrickas It's not really strange if opera is actually fastest 13:11
13:12 synth joined
[Coke] moritz_: this is unusably slow. 13:12
ah well.
frettled It's annoying that rt.perl.org, pause etc. use invalid certificates. :( 13:13
moritz_ yosefk.com/c++fqa/ 13:14
13:14 Psyche^ joined
frettled Heh, nice, "frequently questioned answers". 13:14
13:14 Psyche^ is now known as Patterner
[Coke] frettled: FSOV invalid, yah. 13:14
patrickas frettled: It seems the tests were run by computerworld so they were not necessarly cherry picked to claim Chrome is fatest 13:15
[Coke] but certs ain't free, and rt and pause web interface are not really external interfaces.
s/certs/certs signed by the big guys/
frettled [Coke]: StartCom.
masak about some C++ templates: "don't read this, it's impossible. just count the lines" -- yosefk.com/c++fqa/defective.html 13:16
lovely.
frettled patrickas: With Confuserworld, you'd imagine the deck to be stacked for MSIE ;)
moritz_ masak: wow, that example is harmless, compared to error messages I got with C++ 13:18
[Coke] frettled: those are still $$.
I'm not saying it's expensive, but for a non-user-facing site, what's the poitn?
masak moritz_: I think that's not an error message -- that's code. :/
[Coke] (also, I am not a perl.org admin.)
moritz_ masak: right 13:19
frettled [Coke]: PAUSE is user-facing. 13:20
And even non-users may not be allowed to install third-party CA certificates. 13:21
[Coke] PAUSE is CPAN AUTHORs, neh? 13:24
in any case, I have no influence on Robert and Ask in this area. 13:25
(and pause is not them, anyway, they're RT etc.)
13:26 Italian_Plumber left
frettled This may be a strange notion, but CPAN authors are users. 13:26
13:26 Holy_Cow joined
frettled I'll stop harping now :) 13:26
13:32 sftp left 13:33 sftp joined 13:34 icwiener joined 13:35 JimmyZ left 13:40 Kodi left 13:43 javs left, Italian_Plumber joined 13:49 Axius joined 13:55 hudnix joined 13:56 javs joined 13:58 agentzh left
masak buubot: eval END { print "OH HAI\n" }; die "oh noes" 14:02
buubot masak: ERROR: oh noes at (eval 40) line 1. OH HAI
masak rakudo: END { say "OH HAI" }; die "oh noes"
14:02 uniejo left
p6eval rakudo ea77cc: OUTPUT«oh noes␤ in main program body at line 22:/tmp/FgUuXM3aoF␤» 14:02
masak consults S04
no mention. 14:03
masak submits rakudobug
14:04 Italian_Plumber left, sftp_ joined, sftp left 14:12 mfollett joined, patspam joined, [particle] left 14:17 risou joined
masak "Adding type-checking to Perl would be like making a hot fudge sundae with mashed potatoes instead of ice cream and with gravy instead of fudge. It might be perfectly edible, but it wouldn't be a hot fudge sundae." -- mjd, perl.plover.com/classes/typing/notes.html 14:19
14:20 amkrankruleuen left
moritz_ soemtimes wants to eat something that's not hot fudge sundae :-) 14:20
14:20 alester joined, amkrankruleuen joined
jnthn decommutes 14:21
rhebus gah, that slide is wrong is so many ways 14:22
oh wait, he's talking about *compile-time* type checking 14:23
masak aye.
rhebus which i guess makes it a reasonable point
masak he's basically saying that Perl will never be ML. 14:24
moritz_ that's something I can easily agree with
rhebus but if they breed correctly, they might have a common descendent :)
14:24 foodoo left
moritz_ haskell and ML are kinda extremists 14:25
which is fine for some, and not for others; perl traditionally fills a different niche 14:27
mathw quite
I happen to rather like strong typing myself
but I appreciate Perl's flexibility in that
rhebus i took an evening to try to learn some erlang a week back 14:28
it seems similarly extreme
PerlJam Perl 6 is leaking into Haskell's niche quite well I think :)
mathw even a strongly-typed system can be more fun if you can do type-related decisions at runtime
PerlJam s/Haskell/FP/ really
mathw Well kind of 14:29
rhebus hmm, i can't think of many languages I'd describe as dynamically-typed functional languages
mathw Perl 6 lets you do a lot more FP-type stuff
moritz_ PerlJam: it enables many FP features, but I haven't seen any empirical signs that Haskell programmers migrate to P6 :-)
mathw but Haskell is relentlessly, totally functional
also relentlessly, totally lazy
which Perl 6 most definitely isn't
PerlJam P5 had FP tendencies, and P6 more so. 14:30
mathw Perl 6 is a happy place where paradigms meet
unlike C++, which is a dusty place full of razor-sharp rocks where paradigms meet when they're feeling depressed
PerlJam s/had/has/ # don't want to accidentally write the obit just yet ;-)
Perl 6 is the paradigm bar? They drink beer and sing karaoke? 14:31
rhebus non-pure-functional languages are basically going through the pockets of functional languages for useful features 14:32
moritz_ PerlJam: that's a nice metaphor
14:32 alester left
rhebus even C++0x is getting lambdas 14:32
PerlJam rhebus: Perl has a long history of stealing good ideas, it's just that other languages have stolen *that* idea ;)
rhebus :)
I think English got there first on the whole stealing foreign features thing :) 14:33
PerlJam rhebus: true.
moritz_ PerlJam: we should have got a business pattern patent on stealing features from other programming languages
:-)
masak It's hard to make a good language without stealing lambdas. *cough* Java *cough*
rhebus i really like the fact that the word "trousers" comes from scots gaelic... from a people known for *not* wearing trousers 14:34
java doesn't have lambdas? »ö«
masak rhebus: it's a reverse Sapir-Worf effect
mathw rhebus: C++ with lambdas is going to save my sanity when I finally get to use it at work
and no, Java doesn't have lambdas 14:35
they use instances of anonymous subclasses instead
not fun
masak :(
mathw I believe it's about the most commonly requested feature addition for Java 7
whenever that might or might not happen
rhebus even C++ has boost::lambda, which is an ugly bugger but does the job
mathw yeah... kind of :)
real lambdas will be much nicer though
first time I saw boost::lambda my jaw hit the floor 14:36
rhebus wasn't there a big lambda hoo-ha in python as well?
mathw I had no conception you could do anything like that
moritz_ Mathematica has #^2& for * ** 2 or -> $x { $x ** 2}
rhebus mathw: mine too
mathw but operator overloading gets you a lot :)
as does abuse of the template system
c.f. boost::mpl
rhebus yes
and boost::spirit
moritz_ just the resulting error messages are... !fun
mathw oh yeah spirit's impressive
the error messages are... entertaining 14:37
sometimes Sun C++ comes up with some real crackers
rhebus yeah, spirit's impressive alright
mathw which could almost be better written as "main.cpp:45 DO NOT WANT"
rhebus but when i had to implement a parser for a job, i still just went recdescent
mathw I have no idea what the runtime performance of a Spirit parser is 14:38
rhebus mathw: that's just a symptom of templates in general D:
mathw Perl 6 still wins in parser land
moritz_ points people to maddingue.free.fr/conferences/bpw-2...rise-perl/
mathw don't care about the performance yet
but the syntax is sublime
rhebus mmm, delicious stack traces 14:39
Maddingue ^^
masak as long as END is executed after them... :)
rhebus wow these slides are entertaining
14:40 pkkm left
Maddingue thanks 14:41
14:41 alester joined
rhebus i especially like U+1F4A9 14:41
moritz_ enjoyed the lightning talk at YAPC::EU; it was one of the few that had no problem keeping their time limit :-)
Maddingue the most funny thing, which I didn't say and isn't noted here is that the Møøse traces are just.. warnings 14:42
more than 200 lines of warnings
but the code still works
14:43 snearch joined
rhebus why do the warnings produce traces? that's retarded 14:43
Maddingue I could say "that's Møøse", but that would be very mean. it's probably a setting somewhere that does this, but the end result is the same 14:44
14:44 Guest23195 left 14:45 [particle] joined 14:46 Axius left
arnsholt Is there a simple way to call a parent class's method in NQP/PIR? 14:46
14:46 Axius joined
arnsholt (Where I've overridden the method in my class) 14:46
moritz_ arnsholt: I think you need pir::find_method 14:47
with the explicit parent class
arnsholt Right. Thanks
14:49 Axius left, wtw left, Axius joined 14:51 masak left 14:52 ash_ joined, pkkm joined
ash_ ping moritz_ 14:52
14:54 silug left
moritz_ ash_: pong 14:57
ash_ just wanted to let you know, i updated the backend to try.rakudo.org
14:58 Axius left
moritz_ \o/ 14:58
ash_++
14:58 Axius joined
mfollett ash_++ 15:00
I didn't know that existed, but I'm happy that it does!
Where is that linked from though on the rakudo or perl6 site? 15:01
moritz_ nowhere yet
it wasn't working properly before
fsvo "properly" :-)
ash_ try.rakudo.org/?input=say%20~(1,%203%20...%207) 15:02
if you wana see it
moritz_ and it's surprisingly fast, once you have started the session 15:03
mfollett yeah, that is awesome
ash_ ya, i noticed that server is a LOT faster than my test server
it used to take 1~2 seconds to start a session, now you almost don't notice it starting 15:04
moritz_ ash_: will you blog about it? 15:05
ash_ rakudo: say [\,] 1...3 # what do \, mean here?
p6eval rakudo ea77cc: OUTPUT«11 21 2 3␤»
moritz_ rakudo: say ~[\~] 1..5
p6eval rakudo ea77cc: OUTPUT«1 12 123 1234 12345␤»
ash_ umm good point moritz_ ya, i'll prepare a little something about it
moritz_ the [
ash_ that one looks more sane, not sure i understand \, 15:06
moritz_ the [\ ] is the "triangle reduce"
ash_ h
ah
moritz_ rakudo: say ([\,] 1..5).perl
p6eval rakudo ea77cc: OUTPUT«(1, (1, 2), ((1, 2), 3), (((1, 2), 3), 4), ((((1, 2), 3), 4), 5))␤» 15:07
moritz_ maybe it should flatten... not sure :-)
TimToady I think list associative ops should probably remove the extra parcel 15:08
phenny TimToady: 08:58Z <sorear> tell TimToady I need a parameter type which takes 0-infinity arguments, does NOT flatten, and puts them all into scalar context in a Seq or List
tadzik ash_: well, I'm afraid something's fscked :(
moritz_ arnsholt: re github.com/perl6/nqp-rx/issues#issue/7, a reasonable workaround is to add a :returns('Typename')
tadzik ash_: say 5 / 2, then say 2 + 19
it prints 2.5 twice, like in good^Wold times 15:09
ash_ tadzik: try rand twice in a row 15:10
TimToady sorear: that's what a **@slice is supposed to do, I think
ash_ tadzik: are you getting multiple lines each time you enter rand? 15:11
it might be a caching issue, if your browser has the old javascript file then something could be wrong, but i am not sure i am getting the same result as you are 15:12
moritz_ doesn't see any signs of re-evaluation 15:13
Sec ash_: works fine for me.
15:17 justatheory joined
Sec rakudo: say &say.signature 15:24
p6eval rakudo ea77cc: OUTPUT«get_attr_str() not implemented in class 'Perl6MultiSub'␤ in main program body at line 1␤»
ash_ lol, i just realized i didn't take out the chapter commands in the try site, if you type "chapter 1" it tries to load it, but fails, so it just clears the screen and puts up the help
rakudo: say &infix:<+>.signature 15:25
p6eval rakudo ea77cc: OUTPUT«get_attr_str() not implemented in class 'Perl6MultiSub'␤ in main program body at line 1␤»
ash_ that might be a bug on all mutli's
maybe?
rakudo: say &infix:<+>.^methods(:local)
p6eval rakudo ea77cc: OUTPUT«namemulticandidates␤»
15:40 silug joined, Axius left
tadzik ash_: works fine after hard refresh, I thought I did it before, pardon 15:41
15:43 Guest23195 joined
arnsholt moritz_: I've tried adding :returns('Float') but it doesn't seem to make a difference 15:43
Not sure why, but from what pmichaud said, I think this is more of a PCT issue than an NQP issue 15:44
pmichaud it's a PCT bug.
TimToady smash: I moved your beadsort to the right place in alphabetical order 15:48
15:57 Ross joined
jnthn TimToady: What would be the output of: 15:59
proto x($) { {*} }
multi x($x) { 1 }
my $c; { multi x(Int $x) { 2 }; $c = &x }
say $c(42);
TimToady I would expect 2 16:00
jnthn OK
moritz_ 2
jnthn So what *is* &x?
(I expected it too. It just nicel
TimToady the candidate list for that scope
jnthn y lets me get at what I want to ask. :-)) 16:01
OK, so it's not the proto?
It's "something else"?
TimToady maybe the proto curried with the current scope
jnthn If so, what should that something else look like?
OK
So in that case protos all have an implicit "curry me with a candy list" parameter?
TimToady or the dispatcher that proto calls curried with the scope 16:02
TimToady waves his hands vaguely
jnthn :P
Put another way, is there ever a circumstance where &x really means "give me the proto"? Or is it always "give me a curried proto"? 16:03
That is, we never see the proto in its naked uncurried form.
Currying the proto did occur to me as a solution, fwiw.
TimToady I'm a bit uncomfy with that 16:04
jnthn So was I
But I've been uncomfy with every other solution so far too... :-S
Still hunting for something that feels right.
moritz_ can't resist.... "it's lexical all the way down!"
jnthn :P
TimToady I guess it could get the info from CALLER instead of by currying
jnthn Looking at the CALLER is what I've done in 6model before I went off on vacation but I realized it's really fragile. 16:05
TimToady hmm, that doesn't work for &x though
jnthn Well, that for one.
It's also off-by-one when you inline
And if you wrap the proto then heck knows what the caller is.
16:06 ash_ left
TimToady perhaps it's kind of a generic function that clones itself when put into a lower scope 16:06
you can get the original by making sure you look for &x in the right scope
jnthn What is "the original" though? In the example above, I have candidates at the same level as the proto, for example.
I can go with something clone-y though in general. 16:07
Does it sound wrongish that we'd install something different for &x in each scope that declares some new multi candidates?
TimToady it might be deep magic; not sure how it would look at the surface
jnthn (each inner scope, that is, given a proto somewhere to the outer) 16:08
TimToady it doesn't sound wrongish to me
jnthn What about in the inheritance situation?
Same answer?
TimToady don't see any difference there, offhand
jnthn That is, the methods table has something in it if the class declares some multis at all?
TimToady you have to make sure there isn't an explicit one there already
in either case
jnthn It's just that it incorporates all the candidates up the tree?
Sure, I'm just thinking that it looks different from an introspection POV perhaps. 16:09
TimToady yes
jnthn But if you're comfortable with the &x in the lexpad and the m in the method table having something specialized for the "most derived" case, then I can probably come up with something workable in that space.
I've been having a really hard time coming up with a design where we stash some state and then go look for the proto, or have it work out the two scopes between which it's looking for candidates. 16:10
TimToady I see it as closely related to the shadow alias I install to detect my $x; { $x; my $x }
std: my $x; { $x; my $x }
p6eval std 32123: OUTPUT«===SORRY!===␤Lexical symbol '$x' is already bound to an outer symbol (see line 1);␤ the implicit outer binding at line 1 must be rewritten as OUTER::<$x>␤ before you can unambiguously declare a new '$x' in this scope at /tmp/vaunigtF3T line 1:␤------> my
..$x…
jnthn Aye, though this is an effect that would live on until runtime too
TimToady well, I really do install the alias in the lexpad there 16:11
jnthn Oh, OK :-)
TimToady it's just marked as not real
jnthn *nod*
TimToady the lexinfo, not necessary the lexpad
I still get those terms tangled
jnthn I've been trying to talk about them as "static" vs "dynamic" lexpad. 16:12
smash TimToady: ups, thank you
jnthn In 6model I have the dynamic lexpad being a kind of "instantiation" of the static one. It has all the stuff the static one has, and all the slots allocated.
[Coke] my $x = 3; say $ x; 16:13
rakudo: my $x = 3; say $ x;
p6eval rakudo ea77cc: OUTPUT«===SORRY!===␤Non-declarative sigil is missing its name at line 22, near "$ x;"␤»
[Coke] moritz_++
TimToady p5 does it in sync that way too
moritz_ that's not always a sign of sanity :-)
16:13 patspam left
TimToady otoh the static lexpad could just store int offsets in the dynamic pad 16:14
jnthn Oh, the name -> indexes mapping I always share
All that we really allocate for the a dynamic lexpad is an array of slots
16:14 patspam joined 16:15 stepnem left
TimToady if the static lexpad is really a hash, then you can have extra things there that don't allocate a slot 16:15
jnthn In 6model I've even got parameter binding being done into the slots by array index rather than the name lookup we do in Rakudo at the moment. :-)
Well, true
At the moment I just have a "oh btw extend this lexpad with more slots" method.
TimToady slot binding sounds efficient 16:16
jnthn Since the hash is expandable
Yes, the slot binding gave me a big win.
I need to see if Parrot can learn all of these tricks.
TimToady Unfortunately, most parrots aren't as smart as Alex (RIP)
jnthn :-(
TimToady if the Lorito core turns out well, perhaps the VM should be called Alex :) 16:17
jnthn :-)
Think on the train today I figured out a decent-ish design for a multi-dispatch cache too, that can handle :D and :U efficiently. 16:18
Sec rakudo: my @a=<a a a a a>;my @b=<b b b b b>;for (@a Z @b Z @a) -> $a, $b, $c {say "$a $b $c"} 16:19
p6eval rakudo ea77cc: OUTPUT«No applicable candidates found to dispatch to for 'infix:<Z>'. Available candidates are:␤:()␤:(Any $lhs, Any $rhs)␤␤ in main program body at line 22:/tmp/AwPfCoUswW␤»
16:19 stepnem joined
Sec shouldn't that 'just work'? 16:19
TimToady rakudo doesn't do list associative listops yet 16:20
rakudo: my @a=<a a a a a>;my @b=<b b b b b>;for (@a Z @b) Z @a -> $a, $b, $c {say "$a $b $c"} 16:21
p6eval rakudo ea77cc: OUTPUT«a a b␤a a a␤b a a␤Not enough positional parameters passed; got 1 but expected 3␤ in <anon> at line 2:/tmp/VBA9t093Zk␤ in main program body at line 1␤»
16:21 justatheory left
TimToady rakudo: my @a=<a a a a a>;my @b=<b b b b b>;for ((@a Z @b) Z @a).flat -> $a, $b, $c {say "$a $b $c"} 16:22
p6eval rakudo ea77cc: OUTPUT«a a b␤a a a␤b a a␤Not enough positional parameters passed; got 1 but expected 3␤ in <anon> at line 2:/tmp/IsFYr1Uoxd␤ in main program body at line 1␤»
Sec rakudo: my @a=<a a a>;my @b=<b b b>;for ((@a Z @b) Z @a) -> $a, $b, $c {say "$a $b $c"} 16:23
p6eval rakudo ea77cc: OUTPUT«a a b␤a a a␤»
TimToady that ain't right 16:24
Sec thats what I expect when using ()s, but I wanted to have (a,b,a,a,b,a)
TimToady the parens should disappear in for's list context, in any case
quite apart from whether Z does list assoc correctly 16:25
Sec well, a Z b is (a,b,a,b...) and Z that with (a,a,a) you get (a,a,b,a,a,a,b,a ...)
TimToady your outer parens are useless though
jnthn TimToady: Anyways, thanks for the answers. I'll have a crack at getting something working. :-)
TimToady oh, wait, Z is list context on the left, so flattens 16:26
that's what's going on 16:27
16:28 risou left
TimToady rakudo: my @a=<a a a>;my @b=<b b b>;for (@a »,« @b) »,« @a -> $a, $b, $c {say "$a $b $c"} 16:28
p6eval rakudo ea77cc: OUTPUT«Sorry, sides are of uneven length and not dwimmy.␤ in 'hyper' at line 179:CORE.setting␤ in main program body at line 1␤»
TimToady that looks like a bug
rakudo: my @a=<a a a>;my @b=<b b b>;for @a »,« @b »,« @a -> $a, $b, $c {say "$a $b $c"} 16:29
p6eval rakudo ea77cc: OUTPUT«No applicable candidates found to dispatch to for 'hyper'. Available candidates are:␤:(&op, @lhs, @rhs, Any :dwim-left($dwim-left), Any :dwim-right($dwim-right))␤:(&op, %lhs, %rhs, Any :dwim-left($dwim-left), Any :dwim-right($dwim-right))␤:(&op, %arg)␤:(&op, @arg)␤:(&op, %lhs,
..Any …
TimToady list assoc doesn't work there yet either
rakudo: my @a=<a a a>;my @b=<b b b>;for zip(@a;@b;@a) -> $a, $b, $c {say "$a $b $c"} 16:30
p6eval rakudo ea77cc: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 22␤»
TimToady pugs: my @a=<a a a>;my @b=<b b b>;for zip(@a;@b;@a) -> $a, $b, $c {say "$a $b $c"} 16:31
moritz_ doesn't like ; in lists yet
p6eval pugs: OUTPUT«a b a a b a a b a␤»
TimToady pugs is still better at some things :)
moritz_ you do notice that pugs' output has only one \n?
pugs: my @a=<a a a>;my @b=<b b b>; say zip(@a;@b;@a).perl 16:32
p6eval pugs: OUTPUT«(("a", "b", "a"), ("a", "b", "a"), ("a", "b", "a"))␤»
TimToady innerestin'
moritz_ it gets the slices/lists right, but doesn't flatten on sig binding
TimToady for's sig is what should flatten
not the ->'s
moritz_ right 16:33
TimToady nobody has done slicing according to spec yet :/
moritz_ nobody has specced slicing and laziness according to sanity yet :-) 16:34
Sec and here I was, expecting this to be a simple example to try %) 16:35
TimToady patrickas: as far as I can see, *all* the parens in your tic-tac-toe examples are not really necessary, not to say superstitious. :)
would be, if Z worked right 16:36
or for's list flattening
16:37 lichtkind joined
TimToady patrickas: nice tutorial though 16:39
masak++ for not using parens though :) 16:40
16:40 cjk101010 left
lichtkind which tutorial? 16:42
16:44 macroron left
moritz_ lichtkind: www.reddit.com/r/programming/commen...lly_games/ look for a comment from patrickas++ 16:46
lichtkind thanks 16:47
rhebus patrickas++ # very nice 16:48
lichtkind rakudo error messages++ 16:50
TimToady I think each() is a variant of all() that promises to do things in order, and perhaps more importanly, responds as a Positional/Iterable 16:52
and therefore autothreads the values when in a list context 16:53
oh, and returns the values in question, not the boolean results 16:54
lichtkind OMGNOEZ perl tablets are lacking each
TimToady nobody implements it yet
say each(@array) ~~ $match 16:55
would be equivalent to
grep $match, @array
16:55 dakkar left, cdarroch joined, cdarroch left, cdarroch joined
arnsholt :q 16:56
hugme hugs arnsholt, good vi(m) user!
arnsholt Er, whoops
TimToady say 1 < each(@array) < 10 # only report elements in that range
patrickas TimToady: EBRAINCURRUPTEDBYPERL5 16:57
TimToady apologizes profusely
and sometimes confusely 16:58
16:58 Chillance joined
TimToady it's just a little hot button that, when comparing with python, we need to show that Perl 6 looks clean too 16:59
17:00 envi^home left, tylercurtis joined
patrickas Removed parens form the post :-) 17:04
TimToady oh, you can do that? cool
hmm, they still show up here, must be cached somehow 17:05
oh, down at the end, I see it 17:06
patrickas I Could remove them from second step and below if you feel it is better that way 17:07
TimToady you could use $^player and @^lines if you reversed the X 17:08
patrickas yes but I thought that I would either need to explain it, or risk misleading people 17:09
TimToady but your last point seems to imply that you must lose the names, and that ain't so
it's just you have to worry about alphabetical order
alternately pick different names 17:11
17:11 Italian_Plumber joined 17:12 sftp_ left
patrickas I prefer explicitly naming the variable *instead of being constrained to find names that would match alphabetical order* 17:12
17:12 sftp_ joined, javs left
patrickas Actually I am fully aware that my preference is only coming from probably unjustified fear 17:12
TimToady but those names are explicit too, but I'm just haggling over words
I'd probably stick with -> my own self too 17:13
17:14 rgrau_ joined, thebird left
TimToady anyway, thatnks 17:16
TimToady is starting to talk like Owl
patrickas rakudo: say 1..* ... 5 17:18
p6eval rakudo ea77cc: OUTPUT«(timeout)»
17:19 snearch left
colomon patrickas: we need to make that one work. :) 17:19
unless your patch already did it?
patrickas yea I am working on it right now ... but totally messed up series locally though i am testing with p6eval while waiting for a recompile
TimToady gee, where did you get that one? :)
that's...sick 17:20
colomon TimToady: nah, it's lovely.
:)
I mean, like that it's terrible.
TimToady the two are not mutually exclusive to a goth
colomon Is that Visi- or Ostro-? 17:21
TimToady that's -ic Horror
colomon anyway, it actually makes sense in some contexts. came up on my blog in a comment the other day.
17:21 sekimura joined, ruoso left
TimToady hmm, didn't see that 17:22
+1 for independent discovery and all that
colomon basically it's a simple form of take-until which is actually supported by the spec (if not rakudo yet)
TimToady I presume you guys saw the series refactor in S03 last night?
patrickas TimToady: Wish we hadn't :-) 17:23
colomon so if you said my @fib := 1, 1, *+* ... *; you can later say @fib ... * > 900 to get the beginning of the list, with a limit.
patrickas colomon: That's the example right below it in the spec 17:24
colomon TimToady: I've already groused about it. but honestly, the new version is so clearly superior that it's just the pain of trying to get the old version to work that makes me miss it.
pmichaud ...series refactor? 17:25
pmichaud didn't see it.
colomon series is a lot simpler now.
pmichaud I keep wanting perl6/specs to be perl6/spec :-|
colomon except for some weird stuff that snuck in there about generating series of numbers in string form in arbitrary bases. (evil glare at TimToady) 17:26
pmichaud TimToady: I don't understand rvalue vs. lvalue on subscripts in S09 (more)
17:26 javs joined
pmichaud ...how is postcircumfix:<[ ]> to know it's being used in an lvalue context? doesn't that get back to the "want" issue? 17:26
17:29 ashleydev left, ashleydev joined
TimToady I suspect behaves as an lvalue only when it knows it's on the left side of =, or knows it's being passed to a function with a rw argument, and assumes rvalue otherwise 17:30
s/passed to a function/bound to a parameter/
so method args would always assume rvalue, since those can't be known statically
jnthn So
sub foo($x is rw) { $x = 42 }; my @a = 1,2,3; foo(@a[1]) # fails? 17:31
TimToady no, why would it?
jnthn Well, if the args assumed rvalue... 17:32
I suspect I'm missing the point here though. :-)
pmichaud jnthn: method args
TimToady that foo is known lexically
jnthn pmichaud: ah, ok
pmichaud in that case, we know 'foo' at compile time, so we can see that it has an rw argument and tell postcircumfix:<[ ]> to generate something different
jnthn OK, but are we saying that it would work but not 17:33
my $x = sub ($x is rw) { $x = 42 }; my @a = 1,2,3; $x(@a[1])
TimToady I can take or leave that one, but @foo[1..10] = 0 xx *; oughta work
17:33 jedai left
pmichaud TimToady: sure, I have no problem with that -- lvalues are the easy case 17:33
colomon patrickas: geez, you're right, TimToady++ used that exact example in the spec. I should have read it more carefully this morning! :)
pmichaud it's trimming in the case of rvalues that is tougher
TimToady maybe something can be done lazily 17:34
pmichaud in particular, if I have
17:34 mberends joined
colomon patrickas: 1..* ... * >= $lim is so horrible I never imagined it could have been used, other than as a test... ;) 17:34
patrickas colomon: I guess great /twisted minds do think alike!
17:34 jedai joined, yrgd joined
pmichaud my @b = <a b c>; say @b[3..5].elems 17:35
how many elems?
sorry
wait
my @b = <a b c>; say @b[2..5].elems
TimToady well, if one says that the limit applies to all the values on the left, it's not a big stretch to say that "all" could be infinite
one, I'd think 17:36
pmichaud because @b[2..5] is in rvalue context?
or, more precisely, because it's not in lvalue context?
TimToady because it's not lvalue context ;)
yup
pmichaud and same for
my @b = <a b c>; say @b[2,3,4,5].elems 17:37
?
TimToady that would be different according to current spec, which assume the subscript can ask "am I in a range now?"
pmichaud okay
and how about
my @b = <a b c>; say @b[2.,.5].elems 17:38
?
oops
typo
17:38 sekimura_ joined
pmichaud my @b = <a b c>; say @b[2...5].elems 17:38
TimToady spec sez "range or series"
pmichaud is series a standard type, now?
(I haven't read the updated series spec)
TimToady perhaps "in an iterator, and it's the last one in the list" is more like 17:39
pmichaud 2...5 isn't an iterator, it's a list. 17:40
TimToady so presumably @foo[@bar] could also truncate
pmichaud (in current implementation)
17:40 sekimura left
pmichaud so, @foo[2,3,4,5] doesn't truncate, but @bar = 2..5; @foo[@bar] does? 17:40
TimToady there's likely something they all have in common; someone should write a program to find it. :)
17:40 sekimura_ left 17:41 justatheory joined, sekimura joined
TimToady there's perhaps some introspective call on a list that asks if it's going handwavey at the end 17:41
patrickas can the lhs contain any closure at all except in the last element ? 17:42
pmichaud okay, so then @b[2..5] doesn't truncate? because ranges don't strike me as handwavey :)
and knowing handwavey-ness from map/gather/etc. seems to be a challenge too. 17:43
TimToady I think it wants to, because I wanted it in rosettacode.org/wiki/Top_rank_per_group#Perl_6 17:44
I'd like .[^$n] to give me the first $n, or however many there are, if fewer
pmichaud but we'd also like .[^$n] = 0..* to work also? 17:45
TimToady well, that's why I was proposing the final ,* the other day, for when it's not clearly handwavey
pmichaud (i.e., filling $n elements regardless of the original size of the array?)
TimToady yes, hence the lvalue criterion
pmichaud I'd be very happy to say that .[^$n,*] truncates and [^$n] doesn't
(regardless of lvalue/rvalue ness) 17:46
17:47 plainhao joined
pmichaud i.e., @a[^$n,*] = 0 xx *; would clear up to the first $n elements of @a without extending it 17:47
TimToady that might be okay, need to think about other use cases though
sorear good * #perl6 17:48
pmichaud and @a[^$n] would always return $n elements, while @a[^$n,*] would return up-to $n elements
patrickas TimToady: Do you think we should allow the lhs to contain any closure at all except in the last element ? 17:49
TimToady not sure, which is why I put "next" in the spec :)
it's not clear how one escapes from one closure to continue the list 17:50
return Nil maybe
but that might make it harder to optimize
if we're always testing for that in the loop
next doesn't seem quite right, it'd just call the closure again, seems 17:51
it's almost like we want to rebind the caller's &generator 17:52
or undef it
there's probably a way to make it work, once we have the sticky generator implementation down 17:53
patrickas ok
TimToady but it's not an easy question to answer, which is why I fudged the spec
patrickas :-)
when in doubt torment the implementator 17:54
TimToady and what if the generator returns a generator? :)
17:54 proller left
colomon what if you're generating a series of closures? :) 17:55
TimToady maybe there's some highfalutin' tailcallish solution
colomon: there is that
patrickas colomon: In that case is the last closure just another element or a way telling us how to generate more closures? 17:56
TimToady that's more or less how LazyMap is implemented in STD's Cursors
colomon last closure is a way telling us how to generate more closures.
after all, you can't really use .succ on a closure, can you?
TimToady we don't call an intuited function when there's an explicit one 17:57
and an explicit one can certainly have some way of generating one closure from another
17:58 Axius joined
TimToady mind you, this is probably a gigantic space leak somehow 17:58
which can only be solved by proper application of the the proper set of monads with the proper lift semantics :) 17:59
.dedup
colomon rakudo: my @a := -> $a { 0 }, -> $a { $a + 1 }, -> &closure { -> $a { &closure($a + 1) } } ... *; say @a[^5].perl
p6eval rakudo ea77cc: OUTPUT«({ ... }, undef, undef, undef, undef)␤»
moritz_ undef?
TimToady parrot type? 18:00
s/type/value/?
tylercurtis rakudo: say Failure.new.perl
pmichaud I have no idea where those undefs are coming from.
p6eval rakudo ea77cc: OUTPUT«too few positional arguments: 1 passed, 2 (or more) expected␤ in main program body at line 1␤»
pmichaud must be fossil code.
tylercurtis rakudo: say (fail "foo").perl
p6eval rakudo ea77cc: ( no output ) 18:01
moritz_ src/builtins/Exception.pir line 93
colomon rakudo: my @a := -> { 0 }, -> { 1 }, -> &closure { -> { &closure() + 1 } } ... *; say @a[^5].perl
p6eval rakudo ea77cc: OUTPUT«({ ... }, undef, undef, undef, undef)␤»
TimToady patrickas: now see what you've started! 18:02
patrickas TimToady: Sorry :-( 18:03
colomon rakudo: my @a := -> { 0 }, -> { 1 }, -> &closure { -> { &closure() + 1 } } ... *; say @a[^5]>>.() 18:05
p6eval rakudo ea77cc: OUTPUT«Tried to find null name␤ in main program body at line 22:/tmp/4QHOR9P7DC␤»
colomon ... precedence issue?
pmichaud yes 18:06
colomon rakudo: my @a := (-> { 0 }), (-> { 1 }), -> &closure { -> { &closure() + 1 } } ... *; say @a[^5].perl
pmichaud := still is doing item assignment
p6eval rakudo ea77cc: OUTPUT«({ ... }, undef, undef, undef, undef)␤»
colomon oh!
rakudo: my @a := (-> { 0 }, -> { 1 }, -> &closure { -> { &closure() + 1 } } ... *); say @a[^5]>>.()
p6eval rakudo ea77cc: OUTPUT«Tried to find null name␤ in main program body at line 22:/tmp/VPhIFkDtuo␤»
colomon rakudo: my @a := (-> { 0 }, -> { 1 }, -> &closure { -> { &closure() + 1 } } ... *); say @a[^5].perl
p6eval rakudo ea77cc: OUTPUT«({ ... }, { ... }, { ... }, { ... }, { ... })␤»
colomon there we go.
pmichaud I have a fix for that now in nqp, but I can't move it into Rakudo until we find the Parrot bug that is causing build failures under 64-bit systems 18:07
colomon rakudo: my @a := (-> { 0 }, -> { 1 }, -> &closure { -> { &closure() + 1 } } ... *); for @a[^5] -> &a { say &a(); }
p6eval rakudo ea77cc: OUTPUT«0␤1␤2␤3␤4␤»
pmichaud *ding*
TimToady: in the series operator, do all of the values on the lhs honor the limit value on the rhs? 18:08
for example, if I write 1, 2, 3, 4, 5 ... 3
do I get 1, 2, 3 as the result?
TimToady yes
pmichaud and 1, 2, 3, 5, 7 ... 2 stops at the 2?
TimToady yes 18:09
pmichaud +1
excellent
TimToady however, I still think 1,2,3,4,5 ... 1..* ... 3 ==> 1,2,3,4,5,1,2,3
patrickas pmichaud: That part did not change and is already implemented
TimToady that is, each limit applies only to the term between ...s 18:10
hmm, waitaminnit
18:10 xinming left
patrickas TimToady: But .. but ... 18:10
pmichaud as I read it, that would be 1,2,3 18:11
TimToady the middle limit should apply left too
yes
however, I still think 1,2,3,4,5 ... 6..* ... 3 ==> 1,2,3,4,5,6..*
pmichaud I would expect 1,2,3,4,5,6 18:12
TimToady the 3 applies only to the 6..* and the 6 applies only to the 1..5
pmichaud right
so no ..* at the end
because 7 > 3
TimToady no implicit inequality tests anymore
we talked about that the other day
and you liked it then 18:13
only exact match stops it
PerlJam ... is right assoc?
pmichaud PerlJam: list assoc
TimToady it's in a funny order
pmichaud TimToady: I don't think I was thinking strictly equality test for the part I liked
PerlJam well, I just don't understand that last example.
TimToady it has to go right to left on first value of each list
to find the limit
but then the rest are produced left to right 18:14
pmichaud so, 1, 1.3, 1.6 ... 3 never terminates?
colomon pmichaud: right.
TimToady correct
rhebus there was someone in here the other day who found that { 2,3,*+2 ... sqrt $n } failed to terminate for $n < 4...
pmichaud and the way to get it to terminate is 1, 1.3, 1.6 ... * > 3
okay, I remember now, and I can live with that.
colomon rhebus: that's already fixed. though the new spec makes it not work.
rhebus yes, we discovered it failed as designed 18:15
TimToady hangs head
rhebus and indeed it's not obvious how to make it work without breaking other cases
pmichaud rhebus: it's now 2, 3, *+2 ... * > sqrt $n
TimToady yes, we wanted contradictory dwimmery
rhebus example from rosettacode.org/wiki/Primality_by_t...ion#Perl_6 18:16
PerlJam looks like I'm going to have to read the spec again
rhebus (seeing the eidt history, i see TimToady is well aware of all this)
PerlJam when there's a closure, it terminates when it evaluates true?
pmichaud PerlJam: yes.
patrickas colomon: 2,3,*+2 ... sqrt $n was not (and I think cannot be fixed)
pmichaud "up to this condition"
18:16 rainerschuster joined
tylercurtis is beginning to regret using MooseX::Declare for the Perl 5 bits of Bennu. 18:17
colomon patrickas: are you sure? I thought your patch fixed that one.
TimToady under the old semantics
patrickas no my patch fixes : 2,3,5,7 ... sqrt $n
TimToady sqrt $n is unlikely to be an exact match anymore
patrickas when the last element is a closure I could not work any magic to figure out if it will hit the limit or not 18:18
TimToady sqrt($n).ceiling +| 1 might work though
18:18 timbunce_ left
colomon TimToady: right. but I thought there was a brief window here were it would work -- until we fixed the code to match the spec. 18:18
PerlJam the terminating condition is always straight equality (modulo closures)
TimToady s/equality/smartmatch/
no need to modulo closures anymore
PerlJam ah
of course
okay. makes sense now :-) 18:19
TimToady that was one of those DOH! moments
patrickas rakudo: say 2,3,5,7 ... 2.5
18:19 zby_ joined
p6eval rakudo ea77cc: OUTPUT«2␤» 18:19
18:19 Axius left, zby__ joined
patrickas rakudo: say 2,3,*+2 ... 2.5 18:19
shortcircuit What's the difference between rosettacode.org/wiki/Rakudo_Star and rosettacode.org/wiki/Rakudo ?
p6eval rakudo ea77cc: OUTPUT«2␤»
patrickas rakudo: say 2,3,*+2 ... 1 18:20
dalek p-rx: c83336f | pmichaud++ | src/cheats/hll-grammar.pir:
Add :sub<...> precedence for operator precedence parser (<EXPR>).
TimToady different "works with" entries?
p6eval rakudo ea77cc:
..OUTPUT«(timeout)151719212325272931333537394143454749515355575961636567697173757779818385878991939597991011031051071091111131151171191211231251271291311331351371391411431451471491511531551571591611631651671691711731751771791811831851871891911931951971992012032052072092112132152172192212232…
colomon well bother.
patrickas: have you made any progress at switching over the spectests to the new spec?
PerlJam shortcircuit: Rakudo is a compiler implementation of Perl 6. Rakudo Star is a Perl 6 distribution based on Rakudo that will have the Rakudo compiler and other stuff 18:21
patrickas colomon: I reached 1..* ... * >= $lim
shortcircuit TimToady: Yeah. The Rakudo Star one, I just created when I noticed the reference to Primality by trial division. Rakudo looks like it's linked to by 50-100 pages.
patrickas and drowned in a huge refactor
shortcircuit Hm.
colomon patrickas: and then we distracted you.
shortcircuit Anyone feel like maintaining those two pages? :) 18:22
colomon patrickas: I was figuring we'd get the spectests up to date first, and then dive into the coding.
TimToady some of the entries say "Rakudo Star" but have really only be tested against rakudo HEAD
* been
shortcircuit Well, these two pages might be of use, if anyone wants to verify them: rosettacode.org/wiki/Special:WhatLi...akudo_Star and rosettacode.org/mw/index.php?title=...;limit=100 18:23
shortcircuit goes back to work.
patrickas colomon: maybe that's a better idea ... it's just that I thought I'd at least try to wrap my head around the issues of making this work
insanity ensued. 18:24
colomon I figure it's always good to have a base of correct tests to work from. 18:25
patrickas I think I killed a coroutine
"Cannot resume dead coroutine" 18:26
colomon oh, man, hide the body quickly!
18:27 daxim left
patrickas colomon: I am adding one test at a time from the new spec and trying to make it pass, unfortunately that was the second test in the spec, So I got stuck, side tracked the channel and killed a coroutine :-) 18:28
18:29 sekimura_ joined 18:30 sekimura left 18:32 stepnem left
colomon okay, I'm claiming arity2ormore to fix 18:32
18:34 ruoso joined, stepnem joined
colomon pushed. now for some extraordinarily boring $work 18:37
patrickas: hmm, the $work code I'm looking at has a body_count. Just like you do... ;) 18:41
patrickas I am innocent! It was dead when I walked in! 18:43
18:44 hercynium joined 18:46 icwiener left 18:47 zby_ left, zby joined 18:51 timbunce joined 18:52 justatheory left 18:53 MarderIII joined 18:54 rgrau_ left 19:00 rgrau_ joined, javs left 19:01 timbunce left
patrickas rakudo: say (1,1,{ $^a + 1, $^b * 2 }...*).munch(5).perl; #Is that correct ? 19:01
p6eval rakudo ea77cc: OUTPUT«(1, 1, (2, 2), (2, 4), (3, 4))␤»
TimToady not according to spec 19:02
should be 1,1,2,2,3 19:03
it's a list context, so () should disappear
19:05 justatheory joined
patrickas ok so the third item should be 2 instead of (2,2) 19:05
even if $next is returning 2,2
19:16 javs joined
dalek kudo: 780732f | moritz++ | src/core/IO.pm:
make dir() default to the current directory
19:22
jnthn
.oO( We ever stole from MS DOS! )
19:23
19:24 Schwern joined 19:27 Italian_Plumber left 19:28 sekimura_ left 19:31 stepnem left 19:33 plainhao left, stepnem joined
rhebus From S32/Containers: "Set: A set of unique values. When used as a hash always treats the set's values as the keys of the hash, returning True for set elements. See KeySet for a container that can represent different sets as keys are added or deleted." <-- does this imply that a Set is immutable? 19:37
19:37 timbunce joined
rhebus and if it doesn't, what's the difference between a Set and a KeySet? 19:38
TimToady that would be why Set is listed in the Immutable section of S02 19:39
frettled has a mutable TV. 19:40
rhebus >_< of course
19:40 rschuster joined 19:41 rainerschuster left
rhebus rakudo: my @g = [Set.new(1,2),Set.new([1,2])]; @g.perl.say 19:41
p6eval rakudo ea77cc: OUTPUT«[[Set.new(1, 2), Set.new(1, 2)]]␤»
rhebus rakudo: my @g = [Set.new(1,2),Set.new([1,2],[2,1])]; @g.perl.say
p6eval rakudo ea77cc: OUTPUT«[[Set.new(1, 2), Set.new()]]␤»
frettled huh 19:42
19:42 rschuster is now known as rainerschuster
moritz_ that's curious 19:43
rhebus is it not supposed to do that?
19:43 pkkm left
rhebus I'm trying to implement a graph as a pair (V,E) 19:44
moritz_ ah, the double [] come from assigning [] to an array
rakudo: say Set.new([1,2]).perl
p6eval rakudo ea77cc: OUTPUT«Set.new(1, 2)␤»
rhebus rakudo: say Set.new([1,2],[2,1]).perl
sorear TimToady: what does ; in argument lists do?
p6eval rakudo ea77cc: OUTPUT«Set.new()␤»
frettled So, essentially, attepting to do that means that you end up with an empty set instead. Is that a healthy failure mode? 19:46
rhebus rakudo: say Set.new([1,2],3).perl
p6eval rakudo ea77cc: OUTPUT«Set.new(3)␤»
rhebus frettled: it just ignores arrays
rakudo: say Set.new([1,2],3, 4 => 5, Set.new(6)).perl 19:47
p6eval rakudo ea77cc: OUTPUT«Set.new(3, 4 => 5, Set.new(6))␤»
rhebus huh, now I'm *really* confused
19:47 sekimura joined
rhebus but I guess I can use pairs for my graphs. that's a better conceptual fit for edges anyway 19:48
19:48 timbunce left
sorear TimToady: you say that **@foo accepts any number of positionals and puts them into item context; how does that interact with foo(1,2; 3,4)? 19:50
19:51 wolv joined 19:52 kjeldahl left, wolv is now known as wolverian
pmichaud sorear: I suspect that ; in argument lists forms Slicels 19:52
(but haven't worked out the details yet)
19:52 kjeldahl joined
rhebus I'm looking at github.com/perl6/perl6-examples/blo...oblems.pod and wondering how to translate the graph problems from the original prolog to Perl 6 19:53
might it be a good way to introduce writing OO code? we could ask the reader to write a Graph class 19:54
19:56 timbunce joined
rhebus and then P80 is not "write conversions between different prolog predicate representations of graphs" but instead "write methods .neighbour .add-edge etc so that you can solve the following problems" 19:57
hmm i may sleep on it
19:57 MarderIII left
rhebus -> pub 19:59
TimToady phone
pmichaud be there shortly. 20:02
20:05 snearch joined, javs left 20:06 sekimura_ joined 20:07 sekimura left, sekimura_ left, timbunce left, sekimura joined 20:11 justatheory left
dalek p-rx: ce60da8 | pmichaud++ | src/cheats/hll-compiler.pir:
Temporarily backport PCT::HLLCompiler's 'lineof' method

continue to build from an older Parrot until parrot's trunk is working again. When we're able to bump PARROT_REVISION, this code can go away to fall back to Parrot's version of
  'lineof' (DRY).
20:11
p-rx: bb5d370 | pmichaud++ | src/ (3 files):
Switch 'lineof' method calls to use the version of HLL::Compiler instead of CodeString.
p-rx: d2d100f | pmichaud++ | src/Regex/Cursor.pir:
Eliminate CodeString coercion.
p-rx: 5c1686c | pmichaud++ | src/stage0/ (4 files):
Update bootstrap to include lineof changes.
20:11 patspam left 20:12 patspam joined 20:13 timbunce joined
patrickas TimToady: in the spec my $end = 7; then later 0,2,4 ...^ { $_ > $end }; #Why the exclusive limit ? 20:14
TimToady to include 7 if it matches
but not 7.1 20:15
patrickas include 7 in the returned items ? 20:16
so ...^ is not "exclusive" since it includes the limit? 20:17
20:17 rhebus left
TimToady ... includes the limit, ...^ doesn't 20:18
but ... * >= $end would include the first number after the limit if it didn't match exactly
patrickas and when the limit is a closure
TimToady doesn't matter 20:19
it's just a smartmatch
and if it smartmatches, ... includes it, and ...^ doesn't
patrickas ok
TimToady I don't know if rakudo implements last($value) yet though 20:20
patrickas I htink it does (even though it is not used yet in series)
20:20 jferrero joined
pmichaud rakudo: say (for 1..5 { last 'xyz' if 3 }) 20:20
p6eval rakudo ea77cc: OUTPUT«xyz␤»
pmichaud ummm
rakudo: say (for 1..5 { last 'xyz' if $_ == 3 })
p6eval rakudo ea77cc: OUTPUT«xyz␤»
pmichaud that's supposed to work :( 20:21
20:21 timbunce left
pmichaud rakudo: say (for 1..5 { if $_ == 3 { last 'xyz' } }) 20:21
p6eval rakudo ea77cc: OUTPUT«00xyz␤»
pmichaud oh, they were nils.
rakudo: say (for 1..5 { last 'xyz' if $_ == 3; $_ }) 20:22
p6eval rakudo ea77cc: OUTPUT«12xyz␤»
jnthn oh wow, I didn't know you could do that!
pmichaud last($value) works. 'if' apparently doesn't.
jnthn: next($value) also works :-)
jnthn Cute!
(whoever implemented that)++ :-)
20:23 patspam left
jnthn wipes the dust of the 6model repo 20:23
20:24 tadzik left
moritz_ dust, after less than two weeks of inactivity? 20:24
pmichaud construction dust, I think.
TimToady 'if' is supposed to return Nil on non-match
pmichaud TimToady: right. I'm not sure what happened there.
oh, wait, yes I do.
'if' statement works, 'if' statement_modifier doesn't.
TimToady Nil is supposed to disappear in list context
say provides a list context 20:25
pmichaud right
rakudo: say (for 1..5 { if $_ == 3 { last 'xyz' } })
TimToady say (for 1..5 { last 'xyz' if 3 }).perl
p6eval rakudo ea77cc: OUTPUT«00xyz␤»
TimToady rakudo: say (for 1..5 { last 'xyz' if 3 }).perl
p6eval rakudo ea77cc: OUTPUT«("xyz")␤»
[Coke] we have implicit contexts again?
TimToady now that should've had some Nils in it
pmichaud right 20:26
I'm not sure where my Nils went.
allbery_b they got Bohred?
TimToady willy nilly
pmichaud rakudo: say ('xyz' if 0).perl
p6eval rakudo ea77cc: OUTPUT«Nil␤»
20:26 hercynium left
pmichaud rakudo: say ('xyz' if 0, 'xyz' if 0).perl 20:27
p6eval rakudo ea77cc: OUTPUT«===SORRY!===␤Missing block at line 22, near ").perl"␤»
TimToady loop collector flattened maybe?
patrickas rakudo: say 1,2,3 ... * > 0
pmichaud oh, yes.
our 'for' currently has an 'eager' on it.
p6eval rakudo ea77cc:
..OUTPUT«(timeout)101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130…
pmichaud (awaiting sink context)
patrickas TimToady: that should become be 1 ? ^^
pmichaud and eager likely removed the nils.
TimToady but eager should be orthogonal to flattening
patrickas: yes 20:28
pmichaud it would still remove the Nils, yes? Or does it itemize them?
TimToady I think it should be agnostic to whether it is handling a flat or slice 20:29
pmichaud so does it itemize the Nils?
TimToady no, that would imply slice semantis 20:30
pmichaud it just reifies the Nils as Nil?
TimToady tries to picture a praying semantis
it just processes the list as a list, neither .flat nor .slice
so () and Nil come through unscathed 20:31
20:31 mfollett left
pmichaud what about @a? 20:31
(@a, Nil, @b).eager
I mean, if it doesn't imply flattening... what does it actually do for ranges and other iterators?
what does it "eagerly evaluate" then? ;-) 20:32
TimToady flattening is the removal of () structure. I don't see how it relates to reification, except insofar as you might have to go into a () to reify what's inside it 20:33
if the only way to reify something is to strip the (), that seems wrong to me
pmichaud so, (@a, Nil, @b).eager is the same as (@a.eager, Nil.eager, @b.eager) ? 20:34
TimToady yes
pmichaud what about (1..*).eager ?
TimToady it's like a unary hyper that way
it keeps the current structure
pmichaud so (1..*).eager remains a Range
TimToady well, we know that's infinite, so it can remain
pmichaud how about (1..5).eager ? 20:35
TimToady that reifies
I think
pmichaud why?
TimToady maybe not
well, hmm, I guess our reified lists are pushed into a flat array... 20:36
pmichaud if .eager is just saying to an object "reify yourself and all of your components", then Ranges (as immutable objects) don't need anything for eager
TimToady that might be reasonable 20:37
so all ranges would stay in the imaginary list even under eager
patrickas rakudo: say 10,9,8, { $_ - 1 || last } ... *
pmichaud well, all items, really
p6eval rakudo ea77cc: OUTPUT«10987654321␤»
TimToady anything immutable can be lazy
eager is really trying to force side effects 20:38
pmichaud if I have (@a, 5, @b).eager then @a and @b still need to remain in the imaginary list, I think
TimToady but they aren't immutable 20:39
pmichaud agreed
TimToady people will expect those to snapshot themselves at least
under eager 20:40
pmichaud snapshot into what, though?
that's why eager was flattning
TimToady right, that's the question
pmichaud because the outer parcel becomes a Seq
20:40 tadzik joined
TimToady but maybe this is related to decontainerizing 20:40
pmichaud which then gets the (flattened) values of it components
TimToady and the decontainerizer can shove back into the imaginary part a snapshot of values
pmichaud in that case, .eager returns a new Parcel 20:41
TimToady only flattened into its snapshot spot, the outer () remains
pmichaud right
.eager on an Array would reify the array
TimToady so eager is really more like snapshot
pmichaud yeah 20:42
so, (@a, 1, @b).eager has the effect of reifying both @a and @b, but also returning a new Parcel that has (@a.Seq.eager, 1, @b.Seq.eager)
(where Seq's decontainerize their values) 20:43
TimToady sounds about right, and very similar to decontainerization
pmichaud right -- currently I have Seq as a list of decontainerized values
TimToady and maybe snapshot is just a snazzier word for decontainerization
more or less what eqv does too
pmichaud I'll try that out and see what happens. 20:44
although in some sense I'd also like decontainerization to be orthogonal to eagerness
TimToady also related to the mystery of serialization
pmichaud i.e., I can decontainerize an array without having to reify all of its elements.
20:45 ash_ joined
pmichaud (for some arrays, at any rate) 20:45
20:45 timbunce joined
TimToady and you can snapshot it that way too, if the rest is immutable 20:45
pmichaud right
so I'd like a decontainerize method that is orthogonal to eager
TimToady mainly I see the difference is decontainerization is what you do to a container, and snapshot is recursively that over a data structure
well, iteratively, if not recursively 20:46
pmichaud so, we'd have decontainerization, snapshot, and eager ?
20:46 timbunce left
TimToady snapshot and eager would be basically the same thing 20:46
20:46 whiteknight joined
pmichaud that doesn't sound right 20:46
TimToady each of them does decontainerizations as appropriate 20:47
pmichaud "snapshot" - return me something that contains only values
"eager" - tell everything to reify as much as it can
TimToady values can be lazy
constant @primes := ...
pmichaud well, if @primes is created with a generator, I'd assume that snapshot would have some eagerness there. 20:48
TimToady I wouldn't
I think snapshot === eager 20:49
and both are merely promises about lack of side effects, other than laziness
pmichaud so, @a.eager does.... what?
or is it now @a.snapshot ? 20:50
TimToady gives you a snapshot of the array such that any modification of @a has not effect, that's all
eager is shorter :)
pmichaud so, @a.eager doesn't force any reification at all?
TimToady *no effect on the snapshot
20:51 hercynium joined
TimToady no, that depends on whether the imaginary part has something with side effects 20:52
which, yes, is hard to know
pmichaud for typical generators, we don't know if t..... right
so, we either evaluate the generator for its side effects, or we don't force reification
TimToady I think we evaluate any generator that isn't marked with '*' 20:53
pmichaud where marked with '*' means '*' is the last element?
TimToady or is '0' xx *, or 1..*
20:53 tadzik left
TimToady basically * is a promise of some kind of purity, in addition to unendingness, in that view 20:54
which for xx and .. makes sense
pmichaud how about for parcels in general (more)
TimToady makes a little less sense for a user-code generator that might refer to something external
pmichaud gather { ... }, *
(in parens, I guess) 20:55
(gather { ... }, *)
TimToady but basically, it's a mark that says, exempt this from snapshotting
pmichaud okay
TimToady for whatever reason
maybe I actually *want* the lazy side effects, but snapshot the earlier part of the list, though it seems pretty fragile
20:56 Guest23195 left
TimToady of course, lazy gather {...} should have the same effect, I guess 20:56
eager @a, lazy gather {...} 20:57
eager @a, gather {...}, * # same thing maybe
pmichaud so a gather loop would get snapshotted, but if it's in a parcel that ends with * it won't? 20:59
TimToady something like that. I think * implies lazy, but lazy doesn't necessarily imply * 21:00
21:00 avuserow left
TimToady a generator could be lazy by choice, a * has to be lazy by necessity 21:00
so I don't think * is redundant with lazy 21:01
so .[lazy range()] still uses the whole range, while .[range(), *] doesn't
(if the available elements are fewer) 21:02
putting ,* as a postfix is a bit quirky thought
*though 21:03
one could argue for a statement_prefix:inf instead to go with lazy
and eager
21:03 nperez left, Getty left, Gothmog_ joined, jnthn left, cls_bsd_ joined
pmichaud I don't have a problem with that. 21:03
21:03 au|irc left
pmichaud so, 'lazy' really means "don't eager me" :-) 21:04
21:04 Getty joined
pmichaud does that make eager/lazy into named unaries? 21:04
i.e., "eager" forces snapshotting, "lazy" suppresses it?
(and there's some in-between that is the default?)
21:04 avuserow_ joined, nperez_ joined
pmichaud right 21:04
my @a = 1..*; # lazy
my @a = 1..100; # eager
my @a = eager 1..100; # also eager
my @a = lazy 1..100; # lazy
my @a = 0, 1, *+* ... * ; # lazy, because of the terminating *
21:04 au|irc joined
pmichaud my @a = 0, 1, *+* ... * > 500; # eager 21:04
21:04 azert0x left
pmichaud my @a = lazy(0, 1, *+* ... * > 500); # lazy 21:04
21:04 azert0x joined
pmichaud hmmm, netlag 21:04
21:04 exodist_ joined, jnthn_ joined
TimToady weird 21:04
the ,* kinda works because of all the other places * pops up 21:06
21:06 mfollett joined
TimToady but it really kinda wants to be a modifier on the previous term somehow 21:06
21:07 mfollett left
pmichaud yes, I was trying to work some adverbs in for gather and .[ ] 21:07
i.e.: gather :lazy { ... }
or
gather :inf { ... }
and
@a[1..10]:clip
TimToady rather have those out front
lazy gather or inf gather
pmichaud wfm 21:08
PerlJam lazy gather +1
pmichaud gather is already "lazy" 21:09
it's really "inf gather" that I want.
TimToady but it could hide a gather from an eager
pmichaud i.e., to signal to eager operations that "you really don't want to try to iterate this to the end"
TimToady maybe inf isn't quite right
21:10 snearch left
pmichaud same goes with some cases of .map and .grep and the like 21:10
TimToady wish there was a short word for "unending"
pmichaud eternal 21:11
TimToady ever
ash_ eventually ?
TimToady for ever foo() {...}
ash_ loop
pmichaud dne
:-P
TimToady dnf, you mean :)
pmichaud ohm => mho, end => dne :) 21:12
but yes, dnf works too
but then people really will say that Perl 6 and DNF are DNF
PerlJam dnf is very punnable too :)
TimToady "does not finish" 21:13
pmichaud "Perl 6 isn't finished yet... and we even have an operator for it"
TimToady for never foo() {...}
PerlJam too many words
eternal foo() { ... }
pmichaud well, for is already lazy outside of sink context 21:14
so it would be more like "never for foo() { ... }
which isn't really right.
21:15 jaldhar left
TimToady for the-long-haul foo() 21:16
ash_ loop foo() { }
TimToady it's just a modifier on a term, why would it want a block?
pmichaud wait for it() { ... }
ash_ for EVER { } 21:17
#define EVER ;;
PerlJam ash: I liked where you were going with loop much better 21:18
pmichaud TimToady: you're imagining that the modifier on a term would override sink context?
TimToady sink is just a kind of eager
pmichaud okay.
so with
TimToady "Useless use of lazy list in sink context at line 42" 21:19
pmichaud sink (lazy foo()).map( { ... } )
the lazy wins?
TimToady yes, but could produce that error
21:19 jnthn_ is now known as jnthn
pmichaud so, sink is kind of a super-eager.... more like "strictly eager"? 21:19
and it carps if it's given something marked 'lazy'?
21:20 wolverian left
TimToady well, I suppose the map could have side effects, so no warning there 21:20
pmichaud right
and since for --> map.....
TimToady yes, that's fine
the map will read the lazy foo
pmichaud that's why I was not following the significance of for lazy foo() { ... }
TimToady we need to make it so that "the cow jumped over the lazy dog" is legal Perl 6
s/cow/fox/ 21:21
pmichaud well, I guess the map result signals it's lazy also (transitively)
21:21 lue left
pmichaud i.e., the thing it's iterating is explicitly lazy, so the map result is explicitly lazy also. 21:21
TimToady it does, but then the inside of the map may carp about useless things in sink context
pmichaud well, or the sink can still do it. 21:22
since it'll get the lazy result from map.
this does indicate that the laziness of "lazy foo()" is somehow different from the laziness of 1..* though 21:23
(which I think you alluded to earlier)
TimToady yes, one by choice, one by necessity
* implies lazy, lazy doesn't imply *
pmichaud sink of lazy by choice -> carp
sink of lazy by necessity -> no carp? 21:24
or do we carp there as well, and require some other explicit construct if you *really* want to work through the laziness
TimToady has more to do with whether there were side effects
pure code carps if sunk
pmichaud right... but at the other levels we don't know if there are side effects
*outer
such as with .map
TimToady sink propagates inward to final statements 21:25
pmichaud I haven't figured out how to do that. It sounds too much like want()
TimToady and earlier statements are already sunk
just the opposite, it's don't-want() :)
sorear I thought we got rid of context propagating inward
pmichaud :)
TimToady not that
pmichaud sorear: yes, that's the problem I have with "propagates inward" 21:26
foo() { for @list { .say } }; foo(); 1;
how does foo() know it's in sink context?
TimToady a bit in the call frame 21:27
pmichaud grrr
sorear the same way { say "hi" }; knows to call the block immediately
it's syntactic
pmichaud no, I did that wrong.
sub foo() { for @list { .say } }; foo(); 1
I know that foo() knows it's in sink context.
But how does the map inside of "&foo" know it?
TimToady by looking at the sink bit in the callframe 21:28
pmichaud (TimToady answers; bit in the call frame)
sorear because the map is at statement level
pmichaud sorear: the map is a return value. It's not in sink context.
sorear for loops are exactly like bare blocks in my mind
pmichaud (syntactically it's not in sink context)
TimToady as the last statement in the sub it knows it has to look at the bit in the call frame
sorear they run immediately at statement level regardless of whether they are the return value
pmichaud sorear: I think your interpretation is wrong there.
(TimToady can clarify if yes/no) 21:29
sorear I know my interpretation is 'wrong'; I'm trying to convert you
TimToady sorear++ isn't guessing, he just wants it different
pmichaud sorear: I'm not the one who needs converting.
TimToady and I think his use case is contrived
pmichaud I'm trying to understand how TimToady wants it to work, not to change the spec. 21:30
TimToady and I'm saying the user generally knows which routines are called for values and which for side effects
sorear it seems to me like having both callframe bits and context methods is the worst of both world 21:31
TimToady and that a simple --> Nil in the sig can easily force sink context on the last statement statically
sorear s
pmichaud well, a simple "sink" can force sink context, too :-)
TimToady there can be multiple last statments, like in a switch
so better to mark the return as Nil 21:32
21:32 Mowah left
pmichaud sure, that works for me 21:32
TimToady and the rest of the time, the bit works right nearly all the time
sorear TimToady: sorry, that wasn't a use case 21:34
TimToady: the contrived example I gave was intended to be spectest material
TimToady: the real use case for my interpretation is simplifying the RTS
pmichaud it feels funny that 'sink context' gets a bit when none of our other contexts do
I'm wondering how long it'll be before we have an 'lvalue bit' also.
sorear how about a list bit? 21:35
21:39 [Coke] joined 21:40 tylercurtis left
dalek odel: 920e357 | jnthn++ | dotnet/runtime/R (2 files):
A first crack at implementing a maybe decent multi-dispatch type/definedness cache. Not yet in use, not even tested, but sketches out the idea at least.
21:40
21:40 wolverian joined, justatheory joined 21:41 Holy_Cow left 21:44 Holy_Cow joined 21:50 wolverian left 21:51 wolverian joined, ruoso left
sorear What would be a good name for the low-level opposite of &item? 21:53
It doesn't do any coercion, but fiddles allomorphic reference properies to allow a list to interpolate in list contexts 21:54
in rakudo it would more or less be pir::deobjectref
patrickas phenny: tell colomon I think I implemented the main changes in the new series spec github.com/patrickas/rakudo/tree/series-new-spec (minus a few things that were not working and did not get affected by the change) but we won't really know till we have new correct spectests! In the mean while I tested with the following tests gist.github.com/570893 and your updated series-arity2ormore.t 21:56
phenny patrickas: I'll pass that on when colomon is around.
colomon actually right here at the moment. 21:57
phenny colomon: 21:56Z <patrickas> tell colomon I think I implemented the main changes in the new series spec github.com/patrickas/rakudo/tree/series-new-spec (minus a few things that were not working and did not get affected by the change) but we won't really know till we have new correct spectests! In the mean while I tested with the following tests gist.github.com/570893 and your updated series-arity2ormore.t
colomon :)
pmichaud sorear: I don't know a good name for it, but .list often just creates a new ObjectRef that doesn't have the item property set.
patrickas one commit was removing about 35 lines of unneded convoluted code :-)
colomon was snapping beans for nomming and surfing the web.
pmichaud afk
colomon patrickas++
sorear pmichaud: but I can't use .list to de-item-property, say, Parcels
patrickas i ended up skipping the 1..* ... 5 issue since it had nothign to do with the new change 21:58
21:58 ash_ left
patrickas If you have time to take a look / test it would be great! 21:59
pmichaud That case doesn't come up in Rakudo, because a Parcel is already de-itemed
patrickas gotta go prepare dinner and get some rest... 'night all
21:59 patrickas left
pmichaud afk, errands 22:00
22:06 rgrau__ joined 22:07 rgrau_ left 22:08 Holy_Cow left 22:11 Limbic_Region joined
dukeleto Did masak's work on binary data in Rakudo get merged ? 22:11
dukeleto is writing up a blog post about gsoc 22:12
22:12 sekimura left, Ross left
moritz_ dukeleto: I don't know if everything got merged, but parts were certainly merged 22:13
dukeleto moritz_: does he have a branch that he is working on? 22:14
moritz_: just wanting to mention it in a blog post, which means I should at least topically understand what was actually done :) 22:15
22:15 jhuni joined
moritz_ dukeleto: yes, it's called 'buf' 22:15
dukeleto: and he also blogged a few times about his progress
22:17 ash_ joined
dukeleto moritz_: yes, i read them. just hadn't seen anything recently 22:18
moritz_: thanks for the info!
22:19 flatwhatson left 22:25 ash_ left
jnthn dukeleto: I believe it all got merged. 22:27
moritz_ jnthn: I don't believe so 22:28
oh well
at least I can't find the commit messages from origin/buf in master
22:29 Schwern left
moritz_ but it might have been merged some other way, like with squashed commits or custom messages 22:29
jnthn moritz_: iirc, they were squashed. 22:30
rakudo: pack
p6eval rakudo 780732: OUTPUT«No applicable candidates found to dispatch to for 'pack'. Available candidates are:␤:(Str $template, *@items)␤␤ in main program body at line 22:/tmp/em4nV2EvBm␤»
jnthn pack was the last part of the grant and it's there.
moritz_ ok 22:31
jnthn Maybe they were squashed.
moritz_ phenny: ask masak if there's a good reason to keep the 'buf' branch on github around 22:32
phenny moritz_: I'll pass that on when masak is around.
22:32 rgrau__ left
moritz_ jnthn: 83b2cdfa64becdef052417962cc114e38f5920d8 seems to be the monster commit that brought the buf goodness to master 22:32
22:33 rainerschuster left 22:36 mfollett joined
jnthn -> sleep 22:42
22:43 mfollett_ joined, mfollett left
moritz_ that's acutally quite a good idea 22:44
22:44 mfollett_ is now known as mfollett 22:47 mfollett left
dukeleto moritz_: i don't even see the buf branch on github 22:54
22:59 drbean_ joined 23:00 meppl left 23:02 drbean left 23:03 kjeldahl left 23:04 alester left
dalek ecza: 9740be1 | sorear++ | / (7 files):
Simplify representation and construction of lists
23:04
23:04 felipe joined 23:05 flatwhatson joined
TimToady I guess we can do sink lazily too; it's really temp that is fundamentally broken, at least insofar as it's implemented the way Perl 5 does local. Emulation with dynamic vars would close over lazy lists properly, so temp $lexical should do that. 23:05
23:06 cdarroch left
TimToady Only temp $global would remain borken if used to feed a lazy list. 23:06
23:31 nimiezko joined 23:32 ash_ joined 23:35 Helios left 23:37 ascent_ left 23:39 Limbic_Region left 23:43 ascent_ joined, Helios joined 23:46 azert0x left
diakopter grr indeed :) 23:47
23:48 Alias left 23:49 justatheory left
nimiezko hello #perl6 23:50
dukeleto nimiezko: howdy 23:56
23:59 Patterner left