Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2009-11-21

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:00 quietfanatic joined #perl6
00:00 [particle] joined #perl6
00:09 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:10 cognominal clear this implementation is optimized for reading the hash not for writing in it.
00:10 cognominal *clearly
00:14 cognominal I forgot what is the Perl 6 equivalent of Perl 5 ties
00:14 astrojp joined #perl6
00:15 pmichaud last I checked, it was "Tieable"
00:15 pmichaud see S06
00:19 Exodist joined #perl6
00:22 cognominal nope, in S02 :)
00:38 diakopter chromeos - ubuntu with 2.6.30-forked
00:39 diakopter perl 5.10
00:39 diakopter no gcc
00:52 cognominal would be nice to be able to shove rakudo in that kind of platform
00:55 wolverian joined #perl6
01:08 Whiteknight joined #perl6
01:22 zamolxes joined #perl6
01:28 facsimile joined #perl6
01:30 dalek nqp-rx: 30c8548 | pmichaud++ |  (3 files):
01:30 dalek nqp-rx: Fix handling of 'self' in nested blocks.
01:30 dalek nqp-rx: review: http://github.com/perl6/nqp-rx/commit/30c854862b812b570ff9258f3be75e18c8e4aa3d
01:30 dalek nqp-rx: dae637e | pmichaud++ | src/stage0/ (3 files):
01:30 dalek nqp-rx: Update bootstrap.
01:30 dalek nqp-rx: review: http://github.com/perl6/nqp-rx/commit/dae637e88fa398a0b293b7e062d7d3b6f7f5742c
01:36 pugs_svn r29162 | lwall++ | [rx.t] s/also/S&/
01:45 ng_feed rakudo-ng: colomon++
01:45 ng_feed rakudo-ng: Better argument names for the Range operators.
01:45 ng_feed rakudo-ng: colomon++
01:45 ng_feed rakudo-ng: Uncomment and fix Range's ACCEPTS Range, and implement crude versions of min_test and max_test.
01:46 pugs_svn r29163 | colomon++ | [t/spec] Test Range with smartmatch.
01:46 colomon joined #perl6
01:48 pnate joined #perl6
01:56 snarkyboojum joined #perl6
01:58 gfx joined #perl6
02:02 wknight8111 joined #perl6
02:05 rgrau` joined #perl6
02:07 hcchien joined #perl6
02:07 perigrin joined #perl6
02:08 wolverian joined #perl6
02:08 estrai_ joined #perl6
02:08 wolverian joined #perl6
02:08 Exodist joined #perl6
02:08 IllvilJa joined #perl6
02:08 eiro joined #perl6
02:08 rgrau joined #perl6
02:08 _eMaX_1 joined #perl6
02:08 yahooooo joined #perl6
02:08 estrai joined #perl6
02:08 zaslon joined #perl6
02:08 pointme joined #perl6
02:08 sjohnson joined #perl6
02:08 eiro_ joined #perl6
02:09 wolverian joined #perl6
02:09 diakopter std: *********************************************************
02:09 p6eval std 29163: ok 00:01 106m␤
02:10 wolverian joined #perl6
02:16 justatheory joined #perl6
02:19 orafu joined #perl6
02:21 ng_feed rakudo-ng: colomon++
02:21 ng_feed 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.
02:22 pugs_svn r29164 | colomon++ | [t/spec] Unfudge tests which pass after the last change.
02:50 snarkyboojum left #perl6
03:15 colomon TimToady: ping?
03:16 TimToady colomon: pong?
03:16 colomon \o/
03:16 colomon I'm still looking at Ranges, and I've got a couple of questions if you've got a moment.
03:16 TimToady 'bout to do dinner, but I'll be around off and on
03:16 TimToady shore
03:17 colomon Range.Str: Rakudo turned the Range into a list and then .Str'd it.
03:17 colomon I don't see that in the spec, and I'm not at all convinced it is sensible.  Thoughts?
03:17 colomon (it seems more appropriate for the series operator...)
03:18 TimToady yeah, though Range should flatten in a real list context, I think
03:18 TimToady but Str shouldn't be in the business of supplying one, I suspect
03:18 TimToady so maybe a direct Str should just $n..$m it
03:19 colomon with ^s as appropriate or no?
03:19 TimToady yeah, basically, just return what it originally was, since Ranges are immutable
03:20 colomon check.
03:20 TimToady or what it would have been had it ever been written :)
03:21 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 colomon So the length of 0 .. 1.5 would be 1, not 1.5, for instance?
03:22 colomon errr, 2, not 1.5?
03:22 TimToady 2,yeah
03:22 colomon check.
03:22 colomon Is ^4.5 intended to work?
03:23 TimToady is just 0..^4.5
03:23 TimToady so 0..4
03:23 colomon check.
03:23 colomon Thanks!
03:23 TimToady np
03:23 TimToady it's *possible* that we want to leave + returning the Range
03:24 TimToady if all the numeric transformations are trying to emulate interval arithmatic
03:24 TimToady in which case you'd have to use .elems on it
03:24 colomon Hmmm.
03:24 colomon It should have .elems, then?  :)
03:28 TimToady I suspect .elems is one of those Any methods that coerces to something with elements if possible :)
03:28 TimToady and returns 1 if not
03:28 TimToady so don't worry about it
03:28 TimToady except you probably want to optimize it anyway eventually
03:30 colomon Thanks again.
03:35 estrai_ joined #perl6
03:35 Exodist joined #perl6
03:35 IllvilJa joined #perl6
03:35 _eMaX_1 joined #perl6
03:35 yahooooo joined #perl6
03:35 zaslon joined #perl6
03:35 pointme joined #perl6
03:35 sjohnson joined #perl6
03:35 estrai joined #perl6
03:36 yahooooo0 joined #perl6
03:41 justatheory joined #perl6
03:56 ng_feed rakudo-ng: colomon++
03:56 ng_feed 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.
03:56 pugs_svn r29165 | colomon++ | [t/spec] Tests for ^N form of Range operator.
04:00 pugs_svn r29166 | colomon++ | [t/spec] Change plan * to plan 88 so that ng doesn't complain.
04:12 Wolfman2000 joined #perl6
04:13 japhb What is the proper way in full Perl 6 to find the exit status of the child process spawned by qx()?
04:16 TimToady should set $!
04:16 TimToady also, return of qx should be undef if it failed
04:17 TimToady we haven't really documented what's in $! for exit codes though
04:18 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
04:18 TimToady iirc, exec failure tends to return 255
04:18 TimToady I could be misremembering
04:19 japhb OK, so just a special exit value, no exclusive out of band path
04:19 * japhb finds APUE to check
04:26 pugs_svn r29167 | lwall++ | [STD] remove some redundant rules, and cut termish lexer size by 2/3!
04:27 Wolfman2000 ...that's a big cut
04:33 zloyrusskiy joined #perl6
04:44 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:48 [particle] joined #perl6
04:51 TimToady I can see where I might confuse 255 with 127 :)
04:55 japhb Clearly you're slipping a bit in your old age.
04:56 allbery_b technically the exit status is a single signed bit on most unixlikes, but in practice only 0-127 is portable
04:59 allbery_b (actually, looks like it's defined as unsigned on at least some systems; that would help with the incompatibility...)
05:00 hugh4life joined #perl6
05:01 hugh4life /join #perl6book
05:25 justatheory joined #perl6
05:31 meppl joined #perl6
05:46 gfx joined #perl6
05:47 envi^home joined #perl6
05:49 envi_home2 joined #perl6
05:51 xomas_ joined #perl6
05:59 Nex6 joined #perl6
06:05 envi^home joined #perl6
06:05 estrai joined #perl6
06:05 Exodist joined #perl6
06:05 IllvilJa joined #perl6
06:05 _eMaX_1 joined #perl6
06:05 pointme joined #perl6
06:05 sjohnson joined #perl6
06:06 Exodist_ joined #perl6
06:07 sjohnson joined #perl6
06:07 IllvilJa joined #perl6
06:07 _eMaX_ joined #perl6
06:09 synth joined #perl6
06:10 estrai joined #perl6
06:22 justatheory joined #perl6
06:36 nihiliad joined #perl6
06:40 justatheory_ joined #perl6
06:42 synth joined #perl6
06:54 justatheory_ joined #perl6
06:55 justatheory_ joined #perl6
06:58 frew_ joined #perl6
07:10 Exodist_ joined #perl6
07:33 Woodi joined #perl6
07:47 barney joined #perl6
07:50 ashizawa joined #perl6
08:00 Nex6 joined #perl6
08:02 Nex6 joined #perl6
08:15 kaare joined #perl6
08:26 TiMBuS joined #perl6
08:34 zaslon joined #perl6
09:14 carlin rakudo: sub foo($_) { .say }; foo 'oh hai';
09:14 p6eval rakudo 7347ec: oh hai␤
09:15 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>)␤
09:15 carlin rakudo: class A { method foo($_) { .say }; my $a = A.new; $a.foo: 'oh hai';
09:15 p6eval rakudo 7347ec: Unable to parse block; couldn't find final '}' at line 2, near ""␤in Main (file <unknown>, line <unknown>)␤
09:15 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>)␤
09:15 carlin rakudo: class A { method foo($_) { .say } }; my $a = A.new; $a.foo: 'oh hai';
09:16 p6eval rakudo 7347ec:  ( no output )
09:17 carlin Is there any reason why .method 'param' can't work the same as sub 'param' does?
09:17 carlin rakudo: class A { method foo($_) { .say } }; my $_ = A.new; .foo 'oh hai';
09:17 p6eval rakudo 7347ec: Confused at line 2, near "'oh hai';"␤in Main (file <unknown>, line <unknown>)␤
09:59 JimmyZ joined #perl6
10:28 ejs joined #perl6
10:28 justatheory joined #perl6
10:41 ejs joined #perl6
10:52 xinming joined #perl6
11:05 estrai joined #perl6
11:05 ejs1 joined #perl6
11:13 justatheory joined #perl6
11:50 ashizawa joined #perl6
11:59 Jedai joined #perl6
12:08 _eMaX_1 joined #perl6
12:12 Whiteknight joined #perl6
12:26 payload joined #perl6
12:29 Whiteknight joined #perl6
13:09 Whiteknight joined #perl6
13:13 Whiteknight joined #perl6
13:26 meppel joined #perl6
13:29 jferrero joined #perl6
13:43 iblechbot joined #perl6
13:44 Whiteknight joined #perl6
13:54 mberends joined #perl6
14:01 am0c joined #perl6
14:06 Whiteknight joined #perl6
14:10 nihiliad joined #perl6
14:12 nihiliad joined #perl6
14:24 eiro_ cd
14:25 eiro_ arf.. i apologize! bad screen
14:25 eiro_ btw: hello world
14:26 snearch_ joined #perl6
14:40 nihiliad joined #perl6
14:41 facsimile joined #perl6
14:41 aartist joined #perl6
14:43 aartist can I use Perl6 in production?
14:44 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 #perl6
14:46 nihiliad joined #perl6
14:57 nihiliad1 joined #perl6
15:00 nihiliad joined #perl6
15:10 nihiliad joined #perl6
15:14 Psyche^ joined #perl6
15:15 nihiliad1 joined #perl6
15:18 nihiliad joined #perl6
15:31 xenoterracide_ joined #perl6
15:34 nihiliad joined #perl6
15:40 nihiliad1 joined #perl6
15:42 nihiliad joined #perl6
15:43 nihiliad1 joined #perl6
15:45 zamolxes joined #perl6
15:53 nihiliad joined #perl6
15:54 giftnuss joined #perl6
15:56 nihiliad joined #perl6
16:01 nihiliad joined #perl6
16:11 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:12 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?
16:13 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
16:13 Wolfman2000 rakudo: my $tmp = any(-1, 0, 1); say $tmp[0]; # I want to pull out just the 1 in this instance.
16:13 p6eval rakudo 7347ec: Method 'postcircumfix:[ ]' not found for invocant of class 'Integer'␤in Main (file src/gen_setting.pm, line 324)␤
16:13 pmichaud then use grep
16:14 Wolfman2000 pmichaud: one can grep a junction?
16:14 TimToady why do you want a junction?
16:14 pmichaud rakudo: my @temp = -1, 0, 1;   say @temp[0];
16:14 p6eval rakudo 7347ec: -1␤
16:14 pmichaud junctions aren't lists, junctions aren't sets.  It's tempting to try to use them that way ... don't :)
16:14 Wolfman2000 TimToady: One piece of Feather code I have uses the +- symbol.
16:15 Wolfman2000 Right now, it's set to return a junction of x + y, x - y
16:15 Wolfman2000 There are plenty of math functions out there where the negative value has to not even be used.
16:15 TimToady why does it have to return a junction?
16:15 pmichaud then use an operator that converts negative values into Nil or something
16:15 Wolfman2000 TimToady: because right now Rakudo does not allow returning an array?
16:16 TimToady this sounds more like a range or interval
16:16 pmichaud rakudo doesn't return arrays?
16:16 Wolfman2000 pmichaud: I'm stuck on master branch. I haven't had any luck with returning arrays yet.
16:16 Wolfman2000 perhaps that got implemented and I'm behind on compiling
16:16 pmichaud Wolfman2000: hmmmm.  Have a quick exapmle handy?
16:16 Wolfman2000 pmichaud: hang on
16:16 c9s_ joined #perl6
16:17 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)␤
16:17 pmichaud that's not a list.
16:18 Wolfman2000 I'm about to put in the list version
16:18 pmichaud okay.
16:18 Wolfman2000 rakudo: multi sub infix:<±>(Num $x, Num $y) { return $x + $y, $x - $y; }; say "5 ± 3 = {join(' ', 5 ± 3)}"; # Arrays.
16:18 p6eval rakudo 7347ec: too many positional arguments: 2 passed, 2 expected␤in Main (file <unknown>, line <unknown>)␤
16:19 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␤
16:20 Wolfman2000 ...I thought you had to ignore the parentheses with lists now
16:20 pmichaud we don't yet flatten arguments to return, no
16:20 pmichaud but one _can_ return lists
16:21 Wolfman2000 ...then I have to wonder. What is better? A list or a junction?
16:21 pmichaud for most operations, lists are better
16:21 TimToady what is better, an apple or an orangutan
16:21 Wolfman2000 apple
16:21 pmichaud junctions are good when you want to do boolean evaluation of multiple possibilities
16:22 pmichaud gotta run -- our guest speaker just arrived at our lug meeting
16:23 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
16:24 TimToady precisely because they are autothreading on comparisons and such, they *can't* be used as sets, because the operators are all wrong
16:24 TimToady $set1 === $set2 should only be true if the sets are the same
16:25 TimToady with $junk1 === $junk2 it depends on the internal structure of the junctions
16:25 TimToady arguably all() is the only junction remotely resembling a set
16:26 TimToady because a set contains all of its elements, but not any of them, or one of them, or none of them
16:26 TimToady but even all doesn't work as a set
16:27 TimToady 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))␤
16:27 TimToady rakudo: say "true" if all(1,2,3) == all(1,2,3)
16:27 p6eval rakudo 7347ec:  ( no output )
16:27 TimToady rakudo: say "true" if all(1,2,3) === all(1,2,3)
16:27 p6eval rakudo 7347ec:  ( no output )
16:27 Wolfman2000 ...complicated
16:28 TimToady rakudo: say "true" if all(1,2,3) === any(1,2,3)
16:28 p6eval rakudo 7347ec:  ( no output )
16:28 TimToady that one shoulda worked
16:28 Wolfman2000 rakudo: say "true" if any(1, 2, 3) === all(1, 2, 3)
16:28 p6eval rakudo 7347ec:  ( no output )
16:29 TimToady that one is impossible, since there is no value that can be all of 1, 2, *and* 3
16:30 TimToady pugs: say "true" if all(1,2,3) === any(1,2,3)
16:30 p6eval pugs: true␤
16:30 TimToady pugs has it right
16:31 TimToady 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)␤
16:31 Wolfman2000 Pugs...that's the Haskell implementation if I remember correctly
16:31 Wolfman2000 and ng is apparently the branch of the future that needs work.
16:31 TimToady ng: say "true" if 1 & 2 & 3 === 1 | 2 | 3
16:31 p6eval ng 071cdd: Confused at line 1, near "say \"true\""␤current instr.: 'perl6;HLL;Grammar;panic' pc 448 (src/stage0/HLL-s0.pir:300)␤
16:32 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)␤
16:32 TimToady 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)␤
16:32 Wolfman2000 ng: if (1 & 2 & 3) === (1 | 2 | 3) { say "true"; }
16:32 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)␤
16:33 TimToady gah, I read that as "needs wonk"
16:35 TimToady rakudo: say "true" if all(1,2,3) == any(1,2,3)
16:35 p6eval rakudo 7347ec: true␤
16:35 TimToady ah, I know what's going on
16:35 TimToady rakudo isn't threading ===
16:35 facsimile rakudo: say "true" if 2 == any(1,2,3)
16:35 p6eval rakudo 7347ec: true␤
16:35 facsimile rakudo: say "true" if all(1,2,3) == 2
16:35 p6eval rakudo 7347ec:  ( no output )
16:36 TimToady rakudo: say "true" if 2 === any(1,2,3)  # will fail
16:36 p6eval rakudo 7347ec:  ( no output )
16:36 TimToady it's treating === as a primitive
16:36 facsimile what??
16:36 facsimile oh === vs ==
16:37 TimToady because junctions are implemented in terms of === in rakudo
16:37 perigrin that's fitting ... railroad ... junction ...
16:38 * TimToady has traumatic flashback to Petticoat Junction
16:39 TimToady sort of American Gothic Horror...
16:39 perigrin heh ... that's the most unique description I think I've heard for that show
16:40 Wolfman2000 well, at least we found a bug
16:40 TimToady or maybe I'm thinking of Green Acres...
16:42 TimToady 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?
16:43 TimToady well, we need to change rakudo's implementation of object equivalence testing to be immune to autothreading recursively forever
16:43 TimToady that is, not use ===, or lexically scope a different operator that acts the same without autothreading
16:45 TimToady the junction module needs to see infix:<===>:(Object,Object) when everyone else sees infix:<===>:(Any,Any)
16:46 TimToady jnthn: see ^^^
16:46 perigrin TimToady: does === work on Zha Zha Gabor? If so then you were definitely thinking of Green Acres
16:46 Wolfman2000 I forgot: is Any > Object?
16:46 TimToady my wife tells me that that was Eva pretending to be Zha Zha
16:46 perigrin it's looser than Object I think.
16:47 perigrin TimToady: and I fully suspect she's right
16:47 Wolfman2000 perigrin: that's what I meant. Object is of type Any
16:47 TimToady Any is tighter than Object, which is the loosest
16:47 perigrin Oh
16:47 Wolfman2000 ...so Any is of type Object?
16:47 TimToady junctions are outside of Any so that dispatcher automatically catches things that need autothreading
16:47 TimToady yes
16:47 am0c joined #perl6
16:48 * perigrin needs to read more.
16:48 Wolfman2000 I wonder if it's possible to force sub parameters to be junctions.
16:49 TimToady sure, but why would you want to?
16:49 TimToady usually you'd rather just have a Matcher of some sort that includes junctions, ranges, values, and closures for smartmatching
16:49 Wolfman2000 multi sub infix:<===>: (Object $a where {$a = any(*)}, Object $b where {$b = any(*)}) { # Stuff here };
16:49 Wolfman2000 I know the * is a wild card operator as well...I'm wondering if that would work in this situation.
16:49 TimToady why are you assigning to $a?
16:50 Wolfman2000 TimToady: would it work better if I used $x and $y instead?
16:50 TimToady why are you assigning?
16:50 Wolfman2000 I was trying to come up with a fancy solution that would not require too much changing of rakudo.
16:50 Wolfman2000 Subs can include constraints.
16:50 TimToady $a = is an assignment
16:51 Wolfman2000 ...oh
16:51 Wolfman2000 whoops: that was a typo
16:51 Wolfman2000 multi sub infix:<===>: (Object $a where {$a == any(*)}, Object $b where {$b == any(*)}) { # Stuff here };
16:51 TimToady now you're doing numeric comparison
16:51 Wolfman2000 ...right. need a smart match
16:51 Wolfman2000 multi sub infix:<===>: (Object $a where {$a ~~ any(*)}, Object $b where {$b ~~ any(*)}) { # Stuff here };
16:52 TimToady those wheres are always true
16:52 TimToady rakudo: say 'true' if 237483 ~~ any(*)
16:52 p6eval rakudo 7347ec: true␤
16:52 Wolfman2000 ...gah
16:52 TimToady rakudo: say 'true' if Failure ~~ any(*)
16:52 p6eval rakudo 7347ec: true␤
16:53 TimToady if you really want to limit it to junctions, just declare the parameters to be of junction type
16:54 Wolfman2000 ...wouldn't that solve your problems them with ===?
16:54 TimToady but I don't see any use for that
16:54 TimToady no, junctions wants the version where the arguments aren't junctions
16:54 TimToady or more precisely, where they don't care if the objects are junctoins
16:55 TimToady which is what I said earlier, :(Object,Object)
16:55 TimToady then === will compare the two objects even if one or both of them is a junction
16:55 Wolfman2000 ah
16:56 TimToady iow junction wants to use a primitive form of === that is not availabe normally
16:56 TimToady *ble
17:00 TimToady it probably really just needs to say my &sameobj := &infix:<===>:(Object,Object) and then use sameobj($x,$y) as its primitive
17:01 TimToady hmm, except Object's version is presumably what is catching the junctions and autothreading, so maybe that won't work either
17:02 TimToady so Object's === isn't that primitive either
17:03 bluescreen joined #perl6
17:04 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 TimToady *io
17:05 TimToady ca'nt tyep toady
17:07 lichtkind joined #perl6
17:07 chromatic joined #perl6
17:10 TimToady rakudo: say true any(1,2,3) eqv any(1,2,3)
17:10 p6eval rakudo 7347ec: 1␤
17:10 TimToady rakudo: say true any(1,2,3) === any(1,2,3)
17:10 p6eval rakudo 7347ec: 0␤
17:12 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␤
17:13 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␤
17:13 TimToady there's your primitive object equality
17:13 TimToady rakudo: sub infix:<primeq>(Object $x, Object $y) { $x.WHICH eqv $y.WHICH }; say true any(1,2,3) primeq any(1,2,3)
17:14 p6eval rakudo 7347ec: 0␤
17:14 TimToady that also works, since WHICH always returns a value type
17:14 TimToady say any(1,2,3).WHICH
17:14 TimToady rakudo: say any(1,2,3).WHICH
17:14 p6eval rakudo 7347ec: 47730420136056␤
17:15 frew_ joined #perl6
17:15 TimToady say any(1,2,3).WHICH, ' ', any(1,2,3).WHICH
17:15 TimToady rakudo: say any(1,2,3).WHICH, ' ', any(1,2,3).WHICH
17:15 p6eval rakudo 7347ec: 47358773133424 47358773120664␤
17:16 TimToady maybe p6eval should recognize lines starting with 'say'  :)
17:16 mberends ...but who would say it ?
17:17 TimToady give everyone a shot at it :)
17:17 mberends like all: say "hello"
17:17 TimToady including ng, and std
17:17 Wolfman2000 I have to get going now. Who knows? I may end up indirectly help you guys find another bug.
17:18 Wolfman2000 or helping
17:18 Wolfman2000 whichever works
17:18 TimToady thanks
17:18 Wolfman2000 TimToady: I think I got your case of not typing right
17:19 payload joined #perl6
17:28 envi^home joined #perl6
17:46 nihiliad joined #perl6
17:51 szabgab joined #perl6
18:03 TiMBuS joined #perl6
18:15 dj_goku joined #perl6
18:49 Exodist joined #perl6
19:05 masak joined #perl6
19:05 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.
19:05 phenny 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.
19:05 masak quietfanatic: excellent. just curious. great work!
19:06 quietfanatic Thanks
19:06 mathw evening masak
19:06 mberends masak! how did the talk go?
19:06 masak mathw: oh hai!
19:06 masak mberends: it went better than I had feared. :)
19:07 mberends \o/
19:07 pmurias joined #perl6
19:07 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
19:07 mberends pmurias: pong
19:07 masak as jnthn commented, people like talks styles which are out-of-the-box.
19:08 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.
19:10 pmurias mberends: you don't need re-smop to try mildew-js
19:11 pmurias 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 :)
19:11 masak I'll have a link to the PDF and to the no-longer-sekkrit project page for you in a few moments.
19:12 mberends pmurias: thanks, will try again
19:15 payload1 joined #perl6
19:16 masak I'm kinda curious what pmichaud will say about it all.
19:18 pmurias masak: what's your no-longer-sekkrit project
19:19 pmurias ?
19:19 masak pmurias: it's a port of PGE to Perl 6.
19:19 * mathw thinks about that for a bit
19:20 masak the talk is titled "I am a strange loop".
19:20 mathw I think
19:20 pmurias masak: that's good
19:20 mathw you get the prize
19:20 mathw you're madder than I am
19:20 masak :)
19:20 masak that's saying something.
19:20 pmurias masak: rewriting pir is a worthwhile thing
19:20 masak pmurias: yes, I think so.
19:21 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.
19:21 masak mathw: oh wow.
19:21 mathw Never have before, they've just been 'okay' or 'awful'
19:21 mberends pmurias: 'make' in re-mildew says: open2: exec of ../re-smop/m0ld_exe --yeast-create failed at mildew line 58
19:21 masak http://masak.org/carl/bpw-2009-gge/talk.pdf http://github.com/masak/gge
19:22 pmurias mberends: and make in re-smop?
19:22 mathw wtf
19:22 mberends going there...
19:22 mathw how did I end up with Adobe Reader on my laptop???
19:22 pmurias re-mildew needs m0ld_exe
19:22 mathw urgh
19:25 mberends pmurias: I had tried 'scons' in re-smop, not 'make'. now installing gch 6.8 (debian stable).
19:25 mberends *ghc
19:28 dukeleto the parrot peeps have a wiki page going for request for docs for nqp-rx: https://trac.parrot.org/parrot/wiki/NQPDocs
19:29 johnjohn101 joined #perl6
19:29 johnjohn101 is it possible to do threads in rakudo yet?
19:29 masak johnjohn101: no.
19:29 masak johnjohn101: Parrot doesn't really have a threading model yet.
19:30 johnjohn101 is there a time frame?
19:30 masak johnjohn101: I don't know of any apart from 'not soon'.
19:30 dukeleto masak: we have some threads. they are just not particularly good/secure/cross-platform at this point
19:31 masak dukeleto: ah, I stand corrected.
19:31 dukeleto johnjohn101: what do you want to do?
19:32 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:33 dukeleto johnjohn101: how is it POC and in Perl 5 ?
19:34 johnjohn101 it's a proof of concept for a lite middle tier we'd use for our application
19:35 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:36 dukeleto 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:37 dukeleto 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:38 giftnuss left #perl6
19:40 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 ?
19:42 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:45 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...
19:46 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?
19:46 johnjohn101 well I was going to start evaluating rakudo betwen xmas and new years  (slow time). mgmt knows how clunky perl 5 threads are.
19:47 masak mathw: S17 has the word 'threads' in it.
19:47 mathw masak: oh joy
19:48 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
19:49 masak concurrent dragons.
19:49 mathw even writing a C++ thread class is a nightmare
19:49 mberends pmurias: thanks, re-mildew 'make test' looks good now :-)
19:49 mathw designing threading for Perl 6 has to be at least pi squared times worse
19:49 pmurias mberends: make test-js runs the javascript tests
19:50 pmurias that is test for the javascript backend
19:50 pmurias * tests
19:50 johnjohn101 i really don't mind the perl 5 model as I can get around the restrictions mostly
19:50 masak mathw: because Rakudo has a radius which is sqrt(pi) as large as perl5's? :)
19:50 mberends pmurias: will try that next, gotta build V8 quickly before then
19:51 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
19:51 johnjohn101 PIR?
19:51 pmurias parrot's assembler
19:52 johnjohn101 i'll look into it
19:53 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?
19:53 masak johnjohn101: are the DBI libs in Perl 5?
19:53 johnjohn101 in rakudo?
19:53 johnjohn101 yes
19:53 masak I wouldn't count on it.
19:53 johnjohn101 i need dbd::odbc mostly
19:54 masak there's no plan to establish a Perl 5 bridge by April.
19:54 masak (except perhaps between the communities.)
19:55 johnjohn101 hmm that's not good but certainly understandable
19:56 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.
19:57 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.
19:58 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.
19:59 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 #perl6
19:59 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 masak pmurias: ok -- that's just my personal impression, comparing x86 ASM with PIR.
19:59 johnjohn101 better to wait until it's ready.  look at how they released python 3.0 way before it was ready
20:00 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
20:01 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 masak TimToady: ah, ok.
20:01 masak thanks.
20:01 TimToady and probably glare some at the Cursor.pmc code having to do with cursors, esp forky things like * and +
20:02 masak nodnod.
20:02 masak they're a challenge, that's for sure.
20:02 payload joined #perl6
20:02 TimToady and at some point you have to understand lazymap, which is where the real continuation processing happens
20:02 masak oki.
20:02 TimToady but since it's so slow to emulate in p5, we try to avoid lazymap for anything ratchety, if possible
20:03 TimToady and then just Have the Appropriate Amount of Fun :)
20:03 masak \o/
20:03 mberends masak++: GGE and your talk look great!
20:04 masak mberends: thanks. :)
20:04 masak it's been fun so far.
20:04 TimToady or just look through STD.pm5, and compare the comments with the original code to the derived code
20:04 dukeleto johnjohn101: PIR = http://en.wikipedia.org/wiki/Parrot_Intermediate_Representation
20:04 masak mberends: you can try something like `perl6 test-regex 'xa*?y' xaaaay` on the command line, and it works!
20:05 masak TimToady: that might help too.
20:06 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:07 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
20:07 TimToady if so, it oughta be able to do XS
20:08 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 masak that's part of why I'm doing the port.
20:08 Wolfman2000 joined #perl6
20:13 dukeleto TimToady: patches welcome! this is what happened last time I tried loading XS : http://leto.net/dukeleto.pl/2009/09/blizkost-is-passing-102-tests.html
20:15 dukeleto 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
20:16 TimToady but a real embedded Perl 5 ought to be able to load XS fairly easily
20:17 dukeleto TimToady: i don't think we use miniperl. it is a proper embedded perl 5 interp
20:17 dukeleto TimToady: for what definition of "fairly easily" ? does some marshalling code need to be written?
20:20 * dukeleto attempts to get blizkost working on a recent parrot
20:21 nihiliad joined #perl6
20:21 TimToady fairly easily meaning that P5 code can see the XS modules, not that P6 necessarily can
20:22 dukeleto TimToady: yes, we can't even seem to get P5 code to see XS modules in blizkost yet.
20:24 TimToady print out the embedded %ENV and see if parrot is interfering with it
20:27 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?': http://use.perl.org/~masak/journal/39926?from=rss
20:27 masak I think I'll have an early night. good night, y'all.
20:28 Wolfman2000 Hi and bye masak
20:28 masak Wolfman2000: hi and bye. see you around.
20:29 Wolfman2000 jnthn: Would you happen to have your speeches available online?
20:30 dukeleto TimToady: thanks, that is a good idea!
20:31 diakopter Wolfman2000: http://jnthn.net/articles.shtml
20:32 Wolfman2000 I'm guessing there is no sense of order to these articles diakopter?
20:34 mberends Wolfman2000: the talks are in descending date order
20:35 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 #perl6
20:38 dukeleto Wolfman2000: pl/lolcode ?
20:40 dukeleto 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.
20:44 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:45 TimToady nap &  # I get my beauty rest at night, but my ugly rest in the afternoon.
20:49 mberends pmurias: it looks like Brian Hammond has taken down http://github.com/fictorial/perl-v8 :-( do you know of any other repositories for V8.pm? (it's not in CPAN)
20:55 Wolfman2000 Hmm...nice set of slides jnthn++. I'll bookmark your page.
20:55 Wolfman2000 Now, I have to get back to my homework. I may have more questions later.
21:02 diakopter mberends: no, but I can email you a copy
21:03 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
21:03 mberends yes
21:06 mberends (the passive voice weasels out of *who* does that) (does the convention of who asks, volunteers apply here?)
21:07 Wolfman2000 mberends: In this room? Not that I've seen.
21:07 jnthn oh hai
21:08 * jnthn enjoyed Baltic Perl Workshop today :-)
21:08 mberends oh hai jnthn, how do you feel your talk went?
21:09 jnthn mberends: Quite well, I think.
21:09 jnthn Got at least one good comment. :-)
21:09 jnthn masak++ gave a great talk. :-)
21:10 mberends his slides look very good too
21:10 mathw hai jnthn
21:10 jnthn Yeah
21:10 mathw what was your talk on?
21:11 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
21:11 mathw That's a good talk
21:12 jnthn It seems to be well received, so I didn't feel the need to tweak it much. :-)
21:12 mathw :)
21:12 * jnthn glances to see what's been happening in the ng branch
21:12 mathw that's a good timesaver
21:12 frew_ joined #perl6
21:12 Wolfman2000 Will you upload the lolsql slides at least? I'm curious what you had to say about that
21:13 jnthn colomon++
21:13 pmichaud I got sidetracked yesterday on ng :-(
21:13 mathw I guess once you've done something often enough it's good
21:13 pmichaud on the plus side, my weekend is now free
21:13 mathw unlike my intro to perl 5 slides at work, which get reworked every time
21:13 jnthn pmichaud: \o/
21:13 jnthn pmichaud: You got side-tracked into non-ng stuff, I guess?
21:14 pmichaud family stuff, too.
21:14 pmichaud (yes, family stuff is non-ng stuff)
21:15 jnthn :-)
21:15 mathw family-ng
21:15 jnthn No probs.
21:15 mathw start a branch
21:15 jnthn heh. Family needs grammar improvements. ;-)
21:16 jnthn pmichaud: I'm here tomorrow, then flying back on Monday morning.
21:16 facsimile joined #perl6
21:17 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
21:17 pmichaud masak rewrote PGE in Perl 6, eh?
21:17 mathw pmichaud: apparently
21:17 mathw I told him he's mad
21:17 mathw he agreed with me
21:17 dukeleto pmichaud: it looks interesting
21:17 pmichaud I wonder how he feels about the fact that I'm now abandoning PGE :)
21:18 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 :)
21:18 pmichaud then we need the debugging bits added into nqp-rx
21:18 mathw well he can rewrite that in Perl 6 too then...
21:19 mathw 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
21:19 dukeleto pmichaud: there has been a wiki page started for requests for docs for NQP(-rx) https://trac.parrot.org/parrot/wiki/NQPDocs
21:19 mathw nqp-rx is a really awesome bit of tech pmichaud
21:19 mathw I hope you understand what you've done
21:19 diakopter does anyone know how to do this in nqp (today):  s!\!\\!g  and   s!'!\'!g
21:19 pmichaud diakopter: there's not really a good way to do that yet, sorry
21:19 diakopter or pir.
21:20 diakopter 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
21:20 diakopter (to accomplish that)
21:21 diakopter 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.
21:21 diakopter ok. and I fail at even that.
21:21 pmichaud although Parrot's String type has a .trans method
21:21 pmichaud but I'm not sure that does what you want
21:21 pmichaud looking
21:22 pmichaud oh, looks like the following would work:
21:22 diakopter I see a trans_charset and trans_encoding
21:22 pmichaud my $new = (~$old).replace("\\", "\\\\");
21:22 pmichaud er, :=
21:22 pmichaud testing
21:23 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)␤
21:23 jnthn nqp: my $old := "o'noes"; my $new := (~$old).replace("'", '\\\''); say $new;
21:23 p6eval nqp: Confused at line 1, near "say $new;"␤current instr.: 'parrot;HLL;Grammar;panic' pc 519 (src/cheats/hll-grammar.pir:197)␤
21:24 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)␤
21:24 jnthn lol
21:24 pmichaud the weird thing is that it gives the NPA on the say()
21:24 pmichaud not on the replace.
21:25 diakopter I kept getting an NPA when using pirop::join__SSP
21:25 pmichaud looks like .replace is returning PMCNULL
21:26 jnthn nqp: my $old := "o'noes"; my $new := (~$old).replace("'", '\\\''); say($old);
21:26 p6eval nqp: o'noes␤
21:26 pmichaud aha
21:26 pmichaud .replace is always inplace
21:26 jnthn nqp: my $old := "o'noes"; my $new := $old.replace("'", '\\\''); say($old);
21:26 p6eval nqp: o\'noes␤
21:26 diakopter interesting, ok
21:26 jnthn aww
21:26 jnthn But, well, works.
21:26 diakopter pmichaud: thanks :)
21:26 jnthn .oO( why?! )
21:27 pmichaud jnthn: that's just the way the parrot folks implemented it
21:28 diakopter looks like nqp passes scalars by reference, even values like strings
21:28 jnthn :-)
21:28 jnthn pmichaud: Well, yes, there is that answer.
21:28 jnthn diakopter: So does Perl 6...
21:29 jnthn It's signature *binding*. :-)
21:29 jnthn You just normally don't notice it 'cus you're doing assignment the rest of the time. :-)
21:29 SmokeMachine joined #perl6
21:31 diakopter jnthn: o :)
21:41 Wolfman2000 rakudo: say "3".Int
21:41 p6eval rakudo 7347ec: 3␤
21:41 Wolfman2000 rakudo: say "test".Int
21:41 p6eval rakudo 7347ec: 0␤
21:50 frew_ joined #perl6
21:53 * 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.
21:53 pmurias mberends: great
21:54 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>)␤
21:54 Wolfman2000 ...well, at least that's consistent
21:54 diakopter ?? !!
21:54 lambdabot !!
21:54 Wolfman2000 diakopter: ternary operators
21:54 diakopter you put ?? ||
21:54 Wolfman2000 diakopter: I did put them.
21:55 Wolfman2000 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);
21:55 p6eval rakudo 7347ec: 1␤
21:55 diakopter I was correcting them to ?? !!
21:55 Wolfman2000 ...oh, !!
21:55 diakopter which you misinterpreted as me asking a question
21:57 diakopter rakudo: sub gcd { $^y ?? gcd($y, $^x % $y) !! $x }; say gcd(17, 41);
21:57 p6eval rakudo 7347ec: 1␤
21:57 Wolfman2000 ...that's a new form
21:58 Wolfman2000 Does $^ mean "get the first parameter, stuff it in there"?
21:58 diakopter yep, in the order of the variable names
21:58 diakopter x, then y, etc
21:58 Wolfman2000 ...I like my formal parameters.
22:01 Wolfman2000 ...now I need some actual implementation help.
22:02 Wolfman2000 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:07 cspencer joined #perl6
22:08 justatheory joined #perl6
22:09 diakopter Wolfman2000: I like http://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.
22:10 Wolfman2000 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.
22:11 diakopter parrot has a bigint library that's accessible from Rakudo Perl 6
22:11 diakopter I think.
22:12 mberends sleep &
22:12 Wolfman2000 rakudo: (2.5 + 1.25).Int
22:12 p6eval rakudo 7347ec:  ( no output )
22:13 * pmichaud disappears to work on eval.
22:13 Wolfman2000 worth a shot
22:13 Wolfman2000 rakudo: int(2.5 + 1.25);
22:13 p6eval rakudo 7347ec: the int() sub and .int method have been replaced by the .Int method␤in Main (file <unknown>, line <unknown>)␤
22:13 Wolfman2000 rakudo: say (2.5 + 1.25).Int
22:13 p6eval rakudo 7347ec: 3␤
22:14 facsimile joined #perl6
22:17 Wolfman2000 rakudo: my $tmp = 5; $tmp %= 2; say $tmp;
22:17 p6eval rakudo 7347ec: 1␤
22:19 PerlJam pmichaud: ping
22:28 diakopter pmichaud: 24-module.t is not the same as Perl 6 ordering.. which should I use
22:41 dj_goku joined #perl6
22:43 pmichaud PerlJam: pong
22:44 pmichaud diakopter: how do you mean "not the same as Perl 6 ordering?"
22:46 PerlJam pmichaud: What's the purpose of $LEXPAD := PAST::Var.new( :name('lexpad'), :scope('register') );  in PmTcl/Actions.pm?
22:49 [particle]1 joined #perl6
22:51 diakopter pmichaud: Perl 6 would output ok 2, ok 1, ok 3
22:51 diakopter I mean, it wouldn't find the first XYZ::foo()
22:51 diakopter because XYZ hasn't yet been declared
22:52 diakopter 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␤
22:54 pmichaud declarations occur at compile-time
22:54 pmichaud at least, that's the way I've always understood it.
22:55 pmichaud 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 pmichaud PerlJam: it just creates a universal PAST::Var node that can be used later to access lexpads
22:55 pmichaud (by register name)
22:56 pmichaud diakopter: anyway, NQP follows the new specification, not the old one.
22:56 pmichaud PerlJam: :scope('register') PAST::Var nodes are the only nodes thus far in PAST that are allowed to be re-used in a tree :-)
22:57 pmichaud 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
22:58 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'
22:58 Wolfman2000 rakudo: say ord('√');
22:58 p6eval rakudo 7347ec: 8730␤
22:58 pmichaud PerlJam: I think coke was working on that
22:58 diakopter (it would output ok2ok2ok3)
22:59 diakopter I mean
22:59 Wolfman2000 rakudo: say sprintf("%x", ord('√'));
22:59 p6eval rakudo 7347ec: 221a␤
22:59 Wolfman2000 good to see some things haven't changed
22:59 pmichaud ok2ok2ok3 ?
23:00 diakopter hm
23:00 Wolfman2000 rakudo: my $tmp = "√10"; $tmp =~ s/(.)/sprintf("%x", ord($0))/eg; say $tmp;
23:00 p6eval rakudo 7347ec: s/// not implemented, try .subst as workaround at line 2, near "sprintf(\"%"␤in Main (file <unknown>, line <unknown>)␤
23:00 Wolfman2000 ...and here I get knocked out. Alright, what's the equivalent?
23:01 pmichaud $tmp.subst(/./, { ord($0).fmt('%x') }, :global)   #  I think
23:01 pmichaud oh, have to capture
23:01 pmichaud so
23:01 Wolfman2000 ...yeah
23:01 pmichaud $tmp.subst(/./, { ord($/).fmt('%x') }, :global)   #  I think
23:02 Wolfman2000 rakudo: my $tmp = "√10"; $tmp = $tmp.subst(/./, { ord($/).fmt('%x') }, :global); say $tmp;
23:02 p6eval rakudo 7347ec: 221a3130␤
23:02 Wolfman2000 ...next thing I need to relearn: 0 padding
23:02 pmichaud %04x
23:03 Wolfman2000 rakudo: my $tmp = "√10"; $tmp = $tmp.subst(/./, { ord($/).fmt('%04x') }, :global); say $tmp;
23:03 p6eval rakudo 7347ec: 221a00310030␤
23:03 payload1 joined #perl6
23:03 pmichaud or even
23:04 diakopter pmichaud: I don't understand. how could XYZ::foo be called before the block in which it's declared has run?
23:04 diakopter without adding another pass.
23:04 pmichaud diakopter: declarations occur before runtime
23:04 pmichaud diakopter: same way that one can call a sub before it's declared
23:05 pmichaud rakudo:  say foo();  sub foo() { 'hello' }
23:05 p6eval rakudo 7347ec: hello␤
23:05 pmichaud std:  say foo();  sub foo() { 'hello' }
23:05 p6eval std 29167: ok 00:01 105m␤
23:05 pmichaud std:  say XYZ::foo();  sub XYZ::foo() { 'hello' }
23:05 p6eval std 29167: ok 00:01 105m␤
23:05 diakopter rakudo:  BEGIN { say foo() };  sub foo() { 'hello' }
23:05 p6eval rakudo 7347ec: Could not find non-existent sub foo␤in Main (file src/gen_setting.pm, line 324)␤
23:05 pmichaud hmmm, interesting.
23:06 diakopter std doesn't resolve fully qualified symbols
23:06 pmichaud right
23:07 pmichaud anyway, afaik what 24-module.t is doing now is following the Perl 6 spec
23:07 pmichaud if not, then I need to be corrected (and perhaps the spec updated )
23:07 diakopter then, do you agree that my conclusion should be that past.js should add another pass to set up the namespaces
23:07 pmichaud ummm, no
23:08 pmichaud Neither Rakudo nor NQP do two passes.
23:08 pmichaud but I do see where attempting to evaluate the PAST tree results in the problem you're seeing
23:08 pmichaud hmmm.
23:09 diakopter yes, it needs another pass
23:10 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
23:10 pmichaud unless there's a way to "execute" certain blocks as the tree is being loaded
23:10 diakopter heh
23:10 pmichaud going with two-pass for now ought to work I guess
23:11 pmichaud more to the point past.js probably wants to start making a distinction between compile-time and runtime
23:12 diakopter sigh
23:12 diakopter oh, the .namespace member of PAST::Var nodes is a Regex::Match
23:12 diakopter well, a ResizablePMCArray of them
23:13 diakopter is that right? I thought PAST should be independent of Regex:: objects
23:13 pmichaud it's really just an array of strings
23:13 pmichaud at least, it's treated just as an array of strings
23:14 pmichaud (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) [
23:14 diakopter PMC 'Regex;Match' => "A" @ 0 {
23:14 diakopter <ident> => PMC 'Regex;Match' => "A" @ 0
23:14 diakopter }
23:14 diakopter ]
23:14 diakopter ok, that's why I'm not using parrot's data dumper anymore
23:14 pmichaud yes, we store the array of regex objects simply because it's convenient to do so
23:14 pmichaud no need to create a separate array of strings
23:15 pmichaud but when PAST::Var compiles them, it just takes the string value of each element in <namespace>
23:15 pmichaud it doesn't use them as regex objects
23:15 diakopter ok.  JSEmitter.pm will do likewise
23:15 pmichaud works good :)
23:15 pmichaud in the case of dumping a PAST tree, I would just have the namespace elements dumped as strings directly, not as regex objects
23:15 pmichaud i.e., stringify them in the dump, not in the read
23:16 diakopter yeah, in JSEmitter.pm
23:16 pmichaud right
23:16 pmichaud disappearing again to focus on eval...
23:20 pmichaud afk, shopping
23:24 quietfanatic rakudo: say (method () {...}).arity
23:24 p6eval rakudo 7347ec: 1␤
23:25 quietfanatic Is this the correct arity (1 for the invocant)?
23:25 quietfanatic or should that be 0?
23:26 Wolfman2000 ...drat: Kyle's not here. What exactly does $stringvar.comb do? Comb through the string to get the character strands?
23:30 Wolfman2000 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>)␤
23:31 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>)␤
23:32 Wolfman2000 ...knowing me, I'm doing it wrong.
23:32 * Wolfman2000 is trying to get four characters at a time through a string.
23:34 colomon jnthn: The last few days in the ng commit list have been very lonely.  ;)
23:38 quietfanatic Wolfman2000: You need the slashes.
23:38 quietfanatic rakudo: my $tmp = "004800690021"; say $tmp.comb(/<xdigit>**4/);
23:39 p6eval rakudo 7347ec: 004800690021␤
23:39 quietfanatic rakudo: my $tmp = "004800690021"; say join ',', $tmp.comb(/<xdigit>**4/);
23:39 p6eval rakudo 7347ec: 0048,0069,0021␤
23:39 Wolfman2000 rakudo: my $tmp = "004800690021"; for $tmp.comb(/<xdigit>**4/) -> $ack { say $ack;} ;
23:39 p6eval rakudo 7347ec: 0048␤0069␤0021␤
23:40 quietfanatic Without the slashes you're creating a literal string 'xdigit' and raising it to the fourth power, yielding 0
23:40 quietfanatic actually it's a list containing 'xdigit'
23:40 quietfanatic rakudo: say <xdigit>**4
23:40 p6eval rakudo 7347ec: 0␤
23:40 quietfanatic huh
23:41 quietfanatic or a Parcel
23:41 Wolfman2000 ...once again, I'm helping to reveal stuff no one knew.
23:41 colomon rakudo: say <xdigit>
23:41 p6eval rakudo 7347ec: xdigit␤
23:41 quietfanatic rakudo: say <xdigit>.WHAT
23:41 colomon rakudo: say +<xdigit>
23:41 p6eval rakudo 7347ec: Str()␤
23:41 p6eval rakudo 7347ec: 0␤
23:41 quietfanatic ah
23:42 quietfanatic rakudo: say <xdigit xdigit>.WHAT
23:42 p6eval rakudo 7347ec: List()␤
23:42 colomon say <xdigit>.perl
23:42 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?
23:42 colomon rakudo: say  <xdigit>.perl
23:42 p6eval rakudo 7347ec: "xdigit"␤
23:53 lichtkind_ joined #perl6
23:53 Wolfman2000 rakudo: my $tmp = "004800690021"; for $tmp.comb(/<xdigit>**4/) -> $ack { say ord($ack) } ;
23:53 p6eval rakudo 7347ec: 48␤48␤48␤
23:53 Wolfman2000 err
23:54 Wolfman2000 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>)␤
23:54 Wolfman2000 rakudo: my $tmp = "004800690021"; for $tmp.comb(/<xdigit>**4/) -> $ack { say chr($ack) } ;
23:54 p6eval rakudo 7347ec: 0␤E␤␤
23:54 Wolfman2000 rakudo: my $tmp = "004800690021"; for $tmp.comb(/<xdigit>**4/) -> $ack { say $ack } ;
23:54 p6eval rakudo 7347ec: 0048␤0069␤0021␤
23:56 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>)␤
23:56 Wolfman2000 rakudo: my $tmp = "004800690021"; for $tmp.comb(/<xdigit>**4/) -> $ack { say $ack:16 } ;
23:56 p6eval rakudo 7347ec: Confused at line 2, near ":16 } ;"␤in Main (file <unknown>, line <unknown>)␤
23:57 TimToady :10($ack)
23:57 Wolfman2000 rakudo: my $tmp = "004800690021"; for $tmp.comb(/<xdigit>**4/) -> $ack { say :10($ack) } ;
23:57 TimToady :16($ack)
23:57 p6eval rakudo 7347ec: 48␤69␤21␤
23:57 Wolfman2000 rakudo: my $tmp = "004800690021"; for $tmp.comb(/<xdigit>**4/) -> $ack { say :16($ack) } ;
23:57 p6eval rakudo 7347ec: 72␤105␤33␤
23:57 Wolfman2000 Interesting use of those prefixes TimToady++
23:58 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

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo