»ö« | perl6.org/ | nopaste: paste.lisp.org/new/perl6 | evalbot usage: 'perl6: say 3;' or rakudo: / pugs: / std: , or /msg p6eval perl6: ... | irclog: irc.pugscode.org/ | UTF-8 is our friend!
Set by moderator on 20 October 2009.
00:00 quietfanatic joined, [particle] joined
cognominal base = index ' o c x', backchar # This pir pmichaud line makes me think, how could I express in Perl 6 a hash interface and implementation which keys are chars and which values are unique ints, this hash implemented by a string 00:09
clear this implementation is optimized for reading the hash not for writing in it. 00:10
*clearly
I forgot what is the Perl 6 equivalent of Perl 5 ties 00:14
00:14 astrojp joined
pmichaud last I checked, it was "Tieable" 00:15
see S06
00:19 Exodist joined
cognominal nope, in S02 :) 00:22
diakopter chromeos - ubuntu with 2.6.30-forked 00:38
perl 5.10 00:39
no gcc
cognominal would be nice to be able to shove rakudo in that kind of platform 00:52
00:55 wolverian joined 01:08 Whiteknight joined 01:22 zamolxes joined 01:28 facsimile joined
dalek p-rx: 30c8548 | pmichaud++ | (3 files):
Fix handling of 'self' in nested blocks.
01:30
p-rx: dae637e | pmichaud++ | src/stage0/ (3 files):
Update bootstrap.
pugs_svn r29162 | lwall++ | [rx.t] s/also/S&/ 01:36
ng_feed rakudo-ng: colomon++ 01:45
rakudo-ng: Better argument names for the Range operators.
rakudo-ng: colomon++
rakudo-ng: Uncomment and fix Range's ACCEPTS Range, and implement crude versions of min_test and max_test.
pugs_svn r29163 | colomon++ | [t/spec] Test Range with smartmatch. 01:46
01:46 colomon joined 01:48 pnate joined 01:56 snarkyboojum joined 01:58 gfx joined 02:02 wknight8111 joined 02:05 rgrau` joined 02:07 hcchien joined, perigrin joined 02:08 wolverian joined, estrai_ joined, wolverian joined, Exodist joined, IllvilJa joined, eiro joined, rgrau joined, _eMaX_1 joined, yahooooo joined, estrai joined, zaslon joined, pointme joined, sjohnson joined, eiro_ joined 02:09 wolverian joined
diakopter std: ********************************************************* 02:09
p6eval std 29163: ok 00:01 106m␤
02:10 wolverian joined 02:16 justatheory joined 02:19 orafu joined
ng_feed rakudo-ng: colomon++ 02:21
rakudo-ng: Generalize min_test and max_test to work with things other than numbers. Feel silly for not remembering how to do this previously. Been a long day. Er, month, really.
pugs_svn r29164 | colomon++ | [t/spec] Unfudge tests which pass after the last change. 02:22
02:50 snarkyboojum left
colomon TimToady: ping? 03:15
TimToady colomon: pong? 03:16
colomon \\o/
I'm still looking at Ranges, and I've got a couple of questions if you've got a moment.
TimToady 'bout to do dinner, but I'll be around off and on
shore
colomon Range.Str: Rakudo turned the Range into a list and then .Str'd it. 03:17
I don't see that in the spec, and I'm not at all convinced it is sensible. Thoughts?
(it seems more appropriate for the series operator...)
TimToady yeah, though Range should flatten in a real list context, I think 03:18
but Str shouldn't be in the business of supplying one, I suspect
so maybe a direct Str should just $n..$m it
colomon with ^s as appropriate or no? 03:19
TimToady yeah, basically, just return what it originally was, since Ranges are immutable
colomon check. 03:20
TimToady or what it would have been had it ever been written :)
colomon prefix:<+> on a Range returns its "length" -- are we defining that as the number of elements that would be present if it were iterated? 03:21
So the length of 0 .. 1.5 would be 1, not 1.5, for instance?
errr, 2, not 1.5? 03:22
TimToady 2,yeah
colomon check.
Is ^4.5 intended to work?
TimToady is just 0..^4.5 03:23
so 0..4
colomon check.
Thanks!
TimToady np
it's *possible* that we want to leave + returning the Range
if all the numeric transformations are trying to emulate interval arithmatic 03:24
in which case you'd have to use .elems on it
colomon Hmmm.
It should have .elems, then? :)
TimToady I suspect .elems is one of those Any methods that coerces to something with elements if possible :) 03:28
and returns 1 if not
so don't worry about it
except you probably want to optimize it anyway eventually
colomon Thanks again. 03:30
03:35 estrai_ joined, Exodist joined, IllvilJa joined, _eMaX_1 joined, yahooooo joined, zaslon joined, pointme joined, sjohnson joined, estrai joined 03:36 yahooooo0 joined 03:41 justatheory joined
ng_feed rakudo-ng: colomon++ 03:56
rakudo-ng: Add prefix:<^> to grammar, and use it to implement the ^N Range shortcut. Also change Range.Str to just be an alias for Range.perl.
pugs_svn r29165 | colomon++ | [t/spec] Tests for ^N form of Range operator.
r29166 | colomon++ | [t/spec] Change plan * to plan 88 so that ng doesn't complain. 04:00
04:12 Wolfman2000 joined
japhb What is the proper way in full Perl 6 to find the exit status of the child process spawned by qx()? 04:13
TimToady should set $! 04:16
also, return of qx should be undef if it failed
we haven't really documented what's in $! for exit codes though 04:17
japhb TimToady, how can you tell if the exec() in the child fails, in a way that differentiates it from the exec() succeeding, but the exec'ed program returning a non-zero exit status? 04:18
TimToady assume $! is the same as $? in Perl 5, but it's also an object that has methods to pull exitcode, signal, etc
iirc, exec failure tends to return 255
I could be misremembering
japhb OK, so just a special exit value, no exclusive out of band path 04:19
japhb finds APUE to check
pugs_svn r29167 | lwall++ | [STD] remove some redundant rules, and cut termish lexer size by 2/3! 04:26
Wolfman2000 ...that's a big cut 04:27
04:33 zloyrusskiy joined
japhb Between APUE and the bash manpage, I think I've pieced it together. By convention, on exec a command not found results in the child exiting with status 127. Bash has a few more conventions: command found but not executable is status 126, redirection errors are status 1, etc. 04:44
04:48 [particle] joined
TimToady I can see where I might confuse 255 with 127 :) 04:51
japhb Clearly you're slipping a bit in your old age. 04:55
allbery_b technically the exit status is a single signed bit on most unixlikes, but in practice only 0-127 is portable 04:56
(actually, looks like it's defined as unsigned on at least some systems; that would help with the incompatibility...) 04:59
05:00 hugh4life joined
hugh4life /join #perl6book 05:01
05:25 justatheory joined 05:31 meppl joined 05:46 gfx joined 05:47 envi^home joined 05:49 envi_home2 joined 05:51 xomas_ joined 05:59 Nex6 joined 06:05 envi^home joined, estrai joined, Exodist joined, IllvilJa joined, _eMaX_1 joined, pointme joined, sjohnson joined 06:06 Exodist_ joined 06:07 sjohnson joined, IllvilJa joined, _eMaX_ joined 06:09 synth joined 06:10 estrai joined 06:22 justatheory joined 06:36 nihiliad joined 06:40 justatheory_ joined 06:42 synth joined 06:54 justatheory_ joined 06:55 justatheory_ joined 06:58 frew_ joined 07:10 Exodist_ joined 07:33 Woodi joined 07:47 barney joined 07:50 ashizawa joined 08:00 Nex6 joined 08:02 Nex6 joined 08:15 kaare joined 08:26 TiMBuS joined 08:34 zaslon joined
carlin rakudo: sub foo($_) { .say }; foo 'oh hai'; 09:14
p6eval rakudo 7347ec: oh hai␤
carlin rakudo: class A { method foo($_) { .say }; my $a = A.new; $a.foo 'oh hai'; 09:15
p6eval rakudo 7347ec: Confused at line 2, near "'oh hai';"␤in Main (file <unknown>, line <unknown>)␤
carlin rakudo: class A { method foo($_) { .say }; my $a = A.new; $a.foo: 'oh hai';
p6eval rakudo 7347ec: Unable to parse block; couldn't find final '}' at line 2, near ""␤in Main (file <unknown>, line <unknown>)␤
carlin rakudo: class A { method foo($_) { .say } }; my $a = A.new; $a.foo 'oh hai';
p6eval rakudo 7347ec: Confused at line 2, near "'oh hai';"␤in Main (file <unknown>, line <unknown>)␤
carlin rakudo: class A { method foo($_) { .say } }; my $a = A.new; $a.foo: 'oh hai';
p6eval rakudo 7347ec: ( no output ) 09:16
carlin Is there any reason why .method 'param' can't work the same as sub 'param' does? 09:17
rakudo: class A { method foo($_) { .say } }; my $_ = A.new; .foo 'oh hai';
p6eval rakudo 7347ec: Confused at line 2, near "'oh hai';"␤in Main (file <unknown>, line <unknown>)␤
09:59 JimmyZ joined 10:28 ejs joined, justatheory joined 10:41 ejs joined 10:52 xinming joined 11:05 estrai joined, ejs1 joined 11:13 justatheory joined 11:50 ashizawa joined 11:59 Jedai joined 12:08 _eMaX_1 joined 12:12 Whiteknight joined 12:26 payload joined 12:29 Whiteknight joined 13:09 Whiteknight joined 13:13 Whiteknight joined 13:26 meppel joined 13:29 jferrero joined 13:43 iblechbot joined 13:44 Whiteknight joined 13:54 mberends joined 14:01 am0c joined 14:06 Whiteknight joined 14:10 nihiliad joined 14:12 nihiliad joined
eiro_ cd 14:24
arf.. i apologize! bad screen 14:25
btw: hello world
14:26 snearch_ joined 14:40 nihiliad joined 14:41 facsimile joined, aartist joined
aartist can I use Perl6 in production? 14:43
Wolfman2000 I'll be using Perl 6 for a presentation I'm giving in class on Monday. I don't know if that counts as production though. 14:44
mberends aartist, only if you include lots of testing code to ensure stability while the Perl implementations are still being developed
14:45 nihiliad joined 14:46 nihiliad joined 14:57 nihiliad1 joined 15:00 nihiliad joined 15:10 nihiliad joined 15:14 Psyche^ joined 15:15 nihiliad1 joined 15:18 nihiliad joined 15:31 xenoterracide_ joined 15:34 nihiliad joined 15:40 nihiliad1 joined 15:42 nihiliad joined 15:43 nihiliad1 joined 15:45 zamolxes joined 15:53 nihiliad joined 15:54 giftnuss joined 15:56 nihiliad joined 16:01 nihiliad joined
TimToady carlin: mostly for attributes. if methods expected args without : or (), then Rat.nu / Rat.de would not parse, but would take / as starting a regex 16:11
Wolfman2000 morning. TimToady: I still haven't quite figured out how to extract just one value out of a junction. Is such a thing possible? 16:12
TimToady why do you want to?
Wolfman2000 TimToady: What if I had a junction of both positive and negative values, and I only wanted positive values? Or I wanted specific values inside junction? 16:13
pmichaud junctions aren't sets
Wolfman2000 rakudo: my $tmp = any(-1, 0, 1); say $tmp[0]; # I want to pull out just the 1 in this instance.
p6eval rakudo 7347ec: Method 'postcircumfix:[ ]' not found for invocant of class 'Integer'␤in Main (file src/gen_setting.pm, line 324)␤
pmichaud then use grep
Wolfman2000 pmichaud: one can grep a junction? 16:14
TimToady why do you want a junction?
pmichaud rakudo: my @temp = -1, 0, 1; say @temp[0];
p6eval rakudo 7347ec: -1␤
pmichaud junctions aren't lists, junctions aren't sets. It's tempting to try to use them that way ... don't :)
Wolfman2000 TimToady: One piece of Feather code I have uses the +- symbol.
Right now, it's set to return a junction of x + y, x - y 16:15
There are plenty of math functions out there where the negative value has to not even be used.
TimToady why does it have to return a junction?
pmichaud then use an operator that converts negative values into Nil or something
Wolfman2000 TimToady: because right now Rakudo does not allow returning an array?
TimToady this sounds more like a range or interval 16:16
pmichaud rakudo doesn't return arrays?
Wolfman2000 pmichaud: I'm stuck on master branch. I haven't had any luck with returning arrays yet.
perhaps that got implemented and I'm behind on compiling
pmichaud Wolfman2000: hmmmm. Have a quick exapmle handy?
Wolfman2000 pmichaud: hang on
16:16 c9s_ joined
Wolfman2000 rakudo: multi sub infix:<±>(Num $x, Num $y) { return ($x + $y | $x - $y); }; say "5 ± 3 = {5 ± 3}"; # Original. 16:17
p6eval rakudo 7347ec: 5 ± 3 = any(8, 2)␤
pmichaud that's not a list.
Wolfman2000 I'm about to put in the list version 16:18
pmichaud okay.
Wolfman2000 rakudo: multi sub infix:<±>(Num $x, Num $y) { return $x + $y, $x - $y; }; say "5 ± 3 = {join(' ', 5 ± 3)}"; # Arrays.
p6eval rakudo 7347ec: too many positional arguments: 2 passed, 2 expected␤in Main (file <unknown>, line <unknown>)␤
pmichaud rakudo: multi sub infix:<±>(Num $x, Num $y) { return ($x + $y, $x - $y); }; say "5 ± 3 = {join(' ', 5 ± 3)}"; # Arrays. 16:19
p6eval rakudo 7347ec: 5 ± 3 = 8 2␤
Wolfman2000 ...I thought you had to ignore the parentheses with lists now 16:20
pmichaud we don't yet flatten arguments to return, no
but one _can_ return lists
Wolfman2000 ...then I have to wonder. What is better? A list or a junction? 16:21
pmichaud for most operations, lists are better
TimToady what is better, an apple or an orangutan
Wolfman2000 apple
pmichaud junctions are good when you want to do boolean evaluation of multiple possibilities
gotta run -- our guest speaker just arrived at our lug meeting 16:22
Wolfman2000 Either way...I think I understand a bit better about junctions. Junctions are just meant to be a set of values for comparing, not something where you do stuff and then take individuals out 16:23
TimToady you got it
precisely because they are autothreading on comparisons and such, they *can't* be used as sets, because the operators are all wrong 16:24
$set1 === $set2 should only be true if the sets are the same
with $junk1 === $junk2 it depends on the internal structure of the junctions 16:25
arguably all() is the only junction remotely resembling a set
because a set contains all of its elements, but not any of them, or one of them, or none of them 16:26
but even all doesn't work as a set
rakudo: say all(1,2,3) == all(1,2,3) 16:27
p6eval rakudo 7347ec: all(all(Bool::True, Bool::False), all(Bool::False, Bool::True), all(Bool::False, Bool::True))␤
TimToady rakudo: say "true" if all(1,2,3) == all(1,2,3)
p6eval rakudo 7347ec: ( no output )
TimToady rakudo: say "true" if all(1,2,3) === all(1,2,3)
p6eval rakudo 7347ec: ( no output )
Wolfman2000 ...complicated
TimToady rakudo: say "true" if all(1,2,3) === any(1,2,3) 16:28
p6eval rakudo 7347ec: ( no output )
TimToady that one shoulda worked
Wolfman2000 rakudo: say "true" if any(1, 2, 3) === all(1, 2, 3)
p6eval rakudo 7347ec: ( no output )
TimToady that one is impossible, since there is no value that can be all of 1, 2, *and* 3 16:29
pugs: say "true" if all(1,2,3) === any(1,2,3) 16:30
p6eval pugs: true␤
TimToady pugs has it right
ng: say "true" if all(1,2,3) === any(1,2,3) 16:31
p6eval ng 071cdd: Could not find non-existent sub &all␤current instr.: '_block14' pc 29 (EVAL_1:0)␤
Wolfman2000 Pugs...that's the Haskell implementation if I remember correctly
and ng is apparently the branch of the future that needs work.
TimToady ng: say "true" if 1 & 2 & 3 === 1 | 2 | 3
p6eval ng 071cdd: Confused at line 1, near "say \\"true\\""␤current instr.: 'perl6;HLL;Grammar;panic' pc 448 (src/stage0/HLL-s0.pir:300)␤
Wolfman2000 ng: if 1 & 2 & 3 === 1 | 2 | 3 { say "true"; } 16:32
p6eval ng 071cdd: Missing block at line 1, near "& 2 & 3 =="␤current instr.: 'perl6;HLL;Grammar;panic' pc 448 (src/stage0/HLL-s0.pir:300)␤
TimToady ng: if 1 & 2 & 3 === 1 | 2 | 3 { say 'true' }
p6eval ng 071cdd: Missing block at line 1, near "& 2 & 3 =="␤current instr.: 'perl6;HLL;Grammar;panic' pc 448 (src/stage0/HLL-s0.pir:300)␤
Wolfman2000 ng: if (1 & 2 & 3) === (1 | 2 | 3) { say "true"; }
p6eval ng 071cdd: Confused at line 1, near "if (1 & 2 "␤current instr.: 'perl6;HLL;Grammar;panic' pc 448 (src/stage0/HLL-s0.pir:300)␤
TimToady gah, I read that as "needs wonk" 16:33
rakudo: say "true" if all(1,2,3) == any(1,2,3) 16:35
p6eval rakudo 7347ec: true␤
TimToady ah, I know what's going on
rakudo isn't threading ===
facsimile rakudo: say "true" if 2 == any(1,2,3)
p6eval rakudo 7347ec: true␤
facsimile rakudo: say "true" if all(1,2,3) == 2
p6eval rakudo 7347ec: ( no output )
TimToady rakudo: say "true" if 2 === any(1,2,3) # will fail 16:36
p6eval rakudo 7347ec: ( no output )
TimToady it's treating === as a primitive
facsimile what??
oh === vs ==
TimToady because junctions are implemented in terms of === in rakudo 16:37
perigrin that's fitting ... railroad ... junction ...
TimToady has traumatic flashback to Petticoat Junction 16:38
sort of American Gothic Horror... 16:39
perigrin heh ... that's the most unique description I think I've heard for that show
Wolfman2000 well, at least we found a bug 16:40
TimToady or maybe I'm thinking of Green Acres...
Wolfman2000: more of a design issue; rakudo needs a primitive === that doesn't autothread, but Perl 6 needs a === that autothreads 16:42
Wolfman2000 ...so rakudo and Perl 6 are conflicting if I'm understanding it right. So...how do we resolve this conflict?
TimToady well, we need to change rakudo's implementation of object equivalence testing to be immune to autothreading recursively forever 16:43
that is, not use ===, or lexically scope a different operator that acts the same without autothreading
the junction module needs to see infix:<===>:(Object,Object) when everyone else sees infix:<===>:(Any,Any) 16:45
jnthn: see ^^^ 16:46
perigrin TimToady: does === work on Zha Zha Gabor? If so then you were definitely thinking of Green Acres
Wolfman2000 I forgot: is Any > Object?
TimToady my wife tells me that that was Eva pretending to be Zha Zha
perigrin it's looser than Object I think.
TimToady: and I fully suspect she's right 16:47
Wolfman2000 perigrin: that's what I meant. Object is of type Any
TimToady Any is tighter than Object, which is the loosest
perigrin Oh
Wolfman2000 ...so Any is of type Object?
TimToady junctions are outside of Any so that dispatcher automatically catches things that need autothreading
yes
16:47 am0c joined
perigrin needs to read more. 16:48
Wolfman2000 I wonder if it's possible to force sub parameters to be junctions.
TimToady sure, but why would you want to? 16:49
usually you'd rather just have a Matcher of some sort that includes junctions, ranges, values, and closures for smartmatching
Wolfman2000 multi sub infix:<===>: (Object $a where {$a = any(*)}, Object $b where {$b = any(*)}) { # Stuff here };
I know the * is a wild card operator as well...I'm wondering if that would work in this situation.
TimToady why are you assigning to $a?
Wolfman2000 TimToady: would it work better if I used $x and $y instead? 16:50
TimToady why are you assigning?
Wolfman2000 I was trying to come up with a fancy solution that would not require too much changing of rakudo.
Subs can include constraints.
TimToady $a = is an assignment
Wolfman2000 ...oh 16:51
whoops: that was a typo
multi sub infix:<===>: (Object $a where {$a == any(*)}, Object $b where {$b == any(*)}) { # Stuff here };
TimToady now you're doing numeric comparison
Wolfman2000 ...right. need a smart match
multi sub infix:<===>: (Object $a where {$a ~~ any(*)}, Object $b where {$b ~~ any(*)}) { # Stuff here };
TimToady those wheres are always true 16:52
rakudo: say 'true' if 237483 ~~ any(*)
p6eval rakudo 7347ec: true␤
Wolfman2000 ...gah
TimToady rakudo: say 'true' if Failure ~~ any(*)
p6eval rakudo 7347ec: true␤
TimToady if you really want to limit it to junctions, just declare the parameters to be of junction type 16:53
Wolfman2000 ...wouldn't that solve your problems them with ===? 16:54
TimToady but I don't see any use for that
no, junctions wants the version where the arguments aren't junctions
or more precisely, where they don't care if the objects are junctoins
which is what I said earlier, :(Object,Object) 16:55
then === will compare the two objects even if one or both of them is a junction
Wolfman2000 ah
TimToady iow junction wants to use a primitive form of === that is not availabe normally 16:56
*ble
it probably really just needs to say my &sameobj := &infix:<===>:(Object,Object) and then use sameobj($x,$y) as its primitive 17:00
hmm, except Object's version is presumably what is catching the junctions and autothreading, so maybe that won't work either 17:01
so Object's === isn't that primitive either 17:02
17:03 bluescreen joined
TimToady I think we need to rename rakudo's current === to &sameobj, and then define a new === that autothreads and is unused by the junction implementatoin 17:04
*io
ca'nt tyep toady 17:05
17:07 lichtkind joined, chromatic joined
TimToady rakudo: say true any(1,2,3) eqv any(1,2,3) 17:10
p6eval rakudo 7347ec: 1␤
TimToady rakudo: say true any(1,2,3) === any(1,2,3)
p6eval rakudo 7347ec: 0␤
TimToady rakudo: sub infix:<primeq> { $^x.WHICH === $^y.WHICH }; say true any(1,2,3) primeq any(1,2,3) 17:12
p6eval rakudo 7347ec: 1␤
TimToady rakudo: sub infix:<primeq>(Object $x, Object $y) { $x.WHICH === $y.WHICH }; say true any(1,2,3) primeq any(1,2,3) 17:13
p6eval rakudo 7347ec: 0␤
TimToady there's your primitive object equality
rakudo: sub infix:<primeq>(Object $x, Object $y) { $x.WHICH eqv $y.WHICH }; say true any(1,2,3) primeq any(1,2,3)
p6eval rakudo 7347ec: 0␤ 17:14
TimToady that also works, since WHICH always returns a value type
say any(1,2,3).WHICH
rakudo: say any(1,2,3).WHICH
p6eval rakudo 7347ec: 47730420136056␤
17:15 frew_ joined
TimToady say any(1,2,3).WHICH, ' ', any(1,2,3).WHICH 17:15
rakudo: say any(1,2,3).WHICH, ' ', any(1,2,3).WHICH
p6eval rakudo 7347ec: 47358773133424 47358773120664␤
TimToady maybe p6eval should recognize lines starting with 'say' :) 17:16
mberends ...but who would say it ?
TimToady give everyone a shot at it :) 17:17
mberends like all: say "hello"
TimToady including ng, and std
Wolfman2000 I have to get going now. Who knows? I may end up indirectly help you guys find another bug.
or helping 17:18
whichever works
TimToady thanks
Wolfman2000 TimToady: I think I got your case of not typing right
17:19 payload joined 17:28 envi^home joined 17:46 nihiliad joined 17:51 szabgab joined 18:03 TiMBuS joined 18:15 dj_goku joined 18:49 Exodist joined 19:05 masak joined
masak evening, #perl6. 19:05
phenny masak: 20 Nov 17:55Z <quietfanatic> tell masak The reason for having both the event sub and the Event::Type declaration is that I expect module authors to define and call the types, and users of their module to write the handlers.
masak: 20 Nov 17:56Z <quietfanatic> tell masak Also the Event::Types will have many more options in the future that control just how handlers are dealt with.
masak quietfanatic: excellent. just curious. great work!
quietfanatic Thanks 19:06
mathw evening masak
mberends masak! how did the talk go?
masak mathw: oh hai!
mberends: it went better than I had feared. :)
mberends \\o/ 19:07
19:07 pmurias joined
masak though it might have been too in-depth for some, I think the fact that I totally improvised the beginning saved it. :) 19:07
pmurias mberends: ping
mberends pmurias: pong
masak as jnthn commented, people like talks styles which are out-of-the-box.
pmurias mberends: smop doesn't build for you? 19:08
mberends pmurias: there was a C compiler error message when building re-smop. its was on another machine, I'll try to reproduce it now.
pmurias mberends: you don't need re-smop to try mildew-js 19:10
mberends: make in re-mildew should compile m0ld even if you get C errors and make CORE-js in re-mildew will compile CORE to js 19:11
mathw masak: yay talk :)
masak I'll have a link to the PDF and to the no-longer-sekkrit project page for you in a few moments.
mberends pmurias: thanks, will try again 19:12
19:15 payload1 joined
masak I'm kinda curious what pmichaud will say about it all. 19:16
pmurias masak: what's your no-longer-sekkrit project 19:18
? 19:19
masak pmurias: it's a port of PGE to Perl 6.
mathw thinks about that for a bit
masak the talk is titled "I am a strange loop". 19:20
mathw I think
pmurias masak: that's good
mathw you get the prize
you're madder than I am
masak :)
that's saying something.
pmurias masak: rewriting pir is a worthwhile thing
masak pmurias: yes, I think so.
mathw masak: especially since I'm actually *enjoying* job interviews at the moment 19:21
masak pmurias: and really challenging, considering Perl 6 doesn't have continuations.
mathw: oh wow.
mathw Never have before, they've just been 'okay' or 'awful'
mberends pmurias: 'make' in re-mildew says: open2: exec of ../re-smop/m0ld_exe --yeast-create failed at mildew line 58
masak masak.org/carl/bpw-2009-gge/talk.pdf github.com/masak/gge
pmurias mberends: and make in re-smop? 19:22
mathw wtf
mberends going there...
mathw how did I end up with Adobe Reader on my laptop???
pmurias re-mildew needs m0ld_exe
mathw urgh
mberends pmurias: I had tried 'scons' in re-smop, not 'make'. now installing gch 6.8 (debian stable). 19:25
*ghc
dukeleto the parrot peeps have a wiki page going for request for docs for nqp-rx: trac.parrot.org/parrot/wiki/NQPDocs 19:28
19:29 johnjohn101 joined
johnjohn101 is it possible to do threads in rakudo yet? 19:29
masak johnjohn101: no.
johnjohn101: Parrot doesn't really have a threading model yet.
johnjohn101 is there a time frame? 19:30
masak johnjohn101: I don't know of any apart from 'not soon'.
dukeleto masak: we have some threads. they are just not particularly good/secure/cross-platform at this point
masak dukeleto: ah, I stand corrected. 19:31
dukeleto johnjohn101: what do you want to do?
johnjohn101 i have a poc server project that I have in perl 5 and wanted to see if the memory requirements may be different 19:32
dukeleto johnjohn101: how is it POC and in Perl 5 ? 19:33
johnjohn101 it's a proof of concept for a lite middle tier we'd use for our application 19:34
dukeleto johnjohn101: parrot is much faster and uses less memory than perl 5. Rakudo? not so much. mostly because parrot is optimized for itself right now, but not very much for HLL's. this is obviously top priority 19:35
parrot has a "production release" in 2 months. testing, stability and performance are the goals. if you give up the first 2 for speed, all is lost. 19:36
johnjohn101: if you have specific types of threads on specific platforms, i can tell you if that is possible in parrot. but right now I am not quite sure what you are asking 19:37
19:38 giftnuss left
johnjohn101 my basic model is a thread queue. I start threads that read the thread queue and then do the work based on the request in the thread quue 19:40
dukeleto johnjohn101: what do you want to write this in? PIR,NQP or Perl 6 ?
johnjohn101 i've evaluating perl 6. I'm just getting started. probably nothijg will be done until mid 2010 but i'm working a few migration/gap analysis documents 19:42
masak johnjohn101: cool! a lot of things are in place in Rakudo already. but not threads. 19:45
mberends johnjohn101: the Rakudo Star release scheduled for April 2010 seems perfect for your purposes. You'll have to tolerate a few deficiencies before then...
masak mberends: I'm not sure threads are on the table for April. it's not in docs/ROADMAP. 19:46
mathw we don't even have a spec for threads in Perl 6 yet do we?
johnjohn101 well I was going to start evaluating rakudo betwen xmas and new years (slow time). mgmt knows how clunky perl 5 threads are.
masak mathw: S17 has the word 'threads' in it. 19:47
mathw masak: oh joy
mberends the Perl 5 implementation probably scares everyone off designing threads this time around. There be many dragons there. 19:48
mathw oh hell yes
masak concurrent dragons. 19:49
mathw even writing a C++ thread class is a nightmare
mberends pmurias: thanks, re-mildew 'make test' looks good now :-)
mathw designing threading for Perl 6 has to be at least pi squared times worse
pmurias mberends: make test-js runs the javascript tests
that is test for the javascript backend 19:50
* tests
johnjohn101 i really don't mind the perl 5 model as I can get around the restrictions mostly
masak mathw: because Rakudo has a radius which is sqrt(pi) as large as perl5's? :)
mberends pmurias: will try that next, gotta build V8 quickly before then
mathw masak: hmm. Not so sure about that bit. 19:51
dukeleto johnjohn101: you might want to consider writing the most performance-critical part of your app in PIR and the rest in Rakudo
johnjohn101 PIR?
pmurias parrot's assembler
johnjohn101 i'll look into it 19:52
masak johnjohn101: PIR is (fairly high-level) assembly code for the Parrot VM. it's more accessible than the description 'assembly code' might lead one to believe. 19:53
johnjohn101 will I still be able to use my dbi libs when april comes around?
masak johnjohn101: are the DBI libs in Perl 5?
johnjohn101 in rakudo?
yes
masak I wouldn't count on it.
johnjohn101 i need dbd::odbc mostly
masak there's no plan to establish a Perl 5 bridge by April. 19:54
(except perhaps between the communities.)
johnjohn101 hmm that's not good but certainly understandable 19:55
TimToady I thought that was what blitzkost already was 19:56
masak oh yeah. johnjohn101: it might be blitzkost does what you want. but it, too is in very early stages.
TimToady pugs was starting to get pretty good at intermixing p5 and p6 when development stalled 19:57
johnjohn101 perl dbi is what I use the most.
TimToady and part of the reason I'm writing a p5ish grammar in p6 is so that we can parse intermixed p5 and p6, even if the p5 bits are handed off to a different interpreter 19:58
johnjohn101 that's good to know now before I get my hopes sky high. I'm excited about perl 6.
TimToady well, so are we, and have been for years now, with great (im)patience :) 19:59
pmurias masak: i'm not sure normal assembly code is less accesible than pir
19:59 cognominal joined
masak TimToady: I think I'm ready to learn a little more about how you emulate continuations with closures in STD. any suggestions where I should look? 19:59
pmurias: ok -- that's just my personal impression, comparing x86 ASM with PIR.
johnjohn101 better to wait until it's ready. look at how they released python 3.0 way before it was ready
masak johnjohn101: it's difficult. it's also possible to wait too long. :) 20:00
TimToady masak: hmm, then you want to look at the transformations that gimme5 does to a p6 grammar to end up with p5 code
masak johnjohn101: I think it's more of a question of letting in waves of the right kind of interested people at the right moment in the maturation process. 20:01
TimToady: ah, ok.
thanks.
TimToady and probably glare some at the Cursor.pmc code having to do with cursors, esp forky things like * and +
masak nodnod. 20:02
they're a challenge, that's for sure.
20:02 payload joined
TimToady and at some point you have to understand lazymap, which is where the real continuation processing happens 20:02
masak oki.
TimToady but since it's so slow to emulate in p5, we try to avoid lazymap for anything ratchety, if possible
and then just Have the Appropriate Amount of Fun :) 20:03
masak \\o/
mberends masak++: GGE and your talk look great!
masak mberends: thanks. :) 20:04
it's been fun so far.
TimToady or just look through STD.pm5, and compare the comments with the original code to the derived code
dukeleto johnjohn101: PIR = en.wikipedia.org/wiki/Parrot_Interm...esentation
masak mberends: you can try something like `perl6 test-regex 'xa*?y' xaaaay` on the command line, and it works!
TimToady: that might help too. 20:05
dukeleto TimToady: blizkost does some basic type marshalling, but there is still a fair amount to work on. and of course loading XS-based modules doesn't work, but you already knew that ;) 20:06
mberends masak: will try it soon. grokking it all will take a tad longer ;) 20:07
TimToady I thought it had a real p5 interpreter inside it
if so, it oughta be able to do XS
masak mberends: I was going to say that it's fairly straightforward, but I guess the PGE story has already woven me biased. 20:08
that's part of why I'm doing the port.
20:08 Wolfman2000 joined
dukeleto TimToady: patches welcome! this is what happened last time I tried loading XS : leto.net/dukeleto.pl/2009/09/blizko...tests.html 20:13
TimToady: i should try again, a lot of work has gone into blizkost since then 20:15
TimToady I would guess that it's probably just some configuration issue, unless blizkost is using miniperl
but a real embedded Perl 5 ought to be able to load XS fairly easily 20:16
dukeleto TimToady: i don't think we use miniperl. it is a proper embedded perl 5 interp 20:17
TimToady: for what definition of "fairly easily" ? does some marshalling code need to be written?
dukeleto attempts to get blizkost working on a recent parrot 20:20
20:21 nihiliad joined
TimToady fairly easily meaning that P5 code can see the XS modules, not that P6 necessarily can 20:21
dukeleto TimToady: yes, we can't even seem to get P5 code to see XS modules in blizkost yet. 20:22
TimToady print out the embedded %ENV and see if parrot is interfering with it 20:24
masak there. today's unsatisfying November blog post is submitted. 20:27
zaslon lolmasakhazblogged! masak++ 'November 21 2009 -- you mean the media distort the truth?': use.perl.org/~masak/journal/39926?from=rss
masak I think I'll have an early night. good night, y'all.
Wolfman2000 Hi and bye masak 20:28
masak Wolfman2000: hi and bye. see you around.
Wolfman2000 jnthn: Would you happen to have your speeches available online? 20:29
dukeleto TimToady: thanks, that is a good idea! 20:30
diakopter Wolfman2000: jnthn.net/articles.shtml 20:31
Wolfman2000 I'm guessing there is no sense of order to these articles diakopter? 20:32
mberends Wolfman2000: the talks are in descending date order 20:34
Wolfman2000 mberends: so The Way to Rakudo * is the latest? I thought he also covered a LOLSQL talk 20:35
TimToady he might not have put that up yet
20:38 LylePerl joined
dukeleto Wolfman2000: pl/lolcode ? 20:38
Wolfman2000: come join #plparrot on irc.perl.org if you are interested in embedding parrot in postgres. invites all around. 20:40
Wolfman2000 dukeleto: ...not exactly what I meant, but...well, I'll think about the invite.
dukeleto Wolfman2000: just trying to find more peeps with tuits. come by whenever you have time. i have the shell of a basic new PL language written and I am now integrating pgTAP for the tests and I will use my test harness written in NQP 20:44
TimToady nap & # I get my beauty rest at night, but my ugly rest in the afternoon. 20:45
mberends pmurias: it looks like Brian Hammond has taken down github.com/fictorial/perl-v8 :-( do you know of any other repositories for V8.pm? (it's not in CPAN) 20:49
Wolfman2000 Hmm...nice set of slides jnthn++. I'll bookmark your page. 20:55
Now, I have to get back to my homework. I may have more questions later.
diakopter mberends: no, but I can email you a copy 21:02
mberends diakopter: Thanks, no need, copied from another drive. But long term we need a reliable source... 21:03
pmurias V8.pm needs to be reworked and CPANised
mberends yes
(the passive voice weasels out of *who* does that) (does the convention of who asks, volunteers apply here?) 21:06
Wolfman2000 mberends: In this room? Not that I've seen. 21:07
jnthn oh hai
jnthn enjoyed Baltic Perl Workshop today :-) 21:08
mberends oh hai jnthn, how do you feel your talk went?
jnthn mberends: Quite well, I think. 21:09
Got at least one good comment. :-)
masak++ gave a great talk. :-)
mberends his slides look very good too 21:10
mathw hai jnthn
jnthn Yeah
mathw what was your talk on?
jnthn mathw: It as a re-run of "Solved In Perl 6" - no significant changes from previous times I've given it, just different audience. :-) 21:11
mathw Excellent
That's a good talk
jnthn It seems to be well received, so I didn't feel the need to tweak it much. :-) 21:12
mathw :)
jnthn glances to see what's been happening in the ng branch
mathw that's a good timesaver
21:12 frew_ joined
Wolfman2000 Will you upload the lolsql slides at least? I'm curious what you had to say about that 21:12
jnthn colomon++ 21:13
pmichaud I got sidetracked yesterday on ng :-(
mathw I guess once you've done something often enough it's good
pmichaud on the plus side, my weekend is now free
mathw unlike my intro to perl 5 slides at work, which get reworked every time
jnthn pmichaud: \\o/
pmichaud: You got side-tracked into non-ng stuff, I guess?
pmichaud family stuff, too. 21:14
(yes, family stuff is non-ng stuff)
jnthn :-) 21:15
mathw family-ng
jnthn No probs.
mathw start a branch
jnthn heh. Family needs grammar improvements. ;-)
pmichaud: I'm here tomorrow, then flying back on Monday morning. 21:16
21:16 facsimile joined
pmichaud jnthn: okay, works for me 21:17
mathw my sister caused a stir this week by actually finding a musical instrument supplier who said they had something in stock, and sending it to her so promptly that it arrived next day
pmichaud masak rewrote PGE in Perl 6, eh?
mathw pmichaud: apparently
I told him he's mad
he agreed with me
dukeleto pmichaud: it looks interesting
pmichaud I wonder how he feels about the fact that I'm now abandoning PGE :)
jnthn pmichaud: He mostly did it because he wanted the debugging bits, so far as I understood. 21:18
mberends pmurias: thanks, re-mildew 'make test-js' now works :)
pmichaud then we need the debugging bits added into nqp-rx
mathw well he can rewrite that in Perl 6 too then...
now that it needs much rewriting seeing as how most of it's written in NQP :) 21:19
pmichaud hopefully he can write it in nqp
dukeleto pmichaud: there has been a wiki page started for requests for docs for NQP(-rx) trac.parrot.org/parrot/wiki/NQPDocs
mathw nqp-rx is a really awesome bit of tech pmichaud
I hope you understand what you've done
diakopter does anyone know how to do this in nqp (today): s!\\!\\\\!g and s!'!\\'!g
pmichaud diakopter: there's not really a good way to do that yet, sorry
diakopter or pir.
I can't even get split, join to work. 21:20
pmichaud what are you wanting to do there? those don't look like valid regexes
diakopter (to accomplish that)
replace every backslash with two backslashes. replace every single quote with a backslash and a single quote. 21:21
pmichaud PIR would be the best bet at the moment, alas.
diakopter ok. and I fail at even that.
pmichaud although Parrot's String type has a .trans method
but I'm not sure that does what you want
looking
oh, looks like the following would work: 21:22
diakopter I see a trans_charset and trans_encoding
pmichaud my $new = (~$old).replace("\\\\", "\\\\\\\\");
er, :=
testing
jnthn nqp: my $old = "o'noes"; my $new := (~$old).replace("'", '\\\\\\''); say $new; 21:23
p6eval nqp: Assignment ("=") not supported in NQP, use ":=" instead at line 1, near " \\"o'noes\\";"␤current instr.: 'parrot;HLL;Grammar;panic' pc 519 (src/cheats/hll-grammar.pir:197)␤
jnthn nqp: my $old := "o'noes"; my $new := (~$old).replace("'", '\\\\\\''); say $new;
p6eval nqp: Confused at line 1, near "say $new;"␤current instr.: 'parrot;HLL;Grammar;panic' pc 519 (src/cheats/hll-grammar.pir:197)␤
jnthn nqp: my $old := "o'noes"; my $new := (~$old).replace("'", '\\\\\\''); say($new); 21:24
p6eval nqp: Null PMC access in get_string()␤current instr.: 'print' pc 63924 (gen/nqp-actions.pir:4337)␤
jnthn lol
pmichaud the weird thing is that it gives the NPA on the say()
not on the replace.
diakopter I kept getting an NPA when using pirop::join__SSP 21:25
pmichaud looks like .replace is returning PMCNULL
jnthn nqp: my $old := "o'noes"; my $new := (~$old).replace("'", '\\\\\\''); say($old); 21:26
p6eval nqp: o'noes␤
pmichaud aha
.replace is always inplace
jnthn nqp: my $old := "o'noes"; my $new := $old.replace("'", '\\\\\\''); say($old);
p6eval nqp: o\\'noes␤
diakopter interesting, ok
jnthn aww
But, well, works.
diakopter pmichaud: thanks :)
jnthn
.oO( why?! )
pmichaud jnthn: that's just the way the parrot folks implemented it 21:27
diakopter looks like nqp passes scalars by reference, even values like strings 21:28
jnthn :-)
pmichaud: Well, yes, there is that answer.
diakopter: So does Perl 6...
It's signature *binding*. :-) 21:29
You just normally don't notice it 'cus you're doing assignment the rest of the time. :-)
21:29 SmokeMachine joined
diakopter jnthn: o :) 21:31
Wolfman2000 rakudo: say "3".Int 21:41
p6eval rakudo 7347ec: 3␤
Wolfman2000 rakudo: say "test".Int
p6eval rakudo 7347ec: 0␤
21:50 frew_ joined
jnthn needs some rest - night 21:53
Wolfman2000 argh...gotta love making presentations involving programming when one is unsure if the code works right or not.
pmurias mberends: great
Wolfman2000 rakudo: sub gcd(Int $x, Int $y) { return $y ?? gcd($y, $x % $y) || $x; } ; say gcd(17, 41); 21:54
p6eval rakudo 7347ec: ResizablePMCArray: Can't pop from an empty array!␤in Main (file <unknown>, line <unknown>)␤
Wolfman2000 ...well, at least that's consistent
diakopter ?? !!
lambdabot !!
Wolfman2000 diakopter: ternary operators
diakopter you put ?? ||
Wolfman2000 diakopter: I did put them.
What was wrong with that? 21:55
diakopter rakudo: sub gcd(Int $x, Int $y) { return $y ?? gcd($y, $x % $y) !! $x; } ; say gcd(17, 41);
p6eval rakudo 7347ec: 1␤
diakopter I was correcting them to ?? !!
Wolfman2000 ...oh, !!
diakopter which you misinterpreted as me asking a question
rakudo: sub gcd { $^y ?? gcd($y, $^x % $y) !! $x }; say gcd(17, 41); 21:57
p6eval rakudo 7347ec: 1␤
Wolfman2000 ...that's a new form
Does $^ mean "get the first parameter, stuff it in there"? 21:58
diakopter yep, in the order of the variable names
x, then y, etc
Wolfman2000 ...I like my formal parameters.
...now I need some actual implementation help. 22:01
I know the basics of RSA. I am unsure how to actually implement the part of calculating the private key d, where de = 1 mod n. 22:02
22:07 cspencer joined 22:08 justatheory joined
diakopter Wolfman2000: I like www-cs-students.stanford.edu/~tjw/jsbn/rsa.js and rsa2.js (and its bigint dependencies, on that same site) 22:09
Wolfman2000 diakopter: I'm making this in Perl 6 though.
And I don't know how well Perl 6 supports using Perl 5 libraries such as Math::BigInt 22:10
diakopter Wolfman2000: I was merely pointing out an implementation to follow.
parrot has a bigint library that's accessible from Rakudo Perl 6 22:11
I think.
mberends sleep & 22:12
Wolfman2000 rakudo: (2.5 + 1.25).Int
p6eval rakudo 7347ec: ( no output )
pmichaud disappears to work on eval. 22:13
Wolfman2000 worth a shot
rakudo: int(2.5 + 1.25);
p6eval rakudo 7347ec: the int() sub and .int method have been replaced by the .Int method␤in Main (file <unknown>, line <unknown>)␤
Wolfman2000 rakudo: say (2.5 + 1.25).Int
p6eval rakudo 7347ec: 3␤
22:14 facsimile joined
Wolfman2000 rakudo: my $tmp = 5; $tmp %= 2; say $tmp; 22:17
p6eval rakudo 7347ec: 1␤
PerlJam pmichaud: ping 22:19
diakopter pmichaud: 24-module.t is not the same as Perl 6 ordering.. which should I use 22:28
22:41 dj_goku joined
pmichaud PerlJam: pong 22:43
diakopter: how do you mean "not the same as Perl 6 ordering?" 22:44
PerlJam pmichaud: What's the purpose of $LEXPAD := PAST::Var.new( :name('lexpad'), :scope('register') ); in PmTcl/Actions.pm? 22:46
22:49 [particle]1 joined
diakopter pmichaud: Perl 6 would output ok 2, ok 1, ok 3 22:51
I mean, it wouldn't find the first XYZ::foo()
because XYZ hasn't yet been declared
std: XYZ::foo("hi"); module XYZ { our sub foo($a) { } }; 22:52
p6eval std 29167: Undeclared name:␤ 'XYZ::foo' used at line 1␤ok 00:01 105m␤
pmichaud declarations occur at compile-time 22:54
at least, that's the way I've always understood it.
anyway, as far as when the code is executed -- there was a spec change recently that means that module/class bodies execute in normal sequence 22:55
PerlJam: it just creates a universal PAST::Var node that can be used later to access lexpads
(by register name)
diakopter: anyway, NQP follows the new specification, not the old one. 22:56
PerlJam: :scope('register') PAST::Var nodes are the only nodes thus far in PAST that are allowed to be re-used in a tree :-)
it's possible that there aren't enough usages of $LEXPAD to warrant creating the single node -- that's just a habit I picked up from rakudo-master 22:57
diakopter pmichaud: I thought 24-module.t is wrong by the new specification
pmichaud diakopter: wrong in that you can't use XYZ::foo before it's declared, or ... ? 22:58
PerlJam when I run ./pmtcl t/sanity.t, it says: undefined identifier 'lexpad'
Wolfman2000 rakudo: say ord('√');
p6eval rakudo 7347ec: 8730␤
pmichaud PerlJam: I think coke was working on that
diakopter (it would output ok2ok2ok3)
I mean 22:59
Wolfman2000 rakudo: say sprintf("%x", ord('√'));
p6eval rakudo 7347ec: 221a␤
Wolfman2000 good to see some things haven't changed
pmichaud ok2ok2ok3 ?
diakopter hm 23:00
Wolfman2000 rakudo: my $tmp = "√10"; $tmp =~ s/(.)/sprintf("%x", ord($0))/eg; say $tmp;
p6eval rakudo 7347ec: s/// not implemented, try .subst as workaround at line 2, near "sprintf(\\"%"␤in Main (file <unknown>, line <unknown>)␤
Wolfman2000 ...and here I get knocked out. Alright, what's the equivalent?
pmichaud $tmp.subst(/./, { ord($0).fmt('%x') }, :global) # I think 23:01
oh, have to capture
so
Wolfman2000 ...yeah
pmichaud $tmp.subst(/./, { ord($/).fmt('%x') }, :global) # I think
Wolfman2000 rakudo: my $tmp = "√10"; $tmp = $tmp.subst(/./, { ord($/).fmt('%x') }, :global); say $tmp; 23:02
p6eval rakudo 7347ec: 221a3130␤
Wolfman2000 ...next thing I need to relearn: 0 padding
pmichaud %04x
Wolfman2000 rakudo: my $tmp = "√10"; $tmp = $tmp.subst(/./, { ord($/).fmt('%04x') }, :global); say $tmp; 23:03
p6eval rakudo 7347ec: 221a00310030␤
23:03 payload1 joined
pmichaud or even 23:03
diakopter pmichaud: I don't understand. how could XYZ::foo be called before the block in which it's declared has run? 23:04
without adding another pass.
pmichaud diakopter: declarations occur before runtime
diakopter: same way that one can call a sub before it's declared
rakudo: say foo(); sub foo() { 'hello' } 23:05
p6eval rakudo 7347ec: hello␤
pmichaud std: say foo(); sub foo() { 'hello' }
p6eval std 29167: ok 00:01 105m␤
pmichaud std: say XYZ::foo(); sub XYZ::foo() { 'hello' }
p6eval std 29167: ok 00:01 105m␤
diakopter rakudo: BEGIN { say foo() }; sub foo() { 'hello' }
p6eval rakudo 7347ec: Could not find non-existent sub foo␤in Main (file src/gen_setting.pm, line 324)␤
pmichaud hmmm, interesting.
diakopter std doesn't resolve fully qualified symbols 23:06
pmichaud right
anyway, afaik what 24-module.t is doing now is following the Perl 6 spec 23:07
if not, then I need to be corrected (and perhaps the spec updated )
diakopter then, do you agree that my conclusion should be that past.js should add another pass to set up the namespaces
pmichaud ummm, no
Neither Rakudo nor NQP do two passes. 23:08
but I do see where attempting to evaluate the PAST tree results in the problem you're seeing
hmmm.
diakopter yes, it needs another pass 23:09
pmichaud well, there should probably be one pass where compile-time things occur (e.g., .loadinit blocks), and another pass that emulates the runtime 23:10
diakopter if not for the entire tree, for each block
pmichaud unless there's a way to "execute" certain blocks as the tree is being loaded
diakopter heh
pmichaud going with two-pass for now ought to work I guess
more to the point past.js probably wants to start making a distinction between compile-time and runtime 23:11
diakopter sigh 23:12
oh, the .namespace member of PAST::Var nodes is a Regex::Match
well, a ResizablePMCArray of them
is that right? I thought PAST should be independent of Regex:: objects 23:13
pmichaud it's really just an array of strings
at least, it's treated just as an array of strings
(this is another reason why I suggested having a specific dump format rather than trying to use parrot's data dumper :) 23:14
diakopter --target=past shows PMC 'PAST;Var' { <name> => "B" <namespace> => ResizablePMCArray (size:1) [
PMC 'Regex;Match' => "A" @ 0 {
<ident> => PMC 'Regex;Match' => "A" @ 0
}
]
ok, that's why I'm not using parrot's data dumper anymore
pmichaud yes, we store the array of regex objects simply because it's convenient to do so
no need to create a separate array of strings
but when PAST::Var compiles them, it just takes the string value of each element in <namespace> 23:15
it doesn't use them as regex objects
diakopter ok. JSEmitter.pm will do likewise
pmichaud works good :)
in the case of dumping a PAST tree, I would just have the namespace elements dumped as strings directly, not as regex objects
i.e., stringify them in the dump, not in the read
diakopter yeah, in JSEmitter.pm 23:16
pmichaud right
disappearing again to focus on eval...
afk, shopping 23:20
quietfanatic rakudo: say (method () {...}).arity 23:24
p6eval rakudo 7347ec: 1␤
quietfanatic Is this the correct arity (1 for the invocant)? 23:25
or should that be 0?
Wolfman2000 ...drat: Kyle's not here. What exactly does $stringvar.comb do? Comb through the string to get the character strands? 23:26
rakudo: my $tmp = "004800690021"; say $tmp.comb(<xdigit>**4, *); 23:30
p6eval rakudo 7347ec: No applicable candidates found to dispatch to for 'comb'␤in Main (file <unknown>, line <unknown>)␤
Wolfman2000 rakudo: my $tmp = "004800690021"; say $tmp.comb(<xdigit>**4); 23:31
p6eval rakudo 7347ec: No applicable candidates found to dispatch to for 'comb'␤in Main (file <unknown>, line <unknown>)␤
Wolfman2000 ...knowing me, I'm doing it wrong. 23:32
Wolfman2000 is trying to get four characters at a time through a string.
colomon jnthn: The last few days in the ng commit list have been very lonely. ;) 23:34
quietfanatic Wolfman2000: You need the slashes. 23:38
rakudo: my $tmp = "004800690021"; say $tmp.comb(/<xdigit>**4/);
p6eval rakudo 7347ec: 004800690021␤ 23:39
quietfanatic rakudo: my $tmp = "004800690021"; say join ',', $tmp.comb(/<xdigit>**4/);
p6eval rakudo 7347ec: 0048,0069,0021␤
Wolfman2000 rakudo: my $tmp = "004800690021"; for $tmp.comb(/<xdigit>**4/) -> $ack { say $ack;} ;
p6eval rakudo 7347ec: 0048␤0069␤0021␤
quietfanatic Without the slashes you're creating a literal string 'xdigit' and raising it to the fourth power, yielding 0 23:40
actually it's a list containing 'xdigit'
rakudo: say <xdigit>**4
p6eval rakudo 7347ec: 0␤
quietfanatic huh
or a Parcel 23:41
Wolfman2000 ...once again, I'm helping to reveal stuff no one knew.
colomon rakudo: say <xdigit>
p6eval rakudo 7347ec: xdigit␤
quietfanatic rakudo: say <xdigit>.WHAT
colomon rakudo: say +<xdigit>
p6eval rakudo 7347ec: Str()␤
rakudo 7347ec: 0␤
quietfanatic ah
rakudo: say <xdigit xdigit>.WHAT 23:42
p6eval rakudo 7347ec: List()␤
colomon say <xdigit>.perl
Wolfman2000 alright, there's probably a way of doing this... The common encryption/decryption method for RSA: c = m^e mod n. Assuming n is Int sized, how can I guarantee that m^e won't overflow in the meantime?
colomon rakudo: say <xdigit>.perl
p6eval rakudo 7347ec: "xdigit"␤
23:53 lichtkind_ joined
Wolfman2000 rakudo: my $tmp = "004800690021"; for $tmp.comb(/<xdigit>**4/) -> $ack { say ord($ack) } ; 23:53
p6eval rakudo 7347ec: 48␤48␤48␤
Wolfman2000 err
rakudo: my $tmp = "004800690021"; for $tmp.comb(/<xdigit>**4/) -> $ack { say chr($ack)) } ; 23:54
p6eval rakudo 7347ec: Unable to parse block; couldn't find final '}' at line 2, near ") } ;"␤in Main (file <unknown>, line <unknown>)␤
Wolfman2000 rakudo: my $tmp = "004800690021"; for $tmp.comb(/<xdigit>**4/) -> $ack { say chr($ack) } ;
p6eval rakudo 7347ec: 0␤E␤␤
Wolfman2000 rakudo: my $tmp = "004800690021"; for $tmp.comb(/<xdigit>**4/) -> $ack { say $ack } ;
p6eval rakudo 7347ec: 0048␤0069␤0021␤
Wolfman2000 rakudo: my $tmp = "004800690021"; for $tmp.comb(/<xdigit>**4/) -> $ack { say $ack:10 } ; 23:56
p6eval rakudo 7347ec: Confused at line 2, near ":10 } ;"␤in Main (file <unknown>, line <unknown>)␤
Wolfman2000 rakudo: my $tmp = "004800690021"; for $tmp.comb(/<xdigit>**4/) -> $ack { say $ack:16 } ;
p6eval rakudo 7347ec: Confused at line 2, near ":16 } ;"␤in Main (file <unknown>, line <unknown>)␤
TimToady :10($ack) 23:57
Wolfman2000 rakudo: my $tmp = "004800690021"; for $tmp.comb(/<xdigit>**4/) -> $ack { say :10($ack) } ;
TimToady :16($ack)
p6eval rakudo 7347ec: 48␤69␤21␤
Wolfman2000 rakudo: my $tmp = "004800690021"; for $tmp.comb(/<xdigit>**4/) -> $ack { say :16($ack) } ;
p6eval rakudo 7347ec: 72␤105␤33␤
Wolfman2000 Interesting use of those prefixes TimToady++
TimToady didn't want to use hex and oct like Perl 5, since those are backwards; you'd think hex would *produce* a hex number 23:58
Wolfman2000 ...I did wonder about that