pugscode.org/ | nopaste: sial.org/pbot/perl6 | ?eval [~] <m oo se> | We do Haskell, too | > reverse . show $ foldl1 (*) [1..4] | irclog: irc.pugscode.org/
Set by diakopter on 11 July 2007.
pugs_svn r18946 | dlo++ | [kp6] the lightbulb effect 00:00
moritz_ t/todo/39-junction.t passes here 06:56
dlocaus moritz_: yes, it passes, but I don't think that's how fglock wanted it done 07:18
needhelp Hi! I need your help. Iam collecting points in page listed below. If you be so kind, please click url below.(sorry for the spam, thank you) www.3dwhite.lt/?click=56a3cdcf22ccc...4d2bc900ff 08:48
lambdabot Title: 3D White
moritz_ I hate spammers... especially if they know they are spamming 09:35
masak moritz_: is there any way to keep them out? 09:43
moritz_ masak: not really. I delete the links from the logs, but that's all 09:54
the alternatives are too unfriendly, like making the channel invite-only
masak true 09:56
pugs_svn r18947 | fglock++ | [kp6] implemented list interpolation in parameter-list 14:15
wolverian nice!
moritz_ kp6: sub foo($a, $b) { say "$b | $a" }; my @a = (2, 3); foo(@a); 14:18
exp_evalbot r18946: OUTPUT[ | 2 3␤]
moritz_ tinita: defaultinstallation oder so, freigeist.org/battie/ 14:19
lambdabot Title: my c00l website - content
moritz_ sorry, wrong channel
kp6: sub foo($a, $b) { say "$b | $a" }; my @a = (2, 3); foo(@a);
exp_evalbot r18947: OUTPUT[3 | 2␤]
moritz_ YaY, fglock++
fglock it's not ready yet :P 14:20
moritz_ but the simple example worked 14:21
pugs_svn r18948 | moritz++ | [kp6] simple test for list interpolation into parameter lists 14:31
fglock pugs: my $x := (2,(4,5)); say $x.perl 14:37
exp_evalbot OUTPUT[\2␤] 14:38
fglock pugs: my $x = (2,(4,5)); say $x.perl
exp_evalbot OUTPUT[[2, 4, 5]␤]
fglock what's the difference?
moritz_ uhm 14:39
dunno, really
pmurias S06:888 14:40
moritz_: you added a test for wrong behaviour
moritz_ pmurias: yes, I just noticed
pugs_svn r18949 | moritz++ | [kp6] corrected previous test 14:41
moritz_ pmurias++ 14:42
pmurias ;) 14:42
moritz_ now we need eval() to test the wrong behaviour 14:45
pmurias moritz_: isn't it a runtime error? 14:49
i would guess we need CATCH 14:50
moritz_ pmurias: I don't think so, because it can be checked at compile time
pmurias only in this specific case 14:52
moritz_ why? 14:53
pmurias "&foo := bar()" would make it a runtime error
moritz_ right 14:53
but it's the "normal" case
moritz_ I think a runtime error is a good start, but I'd prefer static checking at compile time wherever possible 14:55
pmurias who wouldn't ;)
moritz_ matlab programmers, sadly
pmurias never met any, or wrote any matlab 14:56
moritz_ lucky man ;) 14:59
fglock which spec defines the behaviour of @a vs $a ? 15:01
moritz_ fglock: in which context?
fglock moritz_: I'm worried with my $x := (2,(4,5)); 15:05
moritz_ TimToady: ping 15:07
pmurias S02: 1153 15:12
moritz_: what is the matlab's users rationale for wanting the errors at runtime? 15:15
fglock pmurias: thanks
moritz_ pmurias: habit, I guess
fglock but I didn't find my answer yet
moritz_ pmurias: I always hated it 15:16
pmurias fglock: "C<$x> may be bound to any object..." 15:17
fglock pmurias: why does my $x := 2 creates a Capture? 15:20
assuming pugs is correct
pugs: my $x = 2; say $x.perl 15:21
exp_evalbot OUTPUT[\2␤]
fglock it may even be a .perl bug 15:22
moritz_ fglock: most .perl expressions generate a capture in pugs
pmurias it's something like :($x) := \(2)
$x shouldn't be a capture
moritz_ pugs: say \2 ~~ Capture 15:24
exp_evalbot OUTPUT[␤]
fglock pugs: my $x := (3,4,5); say $x.perl # why doesn't $x bind to the list? 15:29
exp_evalbot OUTPUT[\3␤]
moritz_ I think it propagates scalar context to the RHS 15:30
fglock the reason kp6 gets confused is because i am confused :P
moritz_ I'd expect it to "upgrade" the list to an array ref instead 15:31
moritz_ pugs: my $x = (2, 3, 4); say $x; 15:32
exp_evalbot OUTPUT[2 3 4␤]
moritz_ just like assignment does
could it be that lists only degenerate to .elems in numerical context, and in other scalar context it's changed to a capture? 15:33
pmurias moritz_: i think bind is supposed to be unmagical
pugs: 2.perl 15:34
exp_evalbot OUTPUT["2"␤]
pmurias pugs: say 2.perl
exp_evalbot OUTPUT[2␤]
fglock hmm - i think the explanation is:
pmurias pugs: my $x := 2;say $x.perl
exp_evalbot OUTPUT[\2␤]
fglock bind is compiled as: ($x) := (1,2,3)
pmurias pugs: my ($x) := (9,10,11);say $x.perl 15:37
exp_evalbot OUTPUT[\9␤]
pmurias fglock: i agree 15:38
fglock but why is assignment different?
pmurias pugs: my ($x) = (9,10,11);say $x.perl 15:38
exp_evalbot OUTPUT[\9␤]
pmurias pugs: my ($x) = (9,10,11);$x++;say $x; 15:39
exp_evalbot OUTPUT[10␤]
pmurias pugs: my ($x) := (9,10,11);$x++;say $x;
exp_evalbot OUTPUT[*** Can't modify constant item: VInt 9␤ at /tmp/JVCUj783sW line 1, column 22-26␤]
fglock pugs: my $x := (3,4,5); say $x.perl; # not an implicit ($x) ? 15:40
exp_evalbot OUTPUT[\3␤]
fglock pugs: my $x = (3,4,5); say $x.perl; # not an implicit ($x) ?
exp_evalbot OUTPUT[[3, 4, 5]␤]
fglock i mean, the second one 15:40
fglock why is assignment different from binding 15:41
pmurias fglock: don't know (you could look at STD, it might be a syntax issue) 15:43
fglock i've got the spec now - i just don't know why :)
pmurias $x := (3,4,5) is a special case of :($x) := \(3,4,5) 15:48
fglock in this case, isn't it a runtime error that not all parameters get bind? 15:50
pmurias it could be
fglock pugs: my $x; :($x) := \(3,4,5); say $x 15:51
exp_evalbot OUTPUT[*** Cannot bind this as lhs: Val (VV :($x))␤ at /tmp/eHa7lVDwQO line 1, column 8-25␤]
fglock ?
moritz_ kp6: say "test" 15:53
exp_evalbot r18949: OUTPUT[test␤]
Tene kp6: say "moritz_"
exp_evalbot r18949: OUTPUT[moritz_␤]
moritz_ my irssi or screen just mixed a "core dumped" line into this window 15:54
so I thought mybe evalbot died
Tene Ahh.
moritz_ it was a leftover from #p5p, though
pmurias pugs: my $x; :($x) := (3,4,5); say $x 15:59
exp_evalbot OUTPUT[*** Cannot bind this as lhs: Val (VV :($x))␤ at /tmp/gHHxojs7Tv line 1, column 8-24␤]
TimToady kp6: sub foo($a, $b) { say "$b | $a" }; my @a = (2, 3); foo(@a);
exp_evalbot r18949: OUTPUT[3 | 2␤]
TimToady that is incorrect
pmurias the test is fixed
TimToady it should attempt to bind @a to $a, and fail when there's nothing left to bind to $b
moritz_ ... but not the implementation
TimToady *nod* 16:00
moritz_ pugs: my $x := <a b>; say $x.perl
exp_evalbot OUTPUT[\"a"␤]
moritz_ pugs: my $x := (7,8); say $x.perl
exp_evalbot OUTPUT[\7␤]
TimToady the difference between := and = is that = always applies either item or list context to the right side, whereas := never does
moritz_ TimToady: is that correct behaviour? 16:01
TimToady no, it's not
if you pass (7,8) as a scalar argument to a function, you expect it to turn into [7,8] 16:02
moritz_ ok
TimToady parens get autoflattened only in list context
and binding doesn't commit to that until you see what you're binding to
fglock isn't passing (7,8) to a function that expects ($x) an error? 16:04
TimToady not if the parens are around a single argument
foo((7,8)) should work fine 16:05
that's what is equiv to $a := (7,8)
moritz_ pugs: say elems: (3,4)
exp_evalbot OUTPUT[*** No compatible multi variant found: "&elems"␤ at /tmp/5VI6XrzY3W line 1, column 5-10␤]
moritz_ pugs: say elems: [3,4]
exp_evalbot OUTPUT[*** No compatible multi variant found: "&elems"␤ at /tmp/1kOBXuUGnI line 1, column 5-10␤]
TimToady you can't use : there 16:06
fglock got it - there is a lot of fixing to do
moritz_ pugs: say elems [3,4]: # that's what I meant
exp_evalbot OUTPUT[2␤]
moritz_ and it works with (3,4) as well 16:07
TimToady indeed, the invocant slot is item context
the only reason 3,4.elems doesn't work is precedence
moritz_ we need Acme::MagicDisambiguation for that ;) 16:08
fglock after $a := (7,8) - should $a.perl return "(7,8)" instead of "[7,8]" ? 16:09
moritz_ I don't think so 16:10
TimToady I don't think the Capture notion has to survive binding, so I'd expect [7,8]
fglock because (7,8) is a List object
hmm 16:11
TimToady if you bind to |$a, that's explicitly asking to preserve capture info
(though you get the whole arglist capture that way)
mostly captures are supposed to be invisible to normal folks 16:12
a capture represents an argument list that we don't know the item/list context of yet
fglock does $a := (7,8) store a read-only Array ?
TimToady arguably that's the right thing for parameter binding, which is readonly anyway 16:13
but in explicit binding to a rw variable, I can argue it both ways
it's probably okay to leave it readonly for now, since they can always use explicit [] to get the other 16:14
and there's likely some benefit to knowing something is readonly 16:15
benefit to the optimizer, that is
on the other hand, I'd hate to see a lot of $a := new Array: 7,8,whatever() 16:17
but maybe that mostly becomes $a <== 7,8,whatever() in any cse 16:18
*case
so probably the conservative thing is to leave $a := (7,8) readonly on the assumption it's useful and also easy to get around 16:21
fglock ok
TimToady it's a bit un-Perl5-like though
amnesiac oi guys, btw, what happened to audreyt? 16:22
TimToady liver problems requiring low stress lifestyle
amnesiac ah 16:23
yeah I'm pretty sure of that
PerlJam "low stress"? Is that even possible for audrey?
amnesiac for anyone, you just have to stay out of IRC :)
PerlJam amnesiac: frenetic people seem to be in a state of perpetual stress. 16:26
fglock stares at Container.pm 16:35
pugs_svn r18950 | rhr++ | [evalbot] [untested] use RESULT[] instead of OUTPUT[] when .perl.say is used 16:41
pmurias thinks rhr is a brave soul (to commit untested changes to the evalbot ;) 16:43
Aankhen`` LOL. 16:44
rhr kp6: 1 16:49
exp_evalbot r18950: OUTPUT[1␤]
Aankhen`` Won't it need to be restarted? 16:50
rhr I dunno, I don't run the bot :) 16:50
Aankhen`` Heh.
pugs_svn r18951 | fglock++ | [kp6] "@a = [1,2,3]" does the right thing, but "@a = @b" now fails 17:14
fglock I don't get how is [1,2,3] different from @b in an assignment?
is it because @b is a container? 17:15
moritz_ kp6: my @a = [1, 2, 3]; say @a.elems
exp_evalbot r18951: OUTPUT[1␤]
moritz_ kp6: my @a = [1, 2, 3]; @b = @a; say(@b.perl) 17:16
exp_evalbot r18951: OUTPUT[[ [ 1, 2, 3 ] ]␤]
moritz_ kp6: my @a = [1, 2, 3]; @b = @a; say(@b.join('|'))
exp_evalbot r18951: OUTPUT[1 2 3␤]
moritz_ kp6: my @a = 1, 2, 3; @b = @a; say(@b.join('|'))
exp_evalbot r18951: OUTPUT[syntax error at position 9, line 1 column 9:␤my @a = 1, 2, 3; @b = @a; say(@b.join('|')␤ ^ HERE␤]
moritz_ kp6: my @a = (1, 2, 3); @b = @a; say(@b.join('|'))
exp_evalbot r18951: OUTPUT[1|2|3␤]
moritz_ that looks right in both cases 17:17
fglock kp6: my @b = (1,2,3); my @a=@b; say @a.perl
exp_evalbot r18951: OUTPUT[[ [ 1, 2, 3 ] ]␤]
fglock fixing
dlocaus hello 17:25
moritz_ hi 17:26
pugs_svn r18952 | fglock++ | [kp6] several array assignment cases are covered, but t/kp6/44-map.t fails 17:27
fglock i don't understand how an assignment from @x.map(...) is a different case of an assignment from [1,2,3] 17:29
maybe @b and @x.map() return a List object
fglock but that would be weird, at least in the @b case 17:30
perhaps my concept of List is wrong 17:31
moritz_ I think @x.map() should return a list 17:32
because you can't (@x.map())[$index] = 3
so it's gotta be read-only
fglock actually, you can - if map returns lvalue 17:33
moritz_ ok, but can you .shift and the like?
fglock i think Array is a special case
moritz_ pugs: say (map({ $_**2 }, <1 4 5>)).shift 17:34
exp_evalbot OUTPUT[*** Can't modify constant item: VUndef␤ at /tmp/bIZmT8DHX7 line 1, column 5 - line 2, column 1␤]
fglock when a List is either inside a @a variable, or an anonymous Array container
moritz_ that's what I meant: the thing returnd by map is a read-only container
fglock ok - gotta recode that
brb 17:39
[particle] oh, right, it's wednesday 17:51
i was in LA yesterday 17:52
[particle] ww 17:53
obra hey particle 17:54
pugs_svn r18953 | dlo++ | [kp6] minor documentation fix 18:05
pugs_svn r18954 | dlo++ | [kp6] explaination of how the infix_58_... and so on is built 18:11
nnunley Hey obra. 18:19
[particle] hi there obra 18:20
obra hey guys. 18:21
clkao nnunley: you are alive!
obra nnunley: sounds like I narrowly missed you in sf a couple weeks back
nnunley obra & clkao: It looks like.
obra: I'm probably going to be in Boston Jan 12. 18:22
nnunley clkao: :) 18:22
obra nnunley: shit. I'm likely to be in sf for a wedding
[particle] maybe you can trade apartments for the weekend... 18:23
nnunley I'll be in sf the week after.
Err, Actually, I'll be in sf on the 13th.
clkao you are just avoiding each other
nnunley grins at particle.
Could be.
nnunley clkao: Where are you these days? 18:25
Hrm. wait. I'm coming back from sf on the 11th, so I'm just confused. 18:26
clkao taiwan
Tene I want to go to sf again.
pugs_svn r18955 | dlo++ | [kp6] I think I accidently removed some code, reverting out 18:27
nnunley clkao: Any likelyhood of you being in the states in the near future? 18:29
obra yeah, clkao. .us hackathon? 18:31
.oo { .mx hackathon }
clkao currently no plan, but we can scsomething 18:33
nnunley .mx would be fun. 18:34
pugs_svn r18956 | dlo++ | [kp6] Documented and cleaned up this file 19:05
pugs_svn r18957 | fglock++ | [kp6] anonymous array is a Container 19:19
moritz_ kp6: 5 19:21
exp_evalbot r18957: RESULT[5␤]
moritz_ YaY, rhr++ 19:22
dlocaus kp6: 1/0
dlocaus I didn't do that... the dog did it. 19:23
dlocaus btw, I put in a fix into Global for that, it will now die if you attempt to divide by zero. 19:24
moritz_ that's bad... why does evalbot die with segfault when the kp6 process is forked off first?
moritz_ kp6: say "back" 19:24
exp_evalbot r18957: OUTPUT[back␤]
dlocaus goes back to looking at signatures. 19:25
pugs_svn r18958 | fglock++ | [kp6] reverted last commit 19:30
fglock & 19:31
dlocaus moritz_: I was checking out dev.pugscode.org/browser/v6/v6-Kind...l5.pm#L522 20:01
lambdabot tinyurl.com/yv836k
dlocaus And it occurred to me that
"'do { if (::DISPATCH(::DISPATCH(' ~ $.cond.emit_perl5 ~ ',"true"),"p5landish") ) '"
should really be
"'do { if (::DISPATCH(::DISPATCH(' ~ $.cond.emit_perl5 ~ ',"true"),"true") ) '"
is this correct?
pmurias dlocaus: no 20:18
dlocaus why not?
pmurias true returns a kp6 object
and p5landish returns a perl5 value 20:19
moritz_ dlocaus: I think you overestimate my kp6 knowledge :/
dlocaus :)
but what about a Junction?
I was attempting to try this 20:20
if ( 1 == any() ) {
say "true";
} else {
say "false";
}
but Junction cannot be rendered into a p5landish "verb"
pmurias 1 == any() => False => perl5 0 20:21
dlocaus that's not what the code says
my bad 20:22
the code does say that
I think I ment to try out this 20:23
if ( 1 == all() ) { say "true" } else { say "false" };
dev.pugscode.org/browser/v6/v6-Kind...ion.pm#L41
lambdabot tinyurl.com/yt29k8
dlocaus if there are no items in things, then it returns true
TimToady pugs: if ( 1 == all() ) { say "true" } else { say "false" }; 20:24
exp_evalbot OUTPUT[true␤]
TimToady pugs: if ( 1 == any() ) { say "true" } else { say "false" };
exp_evalbot OUTPUT[false␤]
pmurias kp6: if ( 1 == any() ) { say "true" } else { say "false" };
exp_evalbot r18958: OUTPUT[no method 'p5landish' in Class 'Junction'␤ at compiled/perl5-kp6-mp6/lib/KindaPerl6/Runtime/Perl5/MOP.pm line 345␤ KindaPerl6::Runtime::Perl5::MOP::__ANON__('HASH(0x87942b0)', 'p5landish') called at compiled/perl5-kp6-mp6/lib/KindaPerl6/Runtime/Perl5/MOP.pm line 169␤
..main::DISPATCH('HASH(0x87942b0)', 'p5landish') called at - line 18␤]
TimToady cool 20:25
pmurias the kp6 answer isn't cool at all
dlocaus well, that is why I was hunting it down... :) 20:26
but how can 1 == all() be true?
TimToady because there are no elements that falsify it
dlocaus brain crashes. 20:27
What?
pmurias it makes sense if you understand it in terms of sets
dlocaus brb, going to the garage to get my college math books 20:28
TimToady my $status = 1; for @elems -> $elem { $status = 0 unless true $elem }; # basic short-circuit "and" 20:29
well, except with a loop exit
for @elems -> $elem { return False unless true $elem }; return True; # basic short-circuit "and" 20:30
moritz_ (set theory)++
dlocaus perl6-- 20:33
making me get my old math books!
moritz_ what's bad about it?
pmurias has his math book <3 meters from his computer
* books 20:34
dlocaus 1 = all(undef) is true!
moritz_ no 20:34
1 = all() is true
undef != empty set 20:35
TimToady note that all()/any() are also spelled [&]/[|] with defaults defined the same way
actually, you can't assign to 1 :P
moritz_ 1 == all() # of course
dlocaus all() !== all(undef)?
pmurias dlocaus: i makes perfect sense if you think in terms of regulation instead of real world objects 20:36
moritz_ dlocaus: the list (undef) holds one element, the list () holds none
pmurias all() == everything
moritz_ a mathematician would express $a == all(X) as 'For all $x in X: $a == $x' 20:37
and an empty set always satisfies a "for all" condition 20:38
because "for all" is just "not (exists ... (not ... ) )"
dlocaus I haven't had use set theory in like 15 years.. this hurts 20:38
TimToady and likewise, "any" is never satisfied by the empty set 20:39
moritz_ hears a course on "automaton theory and formal languages", quite interesting
pmurias moritz_: right now? 20:40
dlocaus I'll make a note to -review set theory tonight...
justatheory sets
moritz_ I didn't know you could build automatons for regular languages that accept input both on the left and on the right hand side ;)
dlocaus Which is really bad, because I just started otn "Stalin: The court of the red Tsar", which turning out to be a pretty facinating read. 20:41
moritz_ pmurias: no, the last course was 12 hours ago ;)
pmurias ok
moritz_ it's the best course this term
and one of the hardest, I might have to add 20:42
pmurias has to look into his copy of "Introduction to Automata Theory, Languages, and Computation" 20:42
moritz_: i thought you were studing physics?
dlocaus pmurias: so how would I go about making Junction handle p5landish? or is it, I need to make == do a special operation for Junction? 20:44
One of my hardest/funest courses was "politics" 20:45
All papers, 500 words OR LESS. :)
moritz_ pmurias: yes, I should ;) but I have to take a second subject, to lesser extend 20:46
TimToady dlocaus: maybe you should look at how Quantum::Superpositions does it. 20:47
dlocaus back in a bit, I have to move my car (street cleaning :)
TimToady or maybe Damian put a Perl6::Junctions out there too...
dlocaus peeeking 20:48
TimToady pity that street cleaners aren't smart enough to wash your car en passant...
dlocaus pity the street cleaners aren't smart enough to wash the street. 20:49
After they run by, its like... "huh guys? you didn't clean anything"
TimToady must be a union shop... 20:50
dlocaus oh cool
yep that's my home town. very pro union...
TimToady maybe we should advertise that we want to unionize the pythonistas. that'd do 'em in... 20:51
"if you want me to indent that, you'll have to pay me more" 20:52
though, gee, I wouldn't mind getting paid for whitespace...
dlocaus back to do performance by KLOC? :) 20:53
/do/doing/
TimToady #comments
#are
#us
dlocaus fglock? 20:54
fglock ping?
whew, I think I've blown my brains for this morning. I'm going to eat lunch before I go completely cross eyed. 20:55
pmurias dlocaus: p5landish shouldn't be required for if 21:00
pmurias dlocaus: (hint) methods in kp6 are $::Code, they authothread on their invocant (it's a bug) so $junction.true is still a Junction (it should be a Bit) 21:14