»ö« | perl6.org/ | nopaste: paste.lisp.org/new/perl6 | evalbot usage: 'perl6: say 3;' or rakudo:, alpha:, pugs:, std:, or /msg p6eval perl6: ... | irclog: irc.pugscode.org/ | UTF-8 is our friend! Set by lichtkind on 5 March 2010. |
|||
00:07
ashleydev left
00:12
lest_away is now known as lestrrat
00:27
azert0x left
|
|||
eternaleye | TimToady: (backlogging) re the Z bug, I would thing kit was the doubled parens around the pair not collapsing correctly | 00:28 | |
Oh wait, nvm. I missed the 'for' | 00:29 | ||
sorear | Passed 781/815, 95.83% | 00:33 | |
34 failed | 00:34 | ||
TimToady: ^^ | |||
TimToady: Why is there a parse/parsefile split? | 00:37 | ||
00:38
Limbic_Region left
00:40
whiteknight left
00:43
yinyin joined
00:45
snarkyboojum left,
lue joined
|
|||
lue | [message check] | 00:45 | |
ohai dere. I had a case of camel apathy :/ | |||
jnthn | lue: You got the hump? | 00:51 | |
sorear | TimToady: I wish there were a way to localize all of the compiler's contextuals in one swoop. Something like a my %*LANG, but not for $~ ... | ||
thoughts are swirling in my head involving connecting this to COMPILING, but I'm not quite there yet | 00:52 | ||
TimToady: What is Cursor.pmc 2392-2393 doing? | 00:54 | ||
lue considers continuing his tutorial for Perl 6 ( you know, the MMORPG :) ) | 00:56 | ||
00:57
snarkyboojum joined,
snarkyboojum_ joined
01:01
snarkyboojum left,
snarkyboojum_ is now known as snarkyboojum
01:07
Schwern left
01:10
christin1 is now known as christine
01:11
pausenclown left,
justatheory left
01:14
xinming_ is now known as xinming,
pausenclown joined
|
|||
sorear | TimToady: Do $*CORE and $*GLOBAL need to be contextualized? | 01:14 | |
TimToady: How does $ALL<UNIT> interact with being able to recurse into other compilation units? | 01:18 | ||
sorear gives up for want of understanding the stash system | 01:20 | ||
01:21
masonkramer_ left,
masonkramer_ joined
01:28
gfx joined
01:30
jaldhar left
01:31
jaldhar joined
|
|||
lue | afk | 01:33 | |
01:33
gabiruh joined
01:36
madalu joined
01:51
plobsing joined
01:52
PenThrive joined
01:55
BrowserUk joined,
lestrrat is now known as lest_away
01:57
yinyin left
01:58
yinyin joined
02:01
jaldhar left,
jaldhar joined
02:07
lest_away is now known as lestrrat
02:10
BrowserUk left,
ShaneC left,
gbacon joined
02:13
patspam joined
02:22
[mark] joined
|
|||
colomon | rakudo: my { a => 1, b => 2 }.WHAT | 02:22 | |
p6eval | rakudo a0b6d7: OUTPUT«===SORRY!===Malformed my at line 11, near "{ a => 1, "» | 02:23 | |
colomon | rakudo: { a => 1, b => 2 }.WHAT | ||
p6eval | rakudo a0b6d7: ( no output ) | ||
colomon | rakudo: { a => 1, b => 2 }.WHAT.say | ||
p6eval | rakudo a0b6d7: OUTPUT«Hash()» | ||
02:25
xinming left
02:31
agentzh joined
02:32
madalu left
02:36
gbacon left
02:44
f00li5h joined,
f00li5h left,
f00li5h joined
02:47
Guest33137 left
|
|||
sorear | I want to kill LazyMap. | 02:51 | |
02:51
\shade\ left
|
|||
sorear | It's too deeply tied to the Perl 5 concepts of list context and unpacking. | 02:51 | |
02:57
meppl left
02:58
shade__ joined
03:06
skangas left
03:11
rv2733 joined,
xinming joined
03:12
snarkyboojum left
03:18
shade__ left
03:24
snarkyboojum joined
|
|||
dalek | kudo: e92a5f4 | (Solomon Foster)++ | src/core/metaops.pm: Allow embedded hashes in array hypers. approximation. |
03:26 | |
pugssvn | r31094 | colomon++ | [t/spec] Tests for hypers on arrays containing hashes. | 03:27 | |
03:33
shade_ joined
03:54
snarkyboojum_ joined
03:56
snarkyboojum left,
snarkyboojum_ is now known as snarkyboojum
03:58
ajs1 joined,
ashleydev joined
03:59
ajs2 joined
04:00
ajs left
04:02
ajs1 left,
molaf joined
04:14
snarkyboojum left
04:15
satyavvd joined
04:20
snarkyboojum joined
04:27
snarkyboojum left
04:34
patspam left
04:38
__2synth joined
04:40
__2synth85 joined
04:41
synth left,
snarkyboojum joined
04:43
__2synth left
04:45
ashleydev left
|
|||
pugssvn | r31095 | lwall++ | [STD] don't attempt two-terms detection on infix_circumfix | 04:46 | |
04:46
JimmyZ joined
|
|||
JimmyZ | rakudo: use MONKEY_TYPING; my $d = ''; augment class Str { method some_meth_1 {$d = $d ~ self;}};for '0' .. '5' -> $a { sub;}; | 04:47 | |
p6eval | rakudo e92a5f: OUTPUT«===SORRY!===Symbol '$ss_SS_S_S__S_S_s' not predeclared in <anonymous>» | ||
JimmyZ | what? | ||
04:48
jrtayloriv joined
|
|||
JimmyZ | use MONKEY_TYPING; my $d = ''; augment class Str { method some_meth_1 {$d = $d ~ self;}}; for '0' .. '5' { .WHAT.say; .some_meth_1; }; | 04:49 | |
rakudo: use MONKEY_TYPING; my $d = ''; augment class Str { method some_meth_1 {$d = $d ~ self;}}; for '0' .. '5' { .WHAT.say; .some_meth_1; }; | |||
p6eval | rakudo e92a5f: OUTPUT«Str()Str()Method 'some_meth_1' not found for invocant of class 'String' in main program body at line 11:/tmp/MCqD6zcoAJ» | ||
JimmyZ | rakudo: use MONKEY_TYPING; my $d = ''; augment class Str { method some_meth_1 {$d = $d ~ self;}}; for '0' .. '5' { .WHAT.say; sub; }; | 04:51 | |
p6eval | rakudo e92a5f: OUTPUT«===SORRY!===Symbol '$ss_SS_S_S__S_S_s' not predeclared in <anonymous>» | ||
sorear | well, first off, you always need ; after } in one-liners | ||
04:52
jrtayloriv left
|
|||
sorear | secondly, iirc that string is part of p6eval's security tripwire | 04:52 | |
so you need to get a real rakudo | |||
04:52
snarkyboojum left
|
|||
JimmyZ | really? | 04:53 | |
rakudo: use MONKEY_TYPING; my $d = ”; augment class Str { method some_meth_1 {$d = $d ~ self;}}; for '0' .. '5' { .WHAT.say;}; | |||
p6eval | rakudo e92a5f: OUTPUT«===SORRY!===Confused at line 11, near "my $d = \u201d;"» | ||
sorear | it's definitely part of p6eval | ||
JimmyZ | rakudo: use MONKEY_TYPING; my $d = ''; augment class Str { method some_meth_1 {$d = $d ~ self;}}; for '0' .. '5' { .WHAT.say;}; | ||
p6eval | rakudo e92a5f: OUTPUT«Str()Str()Str()Str()Str()Str()» | ||
JimmyZ | No, I don't always need ; after } in one-liners | ||
sorear | rakudobug | 04:54 | |
JimmyZ | these three are bugs. | ||
pugssvn | r31096 | lwall++ | [STD] parse >>R~<< correctly, or at least dwimmily | 04:57 | |
04:57
gfx left
|
|||
TimToady | sorear: Cursor:2392 establish a cut scope for :::, backtrack out of current rule | 05:00 | |
05:01
masonkramer left,
masonkramer_ is now known as masonkramer
|
|||
sorear | TimToady: How does $::XACT work? | 05:01 | |
And why doesn't it just use cursor_xact? | 05:02 | ||
TimToady | cursor_xact doesn't have the right scope to localize it | ||
p5 can't localize something in its caller | 05:03 | ||
$::XACT can use the local mechanism because it's only used for setting the initial xact at an alternation point | 05:06 | ||
05:06
finanalyst joined
|
|||
TimToady | the other cursors are just copies, so have the same .{_xact} pointer | 05:06 | |
once we're off into lazy cursor land, we only ever rely on the ->{_xact} | 05:07 | ||
colomon | TimToady: what was wrong with >>R~<<? | ||
TimToady | parsed as >>[R~<]< | ||
because it only did the dwim if it was in HYPER, and R isn't HYPER | 05:08 | ||
so it now does it in any kind of meta | |||
colomon | oh, ick. | ||
TimToady | yeah | ||
it was giving the appearance of running forever on t/spec/S03-metaops/hyper.t | |||
because of the prior bug, that looked for a term when it was expecting the << to see if it was two-terms | 05:09 | ||
colomon | btw, is the nested hash thing okay? It's not clear to me if it's spec or not, but it seems to make sense and was easy enough to add. | ||
TimToady | and in that particular spot, looking for a term starting with < was invoking a maze of twisty nibblers, all alike | ||
if it makes sense, fine | 05:10 | ||
perhaps the .suppose method should have a time limit on it--it was running for at least 5 minutes on my machine | 05:11 | ||
there are a *lot* of nested <'s and >'s after the >>R~<< in that file... | 05:12 | ||
sorear | TimToady: I'm afraid I still don't follow you. Why is cursor_xact able to work in arbitrary subclasses of Cursor but not in categories? | ||
TimToady | and it was desperately trying to get the counts to match | ||
colomon | sorry... | ||
.oO(sounds like getting STD to work with the test case was harder than implementing the feature being tested...) |
05:13 | ||
TimToady | not in categories? | ||
I don't understand your question | |||
sorear | TimToady: add_categorical doesn't use cursor_xact | ||
you said it was because of scope issues | |||
TimToady | add_categorical does use cursor_xact | 05:14 | |
line 2396 | 05:15 | ||
sorear | I somehow hallucinated the # as one row higher | 05:17 | |
but I still don't follow why it doesn't use my $C = $C->cursor_xact('...'); my $xact = $C->{_xact}; like viv-generated code | 05:18 | ||
JimmyZ | std: use MONKEY_TYPING; my $d = ''; augment class Str { method some_meth_1 {$d = $d ~ self;}}; for '0' .. '5' { .WHAT.say;}; | 05:22 | |
p6eval | std 31096: OUTPUT«ok 00:01 106m» | ||
JimmyZ | sorear: I don't think it's a bug | ||
05:23
TiMBuS joined
|
|||
JimmyZ | std: use MONKEY_TYPING; my $d = ''; augment class Str { method some_meth_1 {$d = $d ~ self;}} for '0' .. '5' { .WHAT.say;}; | 05:23 | |
p6eval | std 31096: OUTPUT«===SORRY!===Unexpected block in infix position (two terms in a row, or previous statement missing semicolon?) at /tmp/0znKv4QYPb line 1:------> eth_1 {$d = $d ~ self;}} for '0' .. '5' ⏏{ .WHAT.say;}; expecting any of: bracketed infix | ||
..inf… | |||
TimToady | sorear: I don't remember offhand why there's an extra RULE wrapper there, unless it's accounting for the outer proto somehow maybe | 05:24 | |
pugssvn | r31097 | sorear++ | [Cursor et al] Rename Cursor to CursorBase; add a Cursor subclass | 05:25 | |
sorear | that could make sense; I'll have to look at it in more detail later | ||
TimToady | in case we ever had a way to cut against the proto | ||
(which we don't) | |||
but then I don't know why the circumfix code below doesn't also do that... | 05:26 | ||
that's about all my migrainey braney can deduce from the codey currentley | |||
fortunately, my migraines are idiosyncratic and not generally painful | 05:27 | ||
05:27
molaf left
05:28
shade_ left
|
|||
sorear | TimToady: What did we use before LazyMap? | 05:33 | |
TimToady | pugs | 05:35 | |
actually there was an intermediate form that just generated all the lists eagerly | 05:36 | ||
.*? was even more expensive back then... | |||
sorear | I want to get rid of lazymap; it's too deeply tied to Perl 5 list context semantics | 05:37 | |
and I don't think I can reasonably rewrite it in Perl6 | 05:38 | ||
diakopter | (?:.*.?)* | ||
05:38
rv2733 left
|
|||
sorear | so what I'm planning to do is change viv output to work on raw iterator functions | 05:38 | |
things that can backtrack produce iterators, things that can't produce values | |||
what does FIXINS mean? | 05:39 | ||
TimToady | I dunno, I didn't write that part of the Makefile | 05:40 | |
diakopter | heh | ||
I think only pmurias worked on it other than you..? | |||
(besides sorear) | |||
TimToady | but how will a bare iterator do all the cursor transformations that a lazymap does? those subs are there for a reason... | 05:42 | |
and I don't understand at all what you mean by "too deeply tied" | 05:43 | ||
sorear | I don't understand how to write a viv-Perl6 port of LazyMap | 05:44 | |
TimToady | with the current setup, you can be guaranteed that the first element of the list is of type Cursor | ||
sorear | especially as it would interact with the javascript output | ||
TimToady | if you pass everything as scalars, they'd have to be polymorphic | ||
sorear | LazyRange? | ||
TimToady | and you'd have to test them everywhere for whether they were an iterator or a cursor | ||
sorear | it's always possible to know statically whether an expression is iterator-y or cursor-y | 05:45 | |
whether a regex backtracks is a static property | |||
and it only occurs ~30 times in STD.pmc | 05:46 | ||
05:50
shade_ joined
05:51
_jaldhar joined
05:52
jaldhar left
|
|||
TimToady | I am not convinced it can be known statically. | 05:52 | |
when you call <foo> some of the subrules could be ratchety and some of them not | 05:53 | ||
you'd be forced to always expect an iterator even for the ratchety ones | 05:54 | ||
by always returning at least one cursor followed by an optional iterator, we relieve the caller of that | |||
sorear | cursor + iterator? would work too | 06:00 | |
it's mostly the cursor [cursor | iterator]* that bothers me | |||
Transmitting file data ....svn: Commit failed (details follow): | 06:01 | ||
svn: Can't open file '/usr/local/src/pugs/src/perl6/boot/.svn/tmp/text-base/Cursor.pmc.svn-base': No such file or directory | |||
06:03
shade_ left
06:06
uniejo joined
|
|||
TimToady | well, P6 also allows lazy lists to batch up known values | 06:06 | |
putting my poor head to bed & | 06:07 | ||
sorear | sleep wel | 06:08 | |
perl 6 Cursor will land in a few minutes | |||
eternaleye | sorear++ # Sustained awesomeness | ||
06:08
shade_ joined
|
|||
pugssvn | r31098 | sorear++ | [Cursor] Rewrite in Perl 6, bring under bootstrap control | 06:22 | |
06:36
plobsing left
06:39
Su-Shee joined
06:40
colomon left
|
|||
moritz_ | good morning | 06:44 | |
eternaleye | o/ | 06:46 | |
JimmyZ | good morning moritz_ | 06:47 | |
06:53
shade_ left,
__2synth85 left,
shade_ joined
|
|||
moritz_ | rakudo: my @a = <a b c>; say @a[-1] | 06:54 | |
p6eval | rakudo e92a5f: OUTPUT«Cannot use negative index on arrays in 'Array::postcircumfix:<[ ]>' at line 2575:CORE.setting in main program body at line 11:/tmp/iRY8V6NofP» | ||
moritz_ | rakudo: say 'abc'.comb[-1] | ||
p6eval | rakudo e92a5f: OUTPUT«c» | ||
07:00
shade_ left
07:04
spinclad left,
shade_ joined
07:07
shade_ is now known as \shade\
|
|||
pugssvn | r31099 | moritz++ | [t/spec] simple tests for combining ** quantifier and :sigspace | 07:18 | |
07:19
synth joined
|
|||
dalek | kudo: 8b116ff | moritz++ | build/PARROT_REVISION: bump PARROT_REVISION to get latest nqp-rx fixes for ** quantifier and :sigspace |
07:20 | |
07:26
c9s joined
07:35
agentzh left
|
|||
dalek | kudo: a1695f0 | (Timothy Totten)++ | src/core/ (2 files): Implemented Date.new(::DateTime) and DateTime.Date() Signed-off-by: Moritz Lenz [email@hidden.address] |
07:43 | |
moritz_ | phenny: tell masak that his bug report for :sigpace + ** quantifier never made it to RT, but it's fixed in 8b116ff in | 07:44 | |
phenny | moritz_: I'll pass that on when masak is around. | ||
moritz_ | s/in/anyway/ # where did I leave my mind? | 07:45 | |
07:51
ejs joined
07:53
mikehh left
07:56
ejs left
07:57
ejs joined
08:01
tann_ joined
|
|||
tann_ | rakudo: my $x = repeat { prompt "number? " } until $x == 5; | 08:02 | |
p6eval | rakudo e92a5f: OUTPUT«Use of uninitialized value in numeric contextCould not find sub &repeat in main program body at line 11:/tmp/Oa4510PDLK» | ||
08:03
agentzh joined,
tann_ left
08:12
bjarneh joined
08:13
skangas joined
08:16
snarkyboojum joined
08:18
pnate left
|
|||
pugssvn | r31100 | sorear++ | [STD,Cursor] Push error reporting functions down into the new Perl6 Cursor. You can now define non-STD grammars with viv. | 08:20 | |
08:27
dakkar joined
08:34
k-bits joined
08:40
wallberg joined
08:44
masak joined
|
|||
masak | oh hai from a bus! | 08:44 | |
phenny | masak: 07:44Z <moritz_> tell masak that his bug report for :sigpace + ** quantifier never made it to RT, but it's fixed in 8b116ff in | ||
08:45
snarkyboojum left
|
|||
mberends | oh hai to a bus, masak! | 08:45 | |
masak | moritz_: actually reporting it must have slipped my mind. it's reported now though, and resolved. rt.perl.org/rt3/Ticket/Display.html?id=75558 | 08:46 | |
mberends: I've made some decisions regarding proto. | 08:47 | ||
mberends | masak: I'm all ears | ||
masak | mberends: I think 'pls' is a fitting name for whatever proto is becoming. but I also think that a rename should be accompanied by some core improvements. | 08:48 | |
so it'll be more of a Great Refactor than just a rename. | |||
mberends | agreed | ||
08:49
masak` joined,
masak`` joined
08:50
temporaryusernam joined
|
|||
mberends | masak's bus must be driving on a bumpy road | 08:50 | |
masak`` | I think the satellite was temporarily behind a cloud. | ||
mberends | or a jumbo jet | 08:51 | |
08:51
snarkyboojum joined,
yinyin left
08:52
yinyin joined
|
|||
masak`` | there's a troll on Twitter who seems to take pleasure in saying nasty things about Perl. twitter.com/anktastic/status/15396749783 - I've tried talking to him, which gave me a deeper understanding of the expression "feeding the troll". | 08:52 | |
08:53
masak left,
masak`` is now known as masak,
bjarneh left
|
|||
masak | I'm not at the point where I'm blocking him yet, but I kinda feel sorry for him, and want to help somehow. guess one can't help everyone, though. | 08:53 | |
08:54
masak` left
08:55
xabbu42 joined
|
|||
pugssvn | r31101 | sorear++ | [STD-ecosystem] Overhaul README | 08:57 | |
sorear sleep | |||
masak | rakudo: use MONKEY_TYPING; my $x = "OH HAI "; augment class Str { method foo { say $x, self } }; for "1".."5" { .foo } | 09:02 | |
p6eval | rakudo a1695f: OUTPUT«OH HAI 1Method 'foo' not found for invocant of class 'String' in main program body at line 11:/tmp/GlDeqeEeZO» | ||
masak submits rakudobug | |||
moritz_ | masak: it's enough to re-open | ||
JimmyZ | masak: the bug is in RT | 09:03 | |
masak | url? | ||
JimmyZ | rt.perl.org/rt3/Ticket/Display.html?id=75114 | 09:04 | |
masak | yep, it's already in there. good. | 09:05 | |
moritz_ | is there anybody for whom t/spec/S14-roles/anonymous.rakudo has no unexpectedly passing TODOs? | ||
09:08
xabbu42 left,
xabbu42 joined
|
|||
JimmyZ | moritz_: yes, but occasionally | 09:08 | |
moritz_: paste.lisp.org/display/111137 | 09:10 | ||
moritz_ | thanks | 09:12 | |
09:14
clintongormley joined
|
|||
dalek | p-rx: 42209fb | pmichaud++ | src/ (3 files): ":my" in regexes is now properly declarative for LTM purposes. |
09:18 | |
09:20
colomon joined
09:21
k-bits left
09:24
masak left,
temporaryusernam left,
masak joined
09:25
lestrrat is now known as lest_away,
snarkyboojum left
|
|||
colomon | o/ | 09:26 | |
09:26
shrub joined
|
|||
masak | \o | 09:27 | |
09:28
gfx joined
09:31
bjarneh joined
09:32
yinyin left
09:34
masak` joined
09:38
masak left,
pmurias joined
|
|||
pmurias | hi | 09:39 | |
colomon | \o | 09:40 | |
09:40
snarkyboojum joined
|
|||
mberends | masak: imho a proto -> pls refactor is a big task to undertake on the Rakudo * timescale, unless it can be broken down into smaller intermediate steps. | 09:41 | |
masak` | mberends: indeed. I'm just throwing the idea out there. I want to finish the Web.pm grant before digging into proto. | 09:43 | |
mberends | ok, you've got my neurons oscillating | ||
masak` | for me, 'testable core' is the important feature in such a refactor. after that, it's mostly about gradually adding tests. | ||
mberends | yes, testing still rocks :) | 09:44 | |
mathw | yes | 09:47 | |
testing is good | |||
especially if you've got code written to allow it | |||
09:48
masak`` joined
|
|||
masak`` | the pls core would essentially be a brain-in-a-vat, getting sensory input through some channels and sending motor instructions through others. | 09:49 | |
I should be able to whip up a proof-of-concept in a day or so. | |||
after Web.pm is wrapped up. | |||
09:49
masak``` joined
|
|||
mathw | well that's what you want for testing | 09:50 | |
logic core self-contained, no I/O done inside it | |||
then you can just wrap tests around it | |||
09:50
masak```` joined
|
|||
mathw | which carress it lovingly until it explodes | 09:50 | |
having problems, I see | |||
masak```` | yes. think of logging off for a while. | ||
dalek | kudo: 738fad4 | (Solomon Foster)++ | src/core/metaops.pm: Extend prefix and postfix array hypers to handle nested hashes. |
09:51 | |
mathw | \o/ | ||
nice commit | |||
masak```` | colomon++ | ||
09:51
masak```` left
09:53
xabbu42 left
|
|||
pugssvn | r31102 | colomon++ | [t/spec] Tests for prefix and postfix array hypers with nested hashes. | 09:53 | |
09:53
masak` left
09:54
masak`` left
09:55
masak``` left
|
|||
colomon | slowly but surely extending hypers. | 09:57 | |
snarkyboojum | I'd enjoy helping out with a proto refactor if extra hands are needed | 10:00 | |
if not, I'll just cheer from the sidelines :P | 10:01 | ||
10:06
xabbu42 joined
|
|||
mberends | snarkyboojum: we do need a helping hand there. It's a combination of P5 and P6 code that "grew" as the needs appeared. | 10:07 | |
10:07
agentzh left
|
|||
mathw | I suggest... some kind of design | 10:07 | |
mberends | mathw: agreed. the previous process evolved without a Grand Plan, hence the need to refactor | 10:09 | |
in the meantime, the Perl 6 module ecosystem has been given a better shape in ~/.perl6 | 10:10 | ||
snarkyboojum | mberends: yeah, I'm kinda familiar with it - I've used it and read through the source code a couple of times | 10:11 | |
mberends | :) | 10:12 | |
10:12
Chillance joined
|
|||
mathw | mberends: recent experience at $day-job has shown me the value of a good plan, especially on a multi-person project | 10:13 | |
mberends | mathw: it's so obvious that we sometimes forget it. And everything we do in #perl6 should be multi-person :) | 10:15 | |
mathw | :) | 10:16 | |
or at least potentially multi-person | |||
mberends | one design area that bothers me, is that proto cannot determine whether to install modules into ~/.perl6/lib or <parrot_install>/lib/2.4.0-devel/languages/perl6/lib | 10:17 | |
the former is personal, the latter is system | 10:18 | ||
arnsholt | Default to personal, add switch to install to system? | 10:20 | |
10:20
pmurias left
|
|||
arnsholt | And perhaps other way 'round if you're root | 10:20 | |
colomon | +1 | ||
10:22
__2synth joined
|
|||
snarkyboojum | and/or do what cpanm is doing - install to a system perl6 unless you're using local::lib (or equiv eventually) :) | 10:24 | |
maybe | |||
pugssvn | r31103 | colomon++ | [t/spec] Add fudged test for >>. on hash. | 10:26 | |
10:26
synth left
10:31
pmurias joined
10:40
proller left
10:42
proller joined
10:44
wolverian joined
|
|||
colomon | jnthn: ping? | 10:50 | |
10:54
pmurias left
|
|||
jnthn | colomon: morning! | 11:03 | |
colomon | o/ | 11:04 | |
I was just looking at the code for >>.method | |||
Seems like it would be a win if we could refactor it to use the standard >>op code. | 11:05 | ||
cognominal | o/ | 11:06 | |
jnthn | Feel free if you can get it to work. | ||
11:06
proller left
|
|||
jnthn | I guess we'd need to somehow promote the method call to a closure or soemthing. | 11:06 | |
*something | |||
colomon | jnthn: well, the thing is, I don't have a clue how to approach that in nqp. | ||
right. | |||
I guess if we could get the name of the method, we could do right | 11:08 | ||
11:08
ejs left
|
|||
jnthn | colomon: What's the main win we'd get from it? | 11:08 | |
11:09
proller joined
|
|||
colomon | sub apply-method($method-name, $object) { $object."$method-name" } and then use assuming... | 11:09 | |
main win is it would automatically handle all the cases that aren't just a straight array. | |||
11:09
JimmyZ left
|
|||
colomon | nested arrays, hashes, etc. | 11:09 | |
right now >>. is drastically stupider than >>op | 11:10 | ||
jnthn | OK | 11:13 | |
11:13
ejs joined
|
|||
colomon just realized that the hyper subs should be a direct part of the spec -- lots of potential reuse value for non-operators... | 11:16 | ||
jnthn | colomon: Hmm. I don't think it'll be too hard, but perhaps not too easy either. :-) | 11:19 | |
colomon | :) | 11:20 | |
jnthn | Can probably have a proper go at the weekend or so. | ||
cognominal | jnthn, help : paste.lisp.org/display/111140 | ||
why ~$<name> returns "1"? | 11:21 | ||
jnthn | cognominal: because it's quantified | 11:23 | |
Go for ~$<name>[0] | |||
cognominal | I hate the current behavior '?' quantifier | 11:24 | |
here again I got hurt. | |||
jnthn | It's consistent with all the quantifiers, at least. | 11:25 | |
cognominal | I agree, but consistency for sake of consistency has never been condoned here :) | 11:27 | |
colomon | jnthn: \o/ | 11:29 | |
11:30
snarkyboojum left
11:34
ejs left
11:45
[mark] left
11:50
plainhao joined
11:53
envi^home joined
11:55
satyavvd left
11:57
meppl joined
12:01
skids left
12:08
proller left,
lest_away is now known as lestrrat
12:09
Guest6050 left,
proller joined
12:13
shrub1 joined
12:14
shrub left
12:16
bluescreen joined,
bluescreen is now known as Guest86191
|
|||
takadonet | morning all | 12:19 | |
12:19
PenThrive left
|
|||
colomon | o/ | 12:20 | |
12:30
pausenclown left,
Guest86191 left
12:34
colomon left
12:45
Guest86191 joined
12:47
kaare joined,
kaare is now known as Guest48560
12:58
finanalyst left
12:59
gfx left
13:00
bjarneh left
|
|||
mathw | It's so quiet today | 13:00 | |
13:00
colomon joined
|
|||
mathw | In the office, online... | 13:00 | |
even in here! | |||
jnthn | OH HAI MATHW | 13:06 | |
It's Friday afternoon. Nobody trusts themselves to do anything right. ;-) | |||
mathw | lolitsjnthn | ||
half my office are on holiday | |||
mathw scowls | |||
jnthn | Wait, it is Friday right... | ||
mathw | yes it's Friday | ||
jnthn | ah | 13:07 | |
13:07
M_o_C joined
|
|||
jnthn | Thursday mighta been preferable. Still quite a bit to prepare for $dayjob-project-showing-off. | 13:07 | |
otoh, at least it's going well. :-) | 13:08 | ||
mathw: Wasn't it bank holiday in the UK on Monday? | 13:09 | ||
mathw | yes | 13:10 | |
it's also half term | |||
13:10
snarkyboojum joined
|
|||
jnthn | Ah | 13:11 | |
13:11
ejs joined
|
|||
jnthn | Can imgine they combine to give a lot of people having time off. | 13:11 | |
mathw | yes | ||
there are definitely some parents who've had the four days off | 13:12 | ||
and lots of people off today, tacking an extra day on the weekend | |||
jnthn | Well, if the weather is as nice there as it is here, I can't blame 'em. :-) | 13:13 | |
mathw | it's lovely today | ||
really sunny and clear | |||
and I'm stuck in an office with overactive air conditioning :( | |||
it's actually cold in here | |||
ridiculous | |||
jnthn | Quite the energy waste. | 13:15 | |
mathw | yes | 13:16 | |
and on a day when it's so hot outside, I shouldn't need to be considering bringing a jumper to keep me warm in the office! | |||
although when the air con fails, this building gets very uncomfortable very quickly so I am kind of glad it's on... | |||
it's not designed sensibly | |||
jnthn | Let me guess, in winter the heating is so good you can work in a t-shirt? :-) | 13:18 | |
mathw | mostly | 13:20 | |
but it's got a lot of help from all the computers :) | |||
if they were really clever they could pipe heat from the server room into the offices in the winter | |||
but they're not that cunning | |||
13:21
masonkramer_ joined,
masonkramer left,
masonkramer_ is now known as masonkramer,
ejs left
13:24
bjarneh joined
13:27
ejs joined
13:29
skids joined
13:33
M_o_C left
13:35
Chillance left
13:36
ejs left
13:46
pmurias joined
13:49
clsn left,
snarkyboojum left
14:01
JimmyZ joined
|
|||
JimmyZ | p6c | 14:03 | |
14:04
spinclad joined
14:07
uniejo left
|
|||
pmurias | JimmyZ: ? | 14:10 | |
JimmyZ | hello? | ||
pmurias | hi | 14:11 | |
JimmyZ | hello | 14:12 | |
14:12
arthur-_ joined,
ash__ joined
14:13
xomas_ is now known as xomas,
arthur-_ left
|
|||
jnthn | Wow...so nice outside. :-) | 14:21 | |
jnthn wishes laptops weren't so uncomfy for him, otherwise he could go and hack in a the park for a bit | |||
ash__ and screen's were decent in sunlight | 14:25 | ||
14:25
macdaddy joined
|
|||
jnthn points out the low-tech solution of a shady tree :-) | 14:25 | ||
14:26
macdaddy is now known as Guest75571
|
|||
ash__ | true, those work most of the time | 14:27 | |
the new macbook pro's from apple get 9 hours of battery life, my friend just got one, they are really nifty... | |||
jnthn | Nice | 14:28 | |
I thought my ThinkPad comfortably managing around six hours was good going. :-) | |||
14:29
pmurias left
|
|||
mathw | it is | 14:29 | |
ThinkPads have trackpoints | 14:30 | ||
therefore they are far superior to any shiny thing from apple | |||
ash__ | lol, this reminds me of a patent apple got recently, its for using external light (eg. sunlight) to light a screen instead of led's gizmodo.com/5502431/apple-patent-ap...d-sunlight | 14:31 | |
jnthn | mathw: Yes, but they're not shinier. Isn't that what matters most? ;-) | 14:32 | |
mathw | jnthn: no | ||
I much prefer my ThinkPad to my Powerbook G4 | 14:33 | ||
even though ti was very nice and far superior to the Dell I had afterwards | |||
but I always wanted a ThinkPad | |||
and now I've got one | |||
jnthn | # | ||
oops | |||
Yeah, I had one for several years, until the point it was just too slow. | 14:34 | ||
I work on this thing that's quite resource intensive now and then... | |||
:-) | |||
dalek | ok: e5b650b | moritz++ | src/operators.pod: [ops] typo, whiteknight++ |
14:36 | |
ash__ | i am making progress on my GSoC NCI work, i hope it gets done before Rakudo* comes out, then you can dynamically make any signature for FFI calls you want | 14:37 | |
mathw | \o/ | ||
ash__ | i think that would lower the bar for use a lot, since you don't have to make C extensions to use most libraries | 14:38 | |
s/bar/bar of entry/ | |||
err | |||
i fail english | |||
moritz_ might buy an Acer UL30a for $work | 14:39 | ||
it has a nominal battery life of 12H | 14:40 | ||
jnthn | ash__: Nice! | ||
ash__++ | |||
moritz_ | dual core, 4G ram... 13.3" display | 14:41 | |
14:41
proller left
|
|||
jnthn | ash__: Is it suing some existing FFI library? Or home-grown? | 14:41 | |
ash__ | libffi | ||
jnthn | ok | ||
Know how well it builds/works on Win32? | |||
ash__ | which is supported on a large number of systems | ||
yes, it works on windows | |||
jnthn | \o/ | 14:42 | |
ash__: Anything in Parrot trunk yet? | |||
ash__ | there are some platform specific things, like for instance if I wanted to load libc on OS X, or linux i'll ask for a library called libc, but on windows its msvcrt | 14:43 | |
not yet, but when i do, it should be merged eventually | |||
14:43
proller joined
|
|||
jnthn | OK, it'd be cool to have that before R*. | 14:44 | |
ash__ | github.com/atgreen/libffi it lists Windows as supported platforms (x86 and x86-64) but if you use the windows compiler you have to configure it with an additional parameter | 14:46 | |
14:46
estrabd joined
14:47
gbacon joined
14:56
ashleydev joined
|
|||
jnthn | ash__: Eww. | 14:56 | |
ash__: To build it with MS VC++ you still need MinGW! | |||
ash__ | really? | ||
14:56
ejs joined
|
|||
jnthn | Yeah, but tbh for Windows users I suggest just make a binary and link to it somewhere, or better link to an existing one. | 14:56 | |
(if there is such a thing) | 14:57 | ||
14:57
dual left
|
|||
mberends | would that akshually make zavolaj redundant? | 14:57 | |
jnthn | mberends: No, it makes Zavolaj useful :-) | ||
Well, usefuller. | |||
mberends | :-) :-) | ||
yeah, flexibler | 14:58 | ||
jnthn | mberends: We already rely on Parrot's NCI today. This means we can support any signature rather than just those Parrot gives us. | ||
mberends | ash__++ | ||
ash__ | i'll see if i can find a libffi pre-built for windows, i know before 3.0.10 (which hasn't actually been released yet) there were a set of patches that were needed for it to build on windows, but they have them merged into the core now. I know python uses libffi for its ctypes (the same thing as nci) and they bundle libffi in the core source code with the patches applied | 15:03 | |
jnthn | ash__: Heh, I could always download Python binary build...just for the libffi. ;-) | ||
ash__ | i don't know if its a separate part or if they just put it all into python's main dll | 15:04 | |
jnthn | .oO( Python guys: Even the Perl 6 team find a use for Python! ) |
||
15:13
JimmyZ left
15:26
pnu left
15:27
_jaldhar left,
pnu joined
|
|||
pmichaud | good morning, #perl6 | 15:31 | |
PerlJam | good morning pm. How's life? | ||
pmichaud | About the same 1/2 :-) | 15:32 | |
15:32
Guest43663 joined
15:33
patspam joined
|
|||
jnthn | morning, pmichaud | 15:33 | |
PerlJam | pmichaud: your name came up at the TCOON meeting yesterday | 15:35 | |
15:36
ruoso left
|
|||
PerlJam | pmichaud: Doug asked if we could hire you to document all of the software for datums processing and write a little manual for it. | 15:36 | |
15:38
jaldhar joined
15:39
proller left
|
|||
pmichaud | PerlJam: easier (and cheaper) would be if we just got you or other members of TCOON to ask me questions and I write responses and you guys make a manual out of that :) | 15:39 | |
(and faster, likely) | |||
PerlJam | Since jrizzo is supposedly going to learn how it all works so that he can do the processing, he might be the right person to ask questions. | 15:41 | |
But somehow I think he's as adverse to writing manuals as the rest of us. | |||
pmichaud | Right. But I suspect that in my current situation I'm more adverse. :) | 15:42 | |
PerlJam | indeed | ||
15:42
proller joined
|
|||
pmichaud | also, I figure I kinda owe CBI some work, so I'm not sure I'd want to be paid for it. | 15:43 | |
15:44
jaldhar left
|
|||
PerlJam | If you want to work for free, I'd rather you work on something more fun (for all of us) than a manual :) | 15:44 | |
pmichaud | well, for the next eight weeks I'm unlikely to work on anything other than Rakudo. :-) | ||
jnthn | :-) | 15:45 | |
PerlJam | oh, and Dale Crocket asked about you too. | ||
15:46
k23z__ joined
|
|||
k23z__ | just saw on reddit a question about a GUI toolkit | 15:46 | |
I'm writing my own toolkit in C++ from scratch on top of SDL | 15:47 | ||
SDL offers just basic graphics primitives | |||
and is also portable, as a result the toolkit will be portable | |||
anyone interested in writing bindings ? :) hehe | |||
pmichaud | PerlJam: I noticed that TCOON stations how have their own facebook pages?!? | ||
PerlJam | pmichaud: and the data are broadcast via twitter too | 15:48 | |
several of the sponsors (and potential sponsors) were very excited about that. | |||
pmichaud | sometimes I worry about you guys. | ||
:-) | |||
jnthn | omgzweb2.0! | 15:49 | |
:-) | |||
[particle] | what, they don't use twitter? | ||
jnthn says, while hacking on shiny AJAX thingy | |||
PerlJam | pmichaud: if the tcoon stations get their own myspace pages ... *then* you should start to worry ;) | ||
pmichaud | or if they start showing up on match.com | 15:50 | |
15:51
ruoso joined
|
|||
Su-Shee | jnthn: we're at web 3.5 already. please update. :) ("HTML 5, CSS 3") | 15:57 | |
jnthn | Oh noes...my skills are out of date! | ||
15:58
ejs left,
TiMBuS left
|
|||
Su-Shee | jnthn: but it's VERY shiny! | 15:59 | |
ok, actually it's really cool and will make serious web development extremely nicer and powerful. | 16:00 | ||
16:00
uvtc joined
|
|||
arnsholt | Is there an established Perl 6 idiom for a for loop where you need a counter variable? | 16:02 | |
colomon | arnsholt: counter by itself, or counter along with a value? | ||
uvtc | Hi. I've got Parrot + Rakudo installed into /usr/local/parrot and would like to try installing a few modules for it. I've created a /usr/local/perl6lib directory to house those modules. Is there any sort of standard yet for how to go about installing the modules listed at proto.perl6.org/ ? | 16:03 | |
arnsholt | Along with a value | ||
pmichaud | arnsholt: for @list.kv -> $index, $value { ... } | ||
arnsholt | Oooh, nice. Thanks muchly | ||
16:04
estrabd left,
estrabd joined
|
|||
uvtc | I mean, if you want to install by-hand, rather than using Proto. | 16:05 | |
Analogous to Perl 5's: perl Build.PL ./Build ./Build test ./Build install | |||
16:07
dual joined
16:10
lestrrat is now known as lest_away,
proller left
16:11
ashleydev_ joined
16:14
ashleydev left
16:15
xabbu42 left,
xabbu42 joined
|
|||
arnsholt | Does the @ sigil imply List or Array? | 16:16 | |
pmichaud | currently "Positional" | 16:17 | |
mberends | k23z__: yes, I'm interested in writing bindings (using zavolaj) for native libraries | ||
uvtc | FWICT, there's no standard ATM. Will just copy files manually into place if not using Proto. | 16:18 | |
arnsholt | Ah. In S32/Containers I see stuff like method foo(@values:) for both List and Array. That would then be a bit wrong for both, right? | ||
pmichaud | arnsholt: possibly, but possibly not. | 16:19 | |
arnsholt | Hmm? | ||
mberends | uvtc: before choosing your own custom directories, consider using the standard ones listed in: perl6 -e'.say for @*INC' | 16:20 | |
k23z__ | mberends, what's zavolaj ? | 16:21 | |
uvtc | mberends: Thanks. I see. Per-user ones can go in ~/.perl6/lib and system ones can go into .../parrot/lib/2.4.0-devel/languages/perl6/lib . | 16:22 | |
mberends | k23z__: the Rakudo link to Parrot NCI: github.com/jnthn/zavolaj | ||
uvtc: correct! | |||
16:23
rokoteko joined
|
|||
uvtc | mberends: That said, I think a 3rd option would be useful: system modules that you don't want to install under the parrot directory. That is, if I wipe out and reinstall Parrot + Rakudo, I'd like to still have my system Perl 6 modules around somewhere. | 16:23 | |
16:24
justatheory joined
|
|||
sorear return | 16:24 | ||
mberends | uvtc: good point. I think the planned proto -> pls refactor should take your scenario into account | ||
16:24
proller joined
|
|||
uvtc | mberends: "proto -> pls"? | 16:25 | |
mberends | we're expecting to refactor proto "soon", and pls my be its new name | ||
*may be | |||
eternaleye | arnsholt: Positional is a role. Array does it, Seq does it, etc. | 16:26 | |
arnsholt | True. But Something that does Positional is not necessarily an Array or a Seq, no? | 16:27 | |
moritz_ | no | ||
arnsholt | But I suppose that might not be a problem | ||
16:27
shrub1 left
|
|||
uvtc | mberends: Thanks. Do you happen to know if "pls" is an acronym for something? | 16:27 | |
mberends: just curious. | 16:28 | ||
moritz_ | ./pls install foo | ||
uvtc | Hahaha. :) | ||
16:28
wallberg left
|
|||
arnsholt | I'm just glad it's not plz =) | 16:28 | |
Although if it were called plzen we could abbreviate it to plz ^^ | |||
jnthn | "Perl Library System" | 16:29 | |
mberends | ./pls gimme foo | ||
jnthn | arnsholt: If it were called plzen I'd drink it! | ||
arnsholt | Me too =D | ||
Su-Shee | jnthn: wrong. "polite library system" :) | 16:30 | |
jnthn | Su-Shee: Nice :-) | ||
Su-Shee | I'm totally for pls. :) | ||
it makes so much more sense.. pls delete foo, pls install bar, pls update xyz .. great :) | 16:31 | ||
pmichaud | 16:27 <arnsholt> True. But Something that does Positional is not necessarily an Array or a Seq, no? | ||
correct, which is partially why I said @ _currently_ means Positional. It may change. | |||
jnthn | mberends: pls call it that ;-) | 16:34 | |
pmichaud | ./pls install cheezburger kthxbye | ||
pls +1 | 16:35 | ||
jnthn | Nice, now I know what to call my next 2 Perl 6 modules. | ||
16:35
eternaleye left
|
|||
mberends | :-) | 16:35 | |
Su-Shee | jnthn: HugMe and KissMe? ;) | 16:36 | |
jnthn | EALREADYHUGME | 16:37 | |
pmichaud | why would that be an E, exactly? ;-) | ||
Su-Shee | pls is definetely cool. :) | ||
16:38
bjarneh left,
bjarneh joined
|
|||
jnthn | pmichaud: Well here the prefix stands for "Excellent!" | 16:38 | |
:-) | |||
[particle] | i can't believe pls hasn't already been taken by some linux pkg, but i can't find it with apt-get | 16:39 | |
pls make me a sandwich | 16:40 | ||
pmichaud | IT'S OURS NOW!!!!! YOU CAN'T HAVE IT! | ||
uvtc | sudo pls make me a sandwich | ||
Su-Shee | pls test foobar. nice. | 16:41 | |
uvtc | For running tests that come with Perl 6 modules, is it simply `cd project-dir; perl6 t/*`? | ||
ash__ | uvtc: make test | 16:43 | |
rokoteko | hm. the 'Perl 5 to perl 6' tutorial (at perlgeek.de/en/article/5-to-6) says 'Since everything is an object, you can call methods on arrays' in the chapter talking about arrays it states 'perlgeek.de/en/article/5-to-6' ... is sub foo { 3, 1, 2 4 }; foo.sort(); expected to DWIM then? | ||
phenny | rokoteko: 22 May 18:53Z <TimToady> tell rokoteko you want something like: my $x = { map { $^x * 2}, @_ }; say $x(1..5); | ||
rokoteko: 22 May 18:56Z <TimToady> tell rokoteko Yes, ... is a dwimmy "series" operator, while .. is just interval ranges; === is exact type and value equivalence, while == is forced numeric as in p5 | |||
16:44
ashleydev_ left
|
|||
pmichaud | rokoteko: if you're expecting it to sort the return values, then yes -- I think it dwym | 16:44 | |
ash__ | rakudo: sub foo { 4, 2, 3, 1}; say foo.sort; | ||
p6eval | rakudo 738fad: OUTPUT«1234» | ||
jnthn | rokoteko: Note that you're calling the sub and sorting the returns, not calling .sort on the sub | ||
rokoteko | ah. brilliant. I should learn to use the bots here or compile perl6. | ||
jnthn | rokoteko: To call an actual method on a sub you stick an & before it, fyi. | 16:45 | |
ash__ | you can /msg p6eval rakudo: + code and it will give the result | ||
uvtc | ash__: From looking at some of the modules listed at proto.perl6.org/ (I assume this is currently the main Perl 6 module listing), some don't come with a makefile (though some come with a Makefile.in and a Configure script ...) | ||
ash__ | or do it here if you want others to see it | ||
jnthn | rakudo: sub foo($a, $b?) { }; say &foo.signature.perl | ||
p6eval | rakudo 738fad: OUTPUT«:(Any $a, Any $b?)» | ||
TimToady is going into the shower to think about whether Positional should delegate unrecognized methods to its 0th element if .elems == 1 | 16:46 | ||
16:46
Maddingue[work] left
|
|||
TimToady | would take the agony out of ? quantifiers, methinks | 16:46 | |
rokoteko | TimToady: man that's amazing what just happened. | ||
Su-Shee | jnthn: could you please repeat "call a method on a sub"? ;) how do I call a method on a method then? ;) | ||
rokoteko | TimToady: I guess Im repeating myself instead of reading the docs. ;) | 16:47 | |
TimToady | you can say that again | ||
Su-Shee | rokoteko: read the specs directly and code "like it feels right". you usally hit the right stuff. | ||
16:47
cdarroch joined,
cdarroch left,
cdarroch joined
|
|||
jnthn | Su-Shee: Get hold of the method somehow and call on it. :-) | 16:48 | |
ash__ | uvtc: sorry, i thought you meant the core perl6 tests | ||
rokoteko | hm. the 'Perl 5 to perl 6' tutorial (at perlgeek.de/en/article/5-to-6) says 'Since everything is an object, you can call methods on arrays' in the chapter talking about arrays it states 'Since everything is an object, you can call methods on arrays' is sub foo { 3, 1, 2 4 }; foo.sort(); expected to DWIM then? | ||
# just trying it out. | |||
jnthn | Su-Shee: .^methods for example | ||
rakudo: class A { method m($x) { } }; say A.^methods[0].signature.perl | 16:49 | ||
p6eval | rakudo 738fad: OUTPUT«:(Mu : Any $x;; *%_)» | ||
rokoteko | Im clueless. but Im sure there are a lot of powers beside my understanding. Just never thought it would happen on irc. ;) | ||
ash__ | rakudo: say (1, 2).^methods | 16:50 | |
Su-Shee | jnthn: why do I even ask.. ;) | ||
p6eval | rakudo 738fad: OUTPUT«postcircumfix:<[ | ||
..]>listACCEPTShashfmtsortSeqiteratorBoolitemdefinedrotateperlCaptureofelemsIntlistNumeagerelemsSeqStrceilingunpolarsamecasefloorsubstrasechordroundflipsplitmatchacosecacoshwordscosechcotanatan2ucfirstcombtanatancosacosfmtevalchoptanhsubstNumericchompindexchracotanht… | |||
jnthn | rakudo: say (1, 2).WHAT # Parcel, I guess | 16:51 | |
p6eval | rakudo 738fad: OUTPUT«Parcel()» | ||
rokoteko | jnthn: so are you saying that foo.sort.map{} is ok, but it's not lazy? | ||
jnthn | rokoteko: Well, I think a sort kinda can't be lazy in some senses. But it's possible (but not for sure) that the sort could be delayed until the .map first needs a value. | ||
ash__ | @a = foo ==> *.sort ==> map: { } ; # is that right? for feeds | 16:52 | |
jnthn | ash__: hmm...maybe you'd want instead | 16:53 | |
foo ==> *.sort ==> map: { } ==> @a | |||
rokoteko | jnthn: in other words; my $count = 0; foo.map{$count++ < 10}.sort.map{}; sub foo { 1..Inf } .. is it dwimmy? | 16:54 | |
ash__ | oh, i have it backwards, <== is feed | ||
jnthn | ash__: Well, both are, you can do either direction :-) | ||
ash__ | oh, got ya | ||
rokoteko | oh wait. it misses a last. | ||
ash__ | rakudo: my $count = 0; foo.map{$count++ < 10}.sort.map{}; sub foo { 1..Inf }; | ||
p6eval | rakudo 738fad: OUTPUT«No candidates found to invoke in main program body at line 11:/tmp/37z1JkorBt» | ||
rokoteko | jnthn: in other words; my $count = 0; foo.map{$count++ < 10 and last}.sort.map{}; sub foo { 1..Inf } .. is it dwimmy? | ||
jnthn | map wants the thing you pass to it to be in a closure there, fwiw | 16:55 | |
rokoteko | ok, this is bit kludgish, but hope you get my point of passing the Inf list through a map and a sort before checking when to end. | ||
jnthn | oh, and "or last" | ||
But I think it would do what you want yes | |||
At the moment though map doesn't handle "last" etc | |||
rokoteko | ah brilliant. | ||
jnthn | But it should. | ||
ash__ | rakudo: my $count = 0; (1..Inf).map: { $count++ if $^a < 10 or last } | ||
p6eval | rakudo 738fad: OUTPUT«===SORRY!===Confused at line 11, near "(1..\x{1c}Inf)."» | 16:56 | |
sorear | also, map { $count++ < 10 or last } is spelled batch(10) | ||
16:56
bjarneh left
|
|||
sorear | what does .map{}; mean? | 16:56 | |
jnthn | sorear: It means a : is missing :-) | ||
rokoteko | rakudo: batch(10).map{$_++}.sort.map{$_ % 4}.(1..Inf) | 16:57 | |
p6eval | rakudo 738fad: OUTPUT«Could not find sub &batch in main program body at line 11:/tmp/iFuS0oquq5» | ||
rokoteko | sorear: where is batch() defined? | ||
sorear | Not sure | ||
16:57
dakkar left
|
|||
sorear | it is defined, and it works beautifully | 16:57 | |
ah | 16:58 | ||
S07:196 | |||
jnthn takes a little break | |||
ash__ | rakudo: my $count = 0; eager(1..Inf).map: { print $^a; $count++ if $^a < 10 or last }; print $count; # how do you make it not lazy again? | 16:59 | |
p6eval | rakudo 738fad: ( no output ) | ||
ash__ | that was a bit more lazy than i meant it to be | ||
rokoteko | sorear: can you show an example of it working with the eval bot? Im bit confused. Hope you pardon my questions. :/ | ||
colomon | ash__: pretty sure saying eager(1..Inf) is a Bad Idea. | 17:00 | |
17:00
uvtc left
|
|||
PerlJam | indeed | 17:00 | |
ash__ | good point.. | ||
rakudo: my $count = 0; eager(1..100).map: { print $^a; $count++ if $^a < 10 or last }; print $count; | |||
p6eval | rakudo 738fad: OUTPUT«0» | ||
17:03
k23z__ left
|
|||
rokoteko | TimToady: btw. thanks for explanation of the difference with "==" and "===" .. | 17:04 | |
17:07
PacoLinux left,
PacoLinux joined
|
|||
cognominal | is there a class that all hash, array and scalar nature at once without all the bagage of a Signature? | 17:08 | |
17:09
supernovus joined
|
|||
PerlJam | "nature at once"? | 17:10 | |
17:11
ashleydev joined,
PacoLinux_ joined,
PacoLinux left,
PacoLinux_ is now known as PacoLinux
|
|||
cognominal | A signature can act as a scalar, or an array, or an hash. That's what I want. | 17:11 | |
colomon | rakudo: my $count = 0; (1..100).map: { print $^a; $count++ if $^a < 10 or last }.eager; print $count; | 17:12 | |
p6eval | rakudo 738fad: OUTPUT«Method 'eager' not found for invocant of class 'Block' in main program body at line 11:/tmp/Q0GrWJO32J» | ||
colomon | rakudo: my $count = 0; ((1..100).map: { print $^a; $count++ if $^a < 10 or last }).eager; print $count; | ||
p6eval | rakudo 738fad: OUTPUT«12345678910 in <anon> at line 1 in main program body at line 5466:CORE.setting» | ||
colomon | last doesn't work properly in map yet, I think. | 17:14 | |
17:14
Guest43663 left
|
|||
cognominal | hum, may be I just can't use a Signature. Probably, I will not be hurt by its extra behaviors. | 17:15 | |
17:16
azert0x joined
|
|||
cognominal | or I could derive from the Capture PMC without adding anything | 17:16 | |
supernovus | Creating patches for rakudo is easy enough, but how would I go about sending a patch for a spectest? svn is not as nice in this case. Would an svn diff work? | 17:18 | |
17:18
justatheory left
17:19
proller left,
proller joined
|
|||
[Coke] | sure. or you could just get a commit bit. | 17:19 | |
supernovus | Hi [Coke], how would I go about getting a commit bit? | 17:21 | |
[Coke] | most folks here can hand one out for pugs. | 17:22 | |
17:22
justatheory joined
|
|||
[Coke] | they'd just need your email addy | 17:22 | |
17:23
justatheory left
|
|||
rokoteko | Su-Shee: oh man, you were lying. it's not dwimmy at all. :/ | 17:24 | |
[particle] | i can hand out a commit bit... | ||
Su-Shee | rokoteko: it is! just do what _I_ mean! ;) | 17:25 | |
[Coke] | er, email addy and a desired userid. | ||
Su-Shee | rokoteko: and don't start with high end golf. | ||
[Coke] | (and this is why I dislike "dwim" =-) | 17:26 | |
rokoteko | Im trying to avoid assigning to operators in between calls to functions. is that wrong? | ||
s/operators/variables/ | |||
17:26
proller_ joined
|
|||
[particle] | supernovus: what's your email address and preferred username? | 17:26 | |
supernovus | Well, my e-mail addy is easy enough, avoiding spam-bots from harvesting the IRC logs, it's the current year AT huri dot net and 'novus' for userid or 'supernovus' if the prior is unavailable. | ||
[particle] | sweet | ||
TimToady | I think I convinced myself in the shower that treating <atom>? the same as <atom>**0..1 is a mistake, and ? should go back to being special cased to return a scalar or undefined | ||
Su-Shee | rokoteko: remember this quote about premature optimaziation? ;) | ||
17:27
proller left
|
|||
[particle] | send an invite to 2010@... /novus | 17:27 | |
Su-Shee | optimization. | ||
TimToady | and I think we can change it back without too much pain, since .[0] is a no-op on a scalar | ||
[particle] | might take a few minutes to get it. speak up if something goes wrong | ||
rokoteko | Su-Shee: If I wouldnt be prematurely optimizing I would be trying to do this in perl5. | 17:28 | |
TimToady | pmichaud: ^^^ | ||
pmichaud | TimToady: !!!! | ||
.[0] is a no-op on a scalar? | |||
really? | |||
TimToady | and I think with the current setup we induce an unnecessary FAQ | ||
pugs: say 42.[0].[0].[0] | |||
p6eval | pugs: OUTPUT«42» | ||
pmichaud | okay, I can make that work. | ||
TimToady | rakudo: say 42.[0].[0].[0] | 17:29 | |
p6eval | rakudo 738fad: OUTPUT«get_pmc_keyed() not implemented in class 'Integer' in main program body at line 1» | ||
pmichaud | Changing the meaning of ? now is going to cause a lot of nqp pain. :-( | ||
Su-Shee | rokoteko: well then you have to up you understanding of dwim :) | ||
TimToady | at worst, it creates a list via Any and indexes that | ||
supernovus | thanks [particle] the mail has arrived :-) | ||
pmichaud | TimToady: <atom>? <other> <atom>? would still result in an array, yes? | 17:30 | |
TimToady | yes, presumably | 17:31 | |
multiple mentions always have that effect | |||
pmichaud | okay, here's the issue I see. | ||
supernovus | hmm, the link to set my password appears to be broken though. | ||
pmichaud | in the case of match objects, .[0] is never a no-op | ||
TimToady | $<atom>[0] always gets the first <atom>, which may or may not be defined | 17:32 | |
pmichaud | I would think that $<atom> would give me the 0-capture from within the atom subrule. | 17:33 | |
sorry, $<atom>[0] | |||
token atom { (xyz) }; token expr { <atom>? } | |||
TimToady | that's already not true for <atom>* | ||
pmichaud | $<atom>[0] means something entirely different if $<atom> is a match object instead of an array. | 17:34 | |
I feel like I must be missing something obvious. | 17:35 | ||
supernovus | never mind, google chrome and port 6666 don't seem to like each other... firefox works fine | ||
pmichaud | I just don't see how "we can change it back ..." can be true. | 17:36 | |
rokoteko | my $x = { @_.map({ ++$_}).map({ ++$_ }).map({ ++$_ }).batch(5)}; print $x(1..5) # can I pass another array as an input to $x ? | 17:38 | |
ie. $x((1..3), (1..4)) ? | 17:39 | ||
colomon | rokoteko: yes, but that's not really the way to do it. | ||
pugssvn | r31104 | novus++ | Tests for DateTime.Date() and Date.new(::DateTime) added. | ||
colomon | or wait, maybe it will work? | 17:40 | |
it's not very idiomatic p6, at any rate, IMO. | |||
pmichaud | anyway, I'm ultimately fine if we change $<atom>? to be undef/match instead of always an array, but I don't think it's an easily reversible decision. | ||
[particle] | novus++ | 17:41 | |
rokoteko | rakudo: my $x = { @_.map({ ++$_}).map({ ++$_ }).map({ ++$_ }).batch(5)}; print $x(1..10) | ||
p6eval | rakudo 738fad: OUTPUT«45678» | ||
rokoteko | colomon: how am I supposed to do it then? | ||
pmichaud | (as evidenced by the fact that is itself a reversal that isn't easily made for existing code) | ||
*that this | |||
17:43
xabbu42 left,
hercynium joined
|
|||
rokoteko | rakudo: my $x = { @_.map({ ++$_}).map({ ++$_ }).map({ ++$_ }).batch(5)}; print $x($_) for ((1..10), (11..20)) | 17:44 | |
p6eval | rakudo 738fad: OUTPUT«4567891011121314151617181920212223» | ||
rokoteko | ahh it works. how is this not perl6'ish? | ||
supernovus | Well, in both cases trivial stuff, but yesterday was my first patch to rakudo, and today my first commit to the test suite. :-) | ||
rokoteko | $x = {} .. then you can only do $x($scalar) not a $x(@list) ? | ||
17:45
stephenlb joined
|
|||
TimToady | pmichaud: okay, I will think about how best to get there from here. | 17:46 | |
commuting & | |||
pmichaud | TimToady: I'm only asking that if we do change it, we don't later decide to change it back yet again. :) | ||
as it is, this is a change that will affect a lot of existing p6-code. | |||
rokoteko | and my point being, which I think TimToady has been trying to explain me many times, the above with $x(1..*) is not supposed to work, correct? | 17:47 | |
pmichaud | rokoteko: why would $x(1..*) not work? | 17:48 | |
colomon | pmichaud: well, it wouldn't work under the last list revamp proposal I saw... | 17:49 | |
pmichaud | (and note that 1..* can be a scalar... anything can be a scalar) | ||
colomon | rakudo: my $x = { @_.map({ ++$_}).map({ ++$_ }).map({ ++$_ }).batch(5)}; print $x(1..*) | 17:50 | |
p6eval | rakudo 738fad: ( no output ) | ||
pmichaud | rakudo may fail there simply becuase lists are not yet sufficiently lazy. | ||
*because | |||
that's not a restriction of the language. | |||
rokoteko | pmichaud: ah. with the scalar issue I was referring to $x(@list_of_lists) .. the 1..* is a different issue. and I think it doesn't work, because I tried it out. | ||
pmichaud | rokoteko: "list of lists" makes me think you're really looking for Slicels | 17:51 | |
rokoteko | Might be. I have no idea what they are. can you give an example? :) | ||
pmichaud | rokoteko: note that Rakudo has many things "not quite right" with respect to lists, so you can't say "rakudo fails this case, therefore it's not valid Perl 6". | ||
rokoteko | pmichaud: and thanks for the correction with the 1..* -issue. so it's problem with implementation, not with the language. :) | ||
pmichaud | in fact, the entire list specification needs a rework, which is what did last weekend (and what I'm continuing today) | 17:52 | |
(and that's why I said @-sigils "currently" mean Positional, because there's a small chance that will need to change) | |||
rokoteko | pmichaud: nods. Im no only here to figure out reasons for learning perl6 compared to keep on trying to learn perl5. :) | 17:53 | |
colomon | pmichaud: I'm still inclined to think @-sigils meaning Positional is a bad idea. | 17:54 | |
rokoteko | pmichaud: do you really mean Slicels or did you just mistype slices, that happen to work in a weird way in perl6? | ||
colomon | rokoteko: he means Slicels. | ||
they're not yet implemented, so far as I know. | 17:55 | ||
rokoteko | rakudo: my $x = { @_.map({ ++$_}).map({ ++$_ }).map({ ++$_ }).batch(5)}; print $x([(1..10), (11..20)]) | 17:57 | |
p6eval | rakudo 738fad: OUTPUT«1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 23» | 17:58 | |
colomon | pmichaud: The thing is that Positional is much much weaker than Perl programmers expect @vars to be. | ||
17:58
pmurias joined
|
|||
pmurias | ruoso: ping | 17:58 | |
diakopter | pmurias: hi | ||
pmurias | diakopter: hi | ||
diakopter: how's stuff? | |||
rokoteko | my $x = { @_.map({ ++$_}).map({ ++$_ }).map({ ++$_ }).batch(5)}; print $x(([1..10], [20..30])) | 17:59 | |
man. it always seems to flatten the lists. where I can read about what Slicels are? | 18:00 | ||
18:01
ajs2 left
|
|||
diakopter | pmurias: slow. I'm an invalid, convalescing from a back injury | 18:01 | |
pmurias | :( | 18:03 | |
jnthn | diakopter: Aww. Hope you recover quickly. | ||
18:04
envi^home left
|
|||
pmichaud | colomon: (Positional) I agree. | 18:05 | |
18:05
clintongormley left
18:06
clintongormley joined
|
|||
colomon | pmichaud: of course, if we're planning on making iterators upgrade to List/Seq/Array, then Positional can too... | 18:06 | |
pmichaud | I'm not planning on that currently -- I think that's a mistake at the moment. | 18:07 | |
I think that iterators should remain scalar unless explicitly told to upgrade. | |||
18:07
estrabd is now known as estrabd_brb
|
|||
colomon | pmichaud: oooo, a change in plans. | 18:07 | |
pmichaud | well, the last plan I saw (on the mailing list) I don't think is workable. | 18:08 | |
pmurias | diakopter: is you injury serious? | ||
diakopter | pmurias: I doubt it | 18:10 | |
actually it might give me more hacking time | |||
we'll see | |||
18:11
estrabd_brb is now known as estrabd
|
|||
TimToady | rakudo: say ~(1..*).batch(10); say ~(1..*)[^10] | 18:11 | |
p6eval | rakudo 738fad: OUTPUT«Method 'batch' not found for invocant of class 'Range' in main program body at line 11:/tmp/EOQlJ9I4Zl» | ||
TimToady | rakudo: say ~(1...*).batch(10); say ~(1...*)[^10] | 18:12 | |
p6eval | rakudo 738fad: OUTPUT«1 2 3 4 5 6 7 8 9 10» | ||
TimToady thinks [^10] is not lazy | |||
pmichaud | not yet. :-) | ||
actually, it should be lazy, as it just produces a Range. | |||
but the subscripting might not be lazy | 18:13 | ||
TimToady | yet... :) | ||
rokoteko | TimToady: ok. now Im not understanding the "..." operator again. what did you say about types related to this again? | ||
'=== is exact type and value equivalence' I thought you meant something like Int $foo vs String $foo ... ? | 18:15 | ||
TimToady | rakudo: say "42" == 42 | ||
p6eval | rakudo 738fad: OUTPUT«1» | 18:16 | |
TimToady | rakudo: say "42" === 42 | ||
p6eval | rakudo 738fad: OUTPUT«0» | ||
TimToady | different types, so aren't the same | ||
== coerces to numeric, and then they're equal | |||
rokoteko | but what about your example above with .batch(10) ? ~ is not a "not" operator as in perl5? | 18:17 | |
TimToady | ~ is string concat in p6 | ||
colomon | rokoteko: ~ is stringification in p6 | ||
TimToady | because we used . for method calls | ||
18:17
hudnix left
|
|||
rokoteko | so ~(1...*) forces the $_ to be a string ? | 18:18 | |
TimToady | yes, prefix ~ is stringify, which is the same as concat with '' | ||
yes | |||
well, there's no $_ there | |||
but it's not applied to the (1...*), but to the (1...*).batch(10) | |||
rokoteko | nods. sorry. Im a beginner in your language, but I think I get your point. | ||
TimToady | methods are tighter than prefixes | 18:19 | |
colomon | which is good, because otherwise it would be an infinite string. | ||
TimToady | are you familiar with p5? | ||
colomon | (and infinite strings are not yet implemented. ;) | ||
rokoteko | TimToady: I would say somewhat yes. | ||
TimToady | okay, many things are the same, and most p6 things can be explained in terms of p5 | ||
rokoteko | TimToady: several years of perl5 'knowledge' behind, to be more exact. | ||
TimToady | that's okay, though if you'd played with Moose, you'd have a headstart on p6 OO | 18:20 | |
rokoteko | I know bit of Moose, so Im aware of stuff like that Int $str exists. but never used Moose in practise. also I know a bit about how Moose is implement, about the meta-system etc. no need to hook to methods, because you can just modify what they actually do. | 18:22 | |
TimToady | we do wrapping slightly differently in p6 | ||
18:23
justatheory joined
|
|||
TimToady | we consider "before" and "after" to be redundant with "around" semantics | 18:23 | |
18:23
justatheory left
18:24
justatheory joined
|
|||
TimToady | or whatever that's called in Moose | 18:24 | |
18:24
ash__ left
18:25
patrickas joined
|
|||
patrickas | saba7o perlsixers | 18:25 | |
rokoteko | ... sorry Im not that familiary with Moose. considering: sub foo { .. }, do you mean: { do_stuff_before(); sub foo {..}; do_stuff_after() }; .. or { sub foo { do_stuff_before(); .. do_stuff_after(); } }? | 18:27 | |
pugssvn | r31105 | patrickas++ | Added tests for advent calendar day 18 | ||
patrickas | ping jnthn | 18:28 | |
18:28
supernovus left
|
|||
jnthn | pong patrickas | 18:28 | |
18:30
gbacon left
18:31
gbacon joined
|
|||
TimToady | more like when you call foo(), you actually: get do_stuff_before(); inner_foo(); do_stuff_after() | 18:33 | |
s/: get/ get:/ | |||
pmichaud | afk, lunch | 18:35 | |
rokoteko | to me that sounds like the latter example of mine. but ok, go on with the "..." and "there's no $_ there" explanation, if you arent in a hurry. | ||
TimToady | in a meeting, so distracted... | 18:40 | |
colomon | rokoteko: (1...*).batch(10) produces a list of 10 numbers, starting from 1 and counting up. | ||
rokoteko | ah no probs, I can chat about this again, or someone else willing can explain it to me. :) | ||
s/again/another time/ | |||
colomon | applying prefix ~ to that converts that list to a string. | ||
rakudo: say ~(1...10) | 18:41 | ||
p6eval | rakudo 738fad: OUTPUT«1 2 3 4 5 6 7 8 9 10» | ||
colomon | rakudo: say ~(1...*).batch(10) | ||
p6eval | rakudo 738fad: OUTPUT«1 2 3 4 5 6 7 8 9 10» | ||
rokoteko | colomon: yes I understood that. but as a side question. how would you force it to be a string? "~~" or maybe "!~" ? | ||
colomon | rokoteko: you're seeing it right there. | ||
rakudo: say ~(1...10) | |||
p6eval | rakudo 738fad: OUTPUT«1 2 3 4 5 6 7 8 9 10» | ||
colomon | rakudo: say 1...10 | ||
p6eval | rakudo 738fad: OUTPUT«12345678910» | ||
pugssvn | r31106 | patrickas++ | Added a currently skipped failing test for roles | ||
colomon | If you don't force it to be a string, you don't get the spaces between the numbers. | ||
rokoteko | rakudo: say ~("a".."d") | 18:42 | |
p6eval | rakudo 738fad: OUTPUT«a b c d» | ||
18:43
ashleydev left
|
|||
pugssvn | r31107 | lwall++ | [viv] make sure concise has \n on the end | 18:43 | |
colomon | If you say $a ~ $b, that forces both $a and $b to strings and concats them. | ||
if you say ~$a, it just forces $a to be a string. | |||
or, as TimToady says, it's like saying "" ~ $a. | 18:44 | ||
There is an equivalent operator for numbers, + | |||
ack, sorry, sloppy language there. | |||
pugssvn | r31108 | lwall++ | [viv] move "\n" guarantee down into spew | 18:45 | |
colomon | it doesn't change $a or $b, it just returns their values as strings. | ||
rakudo: my $a = 10; say (~$a).WHAT; say $a.WHAT | |||
p6eval | rakudo 738fad: OUTPUT«Str()Int()» | ||
rokoteko | this might be a bit sily question, but Im definitely missing something essential here. how do you do a say @$_ for (["a".."b"], [1..3]) in perl6 as compared to perl5? | 18:47 | |
colomon | rakudo: for [[1, 2, 3], [4, 5, 6]] -> $a { say $a; say $a.perl; say $a.WHAT } | 18:51 | |
p6eval | rakudo 738fad: OUTPUT«1 2 3 4 5 6[[1, 2, 3], [4, 5, 6]]Array()» | ||
cognominal | say @( $_ ) for ["a".."b"], [1..3] # would do it, I guess | 18:52 | |
colomon | rakudo: for ([1, 2, 3], [4, 5, 6]) -> $a { say $a; say $a.perl; say $a.WHAT } | ||
p6eval | rakudo 738fad: OUTPUT«1 2 3[1, 2, 3]Array()4 5 6[4, 5, 6]Array()» | ||
TimToady | @$_ should work too | ||
colomon | rakudo: for ([1, 2, 3], [4, 5, 6]) -> $a { say $a; say $a.perl; say $a.WHAT; say +@$a } | ||
p6eval | rakudo 738fad: OUTPUT«===SORRY!===Unable to parse blockoid, couldn't find final '}' at line 11» | ||
colomon | I don't think @$_ works in rakudo. | 18:53 | |
rakudo: for ([1, 2, 3], [4, 5, 6]) -> $a { say $a; say $a.perl; say $a.WHAT; say +@($a) } | |||
p6eval | rakudo 738fad: OUTPUT«1 2 3[1, 2, 3]Array()34 5 6[4, 5, 6]Array()3» | ||
TimToady | it *should* work :) | ||
colomon | @($_) works. | ||
PerlJam | TimToady: is @$_ the same as @($_) ? | ||
TimToady | yes | ||
std: @$_ | 18:54 | ||
p6eval | std 31105: OUTPUT«ok 00:01 107m» | ||
TimToady | std: @$$$$$$$_ | ||
p6eval | std 31105: OUTPUT«ok 00:01 104m» | ||
pugssvn | r31109 | patrickas++ | Added missing tests | ||
TimToady | of course $() is generally a no-op | ||
cognominal | TimToady, also @$_.a means @($_).a, not @( $_.a ) ? | 18:55 | |
PerlJam | except that it affords item context where their otherwise may not be. $() that is. | 18:56 | |
TimToady | STD uses @$x in 19 spots | ||
18:56
rgrau joined
|
|||
PerlJam | s/their/there/ | 18:56 | |
TimToady | cognominal: yes, it means @($_).a | ||
PerlJam | that was a weird brain-o | ||
18:56
takadonet left
|
|||
TimToady | @$ is a special form--the @ is not an operator | 18:57 | |
rgrau | hi #perl6 | ||
PerlJam | TimToady: so ... @ is the sigil and $ the twigil in that case :) | 18:58 | |
rokoteko | cognominal: thanks. :) | 18:59 | |
TimToady | PerlJam: kinda sorta | 19:00 | |
though... | 19:01 | ||
std: @$^a | |||
p6eval | std 31109: OUTPUT«ok 00:01 107m» | ||
PerlJam | sigil, twigil, ... thrigil? spigil? quidril? | 19:02 | |
\ | |||
jnthn | std: @$$ | 19:03 | |
p6eval | std 31109: OUTPUT«===SORRY!===Non-declarative sigil is missing its name at /tmp/GfUIjCbKL6 line 1:------> @$⏏$Confused at /tmp/GfUIjCbKL6 line 1:------> @$$⏏<EOL> expecting twigilParse failedFAILED 00:01 105m» | ||
jnthn | Shiny. | ||
rakudo: @$$ | |||
p6eval | rakudo 738fad: OUTPUT«===SORRY!===Confused at line 11, near "@$$"» | ||
cognominal tries to see where TimToady handle the @$ special form in STD | |||
jnthn | LTA | ||
rokoteko | would be easier to use the stringifications of greek alphabets. alphail, betail, deltail, gammail, epsilonil ;) | ||
TimToady | cognominal: look for desigilname | 19:04 | |
19:05
justatheory left
|
|||
patrickas | rakudo: for^20{my ($a,$b)=<AT CG>.pick.comb.pick(*); my ($c,$d)=sort map {6+4*sin($_/2)},$_,$_+4; printf "%{$c}s%{$d-$c}s\n",$a,$b} | 19:05 | |
rokoteko | they would easily map to unicode also to avoid englishmism. | ||
p6eval | rakudo 738fad: OUTPUT«===SORRY!===Sorry, multi-dimensional indexes are not yet supported at line 11, near ""» | ||
PerlJam | that looks like it might be easish to add to rakudo | ||
patrickas | alpha: for^20{my ($a,$b)=<AT CG>.pick.comb.pick(*); my ($c,$d)=sort map {6+4*sin($_/2)},$_,$_+4; printf "%{$c}s%{$d-$c}s\n",$a,$b} | 19:06 | |
p6eval | alpha 30e0ed: OUTPUT« C G CG T A G C T A G C G C CG TA G C T A A T A T T A GC C G A T A T T A C G» | ||
TimToady | that's not Perl 6 | 19:08 | |
std: or^20{my ($a,$b)=<AT CG>.pick.comb.pick(*); my ($c,$d)=sort map {6+4*sin($_/2)},$_,$_+4; printf "%{$c}s%{$d-$c}s\n",$a,$b} | 19:09 | ||
p6eval | std 31109: OUTPUT«===SORRY!===Unsupported use of %{$c}; in Perl 6 please use %($c) at /tmp/LRqcjNhJUq line 1:------> p {6+4*sin($_/2)},$_,$_+4; printf "%{$c}⏏s%{$d-$c}s\n",$a,$b}Undeclared routine: 'or' used at line 1Parse failedFAILED 00:01 108m» | ||
TimToady | std: for^20{my ($a,$b)=<AT CG>.pick.comb.pick(*); my ($c,$d)=sort map {6+4*sin($_/2)},$_,$_+4; printf "%{$c}s%{$d-$c}s\n",$a,$b} | ||
p6eval | std 31109: OUTPUT«===SORRY!===Unsupported use of %{$c}; in Perl 6 please use %($c) at /tmp/GjhJRGFuzO line 1:------> p {6+4*sin($_/2)},$_,$_+4; printf "%{$c}⏏s%{$d-$c}s\n",$a,$b}Undeclared routine: 'for' used at line 1Parse failedFAILED 00:01 108m» | ||
patrickas | unfrtunately that's what we're teaching the kids these days :-( | ||
TimToady | it's wrong several ways, from a p6 point of view | ||
patrickas | straight from : perl6advent.wordpress.com/2009/12/1...witcheroo/ | ||
I really like the result... I'd hate to remove the example .... maybe we just need to clean it up a bit :-) | 19:11 | ||
TimToady | that particular message is perhaps suppressible, since {} has a different meaning as interpolation | ||
however | |||
if we fix that... | |||
std: for^20{my ($a,$b)=<AT CG>.pick.comb.pick(*); my ($c,$d)=sort map {6+4*sin($_/2)},$_,$_+4; printf "%\{$c}s%\{$d-$c}s\n",$a,$b} | 19:12 | ||
p6eval | std 31109: OUTPUT«===SORRY!===Undeclared routine: 'for' used at line 1Check failedFAILED 00:01 108m» | ||
TimToady | let's add spaces around the ^20 | ||
std: for ^20 {my ($a,$b)=<AT CG>.pick.comb.pick(*); my ($c,$d)=sort map {6+4*sin($_/2)},$_,$_+4; printf "%\{$c}s%\{$d-$c}s\n",$a,$b} | |||
p6eval | std 31109: OUTPUT«ok 00:01 108m» | ||
TimToady | that's Perl 6 :) | ||
patrickas | btw spaces everywhere always trip me off in perl6 | ||
ok thanks | 19:13 | ||
TimToady | statement controls require spaces | ||
patrickas | *i* know, i just can't always convince my fingers | ||
TimToady | and {} without space before it is always a subscript | ||
19:13
jjore joined
19:14
pmurias left
|
|||
patrickas | rakudo: for ^20 {my ($a,$b)=<AT CG>.pick.comb.pick(*); my ($c,$d)=sort map {6+4*sin($_/2)},$_,$_+4; printf "%\{$c}s%\{$d-$c}s\n",$a,$b} | 19:14 | |
p6eval | rakudo 738fad: OUTPUT«Too many positional parameters passed; got 3 but expected 2 in 'map' at line 1523:CORE.setting in main program body at line 11:/tmp/PcAO7uENGt» | ||
patrickas | unfortunately rakudo can't handle it yet :( | ||
alpha: for ^20 {my ($a,$b)=<AT CG>.pick.comb.pick(*); my ($c,$d)=sort map {6+4*sin($_/2)},$_,$_+4; printf "%\{$c}s%\{$d-$c}s\n",$a,$b} | |||
p6eval | alpha 30e0ed: OUTPUT«Insufficient arguments supplied to sprintfInsufficient arguments supplied to sprintfInsufficient arguments supplied to sprintfInsufficient arguments supplied to sprintfInsufficient arguments supplied to sprintfInsufficient arguments supplied to sprintfInsufficient | ||
..arguments s… | 19:15 | ||
patrickas | neither could alpha :( | ||
TimToady | yes, well, those backslashes were to fool std, not make the interpolation work right :) | ||
I'll fix that one | |||
rakudo: for ^20 {my ($a,$b)=<AT CG>.pick.comb.pick(*); my ($c,$d)=sort map {6+4*sin($_/2)},$_,$_+4; printf "%{$c}s%{$d-$c}s\n",$a,$b} | 19:17 | ||
p6eval | rakudo 738fad: OUTPUT«Too many positional parameters passed; got 3 but expected 2 in 'map' at line 1523:CORE.setting in main program body at line 11:/tmp/ZyNEgzkxsr» | ||
patrickas | rakudo is having problems with the map .... regardless of the slashes | 19:18 | |
alpha can do it though | |||
TimToady | rakudo: for ^20 {my ($a,$b)=<AT CG>.pick.comb.pick(*); my ($c,$d)=sort map({6+4*sin($_/2)},$_,$_+4); printf "%{$c}s%{$d-$c}s\n",$a,$b} | ||
p6eval | rakudo 738fad: OUTPUT«Too many positional parameters passed; got 3 but expected 2 in 'map' at line 1523:CORE.setting in main program body at line 11:/tmp/iguIpmAiND» | ||
TimToady | rakudo: for ^20 {my ($a,$b)=<AT CG>.pick.comb.pick(*); my ($c,$d)=sort map({6+4*sin($_/2)},($_,$_+4)); printf "%{$c}s%{$d-$c}s\n",$a,$b} | ||
p6eval | rakudo 738fad: OUTPUT« C G AT A T T A C G C G A T GC CG G C T A G C G C G C TA T A G C C G A T T A» | ||
patrickas | thanks :-) | 19:19 | |
I suppose it should not be that hard to fix map ... I'll take a look | |||
TimToady | looks like @list should be *@list in some signature | 19:20 | |
colomon | oh, right, sub map doesn't take a slurpy right now. | ||
That's either very easy to fix, or a big problem. | |||
used to be a big problem, but something may have changed along the way. | |||
PerlJam | Wasn't map just waiting on real laziness? | ||
colomon | it's line 272 in Any-list.pm | ||
PerlJam: map is already really lazy. | 19:21 | ||
TimToady | I think this relates to the list rethink that pmichaud is doing | ||
patrickas | arrg PIR, /me backs away slowly :-) | 19:22 | |
TimToady | and there's a fundamental problem with using the @ sigil to represent a list | ||
colomon | TimToady: certainly might affect it, but I don't think that's really it. | ||
that is to say, grep is already taking a slurpy. | 19:23 | ||
my memory is just that things break when you try it. | |||
patrickas | I'll modify the example in the post in the mean while until map is fixed | ||
colomon | but I'm working on it again in the meantime. | ||
(I mean, trying it, just to see what happens.) | |||
19:24
ShaneC joined
19:25
jjore left
19:26
jjore joined,
ShaneC left
|
|||
colomon | rakudo: say ~map({$_ * 2}, :values(3, 4, 4, 5)) | 19:27 | |
p6eval | rakudo 738fad: OUTPUT«6 8 8 10» | ||
TimToady | we might need to steal the *$foo notation for binding the iterator to $foo; the only alternative is to force *@foo to use shift to iterate its iterator destructively | ||
colomon | yeah, that's it. | ||
TimToady | as far as I can see | ||
colomon | If I change @values to be slurpy, then the above becomes | ||
> say ~map({$_ * 2}, :values(3, 4, 4, 5)) | |||
Unexpected named parameter 'values' passed | |||
but | 19:28 | ||
> say ~map({$_ * 2}, 3, 4, 4, 5) | |||
6 8 8 10 | |||
I think at the moment you can get one or the other but not both. | |||
PerlJam | Is that the rakudo uncertainty princimple? | ||
s/imp/inp/ | |||
grr | |||
TimToady | I think the variadic form is much more important than being able to name your list | ||
PerlJam | s/imp/ip/ | ||
colomon personally prefers the method forms of map and grep.... | |||
TimToady: well then, let me see what tests I break... | 19:29 | ||
*broke | |||
colomon is relieved to have a programming problem simple enough he can handle it after being up most of the night with a feverish toddler. | 19:30 | ||
19:37
skids left
|
|||
TimToady | if *$head,*@tail can be replaced by *[$head,*$tail], we could steal *$ for *$iterator and **$sliceiterator | 19:42 | |
PerlJam | I think I like it. | 19:43 | |
(FWIW) | |||
TimToady | then it's clear that 'for |$iterator {...}' is destructive, unlike @iterator | 19:44 | |
what's clear is that @ means inconsistent things in the current design | 19:46 | ||
19:49
plainhao left
|
|||
TimToady | the other way out is to have a way that says to interpolate an array destructively | 19:49 | |
for @array {...} just reads, but... | |||
for @array.mumble {...} iterates @array destructively | 19:50 | ||
this could work because laziness is orthogonal to arrays | |||
that is, both arrays and iterators have a reified part and an imaginary part, it's just api policy that differs | 19:51 | ||
"mumble" could be something like "shiftall", or it might be common enough to deserve its own operator | 19:53 | ||
19:53
xinming left
|
|||
pugssvn | r31110 | patrickas++ | Added test for DNA one liner at the end of the post | 19:53 | |
TimToady | for @array.munch :) | 19:54 | |
19:54
xinming joined
19:57
pmurias joined
|
|||
colomon | should map { .WHAT } , {"a"=> 1 , "b"=>2}).join(' ') be 'Pair() Pair()' ? | 20:01 | |
TimToady | I don't think so | 20:02 | |
[] and {} don't flatten | |||
colomon | that's failing now... apparently it used to convert {"a"=> 1 , "b"=>2} to a list, now that it's slurpy it takes it as a single argument. | ||
I see the test is marked "#hash in list context", which certainly seems a bad sign... | |||
TimToady | [] and {} are like $ scalars in a list | ||
20:03
Psyche^ joined
|
|||
TimToady | %hash would flatten, but $hash wouldn't | 20:03 | |
it's not the type | |||
%$hash would flatten | |||
%({}) would flatten | |||
|{} would flatten | |||
20:04
Patterner left,
Psyche^ is now known as Patterner
|
|||
pugssvn | r31111 | colomon++ | [t/spec] Fudge tests to work with slurpy map. | 20:05 | |
colomon | TimToady: okays, map is now slurpy. | 20:07 | |
20:07
justatheory joined,
justatheory left
20:08
justatheory joined
|
|||
dalek | kudo: 7c83e65 | (Solomon Foster)++ | src/core/Any-list.pm: Switch sub version of map to take slurpy values. |
20:08 | |
TimToady wonders if @array[@keys]:delete can lazily delete/return values | 20:10 | ||
that's .munch, more or less | 20:11 | ||
20:11
hercynium left
20:12
kfo_ joined
|
|||
patrickas | colomon that's what happens when you give noobs svn access | 20:12 | |
colomon | patrickas: what is? | ||
patrickas | Broken tests | 20:13 | |
ps: I am the noob to blame in that case | |||
colomon | patrickas: believe me, there have been (and probably are) plenty of broken tests written by non-noobs. | ||
pmichaud | back from lunch and shopping | 20:14 | |
colomon | and it was pretty subtle, and it did work before, after all. | ||
patrickas | colomon it didn't work before :-( I thought it should work like that (after asking around) and made it work like that and added a test for it to work like that ... but apparently I was wrong | 20:15 | |
20:15
kfo left,
kfo_ is now known as kfo
|
|||
colomon | TimToady: I think I like the .munch idea better. | 20:15 | |
cognominal | rakudo: %() | 20:16 | |
p6eval | rakudo 738fad: ( no output ) | ||
TimToady | well, if we had a delete macro, it'd be 'delete @array' vs 'delete @array[@keys]' | 20:17 | |
where 'delete @array' presumably means 'delete @array[*]' | |||
or 'munch @array', which gives the idea that it returns the munched values | |||
so we'd have 'for munch @array {...}' | 20:18 | ||
colomon | TimToady: wait, I think there's a big problem with .munch as an idea. | ||
Or at least... | |||
20:18
ashleydev joined
|
|||
TimToady | well, same problem as .delete, if there are keys that have to be unreferenced | 20:18 | |
that's why it has to be a macro or a modifier on the subscript | |||
patrickas | So would the correct test be | 20:19 | |
rakudo: use Test; my $h= {"a"=> 1 , "b"=>2}; is( (map { .WHAT } , $h).join(' ') , 'Pair() Pair()' ); | |||
p6eval | rakudo 738fad: OUTPUT«ok 1 - » | ||
TimToady | no | ||
colomon | patrickas: no | ||
TimToady | $h doesn't flatten either | ||
pmichaud | what are we trying to test? | ||
patrickas | pmichaud: the way I am seing it .... my ignorance and your patience :-) | 20:20 | |
colomon | whether a hash becomes an array of pairs in certain circumstances. | ||
pmichaud | a flattening hash does, yes. | ||
a non-flattening hash wouldn't. | 20:21 | ||
20:21
clintongormley left
|
|||
pmichaud | my %h = { a=>1, b=>2 }; # %h flattens | 20:21 | |
my $h = { a=>1, b=>2 }; # $h doesn't flatten | |||
TimToady | but has nothing to do with the type of the hash itself | 20:22 | |
pmichaud | correct. | ||
patrickas | pmichaud: apparently that was just said in the channel 10 minutes ago but I was too thick to grasp it :-) | ||
TimToady | my %h := $h; %h now flattens | ||
pmichaud | both %h and $h above are of type "Hash" | ||
TimToady | actually, both of those are wrong | 20:23 | |
they want := | |||
pmichaud | oh, correct. | ||
TimToady | well, the first one is wrong | ||
pmichaud | well, the second doesn't. | ||
:) | |||
TimToady | beatcha :P | ||
pmichaud | my mind is a little tapioca'd at the moment. | ||
TimToady | I know the pudding, er, feeling | 20:24 | |
colomon | .oO(oooo, tapioca) |
||
TimToady | pmichaud: been thinking about the *@iter quandry above | ||
pmichaud | TimToady: I saw that. | 20:25 | |
lately I've been wondering if we really want a Feed type. | |||
colomon | My mind is like tapioca where someone has gone through and sucked out all the little fish eyes. | ||
pugssvn | r31112 | pmurias++ | [smop] fix some warnings | ||
patrickas | ok so since the hash should not flatten, what should the result be ? | ||
of a no nflattening hash passed to map ? | |||
TimToady | well, speaking of tapioca, I need to be pudding some lunch into my bloodstream, and it's already after 13:26 here... | 20:26 | |
colomon | patrickas: you pass the entire hash to one iteration of the map. | ||
TimToady | decommute & | ||
pmichaud | TimToady: in particular, I'm wondering about the objects being passed between | ||
map { $_**2 } <== sort <== grep { $_ % 2 } <== @nums; | |||
20:27
justatheory left
|
|||
patrickas | ok... I'll try to fix the tests then | 20:27 | |
colomon | pmichaud: Feed would essentially wrap an Iterator | ||
? | |||
pmichaud | colomon: right, but would be different List in that respect | ||
i.e., a Feed doesn't need memory | |||
unless it's bound/mapped/attached to something that wants memory | |||
colomon | pmichaud: right. | 20:28 | |
pmichaud | *different from List | ||
colomon | and you have to explicitly request a Feed, yes? | 20:29 | |
pmichaud | well, I'd think no. | ||
colomon | (whether by declaring a variable to be a Feed or using <==) | ||
pmichaud | It may depend (more) | ||
for example, .map() on a Feed might behave slightly differently than .map on an Array. | |||
or one might delegate to the other. | 20:30 | ||
but in general, it seems that .map wants to return a Feed and not a List/Seq/Array | |||
colomon | gather also returns a Feed? | ||
pmichaud | colomon: yes | ||
pugssvn | r31113 | patrickas++ | trimmed the lines so the test passes regardless of line ending character | ||
pmichaud | i.e., Feed is the explicit type for "I can produce a sequence of elements in a list context, but I don't bother keeping any of the values of the sequence around." | 20:31 | |
it's still a fuzzy notion at the moment, but it seems to me that we have at least List, Iterator, Feed, and Array | |||
colomon | that feels very right to me. | 20:32 | |
but I get all tangled up in the details. | |||
pmichaud | well, same here :) | ||
I had to abandon work a bit earlier in the week, so I'm back on it now. | |||
Also, it's hard to work on this when answering questions on irc :) | 20:33 | ||
colomon | seems like the tricky bit is we want Feed to automatically convert to an Array when needed, and vice versa? (tricky as in, I don't know how to make dispatch do that without extra magic) | ||
pmichaud | but the existence of <== and ==> and the like somehow tells me that we need a "feed type" | ||
20:34
Guest86191 left
|
|||
pmichaud | I'm not sure about "automatically convert to an Array" -- seems like it might be "be wrapped by an Array" | 20:34 | |
colomon | yes. | ||
pmichaud | e.g., when it's bound. | ||
colomon | I mean, if I have sub fred(@a), I want to be able to pass a Feed to it. | 20:35 | |
binding, yes. | |||
pmichaud | sure | ||
colomon | and if I have sub fred(Feed $a), I want to be able to pass an array to it. | ||
pmichaud | and binding a @-sigil to a feed actually creates an intermediate Array | ||
colomon | pmichaud: yes on the @-sigil. | ||
pmichaud | hmmm | ||
I'm not sure if Array ~~ Feed, though. | |||
colomon | I'm pretty sure Array !~~ Feed. | 20:36 | |
that's why it seems like the binding needs magic. | |||
pmichaud | in which case I don't think we need to pass an array to fred(Feed $a)... | ||
PerlJam | Feed ~~ Positional ? | ||
pmichaud | PerlJam: haven't decided that one yet. | ||
colomon: I don't see the place where we need for sub fred(Feed $a) { ... } to be able to accept an Array. | 20:37 | ||
colomon | pmichaud: just trying to be properly dwimmy | ||
pmichaud | it should not be the case that just anything passes everywhere. | 20:38 | |
if you want to accept arrays, you should probably be using @a anyway | |||
and not trying to accept a feed-as-scalar. | |||
colomon | I guess you could always have an additional sub fred(@a) { fred(@a.Feed) } | ||
disagree strongly with that last. | |||
for some subs, Feed will be a natural. | |||
pmichaud | I don't think you even need an additional sub. | ||
colomon: example? | 20:39 | ||
patrickas | just so I don't mess things up again, I'll replace the currently broken hash test with gist.github.com/425910 did I finally get things right ? | 20:40 | |
pmichaud | patrickas: my %flattens= {"a"=> 1 , "b"=>2}; # wrong | 20:41 | |
patrickas: maybe you want parens there. | |||
colomon | pmichaud: sorry, brain too gone to quickly think of an explicit example, but think of any time you want to refactor a long string of maps and greps out to a single function. You'd normally want it to take a Feed, but that doesn't mean you'd never want to pass an @array to it. | 20:42 | |
pmichaud | colomon: in that case, you have it take an @array, and you shift elements from the @array | 20:43 | |
patrickas | rakudo: my %h1= {"a"=> 1 , "b"=>2};my %h2= ("a"=> 1 , "b"=>2); %h1.perl.say; %h2.perl.say; | ||
20:43
justatheory joined
|
|||
p6eval | rakudo 738fad: OUTPUT«{"a" => 1, "b" => 2}{"a" => 1, "b" => 2}» | 20:43 | |
pmichaud | and the feed automatically promots to an array | ||
*promotes | |||
cognominal | %() crashes is the golfed version of a program that crashes rakudo, whatever the way it is run (p6 shell, with -e, as a program). According to the trace it triggers a infinit recursion in the GC | ||
pmichaud | but trying to get an array to automatically promote to a feed is asking for trouble | ||
cognominal | should i file a bug? | ||
pmichaud | or, instead of trying to get sub foo(Feed $a) to work, what you really want is sub foo($a as Feed) | 20:44 | |
i.e., so that it coerces $a into a Feed, instead of trying to make binding automatically promote it | |||
colomon | pmichaud: $a as Feed, yes. | ||
pmichaud | whenever we try to make our type constraints perform coercions we're likely to run into problems. | ||
20:45
Guest86191 joined
|
|||
colomon | pmichaud: I don't really have any major problem with the idea of forcing you to do a one-line multi sub to get the same behavior as $a as Feed | 20:45 | |
pmichaud | since $a as Feed is the natural way of expressing "convert the argument to a Feed", I think we should use it. | 20:46 | |
colomon | Is it also a valid p6 way? I've seen it tossed about, but not known if it is real or just a notion. | ||
patrickas | in rakudo how can I detect that "my %h1= {"a"=> 1 , "b"=>2};" is different than "my %h2= ("a"=> 1 , "b"=>2);" ? | 20:47 | |
pmichaud | the first will end up being a (runtime) error. | 20:48 | |
because you're tying to create a hash from a list of one scalar. | |||
colomon | pmichaud: (I'm 1000% behind $a as Feed if we can make that work, for what that's worth.) | ||
patrickas | oh ok thanks... so current rakudo is as much to blame as I am :-) | 20:50 | |
pmichaud | well, even if "as Feed" doesn't work, we can always do | ||
sub foo($a) { $a = $a.Feed; ... } | |||
which explicitly builds a Feed for $a, regardless of $a's type. If $a is already a Feed, then it's a no-op. | 20:51 | ||
pugssvn | r31114 | patrickas++ | Corrected broken test | 20:53 | |
colomon | rakudo: sub foo($a) { say $a.WHAT }; my @a = 1..10; say foo(@a) | ||
p6eval | rakudo 7c83e6: OUTPUT«Array()1» | ||
colomon | pmichaud: word. | ||
TimToady | I don't understand how Feed is different from a List | 20:54 | |
colomon | pmichaud: $a as Feed is more elegant, but $a = $a.Feed seems like a perfectly sensible way of doing it. | ||
pmichaud | TimToady: they may in fact be the same. | ||
TimToady: I'm still teasing out the commonalities. | 20:55 | ||
But if Feed is List, that's assuming that List means "I don't remember values" | |||
(which is fine) | |||
colomon | but calling it Feed takes a step back from all the confusing current half-notions. | ||
pmichaud | right | ||
at the moment I'm calling it a Feed just to avoid confusion with past terms | |||
also, S06 talks a lot about "feeds", so it seems reasonable to have a Feed type | |||
TimToady | maybe | 20:56 | |
pmichaud | (which we may end up calling 'List', but 'Feed' is more obvious for discussion) | ||
colomon | I think Feed is a good term, too, because it isn't loaded with all sorts of other connotations. (at least to my ear) | ||
PerlJam | and then we'll get a Feed-lot and some cattle and ... | ||
pmichaud | I'm not entirely comfortable with the name Feed either. | ||
I also considered Pipe, Pipeline, etc. | |||
TimToady | up till now, "feed" has mode more promises about threadability than "list" has, I suspect | ||
pmichaud | but at the moment (for me at least) it's just useful to separate away from the overloaded term "list" | 20:57 | |
PerlJam | Ceci n'est pas une pipe | ||
pmichaud | TimToady: I did have a question about the current synopsis... what's the fundamental difference between the "flat" and "list" listops? | 20:58 | |
s/listops/contextualizers | |||
(i.e., what difference is the synopsis aiming at?) | 20:59 | ||
TimToady | .list only undoes the non-interpolation of $, [], and {}, I suspect | ||
20:59
Su-Shee left
|
|||
pmichaud | okay | 20:59 | |
TimToady | so prefix:<|> is basically .list, I think | ||
except not quite | |||
since | also removes a Parcel wrapping on the arguments | 21:00 | ||
pmichaud | it's not hugely important what the exact difference is... just wanted to get a sense of what the underlying intent was | ||
TimToady | whereas .list, if it's a normal method, would have a Parcel around its values | ||
pmichaud | so essentially, 'list' removes scalar-ness but doesn't deal with interior parcles | ||
*Parcels | |||
TimToady | yes | ||
pmichaud | whereas 'flat' also flattens the interior Parcels | 21:01 | |
TimToady | whereas .flat switches to an flattening iterator | ||
pmichaud | okay | ||
TimToady | that squashes interior parcels | ||
pmichaud | I'm not sure I see where that distinction is needed yet, but I'll know it when I see it. | ||
21:01
Guest43663 joined
|
|||
patrickas | does this mean the method 'list' in 'Hash' gets called only when the Hash needs to flatten ? | 21:02 | |
TimToady | in a list context, .list merely undoes the non-interpolation (I almost said non-flattening) | ||
there may not be a .list method, but there will be a .flat method, I think | |||
patrickas | there is a .list method because I added it and I am checking to know if I should remove it :-) | 21:03 | |
pmichaud | patrickas' question is part of the reason why I'm departing from List for a bit | ||
it's much easier to say "what do I use to get a feed of elements from a Hash"? | |||
21:04
skids joined
|
|||
pmichaud | if we later say that Feed is in fact List, then it works out | 21:04 | |
TimToady | but if the hash returns $feed, that probably stays a single item if %hash.feed is in list context | ||
pmichaud | well, for a single item I really want an Iterator | 21:05 | |
as opposed to a Feed | |||
and that would be %hash.iterator | |||
in some sense, .iterator is the scalar form of a feed. or a feed is something that knows how to flatten an iterator | |||
(but do so w/o memory of past elements) | 21:06 | ||
PerlJam | flatten == iterate? | ||
pmichaud | I suppose we could just have flattening and non-flattening iterators. | ||
TimToady | not sure that's right | ||
pmichaud | .iterator gives back a non-flattening iterator, while .list or .feed or .flat or whatever gives back a flattening iterator | ||
I agree that doesn't seem right either, which is why I'm choosing to multiply types for now until I figure out what the use cases are, then look for combining them where it makes sense | 21:07 | ||
PerlJam: I'm pretty sure that Feed ~~ Positional, as people will expect .map(...).[5] to work | |||
TimToady | I don't think so | 21:08 | |
pmichaud | PerlJam: but I keep going back-and-forth on that. | ||
TimToady | I think Any.[] will create a positional for Positional.[] | 21:09 | |
this is how Any.[0] is Any for non-iterables | |||
pmichaud | sure, but I'm pretty sure the result of .map() is generally iterable. | ||
TimToady | iterable !=== positional | 21:10 | |
21:10
xabbu42 joined
|
|||
pmichaud | can we do .grep().elems ? | 21:10 | |
TimToady | hmm, we've been using iterable for something that can *produce* an iterotor, not something that is an iterator | ||
21:10
xabbu42 left,
xabbu42 joined
|
|||
pmichaud | some iterators are also iterable. | 21:10 | |
TimToady | but if so, they probably clone the iterator | 21:11 | |
pmichaud | sure | ||
but they're iterable :) | |||
TimToady | I don't see why .elems wouldn't do similarly, though Any.elems can short-circuit when we know there's only one thing | ||
pmichaud | but I think that whatever .map() returns can't be simply defaulting to Any.elems | 21:12 | |
colomon | Should these be Any or Cool? | ||
pmichaud | colomon: Any. | ||
the list methods seem to operate outside of the Cool framework. | |||
TimToady | only scalars are Cool :) | ||
colomon | Ah, that explains Any-list.pm. | 21:13 | |
:) | |||
TimToady | only scalar *values* are Cool; and iterators are values | 21:14 | |
*aren't | |||
gotta get that n't key fixed... | |||
colomon | that's "iterators aren't values", I hope? :) | 21:15 | |
pmichaud | TimToady: so, is Any ~~ Positional? (I think no.) | 21:16 | |
is it that it simply understands postcircumfix:<[ ]> without actually being Positional? | |||
*that Any | |||
TimToady | we can probably work it that way | 21:17 | |
pmichaud | okay. Otherwise, @x can potentially bind to any scalar :-) | ||
TimToady | just because a role requires a method doesn't mean it can't be duck-typed outside the role | ||
pmichaud | well, to any Any. :) | ||
agreed (duck-typed); just wanted to make sure I wasn't making an incorrect assumption | 21:18 | ||
well, I'm now at a mental point where I think a walk around the block and some note-jotting will be most helpful | 21:19 | ||
so, afk | |||
TimToady | nap & | ||
21:20
patrickas left
|
|||
sjohnson | nap at work & | 21:21 | |
just kidding.. i dont want to get fired | |||
PerlJam feels like taking a nap | 21:23 | ||
sorear | TimToady: How do I write an "around" in perl 6? | 21:29 | |
21:30
gbacon left
|
|||
sorear | sjohnson: move to spain, I hear they're much more enlightened there | 21:30 | |
[Coke] is thankful again for his flexible job. =) | 21:31 | ||
PerlJam | sorear: See S06:2569 (the section on Wrapping) | 21:32 | |
jnthn | sorear: I think they have a like ~ 20% unemployment rate at the moment. You've a 1/5 chance of being able to spend all day napping there... | ||
sorear | PerlJam: that has absolutely nothing to do with "around" | ||
jnthn | sorear: What exactly are you wanting to do? | 21:33 | |
jnthn doesn't know what "around" is | |||
21:33
arthur-_ joined
|
|||
jnthn | It sounds like something you'd achieve with callsame etc though | 21:33 | |
sorear | jnthn: 'around' et al in Moose are how you use superclass functions | 21:34 | |
21:34
arthur-_ left
|
|||
jnthn | sorear: ah, then callsame and friends | 21:34 | |
Or callwith | |||
sorear | class Foo { method bar { ... }; }; class Quux is Foo { around bar { ... } } | ||
jnthn | in Perl 6 | ||
s/around/method/ | |||
And then "callsame" where you want to call up to bar | |||
er, up to Foo's bar | 21:35 | ||
Or callwith to change the args | |||
sorear | Does that work in roles? | ||
jnthn | Yes | ||
It iterates over the candidate list | |||
Well, that said, by the time you get to dispatch time the role methods don't really play into the equation though. | |||
Since composition is flattening. | |||
sorear | excellent | 21:36 | |
looks like one of my first perl 6 projects will be a macro library implementing before and after and augment and inner, though | |||
jnthn | :-/ | ||
jnthn is a bit scared that macros are so longed after | |||
21:37
Guest86191 left
|
|||
sorear | hey, it'll be a great testbed for the metamodel | 21:37 | |
jnthn | True :-) | ||
21:37
arthur-_ joined,
arthur-_ left
|
|||
jnthn | I didn't mean that specific example, just that I fear macros will be overused when we first get 'em. | 21:37 | |
PerlJam | sorear: Perl 6's .wrap looks like it's exactly how you would do Moose's around to me. | ||
sorear comes from Moose-land, where for hopefully obvious reasons the metamodel is a great deal more mature than even the one specced in S12 | |||
jnthn | It's a hunch. | 21:38 | |
sorear | PerlJam: perl 6 .wrap modifies a method in place | ||
PerlJam: moose around creates a new, wrapped version of a superclass method and installs it in a subclass method table | |||
around foo => sub { my ($orig, @args) = @_; ...; $orig->(@args); ... }; == sub foo { my ($self, @args) = @_; ...; $self->SUPER::foo(@args); ... } but role-aware | 21:40 | ||
there's also before and after, which only insert code in one space and return the same thing as the original code | 21:41 | ||
"return the same thing" being fairly fiddly in Perl 5, whatwith downwards context propagation and all | |||
so it's quite useful to have it in the libraries | |||
pmichaud | .oO( sometimes walks are so helpful to design :-) |
21:42 | |
*to the design process | |||
sorear | agreed | ||
except I never got the "block" part down | |||
people look at me funny when I spent an hour walking in circles mumbling to myself, but it really does help | 21:43 | ||
21:45
Guest43663 left
21:55
hercynium joined
22:01
ispeak_ joined
|
|||
colomon | walks are terrific. hoping to soon again have a dog that needs to be walked. | 22:01 | |
pmichaud | colomon: you're welcome to come walk mine. She's always begging for walks. | ||
We can't even say the word "walk" anymore, we always have to spell it out as w-a-l-k | |||
she also knows "go", because it often precedes the word "walk" :-) | 22:02 | ||
22:03
Guest48560 left
|
|||
colomon | pmichaud: if you lived in reasonable driving distance, I'd take you up on that. | 22:03 | |
pmichaud | gee, I never have trouble with the driving distance to my house. :-) | ||
22:20
ispeak_ left
22:35
lest_away is now known as lestrrat
22:41
ash___ joined
|
|||
pugssvn | r31115 | lwall++ | [STD] don't complain on "%{$count}s" in printf format as if it's a P5ism | 22:52 | |
22:57
pmurias left
|
|||
lue | ohai | 23:00 | |
23:02
orafu left,
orafu joined
23:08
Woody2143 left
23:14
plainhao joined
23:16
Woody2143 joined
|
|||
lue | *chirp* | 23:17 | |
23:31
Woody2143 left
|
|||
pugssvn | r31116 | wayland++ | Made some changes based on S05 -- they may even be right :). | 23:33 | |
23:35
azert0x left
23:36
Woody2143 joined
|
|||
sorear | TimToady: Is Cursor and $¢ a specified thing in Perl 6.n, or is it strictly an implementation detail? | 23:36 | |
23:38
justatheory left
|
|||
TimToady | spec, grep for $¢ in S05 | 23:38 | |
sorear | The first mention of Cursor in S05 is before the definition of Cursor | 23:39 | |
ah, found it | 23:40 | ||
hmm | 23:41 | ||
23:42
cdarroch left
|
|||
sorear | S05 says that every regex returns a Cursor and <&foo> is "sugar for something like" { $¢ = foo($¢); } | 23:43 | |
was this written before the current conception of regexes as returning lists? | |||
TimToady | no, it's just sloppy writing and thinking in ratchet terms | 23:44 | |
every regex returns a list of Cursors, potentially | |||
and I don't know how we'd write that inside a block offhand | 23:45 | ||
except { return () } fails the current rule | 23:48 | ||
and { return $¢.foo() } would return the list that foo returns | 23:49 | ||
perhaps we need a block in list context that lazymaps or .[0]'s as appropriate | 23:50 | ||
sorear | why would a block in a regex catch control exceptions? | 23:58 |