svn switch --relocate svn.openfoundry.org/pugs svn.pugscode.org/pugs/ | run.pugscode.org | spec.pugscode.org | paste: sial.org/pbot/perl6 | pugs.blogs.com
Set by avar on 16 November 2006.
00:01 GabrielVieira joined 00:05 xpika left 00:09 weinig is now known as weinig|away 00:26 mjk joined 00:38 johnjra joined 00:43 jferrero joined, nipra joined 01:01 lyokato joined 01:12 hexmode joined 01:13 seano joined
seano (from the "99 problems" tests, #35): am I wrong about "return X if ...", or is this a bug? Try pf2(4): 01:15
sub pf2($n) {
for 2..floor sqrt $n {
return ($_, pf2($n/$_)) if $n % $_ == 0;
}
return $n;
}
01:26 Maddingu1 joined 01:27 rgs joined
TimToady seano: looks like a bug to me. maybe tail recursion gone awry and not passing the new value? 01:28
seano thanks. it looks painful to track down, so I figured I'd do a sanity check first :(
TimToady but maybe there's also a bug in your algorithm. 01:29
seano works in p5...
aha! $_ is getting clobbered by something ("if", I believe). Should that happen? 01:35
TimToady works to put result of subcall into a temporary array 01:38
but that's an if on the front.
maybe it's getting confused with "for" statement modifier
seano "for modifier"? all I have is an ordinary for statement. the workaround I used was to use a block parameter on the for: "for blah -> $x { ... }" works. 01:40
01:40 johnjra is now known as jarah, twobitsprite joined
twobitsprite something tells me this isn't the place for parrot questions 01:40
TimToady you don't have one, but if you did, it would be assuming -> $_ 01:41
it seems to be mapping the boolean result to $_
#parrot is more likely to have someone who knows the answer
twobitsprite TimToady: I suppose it depends on how you calculate the probability... if the two people in there are a) not idle, and b) willing, helpful experts... 01:42
TimToady it's sorta like a multimethod matching, but more the biological sort of algorithm 01:43
seano right. so maybe "if" is creating its own $_... 01:44
seano goes source-diving for how the heck "if" is implemented...
TimToady the type mismatch can be overcome by driving up the numbers of receptors as well as the number of things to be recepted. 01:45
my guess is it's spillover from the for modifier semantics
01:46 bones_ joined
TimToady in fact, the way biological systems deal with ambiguous mmd dispatch is to simply pick one at random. 01:47
and if it fails--well, you should have taken a higher dosage; 01:48
and if the higher dosage kills you, well, you should have had a better set of mmd methods.
darwinism: better chemistry through living... 01:51
02:04 bsb joined 02:07 bucky joined
twobitsprite TimToady: that's deep 02:08
I'll remember that
TimToady problem with biological mmd is that you don't always get the answer you expect when you dispatch to the IRC multimethod. :) 02:09
you send the "blowup" instruction to the rocket and it says "I'm of two minds about that..." 02:10
so maybe we should give mmd free will, but make it trainable... 02:12
If you pick that option, it hurts. Try something else next time. 02:13
maybe extensible mmd policy is the path to AI... 02:14
"I'm sorry, Dave, I can't allow you to dispatch to that MMD routine..." 02:18
02:19 |Jack| joined 02:25 bones_ joined 02:30 b00t joined 02:58 leed joined
[particle] sing( Daisy, Daisy ); 03:18
03:22 spx2 joined 03:24 hakrzcode joined 03:26 mako132_ joined
spx2 bleah 03:26
twobitsprite mmd on such a scale seems to me that you would spend more time searching for a dispatch candidate than you would actually running code... in which case the algorithm used to dispatch becomes the focus, and now your stuck with traditional search mechanisms to find the right dispatch 03:32
by "search" I mean problem/solution space search, a la AI 03:33
spx2 genetic algorithms ? 03:38
03:39 mako132_ joined 03:48 _Jack_ joined 03:52 spoops is now known as spoop 04:08 nipra joined 04:16 gugod_ joined 04:19 ingy joined 04:46 b00t joined 04:53 hakrzcode left, b00t joined, ingy joined, gugod_ joined, nipra joined, _Jack_ joined, spx2 joined, leed joined, bsb joined, twobitsprite joined, rgs joined, Maddingu1 joined, seano joined, lyokato joined, GabrielVieira joined, justatheory_ joined, mdiep_ joined, Aankhen`` joined, cdfh_ joined, jabbot joined, weinig|away joined, maquis joined, Lunchy joined, ashleyb joined, tewk joined, Steve_p joined, [particle] joined, lumi joined, TimToady joined, yves joined, mj41_ joined, Southen joined, BooK_ joined, nperez joined, asey joined, theorbtwo joined, autark joined, integral joined, cognominal joined, sri_ joined, pjcj joined, arguile joined, bwk joined, awwaiid joined, spoop joined, zgh joined, c6rbon joined, felipe joined, Lorn joined, ruz joined, Khisanth joined, baest joined, spinclad_ joined, araujo joined, avar joined, rafl_ joined, mako132 joined, Azure-BOT joined, SCalimlim joined, mugwump joined, cookys joined, buubot joined, mtve joined, Eidolos joined, tcliou joined, SamB joined, py1hon joined, silug joined, jrockway joined, Grrrr joined, miyagawa joined, audreyt joined, mr_ank joined, allbery_b joined, Gothmog_ joined, masak joined, stevan joined, nekokak joined, jiing joined, buu joined, xinming joined, kane_ joined, nanonyme joined, qmole joined, statico joined, stef__ joined, Debolaz joined, spo0nman joined, kcwu joined, GeJ joined, cj joined, pnu joined, rafl joined, Yappo joined, Juerd joined, perlbot joined, Kattana joined, kolibrie joined, revdiablo joined, greenail_ joined, nipotan joined, takanori_ joined, glasser joined, wolverian joined, PerlJam joined, svnbot6 joined, TreyHarris joined, Shabble joined, knewt joined, broquaint joined, nnunley joined, jamessan joined, takesako__ joined, pasteling joined, evalbot_r15026 joined, scw joined, Caelum joined, nothingmuch joined, jiing_ joined, Tene joined, LCamel_ joined, meppl joined, orafu joined, hcchien joined, obra joined, clkao joined 05:04 seano_ joined, b00t joined, ingy joined, gugod_ joined, nipra joined, _Jack_ joined, leed joined, bsb joined, twobitsprite joined, rgs joined, Maddingu1 joined, lyokato joined, GabrielVieira joined, justatheory_ joined, mdiep_ joined, Aankhen`` joined, cdfh_ joined, jabbot joined, weinig|away joined, maquis joined, Lunchy joined, ashleyb joined, tewk joined, Steve_p joined, [particle] joined, lumi joined, TimToady joined, yves joined, mj41_ joined, Southen joined, BooK_ joined, nperez joined, asey joined, theorbtwo joined, autark joined, integral joined, cognominal joined, sri_ joined, pjcj joined, arguile joined, bwk joined, awwaiid joined, spoop joined, zgh joined, c6rbon joined, felipe joined, Lorn joined, ruz joined, Khisanth joined, baest joined, spinclad_ joined, araujo joined, avar joined, rafl_ joined, mako132 joined, Azure-BOT joined, SCalimlim joined, mugwump joined, cookys joined, buubot joined, mtve joined, Eidolos joined, tcliou joined, SamB joined, py1hon joined, silug joined, jrockway joined, Grrrr joined, miyagawa joined, audreyt joined, mr_ank joined, allbery_b joined, Gothmog_ joined, masak joined, stevan joined, nekokak joined, jiing joined, buu joined, xinming joined, kane_ joined, nanonyme joined, qmole joined, statico joined, stef__ joined, Debolaz joined, spo0nman joined, kcwu joined, GeJ joined, cj joined, pnu joined, rafl joined, Yappo joined, Juerd joined, perlbot joined, Kattana joined, kolibrie joined, revdiablo joined, greenail_ joined, nipotan joined, takanori_ joined, glasser joined, wolverian joined, PerlJam joined, svnbot6 joined, TreyHarris joined, Shabble joined, knewt joined, broquaint joined, nnunley joined, jamessan joined, takesako__ joined, pasteling joined, evalbot_r15026 joined, scw joined, Caelum joined, nothingmuch joined, jiing_ joined, Tene joined, LCamel_ joined, meppl joined, orafu joined, hcchien joined, obra joined, clkao joined, |Jack| joined 05:43 f0rth joined
meppl gute nacht 06:12
06:14 BooK joined 06:33 mj41__ joined, mj41__ is now known as mj41 06:34 mj41__ joined 06:37 gugod_ is now known as gugod, mj41___ joined 06:41 mj41____ joined 06:54 demy joined 06:55 demy left 07:25 Southen joined 07:41 marmic joined 07:48 ruz joined 07:57 iblechbot joined 08:10 Steve_p joined 08:19 devogon joined 08:34 dduncan joined 08:48 elmex joined 09:03 spx2 joined
spx2 hello all 09:04
i have a problem
i'm trying to make a script in perl using sockets 09:05
but it works only for 4 seconds
and then
BOOOM!
it stops :(
justlinux.com/forum/showthread.php?...post862332
please help me
09:11 xinming joined 09:14 cdfh joined 09:31 ozo_ joined 09:37 ozo joined 09:46 pnu joined 09:49 Salzh joined 09:50 b_jonas joined 09:56 Psyche^ joined, Psyche^ is now known as Patterner 10:21 fglock joined
fglock I've got algorithms for executing the begin-block in the right env, and for replaying the side effects in the run-time env 10:25
now I need some way to 'collect' the compile-time side-effects, in order to have something to replay... 10:26
possible side-effects are: imported subs, things that were modified in other packages 10:27
spx2 i need some help on this justlinux.com/forum/showthread.php?...post862332
fglock spx2: the best place to ask is perlmonks.org - please create an account so that you can have a proper dialog there 10:29
spx2: it's a nice place to learn perl
spx2 already did that 10:30
fglock ah, I found it :)
spx2 what ? 10:32
fglock I foud your question there - would you remove the <br/> in the code? it's difficult to download 10:33
10:33 lumi_ joined 10:35 Psyche^ joined
fglock spx2: I guess that at some point, you have both sides waiting for input at the same time 10:39
spx2 that would mean the socket would be empty on that time,but it is not possible because one of the sides fills the sockets,so at the next moment one of them should have what to read from the sockets 10:40
i mean 10:41
10:41 ruoso joined
spx2 you are probably right,but from how it was built it shouldn't come to an issue as you're poiniting out 10:41
fglock spx2: try 'timeout' at the perlmonks search - it has some nice tips 10:42
svnbot6 r15030 | fglock++ | kp6 - added example of pure-perl compile-time env implementation 10:58
pasteling "evalbot_r15029" at 194.145.200.126 pasted "Pugs build failure" (375 lines, 20.9K) at sial.org/pbot/22282 11:00
11:13 luqui joined 11:21 spx2 joined 11:28 Psyche^ joined, Psyche^ is now known as Patterner 11:31 baest_ joined 11:32 baest_ is now known as baest 11:36 sunnavy joined
spx2 why does perl 6 even exist ? 11:37
is it because there is a 6 after 5 ?
i mean....really why does it exist ? 11:38
does it bring anything new ?
or better ?
avar spx2: read the synosis 11:46
spx2 whats your oppinion avar ? 11:48
luqui it does not exist...
spx2 lol @ luqui 11:50
11:52 GabrielVieira2 joined 12:00 bwk joined 12:01 idiotmax joined 12:03 sunnavy joined 12:14 chris2 joined 12:15 bwk joined 12:17 fglock joined 12:20 bwk joined, iblechbot joined 12:23 baest joined 12:24 ayrnieu joined 12:25 Jaak joined
svnbot6 r15031 | kudra++ | Placeholders 12:34
12:41 bonesss joined 12:51 rindolf joined 12:52 Limbic_Region joined 12:55 kanru joined
masak spx2: perl6 can be considered a way to put the learnings from perl5 into perl 12:57
12:59 seano joined 13:00 bonesss joined 13:01 bonesss joined 13:03 seano_ joined
svnbot6 r15032 | luqui++ | Solved 99 problems problem 27. 13:10
13:10 seano joined
svnbot6 r15033 | luqui++ | Changed problem 27 to "require" problem 26, the same way 33 does for 32. 13:16
13:17 fglock joined 13:18 bonesss joined 13:19 iblechbot joined
fglock kp6 would need a definition of which begin-block side-effects should be recorded 13:22
13:23 dduncan left
fglock I'm still looking up for older discussions 13:23
13:25 bonesss joined 13:26 Psyche^ joined, Psyche^ is now known as Patterner
spx2 how long has perl been around ? 13:26
13:26 bonesss joined
luqui 1989 or something like that? 13:30
svnbot6 r15034 | luqui++ | Wrote many more tests for problem 34. The solution was wrong, and just happened to work correctly for the test
r15034 | luqui++ | (turns out that totient(10) = pi(10) where pi(n) is the number of primes less than n).
13:32 Psyche^ joined
svnbot6 r15035 | luqui++ | And... fixed problem 34. 13:32
fglock does running 'use' at BEGIN means that the precompiled code must have already included all modules - and there is no linking work left for the runtime? 13:35
svnbot6 r15036 | luqui++ | Forgot the special case phi(1) = 1.
fglock that is, use'd modules are statically linked 13:37
luqui not necessarily... 13:40
svnbot6 r15037 | luqui++ | Solved 99 problems problem 35.
fglock maybe 'use', 'export' are special in some way
luqui though I suppose so, since you do need to have compiled the used module at the using module's compile time 13:41
13:43 Psyche^ is now known as Patterner
Limbic_Region eval: my @foo = (1,2,3); my @bar = (4, 5, 6); my $bit = 1; push ($bit ? @foo : @bar), (7, 8, 9); @foo; 13:44
buubot Limbic_Region: Error: Type of arg 1 to push must be array (not null operation) at eval line 1, near "@bar)"
13:44 pnu joined
luqui eval: my @foo = (1,2,3); my @bar = (4, 5, 6); my $bit = 1; push +($bit ? @foo : @bar), (7, 8, 9); @foo; 13:45
buubot luqui: Error: Type of arg 1 to push must be array (not null operation) at eval line 1, at EOF
Limbic_Region luqui - you might not want to trust buubot and try it yourself from command line
Limbic_Region doesn't have that ability ATM
luqui buubot is correct 13:46
eval: my @foo = (1,2,3); my @bar = (4, 5, 6); my $bit = 1; push @{$bit ? \@foo : \@bar), (7, 8, 9); @foo;
buubot luqui: Error: syntax error at eval line 1, near "@bar)" Missing right curly or square bracket at eval line 1, at end of line syntax error at eval line 1, at EOF
Limbic_Region eval: my @foo = (1,2,3); my @bar = (4, 5, 6); my $bit = 1; push (($bit ? @foo : @bar)), (7, 8, 9); @foo;
buubot Limbic_Region: Error: Type of arg 1 to push must be array (not null operation) at eval line 1, near "))"
luqui eval: my @foo = (1,2,3); my @bar = (4, 5, 6); my $bit = 1; push @{$bit ? \@foo : \@bar)} (7, 8, 9); @foo;
buubot luqui: Error: syntax error at eval line 1, near "@bar)"
luqui eval: my @foo = (1,2,3); my @bar = (4, 5, 6); my $bit = 1; push @{$bit ? \@foo : \@bar} (7, 8, 9); @foo; 13:47
buubot luqui: Error: syntax error at eval line 1, near "} ("
luqui ugh
eval: my @foo = (1,2,3); my @bar = (4, 5, 6); my $bit = 1; push @{$bit ? \@foo : \@bar}, (7, 8, 9); @foo;
buubot luqui: 6
luqui eval: my @foo = (1,2,3); my @bar = (4, 5, 6); my $bit = 1; push @{$bit ? \@foo : \@bar}, (7, 8, 9); "@foo";
buubot luqui: 1 2 3 7 8 9
luqui hahahaha! finally!
Limbic_Region luqui - did you see the perlmonks node that is making me test this?
b_jonas heh, the www.perlmonks.com/?node_id=594109 thing
13:47 mj41_____ joined, penk joined, mj41_____ is now known as mj41
luqui doesn't read perlmonks 13:48
13:48 cdfh_ joined
Limbic_Region well, the thing is, the reference to the array isn't needed 13:49
luqui wow... very strange
eval: my @foo = (1,2,3); my @bar = (4, 5, 6); my $bit = 1; push @{$bit ? @foo : @bar}, (7, 8, 9); "@foo";
buubot luqui: 1 2 3 7 8 9
luqui it's as if @{} imposes referential context or something
Limbic_Region so I was wondering if the deref was needed at all 13:50
luqui much like \($bit ? @foo : @bar)
Limbic_Region eval: my @foo = (1,2,3); my @bar = (4, 5, 6); my $bit = 1; push $bit ? @foo : @bar, (7, 8, 9); @foo;
buubot Limbic_Region: Error: Type of arg 1 to push must be array (not null operation) at eval line 1, at EOF
luqui I don't know what this null operation it's talking about is
fglock I wonder if building the target program in the env and then serializing to .perl would make sense 13:51
13:51 thepler joined
fglock smalltalk does something like this, right? 13:52
Limbic_Region eval: my @foo = (1,2,3); my @bar = (4, 5, 6); my $bit = 1; push {$bit ? @foo : @bar}, (7, 8, 9); @foo;
buubot Limbic_Region: Error: Type of arg 1 to push must be array (not single ref constructor) at eval line 1, at EOF
13:53 devogon joined
Limbic_Region whatever, I have abused the channel enough 13:53
fglock and then, compile-time to run-time transition is just 'suspended execution' 13:54
13:54 chris2 joined
fglock lunch & 13:55
14:12 seano_ joined
svnbot6 r15038 | luqui++ | Solved 99 problems problem 49. 14:12
14:16 GabrielVieira2 is now known as GabrielVieira 14:17 gnuvince left, cdfh joined 14:23 cdfh_ joined 14:29 nipotan is now known as nipotaway 14:33 cdfh joined 14:38 cdfh_ joined 14:54 buetow joined
svnbot6 r15039 | kudra++ | Posted version 14:54
14:55 cdfh joined 15:02 bonesss joined 15:04 cdfh__ joined 15:05 fglock joined 15:06 vel joined 15:07 yves_ joined 15:08 vel joined 15:15 cdfh joined 15:23 cdfh_ joined 15:26 hexmode joined 15:28 cdfh joined 15:32 weinig|away is now known as weinig
fglock re env dump - Data::Dump::Streamer can't work out nested closures 15:32
luqui fglock, really? :-( 15:39
svnbot6 r15040 | luqui++ | w00t, solved 99 problems problem # 98. 15:40
luqui perl 6 is a pretty nice language to program in 15:41
it would be nicer if pugs didn't have those little idiosyncracies... 15:42
(but there are way fewer of them than a year ago or so)
15:43 cdfh joined 15:48 jferrero joined
Limbic_Region fglock - do you have a test case, I will be sure demerphq and diotalevi have it fixed if possible soonish 15:52
@tell fglock if you have a test case for Data::Dump::Streamer failing on nested closures let demerphq or diotalevi know and I am sure they will fix it soonish if possible 15:53
luqui it'd be nice if lambdabot would just say "ok, I'll tell him" 15:55
as an error check to catch yourself if lambdabot is not in the room
like now
Limbic_Region luqui - it does say "consider it noted" 15:56
luqui ahh, good
Limbic_Region that's how I knew there was a problem
luqui gut 15:57
Limbic_Region wanders off to a $meeting 15:58
15:58 cdfh_ joined
pasteling "fglock" at 201.35.169.13 pasted "problem with dumping nested closures" (22 lines, 759B) at sial.org/pbot/22293 16:00
fglock the problem is, all variables are created in the same pad
and it uses variable renaming, instead of shadowing 16:01
16:01 lambdabot joined
fglock anyway, I'm not convinced that a disassembler is the best solution for passing env 16:04
16:10 agentzh joined
agentzh is writing a Parse::RecDescent that emits C# code. 16:10
luqui doesn't C# already have several parser generators? 16:11
agentzh i'm wondering how difficult it would be for miniperl6 to emit C#
luqui: just for fun ;)
luqui fair enough :-) 16:12
agentzh C# 2.0's closure support helps a lot.
luqui oh, with that it might be pretty easy to get mp6 to emit C# 16:13
agentzh yes! i'm thinking about that too!
so i take the P::RD on C# as an excercise. 16:14
*exercise
luqui agentzh, you could try L::AG
that needs closures up the wazoo
agentzh luqui: i'm already a L::AG user. :)
fglock agentzh: I can help you 16:15
agentzh fglock: oh!
fglock agentzh: it would need some native libs
agentzh that will be great!
agentzh is listening
fglock take a look at the existing lib/MiniPerl6/*/Emitter.pm modules 16:16
agentzh aye
luqui agentzh, I was talking about porting L::AG to C# :-)
agentzh i see the perl 5 emitter emits code that depends on the perl 5 runtime.
fglock this is where the AST is translated into target source code
agentzh fglock: i know this part.
luqui: i knew. :) 16:17
16:17 cognominal joined
agentzh but i don't quite understand the algorithms used by miniperl6. 16:17
so i should read the source first.
fglock agentzh: it depends on what C# runtime already has - you can emit everything into subroutine calls, or you can inline code
you can dump the ast tree - see one of the controller scripts 16:18
agentzh fglock: thanks. i will. :)
fglock: the performance of the miniperl6 compiler looks quite good.
it didn't take very long to bootstrap it using perl 5 16:19
fglock: if i have problems in understanding the miniperl6 source, i'll let you know. :)
fglock ok! 16:20
agentzh :)
luqui: re L::AG
i used that to implement a program prover in the last year.
luqui cool! 16:21
agentzh it's great for transforming ASTs.
and my prover has proved all the examples in our textbook.
16:21 nipra joined
luqui well, that is the idea. I think we can do way better than AGs for transforming ASTs, I'm just not how 16:21
by prove, do you mean...
agentzh prove the programs' correctness. 16:22
luqui as in prove that they terminate?
agentzh given a program source and a spec. compare these two automatically.
luqui oh wow
very nice
16:22 spx2 joined
luqui what did you use to write the spec? 16:22
agentzh a math-like language.
i was using the Maple software to do the maths. 16:23
spx2 i need help with regex
luqui oh, interesting
spx2 perl doesnt want to do but the first line !
what do i do ?
luqui spx2, example?
fglock agentzh: humm - would you like to work on kp6 devel? it's the next step towards 6-on-6 16:24
agentzh luqui: my #1 complaint about L::AG is its performance
fglock: verily.
luqui agentzh, yeah, the lazy approach does have a few drawbacks
agentzh fglock: but i'm still getting my head around your cool stuff. :)
luqui when comparing to the "compiled" approach in the literature
fglock I'm writing the specifications 16:25
luqui :-)
spx2 $ipadress = `ipconfig`;$ipadress =~ /IP(.*)/s;print $1. "\n" ;
agentzh fglock: cool
spx2 im expecting this to get the line "IP Address. . . . . . . . . . . . : xx.xx.xx.xx"
agentzh fglock: kp6 compilers generate mp6 code, no?
spx2 why is it not getting it ? 16:26
i mean i think i wrote it all correct...
$ipadress has at first multiple lines
can the regex parse all of it ? it seems to stump on the first line
luqui spx2, well.. you will get IP........ to the end of the string
spx2 luqui: i dont
luqui that's a little strange 16:27
do you check that it matches?
agentzh luqui: is it possible to pre-compile the L::AG grammar?
clkao
fglock agentzh: mp6 is just one of the backends - it's being called "desugared p6"; other backends may need different desugarings
agentzh fglock: gotcha.
luqui agentzh, not with this algorithm. the time consuming part is annotating the tree with the computation closures 16:28
(that's my guess at least)
spx2 luqui: i get a pattern from the text,to extract
agentzh luqui: oh!
luqui and after that is done, it should be just as fast as the compiled approach (modulo sub call overhead) 16:29
agentzh luqui: i'm looking forward to that. :)
luqui er, no... 16:30
after L::AG annotates the tree, then its algorithm is just as fast as the compiled approach
so if it's running slow, I guess that it's taking too much time annotating..
agentzh hmm
i've profiled L::AG, but forgot its bottle-neck... 16:31
luqui: and there's a bug i've encountered.
luqui agentzh, I would like to see your data. I haven't run it on any big data structures 16:32
agentzh i found myself cloning the trees over and over again.
two grammars can be applied to the same data structrues?
*can't
luqui that is true
wait...
no, that shouldn't be true 16:33
agentzh luqui: i'll send some data to you when i have some time.
luqui okay, thanks
I'll look at that bug
agentzh excellent!
0:35 AM here. G'night &
luqui night 16:34
agentzh :)
16:35 weinig is now known as weinig|away 16:37 GabrielVieira2 joined
fglock I guess I can build a 'closure' object that knows how to dump itself 16:40
but there is still the problem of dumping use'd CPAN modules 16:41
I don't think that's possible without 5-on-6
one possible solution is, perl5 modules are loaded twice - at compile and runtime 16:43
TimToady assuming you can be sure of getting the same one... 16:46
or at least one that has the same interface
Ada was always big on separating the interface from the implementation so you could swap out the implementation without changing the interface 16:47
fglock TimToady: I'm a bit lost regarding the begin block implementation - specifically, how to separate compile/run time 16:48
I figured out several bits already - but saving BEGIN side-effects still looks difficult 16:50
TimToady the reload trick should work find for Perl 6, because we guarantee that the user can't modify the used.
and we also guarantee that modules installed in the library have version numbers 16:51
so in an a.b.c the b theoretically guarantees a unique interface. 16:52
and you already presumably know how to save your own closures, or you wouldn't a compiler... 16:54
luqui TimToady, I've been programming in perl 6 recently...
TimToady yes, I backlogged. :)
luqui there were a few odd-feeling points
TimToady all ears
luqui but by far the largest one was that I couldn't tell when ((1,2),(3,4) had two elements and when it had four
s/)/)) 16:55
TimToady exactly the same as when (@foo,@bar) has 2 vs N
a Capture won't decide that till it's bound
luqui what about: (1,(2,(3,4))) 16:56
is it possible for that to have three elements?
er..
TimToady probably not
forgot your outer parens there
so ((1,2),(3,4)) is always going to be (1,2,3,4) 16:57
because the , is list context maker
luqui okay, good!
pugs is wrong then
(well, I'm not sure how much I like that from the language perspective, but at least it's consistent)
how does one make List objects? 16:58
TimToady well, that's how I read it. Audreyt may think of it differently.
in which case we'll need to negotiate.
Seq(1,2) I suppose 16:59
but maybe that's different
luqui hmm
TimToady \(1,2) can function as a list
1 => 2 => 3 => 4 is a list in the Lisp sense... 17:00
luqui but not in the (1 => 2 => 3 => 4) == 4 sense...
TimToady right
17:01 dmq joined
luqui which one of the following takes the second column of a matrix: 17:01
@a[*][1] or @a[][1]
lambdabot Unknown command, try @list
luqui shutup lambdabot :-) 17:02
(neither works in pugs, of course :-) 17:03
dmq fglock? 17:04
TimToady @a[*;1] would eventually be it, I think
lambdabot Unknown command, try @list
TimToady @tell yourself to shutup
lambdabot Consider it noted.
luqui TimToady, even if @a is just an AoA, not a shaped matrix?
TimToady but S09 is not notably implemented yet
I would think an array that discovered itself to have compound leaves would try to emulate shape 17:05
17:06 seano joined
luqui oh... kay 17:06
TimToady [][] notation is hard to interpolate multidimensional slices into... 17:07
luqui fair enough
(because the first [] has to return something...)
TimToady and what does [*] return that would make [1] work right? 17:08
without saying >>.[1]
luqui a list potential (like a junction) :-)
I'd rather not go there ;-) 17:09
TimToady well, that's essentially what the "for list(@x) < 2" was trying to do...
but I don't see a real list comprehension syntax helping with [*][1] offhand 17:10
the . boundary is pretty much limited to scalars in P6
luqui uh huh...
TimToady well, not scalars, items 17:11
anyway, [*;1] syntax is supposed to be the way around that.
svnbot6 r15041 | fglock++ | kp6 - added proof-of-concept recursive closure dumper
fglock dmq: pong 17:12
TimToady a way, rather
dmq hi.
l~r said you disagreed with the output of sial.org/pbot/22293
lambdabot Title: Paste #22293 from "fglock" at 201.35.169.13
dmq I was wondering why?
or point me at how i can read the log if you already said.
fglock dmq: there are 3 pad levels, but the dump only shows one 17:13
dmq yes, thats correct.
there is no guarantee that you get back the exact same internal representation, just that it will function the same. 17:14
any other approach very quickly leads to madness.
TimToady pun intended, I presume
fglock dmq: I'm working around it
with madness and all :) 17:15
TimToady if you need an exact representation of the original back out, only madprops will give it to you.
dmq ah, i think its an NP-complete problem. 17:16
17:17 maquis left
dmq oh right, with MAD or in perl6 not, in Perl5 its er /hard/. 17:17
17:17 spx2 joined
dmq consider weird shit like my @subs; my ($x,$y,$z)=qw(x y z); for my $x ($x,$y,$z) { push @subs,sub { $x; eval $_[0] } } for my $y ($x,$y,$z) { push @subs,sub { $y; eval $_[0] } } for my $z ($x,$y,$z) { push @subs,sub { $z; eval $_[0] } } Dump(\@subs); 17:19
spx2 how do i get my own ip adress ? i've used with success `ipconfig` and then applied some regular expressions and got what i need(on Windows) ,but on Linux,i have a shell where im running the script and i am not allowed to do ifconfig,so what do i do ??????
fglock dmq: this is my workaround so far: svn.pugscode.org/pugs/v6/v6-KindaPe...n-block.pl
it allows you to build closures, execute code inside them, and then inspect the environment 17:20
dmq and that code doesnt even cover all the cases :-)
fglock dmq: not sure yet
TimToady spx2: use the Socket module 17:21
fglock it only needs to work for BEGIN blocks
spx2 TimToady: what exactly in the socket module,thats what im trying to figgure out for the last 1 hour and 30m
dmq The point is that with aliasing in the mix you can end up with some really bizarre cases. 17:22
spx2 TimToady: i found IO::Socket,Socket,Win32::Internet
TimToady: of wich win32 is not good
dmq for instance, names that are the same that refer to different vars, names that are different that refer to the same vars, etc.
fglock dmq: this is not supposed to happen at this level (desugared p6)
dmq so in some situations is not clear to me that any given representation is necessarily correct, unless you have more info that name/sv_location 17:23
spx2 TimToady: ?
dmq er, fglock, i didnt grok that comment.
fglock dmq: this is generated code, so I can control what it gets 17:24
dmq im speaking to the arbitrary issue of taking a set of code and closures and restoring it correctly. 17:26
TimToady spx2: if you know your local machine's name, you can use gethostbyname
but generally one just lets the machine assign your address for you when you're connecting, because you don't generally know which interface you're going to go out of, and the address depends on the interface. 17:27
dmq i believe my code does restore it correctly, so long as "correctly" doesnt mean "topologicially identical".
TimToady once you're connected you can look up your own binding with getsockname
shower & 17:28
fglock dmq: I wonder what happens if the code is recursive (needs closure cloning) 17:29
luqui ?whois spx2
lambdabot Unknown command, try @list
luqui sigh
spx2 luqui: in perl...
dmq it should DTRT. 17:30
:-)
luqui hmm.. it is possible (even likely) for a machine to have multiple IP addresses 17:32
so it is an ill-defined thing to do in general
you need to talk to your network card interface somehow...
spx2 luqui:..are you a noob ? 17:36
i just did this 17:37
$ipadress=`curl www.whatismyip.com/`;
$ipadress=~/Your IP Is (.*)<\/h1>/m;
print $1;
and i got what i needed
fglock dmq: I'll make some experiments
luqui spx2, most certainly, because the IP address that made a request comes with the packet that made it
fglock but I think there may be problems with recursive subs
luqui if a computer has two network cards, one of them will make the request 17:38
dmq in code as hairy as DDS i wouldnt say that there isnt :-)
and i could imagine recursive subs being one place where it might be so
17:39 ashleyb joined
luqui spx2, but right now, my IP is 67.174.183.183, 192.168.0.100, and 127.0.0.1... which one do you want? 17:39
(I'm not saying you can't do what you're trying to do, I'm just trying to establish that the problem is tricker than a simple OS call or something) 17:40
*trickier
spx2 luqui: dude,im very practical , i dont have time for jokes,i meant the external one 17:41
luqui spx2, which external one? 67.174.183.183 or 192.168.0.100
if I make a request to somebody on my LAN, the latter is probably what they're looking for
so you want the IP of my router? 17:42
that's even harder :-)
you might even have to parse whatismyip.com to get that...
spx2 luqui: DUDE, ALMOST ALL OF THE WORLD IS OUTSIDE YOUR LAN !
luqui spx2, because ifconfig says my IP is 192.168.0.100
calm down.
spx2 luqui: i am calm 17:43
luqui: listen
luqui: say that i'm like some thousands of miles away
luqui: there is only *ONE* ip i'm intrested in from you !
luqui okay
spx2 luqui: and that is most certainly the one on whatismyip.com
luqui well, I think that's basically the only way you're going to get it 17:44
because my computer doesn't know that information without at least sending one packet
(as an example of why that is true, my router could get a new address from DHCP without telling me) 17:46
(unless telling me is part of the dhcp protocol, I'm not really sure actually)
17:50 buetow joined 17:52 mbradley joined 17:53 bernhard joined 18:01 fglock joined 18:02 diotalevi joined 18:06 silug joined 18:08 ruoso joined 18:18 GabrielVieira joined 18:19 Jaak left 18:23 weinig|away is now known as weinig 18:27 GabrielVieira2 joined 18:30 fglock joined 18:34 justatheory joined
svnbot6 r15042 | fglock++ | kp6 - added a closure 'emitter' to the begin-block prototype 18:42
fglock requiring a disassembler is not a reasonable requirement for 6-on-6 18:43
I'll try to find other solutions
TimToady for your own closures, surely you have the original AST
or at least "had" at some time in the past... 18:44
fglock yes - I'm working on that direction...
TimToady and anything imported just has to have a "true name" that you can relink to at run time. 18:45
fglock I wonder if it would be useful to have the program dump'able at any time - as a side effect of having enough info available 18:47
TimToady in fact, "is export" basically just makes a link to a name in a subpackage...
the Smalltalkers would like that... 18:48
but I'm not sure it's practical on every VM
fglock basically, you have the source file, global variables, and the pads - only the stack is missing 18:49
but cps can take care of that
could
TimToady you can't remember foreign stacks in any case, if you've called out to some other runtime that doesn't integrate with your cps 18:50
which is why cps systems tend to shun outside "help", I suspect. 18:51
fglock ah 18:52
TimToady we could start a marketing campaign for "100% Pure Perl" I suppose, but it seems a bit unperlish... 18:53
I suppose if you can replay all the API events to a non-cps system you can fake a continuation. 18:54
ignoring side effects.
and assuming you could restart the API in a consistent state. 18:55
well, not today's problem.
fglock sure :) 18:56
TimToady anyway, assuming all imports are done with true names, a re-use at runtime only has to do a require, not an import. 18:58
18:58 penk joined
TimToady course, the whole point of pragmas is to cheat... 18:59
but maybe we can help them "cheat fair" 19:01
fglock the 'use' implementation probably needs to install hooks to do the right thing at INIT 19:05
TimToady and I'm saying that hopefully the right thing is just a require 19:06
require just says "make sure the package aka (true names) are populated" 19:07
normal importation should have mapped all aliases to package symbols that require will bring in 19:08
so nothing needs to be realiased at run time.
fglock you mean, the generated code is something like this? require X; *s = \&X::s; 19:09
TimToady that implies to me that "use Foo" resolves to "use Foo-1.2.3-JRANDOM" at compile time
well, P6 does lexical imports by default, not typeglobs 19:10
fglock what does it desugars to? require Foo-1.2.3-JRANDOM; s := X::s 19:11
how do you import a sub?
TimToady I'm saying that if you have something aliased to X::s at compile time, the dump of that structure should preserve the alias without having to regenerate it a run time. 19:12
fglock I mean, what does the dump would look like?
TimToady how do you dump lexicals currently with their latest compile-time value? 19:14
fglock I call a subroutine that is defined inside the lexical scope
an 'inspector' sub 19:15
TimToady so if you've got "my $importsub = \&X::s" there...
it just needs to find a way at run time to remap $importsub back to the "X::s" true name 19:16
aka symbolic reference
so basically linking is turning symbolic refs back into hard ones, I guess. 19:17
fglock what is the p6 syntax for this? "my $importsub = \&X::s"
TimToady phone &
kolibrie pesky phones 19:18
TimToady my &importsub := &X::s; 19:19
fglock hmm - when to use ::= ? 19:20
TimToady we might have to limit the exportation of anonymous subs though, I suppose.
or assign them an obfuscated true name for linking purposes.
for now we can just make "sub is export {...}" illegal 19:21
19:21 renormalist joined
TimToady and if there's a custom import sub, it can handle its own semantics presumably... 19:22
fglock I guess I need to start implementation - I'd like to have something runnable to experiment with 19:23
TimToady including, presumably handing the user a thunk to poke into the INIT queue.
for now assume you don't have to save anything anonymous across a use boundary. 19:24
that's the main point of package namespaces, after all--to hold the public interface 19:25
luqui why can't you use Data::Dump::Streamer as a catch-most method?
19:26 elmex joined
fglock luqui: one reason is that it renames variables 19:26
luqui hmp 19:27
fglock another reason is to avoid cheating - this is 6-on-6, and it doesn't have a disassembler
luqui ahh 19:28
okay, that makes sense
fglock v6.pm does use DDS 19:29
19:33 beppu_ is now known as beppu
fglock I guess I can close the kp6 spec now, with: lexical subs and classes; metamodel interface; begin blocks 19:34
TimToady if you want to tweak it later, we might just let you. :) 19:35
fglock oh, and containers
dmq it does? 19:38
patches welcome :-)
19:38 Jedai joined
dmq if you can hold your nose long enough to patch it. 19:38
ah if only i knew then what i know now.... 19:39
TimToady I would think the regex engine would have burned out your nose completely. :)
dmq heh
fglock dmq: you are talking about DDS?
dmq yes 19:40
you could have pushed me over with a feather when i read you were using it for v6.pm
fglock it's quite a nice module
the problem is me - I want it to do too much :)
dmq the problem is the code is heaping pile of steaming dung so making it do what you want is infinitely harder than it should be. 19:41
i mean, its dung that i know and love, and raised from a little mostly not smelly cow-patty, but its still dung. 19:42
fglock heh - I wonder how v6.pm even works, with it's half-hundred dependencies 19:43
dmq anyway, im very glad that you like it, and that its being used for the v6 stuff.
fglock DDS handles the .perl method
dmq i keep thinking i aught to rewrite it in C/XS 19:45
fglock dmq: I wonder if you'd write a Dumper for mp6... 19:46
this would force the compiler to expose enough info 19:47
TimToady *cough* madprops *cough* 19:48
fglock and it's needed for serializing begin->init blocks in kp6
19:48 lisppaste3 joined
TimToady I presume you mean a Dumper written in mp6 19:48
fglock TimToady: is there some text about madprops? I'd like to know what kind of annotations are needed 19:49
TimToady: yes - written in mp6
mp6 is "clean-room"-ish 19:50
TimToady madprops are strictly a p5 thing to work around the fact that the compiler throws away far too much info
and the fact that if you simply tell p5 not to throw away the info, it either breaks the compiler completely or changes the semantics 19:51
dmq sorry was on the phone. 19:52
TimToady the madprops approach is to simply attach the information anywhere close by that will be preserved, and then run a postprocessor to move the info back to the right spot in the tree. 19:53
19:53 hexmode left
TimToady it's not an approach you want to design into anything on purpose... 19:53
dmq fglock: id be glad to consider it once im wrapped up with the "get stuff done before perl 5.10 is out" mode. 19:54
fglock dmq: that would be nice 19:55
dmq and timtoady: regarding our last brief conversation, im sorry i wasnt trying to drag out an analysis of the design of p5's regex engine. i was just trying to get insight into what you had in mind as the work around.
anyway, i really dont mean to annoy you with my interest/questions/schemes for the perl5 re. sorry if i have. 19:56
TimToady np, just wish I was several more people...
dmq heh. dont we all (on multiple levels) 19:57
:-)
TimToady occasionally I also wish I was smarter.
fglock home &
TimToady I'm either the smartest stupid person or the stupidest smart person you'll ever meet. :) 19:58
fglock TimToady: thanks
TimToady welcome
dmq anyway, ive done some analysis on how to do the perl6 style var bindings. im not there yet but you never know.
fglock oh, and I'd like to meet you sometime :)
dmq fglock: have a good one. 19:59
Limbic_Region refrains from mentioning "idiot savant"
TimToady well, my brain is definitely in sideways from everyone else's, in any case. 20:01
Limbic_Region dmq - out of curiosity, has there been talk on p5p or elsewhere about 5.12 once 5.10 is released?
dmq beyond that Dave Mitchel will be the pumpking not that ive heard. 20:02
timtoady: i'm happy to follow in your brains footsteps. sidewise or not, it goes interesting places.
l~r: i think the general thing is we just want to get perl 5.10 out now. 20:03
Limbic_Region I agree
dmq freaping creaturities
TimToady except my brain usually refused to cooperate in telling me where *it's* been...
Limbic_Region but I would hate to see 5.12 take as long to release as 5.10 was from 5.8
dmq timtoady: do like the rest of us and follow the breadcrumbs. ;-)
TimToady things just bubble up, and I say them, and they're usually true enough to pass for truth. 20:04
Limbic_Region dmq - you didn't know TimToady's brain is a multi-headed hydra - one of the heads is constantly eating the bread crumbs
dmq hrm, i guess i dont really know how much of what im doing is TimToadys, Henry Spencers or Ilya's footsteps. probably all of them. :-) 20:05
TimToady having known both of the others individually, I can't imagine how they could interact in person... 20:07
dmq heh
TimToady I suppose if they stuck to math they'd be fine. 20:08
Limbic_Region TimToady - have you considered what you want to do after Perl 6? 20:10
TimToady I want to see if Perl 6 stops first. :)
but the world is full of many interesting things 20:11
I'm doing Perl 6 by choice, not by necessity.
Limbic_Region TimToady - ok, assuming Perl 6 is released to the world and it doesn't stagnate in say 3-5 years, have you considered what of those interesting things you might like to pursue? 20:12
TimToady my brain doesn't work that way. I'm sure I'll be happy with whatever bubbles up at the time.
and I will probably find that it was both surprising and completely expected 20:13
Limbic_Region I never really thought about it but my life so far has been pretty much that way 20:14
though I often think about what I would do when I win the lottery
TimToady for my wife it's the Reader's Digest Sweepstakes... 20:15
are you planning to win the lottery?
Limbic_Region where often = once or twice a year
TimToady - yes, though I haven't quite figured out when yet
it isn't responsible to go and do something as life altering as winning the lottery if you haven't bothered to think through how you are going to let it benefit your friends, family, and mankind in general 20:17
20:18 GabrielVieira2 is now known as GabrielVieira
TimToady with me I occasionally hope for a MacArthur grant, but I know I'm probably perceived as far to conservative (not to mention old) to get one from them. Now I wouldn't be surprised if a certain other lady who hangs around here managed to pull one down. 20:18
Limbic_Region as soon as I have it all figured out though, funding a handful of hackers working on perl full time is on the list so I will be sure to let you know
luqui that'd be nice 20:19
luqui is off to an informal interview at the moment :-)
Limbic_Region actually, with you I had considered buying your family exceptional health insurance
TimToady my other option is for a billionaire to leave me some of the estate. 20:20
but my estate-planning department is not well staffed.
Limbic_Region realized that lag of his client may have implied that his consideration of health coverage was intended for luqui not TimToady 20:22
20:22 buetow joined
luqui figured otherwise... 20:22
:-)
Limbic_Region in any case, I pretty much let things happen as they happen and am pretty happy with the results but also occassionally consider what would happen if his life were suddenly altered in such a way as winning the lottery 20:23
TimToady well, I agree with Miles Vorkosigan. It's important to me to win with the hand I was dealt. 20:24
20:49 Khisanth joined 20:50 Vex joined 21:07 ludan joined 21:10 bonesss joined 21:11 Aankhen`` joined 21:24 christopher joined
christopher How is typeglob assignment written now? (for redefining subroutines) 21:29
gaal there are no typeglobs. you can access the symbol table with ThisPackage::<&foo> = sub ($moose) { ... } 21:32
see L<S02/Names> 21:33
:= is probably better there.
christopher is it just ::<&foo> for the current package?
gaal no, OUR::<&foo> should work though. 21:34
(not in pugs yet though, probably!)
christopher indeed 21:35
yay, simply &foo := &bar seems to work
(but not non-binding =)
thanks. I wonder if it will work with regexes, rules, etc. too. 21:36
gaal rules are methods.
grammars are classes.
christopher but are they implemented that way yet? ::) (I'm using PGE) 21:37
21:37 jferrero joined
gaal you'll have to try and see :) I don't know 21:37
21:37 weinig is now known as weinig_
gaal also, I'd better be getting to bed... 21:38
christopher ok. know where a test might belong?;
21:38 weinig_ is now known as weinig
gaal I think there's a sytable.t somewhere 21:38
*symtable
t/syntax/symbol_table.t
christopher doesn't seem to test binding, but that's probably a fine place 21:39
gaal cool
good night :)
christopher good night
21:39 larsen_ joined 21:49 buetow joined
dmq see TimToady, why couldnt you have invented make (as well)? the world would have been a much better place 21:51
22:00 renormalist left 22:06 Limbic_Region joined 22:12 diotalevi left 22:13 diotalevi joined 23:01 buubot joined
svnbot6 r15043 | malon++ | t/operators/binding/subs.t - tests for subroutine and token rebinding 23:07
23:10 mbradley joined 23:23 Arathorn joined
Arathorn surfaces for old time's sake 23:23
don't suppose anyone's a) awake, b) still familiar with Judy?
23:27 dduncan joined
dmq im awake, but know only a very little about judy. sorry 23:27
23:28 mako132_ joined
Arathorn dmq: fair enough - thanks for acking, eitherway :) 23:29
Arathorn is trying to work out why Judy doesn't compile under c++, and #perl6 is the only place I know of who are savvy with it
23:29 mbradley is now known as mbradley|bbl 23:37 bucky joined
Khisanth not #haskell? 23:37
Arathorn mm, point 23:43
Arathorn tries there
Limbic_Region Judy isn't a haskell thing Khisanth 23:56
Khisanth - judy.sourceforge.net/ 23:58
lambdabot Title: Judy Arrays Web Page