»ö« | perl6.org/ | nopaste: paste.lisp.org/new/perl6 | evalbot usage: 'perl6: say 3;' or rakudo:, alpha:, pugs:, std:, or /msg p6eval perl6: ... | irclog: irc.pugscode.org/ | UTF-8 is our friend!
Set by lichtkind on 5 March 2010.
00:00 meppl left
jnthn o/ 00:01
lue is that hello or goodbye. In any case, (hello|goodbye), jnthn o/ 00:02
jnthn it's "hai I'm back for a bit" :-) 00:04
lue rakudo: my $greetings=('hello'|'goodbye'); say "$greetings jnthn!" 00:08
00:08 hanekomu left
p6eval rakudo c9db3d: OUTPUT«any("hello", "goodbye") jnthn!␤» 00:08
colomon \o 00:14
lue o/ 00:17
00:20 Sarten-X joined 00:22 k23z__ left
lue wonders if you can represent aleph numbers in P6... 00:24
jnthn Maybe suggest it on p6l. :-) 00:26
00:28 snarkyboojum joined
lue Oh yeah, I signed up for that, didn't I? 00:31
snarky: hai o/
std: aleph
p6eval std 30307: OUTPUT«Undeclared routine:␤ 'aleph' used at line 1␤ok 00:01 108m␤»
lue std: my $a = Inf 00:32
p6eval std 30307: OUTPUT«ok 00:01 107m␤»
lue rakudo: say Inf - 1
p6eval rakudo c9db3d: OUTPUT«Inf␤»
lue rakudo: say (Inf - 1)
p6eval rakudo c9db3d: OUTPUT«Inf␤»
lue the same happens when s/Inf/aleph/
snarkyboojum lue: hai ho o/ 00:33
lue .u aleph
phenny lue: Sorry, no results for 'aleph'.
lue .u beth 00:34
phenny U+0712 SYRIAC LETTER BETH (ܒ)
lue ( obviously, hebrew is not a part of phenny :( )
rakudo: say * 00:36
p6eval rakudo c9db3d: OUTPUT«!whatever_dispatch_helper␤»
lue rakudo: say -(1)
p6eval rakudo c9db3d: OUTPUT«-1␤»
lue rakudo: say -(*)
p6eval rakudo c9db3d: OUTPUT«Method 'Num' not found for invocant of class 'Block'␤current instr.: 'perl6;Mu;' pc -1 ((unknown file):-1)␤»
sorear .u HEBREW LETTER ALEF
phenny U+05D0 HEBREW LETTER ALEF (א)
sorear your spelling sucks
.u U+05D1
phenny sorear: Sorry, no results
sorear .u 05D1
phenny U+05D1 HEBREW LETTER BET (ב)
sorear .u 05D2 00:37
phenny U+05D2 HEBREW LETTER GIMEL (ג)
sorear .u 05D3
phenny U+05D3 HEBREW LETTER DALET (ד)
sorear .u 05D4
phenny U+05D4 HEBREW LETTER HE (ה)
sorear .u 05D5
phenny U+05D5 HEBREW LETTER VAV (ו)
daemon hmm anyway to look up the name of a symbol relative to its 'alt' code for isntance this symbol
(alt-456)
sorry
alt-789
􏿽xA7
lue sorry, but all the (math) resources I've read it's 'aleph' and 'beth'. 00:38
sorear rakudo: say chr(789)
p6eval rakudo c9db3d: OUTPUT«̕␤»
sorear rakudo: say sprintf("%x", 789)
p6eval rakudo c9db3d: OUTPUT«315␤»
sorear .u U+0315
phenny sorear: Sorry, no results
sorear .u 0315
phenny U+0315 COMBINING COMMA ABOVE RIGHT (◌̕)
sorear .u 0789 00:39
phenny U+0789 THAANA LETTER MEEMU (މ)
lue how do you define a range of real numbers in rakudo? ( I saw Real.pm, so don't say I can't :) )
colomon 3..5 00:40
for instance.
sorear woah
rakudo has reals now?!
rakudo: sprintf "%.100f", sqrt(2)
p6eval rakudo c9db3d: ( no output )
snarkyboojum Real.pm is a work in progress I think :)
sorear rakudo: printf "%.100f", sqrt(2)
colomon sorear: might not be what you are thinking of.
p6eval rakudo c9db3d: OUTPUT«1.4142135623730951454746218587388284504413604736328125000000000000000000000000000000000000000000000000»
colomon and yes, it is a work in progress. 00:41
sorear sqrt(2) does not have that many 0s
colomon very much so.
snarkyboojum was about to say.. colomon++ should know about it ;)
00:41 eternaleye left
lue I meant how would you go about defining ℝ 00:41
snarkyboojum rakudo: my Real $a = 1.4; 00:42
p6eval rakudo c9db3d: ( no output )
00:42 opx^on is now known as opx^away
colomon sorear: sqrt(2) generates a floating point number, with the usual 15 or so digits of precision. 00:42
snarkyboojum rakudo: my Real $a = 1.4; $a.say; $a.WHAT.say
p6eval rakudo c9db3d: OUTPUT«1.4␤Rat()␤»
snarkyboojum I smell a Rat!
colomon Real is a role, and Rat does Real.
snarkyboojum :)
jnthn OH REALY? ;-) 00:43
snarkyboojum so I can never had a Real type hanging around?
lue I'm curious as to how you would go about defining *all* real numbers ℝ (the range)
colomon snarkyboojum: not by itself, Real is an abstract Role.
lue: depends on what you mean.
snarkyboojum colomon: oic
colomon oic?
snarkyboojum oh i see 00:44
sorry
sorear lue: You can't. Not all reals are definable
lue for use in math involving things like aleph and beth numbers :)
snarkyboojum rakudo: my Real $a = Real.new(4.3); say $a;
colomon lue: if you really want to be able to represent any real, you need to have some way to represent irrational numbers.
p6eval rakudo c9db3d: OUTPUT«Real()<0x435a5f0>␤»
lue (lazy of course)
snarkyboojum rakudo: my Real $a = Real.new(4.3); say $a; $a.WHAT.say
p6eval rakudo c9db3d: OUTPUT«Real()<0x4a1b808>␤Real()␤»
colomon snarkyboojum: that's actually some sort of bug. hmm....
lue rakudo: say pi
p6eval rakudo c9db3d: OUTPUT«3.14159265358979␤»
snarkyboojum colomon: cool
lue rakudo: say pi.WHAT
p6eval rakudo c9db3d: OUTPUT«Num()␤»
lue There's no IrRat!? 00:45
snarkyboojum rakudo: say Num ~~ Real
p6eval rakudo c9db3d: OUTPUT«1␤»
colomon There's no IrRat.
lue rakudo: say Num; say IrRat
p6eval rakudo c9db3d: OUTPUT«Num()␤Could not find sub &IrRat␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
snarkyboojum an irrational number is a Num I guess?
lue thinks it's logical to include IrRat when creating Rat
colomon there is no way to represent irrational numbers in Perl.
at least, not so far. 00:46
I'm not aware of any computer language that supports them.
00:46 Sarten-X left
lue What would be a good substitue for all real numbers ℝ then? 00:46
colomon I've toyed with trying to implement them as lazy infinite streams of digits, but that would only be a toy.
snarkyboojum colomon: that would be very cool tho 00:47
colomon snarkyboojum: yeah, I know, that's why I was playing with the idea. ;)
snarkyboojum colomon: I like it! :)
colomon lue: it totally depends on what you are trying to do with it. 00:48
-Inf..Inf is sort of ℝ
as a range.
lue Trying to prove in rakudo that aleph 0 minus 1 equals aleph 0.
( as PoC code of advanced math, of course :) ) 00:49
colomon If we actually had properly implemented irrational numbers, they would be in the range -Inf..Inf.
lue
.oO(If P6 gets any more math-related features, then you could write the #1 programming best-seller "AP Calculus in Perl 6 and More")
rakudo: say (-Inf..Inf)-1=(-Inf..Inf) 00:50
rakudo: say (-Inf..Inf)-1==(-Inf..Inf)
p6eval rakudo c9db3d: ( no output )
lue ō.o
colomon lue: you probably need an entirely different class-based concept of number system to mess about with different levels of infinity.
snarkyboojum use Cantor; 00:51
00:52 synth joined
cognominal use Cantor 'hôtel'; 00:52
colomon I believe the spec says you are supposed to be able to do math on ranges, but it was implemented last time I checked.
lue Technically, the categorization of numbers can be seen as a series of augmentations of classes.
rakudo: say (1..3)+1 00:53
p6eval rakudo c9db3d: OUTPUT«4␤»
lue perl6: say (1..3)+1 00:54
p6eval pugs, rakudo c9db3d: OUTPUT«4␤»
..elf 30307: OUTPUT«2␤»
00:54 Sarten-X joined
lue that does not seem right. 00:54
snarkyboojum rakudo: say +(1..3) 00:55
p6eval rakudo c9db3d: OUTPUT«3␤»
snarkyboojum is coerces the range to a num i.e. the no of elems in the range I guess
to an Int even
colomon snarkyboojum has it.
lue rakudo: say (1...3)+1 00:56
p6eval rakudo c9db3d: OUTPUT«4␤»
snarkyboojum rakudo: say (1..3) Z+ 1
p6eval rakudo c9db3d: OUTPUT«2␤»
jnthn If you want to do those kinds of things, consider junctions.
lue that's impractical for large ranges :)
jnthn rakudo: say (all(1..3) + 1).perl
p6eval rakudo c9db3d: OUTPUT«all(2, 3, 4)␤»
lue (afaik)
rakudo: say (all(1..3) + 1).WHAT 00:57
p6eval rakudo c9db3d: OUTPUT«Junction()␤»
lue rakudo: say (all(-Inf..Inf) - 1) == all(-Inf..Inf) 00:58
p6eval rakudo c9db3d: ( no output )
lue again, nothing :/ 00:59
jnthn rakudo: printf "hmm '%s'", 'wtf';
p6eval rakudo c9db3d: OUTPUT«hmm 'wtf'»
jnthn rakudo: printf "hmm %s", 'wtf';
p6eval rakudo c9db3d: OUTPUT«hmm wtf»
lue rakudo: say (Inf - 1) == Inf
p6eval rakudo c9db3d: OUTPUT«1␤»
colomon snarkyboojum: (1..3) Z+ 1 iust (1, 2, 3) Z+ (1)
and Z stops when it runs out of elements on either side.
rakudo: (1..3) >>+>> 1 01:00
p6eval rakudo c9db3d: ( no output )
colomon rakudo: say (1..3) >>+>> 1
p6eval rakudo c9db3d: OUTPUT«234␤»
snarkyboojum I was going for >>+>> yeah
just had to check the spec :)
colomon or maybe
snarkyboojum oh wow - so those hyper operators work 01:01
01:02 astrojp left
snarkyboojum still hasn't worked out how to do those double arrow characters on his mac 01:02
these ones »
(without copying and pasting) ;)
colomon rakudo: say (1..3) Z+ (1, 1 ... *) 01:03
lue if you know how to use the third level, try [third level key]-\ and SHIFT-[third level key]-|
p6eval rakudo c9db3d: OUTPUT«234␤»
lue The third level key is either ctrl, option, or Apple
(forget)
colomon There's no shame in using the Texas version like I did back there. :)
lue rakudo: say (1..3)»+»1 01:04
p6eval rakudo c9db3d: OUTPUT«234␤»
colomon [This section is conjectural, and may be ignored for 6.0.]
Since use of Range objects in item context is usually non-sensical, a Range object used as an operand for scalar operators will generally attempt to distribute the operator to its endpoints and return another suitably modified Range instead, much like a junction of two items, only with proper interval semantics.
01:04 meppl joined 01:05 dj_goku left
snarkyboojum rakudo: say (1..3)>>++ 01:05
p6eval rakudo c9db3d: OUTPUT«maximum recursion depth exceeded␤current instr.: 'perl6;Iterable;list' pc 10768 (src/builtins/Role.pir:111)␤»
snarkyboojum rakudo: say (1,2,3)>>++ 01:06
p6eval rakudo c9db3d: OUTPUT«Cannot assign to readonly value␤current instr.: '&die' pc 17239 (src/builtins/Junction.pir:399)␤»
snarkyboojum oops ;)
rakudo: my @a = (1,2,3); say @a>>++
p6eval rakudo c9db3d: OUTPUT«123␤»
colomon rakudo: use Test; ok((!(1 & 2 | 3) < 2), "ditto");
p6eval rakudo c9db3d: OUTPUT«ok 1 - ditto␤»
snarkyboojum rakudo: my @a = (1,2,3); @a>>++; say ~@a
p6eval rakudo c9db3d: OUTPUT«2 3 4␤»
colomon doesn't work after my latest local real changes. 01:07
lue I heard there was a fourth sigil (the first three are $,@,%).
jnthn ++ modifies in place.
snarkyboojum aye
jnthn &
colomon rakudo: my @a = (1,2,3); ++<<@a; say ~@a
p6eval rakudo c9db3d: OUTPUT«2 3 4␤»
colomon prefix hyper ops, \o/ 01:08
jnthn: that test: (!(1 & 2 | 3) < 2)
snarkyboojum definitely TMTOWTDI :)
colomon what the heck is it supposed to be doing?
is < tighter than !?
snarkyboojum rakudo: my @a = (1,2,3); say ++<<@a; 01:09
p6eval rakudo c9db3d: OUTPUT«234␤»
snarkyboojum :)
takadonet rakudo: say 'a'..'f'
p6eval rakudo c9db3d: OUTPUT«abcdef␤»
takadonet rakudo: say 'a'..'bf'..'n' 01:10
p6eval rakudo c9db3d: OUTPUT«Method 'succ' not found for invocant of class 'Range'␤current instr.: '!dispatch_.=' pc 440 (src/glue/dispatch.pir:118)␤»
lue rakudo: say (!(1 & 2 | 3) < 2)
p6eval rakudo c9db3d: OUTPUT«1␤»
colomon rakudo: say (1 & 2 | 3) < 2 01:11
p6eval rakudo c9db3d: OUTPUT«any(all(Bool::True, Bool::False), Bool::False)␤»
jnthn colomon: That looks...weird.
colomon: I suspect the ! should be outside the opening (
takadonet rakudo: say 'a'..'b' 'f'..'n'
p6eval rakudo c9db3d: OUTPUT«Confused at line 11, near "say 'a'..'"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
colomon rakudo: say 'a'..'b', 'f'..'n'
p6eval rakudo c9db3d: OUTPUT«abfghijklmn␤» 01:12
takadonet thanks colomon
colomon jnthn: this is in precedence.t 01:13
01:13 TiMBuS left
lue quick, do you think natural numbers include the number 0? 01:14
snarkyboojum rakudo: say 'a'^..'d'
p6eval rakudo c9db3d: OUTPUT«bcd␤»
colomon jnthn: if I move the ! to outside the opening (, the test passes. but I'm not comfortable doing that because I don't understand what the test is trying to test.
snarkyboojum lue: no
colomon lue: first instinct yes, second .... um... no?
lue I ask because one argument say it is NOT is this: "Counting to three is saying 'one, two, three', not 'zero, one, two'"
With that argument, a programmer would say yes :) 01:15
snarkyboojum lue: yeah, natural numbers are traditionally called 'counting numbers', so 0 isn't included :)
but that's the traditional definition :)
lue a programmer's counting numbers includes 0 :) I say it depends on what you do. (so for me it's a yes) 01:16
snarkyboojum Perl 6 isn't exactly traditional is it?
colomon ./perl6 01:17
snarkyboojum N = Z+ :)
lue: ah, but you don't count with 0, you index from it ;) 01:18
lue it involves counting when you access the array! :)
snarkyboojum lue: but you certainly don't count, zero items ;) 01:19
colomon syntax.t has max(1, 2, 3), but that's not a legal form, so far as I know? 01:20
lue It feels like I count from zero quite often, actually :)
rakudo: max(1,2,3)
p6eval rakudo c9db3d: OUTPUT«invoke() not implemented in class 'Integer'␤current instr.: 'perl6;Any;_block4814' pc 341098 (src/gen/core.pir:27698)␤»
lue std: max(1, 2, 3)
p6eval std 30307: OUTPUT«ok 00:01 109m␤»
colomon oh, I see. 01:21
multi sub max($a, $b, $c) {return 9}
that doesn't seem to be working any more.
(in my local version, anyway)
rakudo: multi sub max($a, $b, $c) {return 9}; say max(1, 2, 3) 01:22
p6eval rakudo c9db3d: OUTPUT«get_attr_str() not implemented in class 'Sub'␤current instr.: 'perl6;Code;signature' pc -1 ((unknown file):-1)␤»
01:22 astrojp joined
lue ō.o 01:22
01:22 eternaleye joined
snarkyboojum lue: people would certainly be confused if you asked for zero coffee in the morning :) 01:22
jnthn colomon: oh, hmm 01:23
colomon does syntax.t work for you?
jnthn colomon: It appears...not :-/
colomon t/spec/S06-multi/syntax.t
I mean.
jnthn colomon: That looks bizzarely like something htat may be my fault.
Yeah, I know the one you mean.
lue well of course. That's why the 1,2,3 set of "natural numbers" are mapped to the 0,1,2 set of natural numbers :)
jnthn Yes, I think my earlier patch is to blame. Sorry.
lue Point is: I think 0 is a natural number. 01:24
colomon jnthn: no worries, just trying to get my latest Real work tested and in. :)
lue Who here knows of a graphical hierarchy of number systems they've found? I'm looking...
colomon rakudo: say (1 & 2 | 3) < 2 01:28
p6eval rakudo c9db3d: OUTPUT«any(all(Bool::True, Bool::False), Bool::False)␤»
colomon rakudo: say !(1 & 2 | 3) < 2
p6eval rakudo c9db3d: OUTPUT«1␤»
colomon rakudo: say (!(1 & 2 | 3)) < 2 01:29
p6eval rakudo c9db3d: OUTPUT«1␤»
colomon rakudo: say ?((1 & 2 | 3) < 2) 01:30
p6eval rakudo c9db3d: OUTPUT«0␤»
jnthn colomon: Yeah, I kinda...refactored the world...earlier today. :-)
colomon jnthn: I got them impression. jnthn++
I've kind of slowly starting doing the same with the math world. ;)
jnthn :-) 01:31
I've got more to go in that area.
I guess I did the first 80% and the second 80% is to come. :-)
lue jnthn: is that why the whole planet just felt...happier, today?
jnthn Well, I'd expect things to be found in a different way... :-)
diakopter rakudo: my $a = 2; say 2 - $a += 4; 01:34
p6eval rakudo c9db3d: OUTPUT«Cannot assign to readonly value␤current instr.: '&die' pc 17239 (src/builtins/Junction.pir:399)␤»
diakopter I thought += was tighter than -
lue I want to find a detailed graphic showing how all the number systems fit together (a "dependency tree" you might say), so I could toy with the possibility of a class-based way of dealing with numbers in P6 01:35
pugssvn r30308 | colomon++ | [t/spec] Fudge precedence.t, add new real-bridge.t test file. 01:36
01:36 wolf2k_ubuntu joined
lue i.e. class natural(){} class integers(){augments natural} class rational() {augments integers} and so on 01:36
sorear colomon: Nobody implements them natively because they have nasty properties (most importantly, equality is undecidable, and while ordered, x > x diverges), however there are a dozen or three computable real libraries 01:37
colomon: TimToady has been talking about surreals in Perl... 01:38
colomon ah, yes, hadn't considered equality.
you'd have to do it approximate equality.... 01:39
cognominal one Conway or another has got to be involved
lue I love all the weird number systems. Surreal, superreal, etc. I just would like to see the dependency tree for these number system.
diakopter lue: I don't think they'd augment 01:40
I think they'd subset from the larger sets
dalek kudo: c638c55 | (Solomon Foster)++ | src/core/Real.pm:
Start adding operators for Real and Num.
kudo: 6ce9873 | (Solomon Foster)++ | t/spectest.data:
Add real-bridge.t to the tests.
colomon cognominal: around here, the most likely Conway to be involved is Brian.
;)
lue depends on how you write the handling of numbers :)
colomon: how are you reinventing the math world? I'm interested 01:41
colomon lue: justrakudoit.wordpress.com/2010/03/...of-attack/ 01:43
sorear colomon: I'd really like to see an implementation of the algebraic numbers. They can do a lot of the cool things computable reals can, but you can do ordered field operations on them without running into Rice hell 01:44
otoh - galois theory makes my head explode
01:45 alester joined
colomon sorear: it's been nearly 20 years since I thought about any of that. :) 01:45
lue I think a dependency-tree type system for different number systems (much like with linux package managers) is at least an idea worth trying out (if only as a module to start out) 01:47
i.e. real numbers depend on rational and irrational
01:47 xabbu42 left
colomon lue: in particular, today I set things up so when you define a new Real type, you automatically get some basic operators compatible with any other Real type. 01:48
The new real-bridge.t is the start of example tests. 01:49
Coke-san graphjam.com/2010/04/03/funny-graph...cal-colon/
lue :) 01:51
colomon sorear: (quick wikipedia check) ooo, algebraic numbers are interesting.
I can't recall ever knowing there was a countable subset of the irrationals...
01:52 astrojp left
cognominal Coke-san: you could make that a corollary of the first Law of language redesign if you think smiley as a language redesign 01:54
sorear Zorn's lemma implies the existance of a countably infinite subset of every infinite list 01:55
01:55 Psyche^ joined
sorear I have a feeling, though, that this is much weaker than the AoC 01:56
takadonet rakudo: for 0..2 Z 1..3 -> $x,$y { say "$x $y" } 01:58
p6eval rakudo c9db3d: OUTPUT«0 1␤1 2␤2 3␤»
01:59 Sarten-X left 02:00 Patterner left, Psyche^ is now known as Patterner
sorear according to wikipedia, "every infinite set has a countably infinite subset" is independant of ZF and strictly weaker than even the axiom of countable choice 02:00
lue
.oO(and to think this discussion started because I wanted to be able to define aleph)
02:01
colomon :)
off to bed... 02:02
jnthn night, colomon 02:03
lue good night o/
and now, back to a P6-created game where the game is described by a text file (yes, a parser) 02:04
sorear Er, I had Zorn's lemma mixed up with the well-ordering theorem 02:09
dalek kudo: cb2a2d8 | jonathan++ | src/ops/perl6.ops:
Fix throwing of exceptions when binding fails so we don't end up treating hash parameters as formats.
02:10
kudo: 4d1b1c7 | jonathan++ | src/binder/bind.c:
Awesomize errors for sub-signatures, to mention that the binding error was in a sub-signature and also, if it has one, the name of the variable that captured the entire thing that sub-signature is being bound against.
jnthn std: sub foo (:$) { }
p6eval std 30308: OUTPUT«ok 00:01 109m␤»
sorear jnthn: Why does blizkost have gen-parrot.pl and related trappings? Surely if you don't have Parrot, you should just use Perl5? 02:34
sorear attempts to remove the use of recursive make 02:36
jnthn: What is staging for 02:51
?
lue rakudo: my $a="module"; use $a.perl 03:06
p6eval rakudo 4d1b1c: OUTPUT«Could not find sub &use␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
lue rakudo: my $a="module"; use perl
p6eval rakudo 4d1b1c: OUTPUT«Unable to find module 'perl'.␤current instr.: 'perl6;Perl6;Module;Loader;need' pc 34766 (src/gen/role_pm.pir:807)␤»
lue could I load a module from input given by the user (they give the name of a module, and then I use it)? 03:07
std: my $a="module"; use $a.perl
p6eval std 30308: OUTPUT«Undeclared routine:␤ 'use' used at line 1␤ok 00:01 109m␤»
lue rakudo: use lib 03:09
p6eval rakudo 4d1b1c: OUTPUT«Unable to find module 'lib'.␤current instr.: 'perl6;Perl6;Module;Loader;need' pc 34766 (src/gen/role_pm.pir:807)␤»
Coke-san NQP question: nopaste.snit.ch/20175 03:10
sorear: (don't have parrot) ... doesn't blizkost /require/ parrot? 03:11
blizkost?
is there an infobot in here?
03:12 quester joined
Coke-san (putting the class definition in an INIT doesn't seem to help, presuming that my problem is that the INIT is trying to get the class before it's ready.) 03:19
03:20 molaf joined
takadonet rakudo: say 'ab'..'e' 03:24
p6eval rakudo 4d1b1c: OUTPUT«␤»
ash_ rakudo: my $a = 5; $a.HOW.add_method($a, 'fo', method { say 'new_method'; }); $a.'fo'(); 03:30
p6eval rakudo 4d1b1c: OUTPUT«Method 'fo' not found for invocant of class 'Integer'␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
ash_ hmmm thats bad, Integer is a leak from parrot
rakudo: class A { }; my $a = A.new; $a.HOW.add_method($a, 'fo', method { say 'new_method'; }); $a.'fo'();
p6eval rakudo 4d1b1c: OUTPUT«new_method␤»
ash_ works fine with custom classes, seems to be a leaky parrot issue 03:31
03:31 meppel joined 03:32 meppl left, meppel is now known as meppl
sorear Coke-san: Hi 03:33
Coke-san ~~
sorear Coke-san: Look carefully at the backtrace. 03:34
Are all the functions loaded in the right HLLs?
Coke-san: yes, blizkost requires Parrot. But it has a built-in Parrot downloader/installer 03:35
which doesn't make much sense to me
Coke-san sorear: it's probably a straight copy from rakudo's
and since you need parrot, giving the developer a hand to get it seems reasonable. 03:36
sorear it makes no sense to install blizkost as your first Parrot library though
if your only Parrot library is blizkost, you might as well just use perl directly 03:37
Coke-san sorear: first != only
also, blizkost may require a newer parrot than you have. 03:38
regarding my error - there is no HLL before or after the diff in the generated PIR. 03:39
03:40 dj_goku joined
Coke-san ok. the class definition was a noop. adding a literal pir::noop in the class definition causes it to actually create the subclass, but then it complains about using the core parrot type. Getting closer. 03:43
03:43 ash_ left
sorear Coke-san: I meant HLL in the backtrace 03:48
oh 03:49
Coke-san: try changing pir::subclass__ps to pir::subclass__vps
subclass__ps takes 1 string argument and returns a PMC
Coke-san sorear: .. that code /works/ 03:50
it's the nqp syntax of "class Foo is Bar" that is failing.
sorear oh
Coke-san even better, subclassing parrot's Hash seems to work; it's the ResizablePMCArray that's dying. 03:51
sorear I wish I understood half of this 03:52
Coke-san zzz 03:59
lue good night 04:02
04:11 meppl left 04:18 JimmyZ joined 04:19 wolf2k_ubuntu left 04:23 Chillance left
quester rakudo: our sub infix:<q> {$^a, $^b}; say <a c> «q» <b d>; 04:32
p6eval rakudo 4d1b1c: OUTPUT«abcd␤»
quester rakudo: sub infix:<q> {$^a, $^b}; say <a c> «q» <b d>;
p6eval rakudo 4d1b1c: OUTPUT«Could not find sub &infix:<q>␤current instr.: '' pc -1 ((unknown file):-1)␤»
quester ... does anyone know off the top of their head why "our" is needed here? It seems odd to me. 04:33
quester was trying to define ö so that »ö« would be a metaop and got sidetracked 04:36
04:37 arthur-_ left 04:45 nihiliad left 04:51 quester is now known as quester--away-- 05:29 quester--away-- left 05:39 gfx joined 05:48 quester--away-- joined 05:49 quester--away-- is now known as quester_
cognominal rakudo: say %hash<a b c>.perl 05:58
p6eval rakudo 4d1b1c: OUTPUT«Symbol '%hash' not predeclared in <anonymous>␤current instr.: 'perl6;PCT;HLLCompiler;panic' pc 152 (compilers/pct/src/PCT/HLLCompiler.pir:108)␤»
cognominal rakudo: %hash = (:a<A>, :b<B>);; say %hash<a b c>.perl
p6eval rakudo 4d1b1c: OUTPUT«Symbol '%hash' not predeclared in <anonymous>␤current instr.: 'perl6;PCT;HLLCompiler;panic' pc 152 (compilers/pct/src/PCT/HLLCompiler.pir:108)␤»
cognominal rakudo: my %hash = (:a<A>, :b<B>);; say %hash<a b c>.perl
p6eval rakudo 4d1b1c: OUTPUT«Proxy.new()␤»
cognominal rakudo: my %hash = (:a<A>, :b<B>);; say %hash<a b c>
p6eval rakudo 4d1b1c: OUTPUT«␤»
06:00 quester_ left 06:11 JimmyZ left 06:15 mberends joined 06:31 justatheory left 07:05 alester left 07:17 cyberpass joined 07:23 espadrine left 07:29 ewilhelm joined 07:30 cyberpass left 07:33 snarkyboojum_ joined 07:34 snarkyboojum left, ewilhelm left, snarkyboojum joined 07:35 ewilhelm joined 07:37 snarkyboojum_ left 07:42 proller joined 07:43 M_o_C joined 07:44 M_o_C_ joined, M_o_C_ left 07:53 Su-Shee joined
Su-Shee good morning 07:53
sorear hello
fperrad got back to me. 5 down, 1 to go 07:55
moritz_ good morning 08:04
sorear moritz_! 08:06
I've been waiting for you
hello moritz 08:07
moritz_ sorear: just replying to your mail 08:08
sorear excellent, thank you 08:09
moritz_ I also don't think I contributed enought to blizkost so that my opinion really counts :-)
08:25 xabbu42 joined 08:33 pmurias joined 08:41 gfx left 08:42 ruoso left
Su-Shee the example in "user defined array indexing" which says :Jan(1) - does that mean that the @months index starts with 1 instead of 0? 08:45
moritz_ where? S09?
Su-Shee yes
moritz_ I think it means that only the enum values of Month are valid indexes in the first dimension 08:46
so yes, starts with 1 and ends with 12
08:56 ruoso joined
Su-Shee alpha: my $vitamin = 'c'; my @healthy = <<apple $vitamin>>; @healthy.say; 08:58
p6eval alpha 30e0ed: OUTPUT«applec␤»
09:00 envi^home joined
moritz_ has a prototype command line script that uses WWW::Mechanize to add comitters to the pugs repo 09:00
sorear hugme is cooler.
moritz_ sorear: the plan is to incorporate it into hugme 09:01
sorear: but first I need to make it non-blocking
because it takes some time, and hugme is POE based
so far hugme only works with github stuff
sorear moritz++ I wanted to add the NQP tests to the harness but couldn't see how 09:02
moritz_: system("... &")?
moritz_ sorear: then I don't get any feedback if it was successful 09:03
sorear What could possibly go wrong?
moritz_ lots of things
for one commitbit is sometimes down 09:04
mberends phenny, tell colomon re: S32::Numeric relocations, it would be most comforting if roots, which returns Complex, was also a method of Complex. Hopefully that is also implementable.
phenny mberends: I'll pass that on when colomon is around.
sorear what is 'commitbit'?
moritz_ sorear: the web frontend used to add committers
mberends: then you can't easily calculate the complex roots of real numbers 09:05
mberends moritz_: can a real number be coerced to Complex for roots() ? 09:08
moritz_ probably, yes
4.Complex.roots(5)
looks sufficiently nice :-)
mberends likes that too 09:13
09:18 mikehh left
cognominal rakudo: my ($a, $b) = 1, 2; (1 ?? $a !! $b) = 3; say "$a$b" 09:19
p6eval rakudo 4d1b1c: OUTPUT«32␤»
cognominal I knew it :) 09:20
rakudo: my $a is readonly := 0; 09:23
p6eval rakudo 4d1b1c: OUTPUT«No applicable candidates found to dispatch to for 'trait_mod:<is>'. Available candidates are:␤:(Mu $child, Role $r)␤:(Code $block, Any $arg?, Any :export($export!)␤:(Mu $child, Mu $parent)␤␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
09:23 agentzh joined
cognominal rakudo: my $a is readonly 09:23
p6eval rakudo 4d1b1c: OUTPUT«No applicable candidates found to dispatch to for 'trait_mod:<is>'. Available candidates are:␤:(Mu $child, Role $r)␤:(Code $block, Any $arg?, Any :export($export!)␤:(Mu $child, Mu $parent)␤␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
moritz_ sorear: after looking at PoCo::Client::HTTP in more detail I think I will really use system("script &") :/
cognominal Well, I wanted to be able to bind a read-only variable to a constant but apparently readonly for variable is not (yet) supported. 09:24
moritz_ right
it's only supported for parameters
rakudo: sub a($x) { say $x); a(5); # binds a read-only variable to a constant 09:25
p6eval rakudo 4d1b1c: OUTPUT«Unable to parse blockoid, couldn't find final '}' at line 11␤current instr.: 'perl6;Regex;Cursor;FAILGOAL' pc 1664 (ext/nqp-rx/src/stage0/Regex-s0.pir:907)␤»
cognominal meaning it will not be supported for mere variable
moritz_ rakudo: sub a($x) { say $x}; a(5);
p6eval rakudo 4d1b1c: OUTPUT«5␤»
moritz_ it's just not yet implemented
cognominal now suppose I bind a rw variable to a constant using := It should blow on me if I try to modify the variable value. 09:29
moritz_ aye
09:35 mikehh joined 09:53 espadrine joined
pugssvn r30309 | moritz++ | [t/spec] test that you can call a sub of the same name as the current method (RT #74014) 10:05
10:06 payload joined
cognominal rakudo: say !0 10:09
p6eval rakudo 4d1b1c: OUTPUT«1␤»
cognominal rakudo: say &prefix:<!>(0) 10:10
p6eval rakudo 4d1b1c: OUTPUT«1␤»
cognominal rakudo: say &prefix:<!>(False)
p6eval rakudo 4d1b1c: OUTPUT«1␤»
cognominal rakudo: say False.WHAT
p6eval rakudo 4d1b1c: OUTPUT«Bool()␤»
cognominal rakudo: say (!0).perl 10:11
p6eval rakudo 4d1b1c: OUTPUT«Bool::True␤»
10:12 hanekomu joined 10:15 testme joined 10:16 testme left
cognominal rakudo: say &prefix:<!>.perl 10:16
p6eval rakudo 4d1b1c: OUTPUT«{ ... }␤»
10:19 hugme left 10:21 hugme joined
moritz_ hugme: add foo to pugs 10:21
hugme moritz_: usage: Add <email>,<nickname> to pugs
10:21 moritz_ sets mode: +v hugme
moritz_ hugme: add [email@hidden.address] to pugs 10:21
hugme moritz_: usage: Add <email>,<nickname> to pugs
moritz_ :/
Su-Shee alpha: my @foo = <foo bar baz flubb>; @foo[1:delete]; @foo.say 10:22
p6eval alpha 30e0ed: OUTPUT«Confused at line 10, near "[1:delete]"␤in Main (file <unknown>, line <unknown>)␤»
Su-Shee yeah, alpha, I'm confused too.
moritz_ adverbs go outside the subscripts, but it was never implemented in rakudo
std: my @foo = <foo bar baz flubb>; @foo[1:delete]; @foo.say
p6eval std 30308: OUTPUT«ok 00:01 109m␤»
moritz_ std: my @foo = <foo bar baz flubb>; @foo[1]:delete; @foo.say
p6eval std 30308: OUTPUT«ok 00:01 107m␤» 10:23
10:23 hugme left
Su-Shee then I'll ignore it. 10:23
10:24 hugme joined
moritz_ hugme: add [email@hidden.address] to pugs 10:24
hugme moritz_: usage: Add <email>,<nickname> to pugs
10:24 hugme left, hugme joined
moritz_ hugme: add [email@hidden.address] to pugs 10:24
hugme hugs moritz_. If all goes well you'll get an email soon
Su-Shee alpha: my @foo = <foo bar baz flubb>; @foo[1].delete; @foo.say 10:25
p6eval alpha 30e0ed: OUTPUT«Method 'delete' not found for invocant of class 'Str'␤in Main (file src/gen_setting.pm, line 324)␤»
moritz_ alpha: my @foo = <foo bar baz flubb>; @foo.delete(1); say @foo
p6eval alpha 30e0ed: OUTPUT«fooUse of uninitialized value␤bazflubb␤»
Su-Shee that was the next one I've wanted to try. ;) 10:26
moritz_ :-)
Su-Shee delete leaves the element empty and doesn't change the index, does it? 10:27
moritz_ right 10:29
I don't know if it shortens the array if the last item is deleted
cognominal say +"toto"
oops
rakudo: say +"toto"
p6eval rakudo 4d1b1c: OUTPUT«0␤»
10:30 Intensity joined
Su-Shee alpha: my @foo = <foo bar baz flubb>; @foo.push(<blubb>); @foo.say 10:30
p6eval alpha 30e0ed: OUTPUT«foobarbazflubbblubb␤»
10:34 ruoso left
Su-Shee alpha: my @foo = <foo bar baz flubb>; @foo.unshift(<blubb>); @foo.say 10:35
p6eval alpha 30e0ed: OUTPUT«blubbfoobarbazflubb␤»
10:37 payload left 10:41 rekhajos joined 10:45 kaare joined 10:46 kaare is now known as Guest60427
cognominal rakudo: say ('a', 'b').WHAT 10:47
p6eval rakudo 4d1b1c: OUTPUT«Parcel()␤»
cognominal I thought Parcel were mostly invisible at the user level?
10:47 M_o_C left 10:48 M_o_C joined
moritz_ I don't know if they should be completely invisible, but I'm sure Rakudo exposes them far too often 10:50
cognominal Writing an article makes me discover a lot of things 10:52
There is no such things as teaching to learn. 10:53
hum, I am not sure that's correct English
10:56 Guest60427 left 10:58 agentzh left
Su-Shee alpha: my @foo = <foo bar baz flubb>; @foo.delete(1, 3); say @foo 11:03
p6eval alpha 30e0ed: OUTPUT«fooUse of uninitialized value␤baz␤»
Su-Shee oha.
alpha: my @foo = <foo bar baz flubb>; @foo.delete(1..3); say @foo
p6eval alpha 30e0ed: OUTPUT«foo␤»
11:03 clintongormley joined
Su-Shee alpha: my @foo = <foo bar baz flubb>; @foo.delete(0..2); say @foo 11:04
p6eval alpha 30e0ed: OUTPUT«Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤flubb␤»
Su-Shee alpha: my @foo = <foo bar baz flubb>; @foo.shift(0..2); say @foo 11:05
p6eval alpha 30e0ed: OUTPUT«No applicable candidates found to dispatch to for 'shift'␤in Main (file <unknown>, line <unknown>)␤»
Su-Shee alpha: my @foo = <foo bar baz flubb>; @foo[0..2].shift; say @foo
p6eval alpha 30e0ed: OUTPUT«foobarbazflubb␤»
Su-Shee alpha: my @foo = <foo bar baz flubb>; my @new = @foo[0..2].shift; say @new 11:06
p6eval alpha 30e0ed: OUTPUT«foo␤»
Su-Shee alpha: my @foo = <foo bar baz flubb>; my @new = [||] @foo.delete(0..2); say @new 11:28
p6eval alpha 30e0ed: OUTPUT«foo␤»
Su-Shee alpha: my @foo = <foo bar baz flubb>; @foo.delete(0..2); my @new = [||] @foo; say @new 11:29
p6eval alpha 30e0ed: OUTPUT«flubb␤»
Su-Shee alpha: my @foo = <foo bar baz flubb>; @foo.delete(0..1); my @new = [||] @foo; say @new
p6eval alpha 30e0ed: OUTPUT«baz␤»
Su-Shee alpha: my @foo = <foo bar baz flubb>; my @obs = @foo.delete(0..1); my @rest = @obs ~~ @foo; say @rest 11:32
p6eval alpha 30e0ed: OUTPUT«0␤»
moritz_ rakudo: my @a = <foo bar baz>; @a.delete(1); say @a[1] ~~ EMPTY 11:33
p6eval rakudo 4d1b1c: OUTPUT«0␤»
Su-Shee I'm trying to get a list with obsolete elements really removed. ;) 11:34
and not just empty.
moritz_ then @foo.grep({.defined}) or so 11:35
or maybe with with splice instead of delete
Su-Shee I was hoping for something simple and obvious. :/ 11:36
alpha: my @foo = <foo bar baz flubb>; my @obs = @foo.delete(0..1); my @rest = all(@obs) ~~ all(@foo); say @rest 11:38
p6eval alpha 30e0ed: OUTPUT«all(Bool::False)␤»
Su-Shee oeh :)
11:40 rekhajos left
moritz_ smart matching will nearly always return True or False 11:41
the only exception I know if is matching a regex, which returns a Match object
Su-Shee that can't be that difficult. how do I do a simple union/intersection of two lists? 11:45
moritz_ with hashes 11:46
jnthn o/
moritz_ or with grep and any()
lolitsjnthn!
jnthn: I get two fails in t/spec/S06-multi/syntax.t - a regression?
11:47 M_o_C left
jnthn moritz_: It appears my setting work yesterday did it. 11:47
11:48 meppl joined
jnthn moritz_: Will try and fix tha tup today. 11:50
moritz_ rakudo: class A { method x { say %_.perl } }; A.new.x(:b) 11:51
p6eval rakudo 4d1b1c: OUTPUT«Placeholder variables cannot be used in a method at line 11, near "}; A.new.x"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
moritz_ rakudo: class A { method x(*%_) { say %_.perl } }; A.new.x(:b)
p6eval rakudo 4d1b1c: OUTPUT«{"b" => Bool::True}␤» 11:52
moritz_ jnthn: afaict both should work, since methods always have implicit *%_
11:52 dzikasosna joined
jnthn moritz_: I suspect so, yeah. 11:53
pugssvn r30310 | moritz++ | [t/spec] test usage of %_ in methods, RT #73892
jnthn is still not completely awake yet :-) 11:54
moritz_ jnthn: no hurry :-)
jnthn om nom noms breakfast 12:01
Su-Shee meh. that's all too 5ish. :/ 12:02
moritz_ rakudo: my @a = <a b c>; my @b = <b c d>; my @inter = @a.grep(any(@b)); say @inter.perl 12:04
p6eval rakudo 4d1b1c: OUTPUT«[any((), (), ())]␤»
moritz_ ouch 12:05
rakudo: my @a = <a b c>; my @b = <b c d>; my @inter = @a.grep({ $_ eq any(@b) }); say @inter.perl
p6eval rakudo 4d1b1c: OUTPUT«["b", "c"]␤»
colomon o/
phenny colomon: 09:04Z <mberends> tell colomon re: S32::Numeric relocations, it would be most comforting if roots, which returns Complex, was also a method of Complex. Hopefully that is also implementable.
moritz_ afaict those two should be the same
colomon grep just does a smartmatch with it's filter argument. 12:06
moritz_ yes
so smartmatching against any(@b) should the same as { $_ eq any(@b) }, right? 12:07
colomon rakudo: say 'a' ~~ any(<b c d>)
p6eval rakudo 4d1b1c: OUTPUT«0␤»
colomon rakudo: say 'b' ~~ any(<b c d>)
p6eval rakudo 4d1b1c: OUTPUT«1␤»
colomon looks like somehow a grep bug and not a smartmatch bug? 12:08
jnthn phenny tell quester the need for our on that of is a Rakudo bug...working on it, but it's teh hard. :-/
moritz_ colomon: aye
heh 12:09
12:09 jhuni left
moritz_ 31: our multi method grep($test) { 12:09
that should be Mu $test
colomon mberends: there should be a roots.Complex because there is a version of roots which takes a Complex number. IMO returning Complex number doesn't enter into it.
moritz_++ 12:10
moritz_: can you fix that and make sure there's a test for this case in grep.t?
moritz_ colomon: working on it
(and on RT #74056 at the same time :)
colomon \o/ 12:11
moritz_ actually I think I'm done with the latter, now just need to spectest
heh, there was actually a test in undef.t that didn't pass because grep in boolean context would always return 1 12:19
12:19 snarkyboojum left
moritz_ rakudo: sub foo(%h($left)) {}; foo({ no => "left key" }) 12:24
p6eval rakudo 4d1b1c: OUTPUT«Not enough positional parameters passed; got 0 but expected 1 in sub-signature of parameter %h␤current instr.: 'foo' pc 213 (EVAL_1:82)␤»
12:24 dzikasosna left
jnthn moritz_: That's correct too. 12:25
moritz_: $left is a positional, it just happens to work because of named to positional bindings. 12:26
12:26 ruoso joined
moritz_ thought so 12:40
pugssvn r30311 | moritz++ | [t/spec] test Junction matchers with .grep
r30312 | moritz++ | [t/spec] unfudge passing TODO tests for rakudo
dalek kudo: ebb9f47 | moritz++ | src/builtins/Iterator.pir:
implement Iterator.Bool, so that "if @things.grep($tester)" works properly. Fixes RT #74056
kudo: 7348b9a | moritz++ | src/c (2 files):
List.grep should take a Mu, so that Junction matchers DWYM
12:49 Coke-san is now known as CokeBot9000, Chillance joined
pugssvn r30313 | moritz++ | [t/spec] test that the return value from .grep Boolifies sensibly (RT #74056) 12:49
12:58 snarkyboojum joined 13:05 am0c joined
takadonet morning all 13:06
jnthn o/
am0c morning!
takadonet wow! lots of commit since last night 13:08
moritz_ mostly jnthn++
30524 passing tests. \o/
13:09 [particle] left, dual left 13:11 TiMBuS joined 13:14 [particle] joined
takadonet how many tests are they in the spec right now? 13:16
13:17 slavik joined
moritz_ estimated 38.5k 13:18
that's what rakudo's test_summary.pl says
probably more... maybe 40k to 45k
colomon takadonet: but note that Rakudo Alpha only passed 32k
slavik what are we measuring? 13:19
moritz_ numbers 13:20
integers, to be exact
snarkyboojum wow, so less than 2k away from alpha? 13:22
dalek kudo: eaac605 | jonathan++ | src/Perl6/Actions.pm:
Make anonymous named parameters (yes, I know...masak told me to) work.
kudo: 1795a2e | jonathan++ | src/core/Signature.pm:
Show sub-signatures in .signature.perl.
colomon snarkyboojum: well, it's a bit tricky... because we pass tests alpha never did.
so we won't have alpha's full functionality back by 32k. 13:23
snarkyboojum colomon: but a simple numbers comparison
colomon but we will be comparable.
snarkyboojum colomon: ah ok
be awesome in different areas :)
colomon but yeah, definitely it will be cause for celebration.
snarkyboojum :) 13:24
colomon and I'm looking forward to celebrating! ;)
13:26 ignacio_ joined 13:28 Guest42283 left
moritz_ rakudo: multi x(%h($a, $b)) {}; multi x(%h($a, $b)) {}; x({:a, :b}) 13:28
p6eval rakudo 7348b9: OUTPUT«Ambiguous dispatch to multi 'x'. Ambiguous candidates had signatures:␤:(%h)␤:(%h)␤␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
moritz_ rakudo on the server not yet recompiled
cognominal jonathan++ 13:33
CokeBot9000 rakudo: my @a=<svg form web>; say @a.grep("svg").perl 13:34
p6eval rakudo 7348b9: OUTPUT«("svg", )␤»
CokeBot9000 should we not emit the trailing comma when .perl'ing ? 13:35
cognominal is there a way to ask rakudo which branch and which patch number is used for its compilation? 13:36
WHOA THERE, now compile is fast again.
moritz_ cognominal: not now - there's a patch for that in RT, but waits review from pmichaud++ 13:37
CokeBot9000 chromatic++
13:39 [particle] left
colomon ah, that's what happened to that patch. 13:39
moritz_ colomon: speaking of patches... I think you'd be well suited to review RT #74008 13:40
colomon is that the lazy seq / array patch? 13:42
13:43 [particle] joined
moritz_ yes 13:43
13:43 am0c left
colomon it's been sitting open in a tab in Chrome since the first time you mentioned it, but I haven't had a chance to take a look. 13:43
moritz_ ok 13:44
then sorry for redundant bothering :-)
colomon maybe if I can get packing stuff done today, I can take a closer look tonight...
no, it's good, I should be looking at it. :)
moritz_ in the end I don't want to hinder your packing in any way 13:46
in current rakudo, how do I create a proper Perl 6 hash in PIR? 13:53
colomon well, believe me, packing has the highest priority at the moment. since the movers are coming to pack whatever we haven't tomorrow.... 13:54
afk # heading back to pack, will hopefully be able to get wi-fi set up again when I arrive.
13:54 colomon left
jnthn rakudo: say (:()).WHAT 13:54
p6eval rakudo 1795a2: OUTPUT«Parcel()␤»
jnthn rakudo: say :().WHAT 13:55
p6eval rakudo 1795a2: OUTPUT«Parcel()␤»
moritz_ expects Signature()
13:55 PacoLinux joined
jnthn yeah, same 13:55
Just looking at #69320 on this. :-)
13:55 astrojp joined
jnthn rakudo: say :($a).WHAT 13:56
p6eval rakudo 1795a2: OUTPUT«Symbol '$a' not predeclared in <anonymous>␤current instr.: 'perl6;PCT;HLLCompiler;panic' pc 152 (compilers/pct/src/PCT/HLLCompiler.pir:108)␤»
jnthn hmmm
moritz_ std: say :($a).WHAT
p6eval std 30313: OUTPUT«ok 00:01 109m␤»
jnthn oh heh 13:57
we're missing token:sigterm anyway :-)
13:57 gbacon joined
moritz_ std: :($a); say $a 13:57
p6eval std 30313: OUTPUT«===SORRY!===␤Variable $a is not predeclared at /tmp/gCi6GwNeAp line 1:␤------> :($a); say $a⏏<EOL>␤ expecting any of:␤ POST␤ postfix␤ postfix_prefix_meta_operator␤FAILED 00:01 108m␤» 13:58
jnthn std++
moritz_ looks at src/core/YOU_ARE_HERE.pm with slight bewilderment
jnthn moritz_: :-) 13:59
moritz_ ah, some kind of marker for lexical things for the setting`
jnthn moritz_: Correct.
CokeBot9000 I just tripped over that trying to run rakudo against an old parrot.
jnthn moritz_: It's also the last line in CORE.setting
(that STD uses) 14:00
pugssvn r30314 | moritz++ | [t/spec] test that subsignatures appear in the output of Signature.perl 14:03
jnthn \o/ 14:04
moritz_ rakudo: multi x(%h($a, $b)) {}; multi x(%h($a, $b)) {}; x({:a, 14:05
p6eval rakudo 1795a2: OUTPUT«Unable to parse blockoid, couldn't find final '}' at line 11␤current instr.: 'perl6;Regex;Cursor;FAILGOAL' pc 1664 (ext/nqp-rx/src/stage0/Regex-s0.pir:907)␤»
moritz_ rakudo: multi x(%h($a, $b)) {}; multi x(%h($a, $b)) {}; x({:a, :b})
p6eval rakudo 1795a2: OUTPUT«Ambiguous dispatch to multi 'x'. Ambiguous candidates had signatures:␤:(%h (Mu $a, Mu $b))␤:(%h (Mu $a, Mu $b))␤␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
moritz_ jnthn++ 14:06
jnthn :-)
14:10 xabbu42 left 14:16 dual joined 14:17 Lorn joined 14:23 nihiliad joined 14:37 alester joined 14:41 justatheory joined 14:42 pmurias left 14:43 Trashlord joined, jaldhar left
ruoso hmm... 14:55
14:56 Chillance left, jaldhar joined 14:57 ignacio_ left 14:58 ash_ joined
moritz_ wow, signature parsing is complicated 15:00
or declaration parsing, for that matter
jnthn Tell me about it!
moritz_ tells jnthn that declaration parsing is complicated
ruoso I didn't quite understand the motivations on lue's revamp of S32/Temporal 15:01
takadonet glad he only working on trans
ash_ jnthn, moritz_ i think i found a leaky parrot object
15:01 IllvilJa joined
ash_ rakudo: class A { }; my $a = A.new; $a.HOW.add_method($a, 'fo', method { say 'new_method'; }); $a.'fo'(); my $b = A.new; say $a.^methods(:local); my $c = 1; $c.^add_method('fo', method { say 'new_method'; }); $c.fo; 15:01
p6eval rakudo 1795a2: OUTPUT«new_method␤_block73␤Method 'fo' not found for invocant of class 'Integer'␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
ash_ Integer i think is from parrot
moritz_ ruoso: I think he meant to simplify things, but since he hasn't replied to Mark's question on p6l, it's still a mistery to me
ruoso: I think if he doesn't respond within a reasonable time frame, we could just revert his commit 15:02
IllvilJa Builds of github rakudo goes WAY faster these days :-)
moritz_ IllvilJa: aye, chromatic++'s and bacek++'s "fault" :-)
ruoso moritz_, one way or the other, I think his change is not aligned at all with current view of temporal definitions
i.e.: "Temporal is divided into two parts: date and time." 15:03
that's simply not true. it is the case in the gregorian calendar
but might not be the case in other calendars 15:04
IllvilJa chromatic++ & bacek++ indeed
ash_ my example could be shortened some, but the add method worked on a custom class object, but it fails on the Int
jnthn ash_: I think I know why that is. 15:05
ruoso using $*NOW as a context variable instead of a multi call
ash_ also, should ^add_method add a method to ALL instances of that object type? I added it to $a, and $b got it too
ruoso ash_, "type" is not the precise word... 15:06
every object that shares the same metaclass instance
jnthn ash_: yes, to all instances.
ash_ got ya, just wondering, i wasn't sure 15:07
ruoso in fact... if that object was already runtime composed with other role
calling ^add_method would probably add just to that specific object
since it would have a metaclass instance on its own...
jnthn Yes, true. 15:08
15:08 SmokeMachine joined
ruoso rakudo: my $a = 0 but True; $a.^add_method('bla',method { say "Hello" }); $a.bla() 15:08
p6eval rakudo 1795a2: OUTPUT«No applicable candidates found to dispatch to for 'infix:<does>'. Available candidates are:␤:(Mu $do-it-to-me, Role $r)␤:(Mu $do-it-to-me, ConcreteRole $r)␤␤current instr.: 'infix:<but>' pc 277213 (src/gen/core.pir:3883)␤»
ruoso oops 15:09
jnthn Don't do "but True" yet.
One of the many todos.
ruoso okay...
rakudo: my $a = 0; role B { }; my $b = B.new(); $a does B; $a.^add_method('bla',method { say "Hello" }); $a.bla(); $b.bla(); say 'survived'; 15:10
p6eval rakudo 1795a2: OUTPUT«Hello␤Method 'bla' not found for invocant of class ''␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
ruoso hmm... that was supposed to work... I think...
ash_ um... 15:11
how would that work?
ruoso ah...
wait...
it did work
ash_ roles are immutable, add_method shouldn't be adding to the role
ruoso just spotted the "Hello" at the beggining...
jnthn :-)
moritz_ alpha: my $a = 0; role B { }; my $b = B.new(); $a does B; $a.^add_method('bla',method { say "Hello" }); $a.bla(); $b.bla(); say 'survived';
ruoso $a has the method "bla", $b doesn't
p6eval alpha 30e0ed: ( no output ) 15:12
moritz_ ruoso: care to turn that into a spectest?
ash_ i think this is a clearer example of what you meant ruoso 15:13
rakudo: class B { }; role Blank { }; my $a = B.new; my $b = B.new; $a does Blank; $a.^add_method('bla',method { say "Hello" }); $a.bla; $b.bla; say 'survived';
15:13 ignacio_ joined
p6eval rakudo 1795a2: OUTPUT«Hello␤Method 'bla' not found for invocant of class 'B'␤current instr.: '_block14' pc 29 (EVAL_1:0)␤» 15:14
ash_ it wasn't added to B in that case because $a had a does applied to it, so it had a new meta instance, i think, that was different than the one $b has
ruoso ash_, precisely 15:15
ash_ if you don't do the $a does Blank; they both say hello
jnthn Seems to make sense to me too. :-)
ruoso that's why saying "type" is confuse... 15:16
ash_ yeah, true
15:16 pmurias joined
ruoso it's better to spell out the full name 15:16
ash_ what should happen if instead of $a does Blank; you did B does Blank; ?
should $a and $b have 'bla'?
ruoso yes
because you modified the roel
but i *think* roles are closed
ash_ well, in my example i changed the role B to class B 15:17
ruoso wait waity
dalek kudo: 2464ddb | moritz++ | src/glue/run.pir:
bring back %*VM, though currently it is a parrot Hash, not a Rakudo Hash (no idea how to fix that :/ )
ash_ sorry, i should of given it a new name, that's probably confusing since our two examples are so similar
ruoso I see what you mean 15:18
I think it wouldn't
ash_ wonldn't or shouldn't?
ruoso when you call $a.^add_method it probably is a good reason to specialize the metaclass instance of $a
to avoid action-at-a-distance
jnthn eww...in place? :-)
ruoso yeah... in place.. 15:19
jnthn I think .^add_method will do some action at a distance.
If you're playing with meta-methods then you're asking for trouble anyway.
ruoso if you do that on the protoobject, yes
but doing that on a concrete object
ash_ hey, if the spec isn't clear enough, people like me will do "Bad Things" ™ with it
ruoso it's kinda confuse
jnthn But all of those share the same meta-class instance (unless they got mixed in to).
I'd rather things like add_method don't start doing magical things. 15:20
They're our primitives.
ruoso it's not magical
jnthn That the magical things get implemented in terms of.
It's more magical than I want a metaclass to be doing.
ruoso it's assuming that it can't modify a public protoobject
ruoso would be happy with a warning 15:21
ash_ well, one more question, to confuse this a bit more, say class A { }; my $a = A.new; augement class A { ... add method ... }; does $a have it?
jnthn Yes.
ash_ and by it i mean the new method
jnthn yes.
:-)
ruoso but in order to use augment, you need to use MONKEY_PATCH
ash_ what about augment class A does Foo {}, does $a get all of Foo?
jnthn MONKEY_TYPING
:-)
ruoso a bit outdated 15:22
ash_ or does that make a new meta instance?
jnthn No, $a gets all of Foo
I made that work only a few days ago. :-)
ash_ is trying to figure out all the things that cause a new meta instance
jnthn For colomon++
ruoso ash_, in order to use augment, you need to add a very ugly notice in your code, that will tell you that you're doing something nasty
jnthn ash_: Mix-ins.
ruoso you need to literally "use MONKEY_TYPING;"
ash_ i know
jnthn Rakudo makes you do that these days too. :-)
rakudo: augment class Int { } 15:23
p6eval rakudo 1795a2: OUTPUT«Can't augment class Int without 'use MONKEY_TYPING'␤current instr.: 'perl6;Perl6;Grammar;add_name' pc 40228 (src/gen/perl6-grammar.pir:364)␤»
ruoso my point is about being implicit vs explicit
having $a.^add_method to modify the class is MONKEY_TYPING
it should: 1) understand you're modifying just this object
or
jnthn ruoso: It is, but I think people can Just Cope with that. 15:24
Using .^ is immediately a big sign that something weird is going on.
ruoso 2) refuse to do it unless "use MONKEY_TYPING" is enabled
or
jnthn We could do (2)
pmurias jnthn: there's a distinction between weird and evil
15:24 IllvilJa left
ash_ 2 seems like a safe assumption 15:24
ruoso is there a metamethod to say "localize my metaclass instance"? 15:25
because that refusal is only valid if you're modifying a public class
but if you're modifying a private metainstance 15:26
that's not monkey_typing
jnthn There's not a meta-method to do that at the moment. 15:27
Could be possible to make one.
ruoso $a.^customize()
jnthn Yeah, that could have other uses too.
I'll ponder it a bit...could work. 15:28
ruoso always remember the prototype-based-oo
jnthn Trouble is we then have to make "is monkey typing allowed" something known at runtime.
At the moment it's purely a prase time concept in Rakudo.
Again, not a big deal...
ruoso well... it's not this feature is the only that requires compile-time info in run-time 15:29
takadonet anyone have example of using complex data structure such as hash of arrays?
ash_ the ability to customize a single object is a nice feature to have, IMO anyway, even if it is weird
ruoso last phrase was kinda unparseable
jnthn, at first, I think we could just forbid calling $a.^add_method before calling $a.^customize 15:30
jnthn Well, maybe...
ruoso one can always do $a.WHAT.^add_method if that's what he wants
jnthn We gotta have a distinction between the initial class creation and later on :-)
ash_ rakudo: my %hash = { a => [1, 2, 3], b => [4, 5, 6] }; say %hash<a>[2];
p6eval rakudo 1795a2: OUTPUT«3␤»
ruoso jnthn, the distinction is if it is defined or not 15:31
jnthn since we add methods in the first place with .^add_method now.
Oh, hmm.
ruoso but always on undefined objects
jnthn Could work too.
yeah, true
ash_ IMO its $a.HOW.add_method($a ...) vs Foo.HOW.add_method(Foo...)
instance vs class, or defined vs undefined objects
ruoso the rule is, you can only call modifying-metamethods in 1) undef objects or 2) customized objects 15:32
ash_, that's not what I meant
ash_, $a.WHAT gets $a's protoobject
takadonet rakudo: my %hash = { a => [1, 2, 3], b => [4, 5, 6] };say %hash<a>
p6eval rakudo 1795a2: OUTPUT«1 2 3␤»
ruoso ash_, so $a.WHAT.^add_method is explicitly modifying $a's metaclass instance
ruoso lunch & 15:33
takadonet rakudo: my %hash = { a => [1, 2, 3], b => [4, 5, 6] };for %hash<a> -> $x { say $x} 15:34
p6eval rakudo 1795a2: OUTPUT«1 2 3␤»
ash_ rakudo: my %hash = { a => [1, 2, 3], b => [4, 5, 6] }; for @(%hash<a>) -> $x { say $x} 15:35
p6eval rakudo 1795a2: OUTPUT«1␤2␤3␤»
ash_ takadonet: it tried to assign the whole array to $x, if you do @() around it though, it will assume its a list and iterate that instead 15:36
takadonet ash_: that was my issue! Thanks Got a few more test working in trans.t now! 15:37
jnthn \o/
15:38 pyrimidine joined
takadonet up to 16 passing out of .. a few more to go 15:38
15:39 pmurias left
ash_ jnthn: i think i am just trying to find all the edge cases of when a meta instance might change, since I am looking to start implementing some of the MOP in my nq-nqp... its either do some of the MOP or try to imitate parrot's object model, so... for now I am just going to work with MOP since its perl 6's model, and nqp is based off of perl 6 15:39
15:41 IllvilJa joined
jnthn Yes, that's a good idea. 15:41
ash_: That's that P6object.pir does fwiw.
Implements the Perl 6 model atop of the Parrot primitives. 15:42
But certainly there's no reason to emulate Parrot.
pyrimidine do we have something akin to AttributeDeclarand implemented yet? or (put another way), if there isn't how hard would it be to get that working?
jnthn We had it in alpha. 15:43
Pretty sure it's not yet put back in master.
ash_ i used it in alpha, at one point
jnthn It shouldn't be too hard.
pyrimidine ok
ash_ lolibloged greaterthaninfinity.com/2010/04/run...or-nq-nqp/
jnthn EDOMAINNAMETOOBIG
;-)
ash_ >∞ is what i always put for short 15:44
moritz_ what exactly is nq-nqp? 15:45
ash_ an independent study i am doing on compilers, my attempt at applying what i am learning by constructing an alternative nqp based on the llvm 15:46
moritz_ cool
sounds a bit like smop in reverse :-)
ash_ hence, not quite nqp :P
dalek kudo: c1b6e23 | jonathan++ | src/Perl6/ (2 files):
Implement signature literals.
kudo: c6c7754 | jonathan++ | src/core/operators.pm:
prefix:<|> on anything other than the things we already define it on should not give an error, but instead give a Capture with just that thing in it; TimToady++.
kudo: 1529fa0 | jonathan++ | src/builtins/Capture.pir:
Capture.Capture should be identity.
kudo: b737dff | jonathan++ | src/core/Signature.pm:
Implement smart-matching against a signature for the Capture and Any cases (and throw exceptions on the two we don't yet implement).
kudo: 38db52b | jonathan++ | src/glue/run.pir:
Merge branch 'master' of github.com:rakudo/rakudo
cognominal jnthn, if I understand well, dispatch is also made on the return type coercion. Am I right? 15:47
jnthn In multi-dispatch?
No.
ash_ i thought return type's weren't involved in MMD
jnthn It isn't (and kinda can't be in Perl 6 - context doesn't work like that).
Time for a walk. :-) bbiab. 15:48
cognominal ok, I just skimmed src/binder/bind.c and wondered what the coerce_to was.
jnthn cognominal: That's to do with sub foo($x as Int) { ... } 15:49
The Int goes in coerce_to
cognominal ok, thx
makes sense.
... to me.
jnthn To me too, some days. ;-) 15:50
jnthn goes for walk
cognominal is amazed as how jonathan can compile S06 to code. 15:51
ash_ i wonder if you could implement the MMD in just parrot... 15:53
cognominal you certainly could but that would probably a bad idea. 15:55
ash_ doesn't parrot have mmd? or does it follow a different set of rules than perl 6's mmd? 15:56
cognominal I quite grok what C< x as Int > can mean in a signature, but I fail to find something like it in S06.
ash_ I think it has a simpler set of rule, but you should ask jonathan 15:57
moritz_ cognominal: S02 mentions 'as'
though only for return type coercions 15:58
cognominal C<as> is mentionned in many places
moritz_ S02:1435 for example 16:00
CokeBot9000 parrot does have mmd. 16:01
moritz_ is it manhattan distance?
CokeBot9000 I believe so, yes. 16:02
ash_ manhattan distance? 16:03
moritz_ en.wikipedia.org/wiki/Taxicab_geometry 16:04
16:04 nihiliad left
moritz_ use.perl.org/~chromatic/journal/37753 has a short explanation 16:05
16:05 nihiliad joined
cognominal uses his ack fu ack --nocolor --nogroup -- '^ .*(.* as .*)' 16:05
but finds nothing relevant
ash_ cognominal: did you check t/spec ? 16:06
moritz_ rakudo: sub foo($a = 1, $b) { say $a }; foo(3)
p6eval rakudo 2464dd: OUTPUT«Not enough positional parameters passed; got 1 but expected between 1 and 2␤current instr.: 'foo' pc 180 (EVAL_1:77)␤»
cognominal ash_ : good idea
16:06 cdarroch joined, cdarroch left, cdarroch joined
moritz_ rakudo: sub foo { @_[0] = "bah" }; my $a = "!"; foo($a); say $a 16:06
p6eval rakudo 2464dd: OUTPUT«!␤»
slavik rakudo: if ("123 500 5" ~~ /[(\d+)\s]+ <?{0 <= $0 <=255}>/) { say $0 } 16:07
p6eval rakudo 2464dd: OUTPUT«No applicable candidates found to dispatch to for 'infix:<<=>'. Available candidates are:␤:(Any $a, Any $b)␤␤current instr.: '_block64' pc 844 (EVAL_1:289)␤»
16:08 jaldhar left 16:09 REPLeffect left
moritz_ rakudo: class A { has $s .= new } 16:09
p6eval rakudo 2464dd: OUTPUT«too few positional arguments: 1 passed, 2 (or more) expected␤current instr.: '!dispatch_.=' pc 440 (src/glue/dispatch.pir:118)␤»
moritz_ rakudo: if ("123 500 5" ~~ /[(\d+)\s]+ <?{0 <= +$0 <=255}>/) { say $0 }
p6eval rakudo 2464dd: OUTPUT«123500␤»
cognominal I suppose jonathan compiles straight form TimToady's mind. 16:10
moritz_ I think it was more explicit in previous versions of the spec
slavik moritz_: I'll compile rakudo one of these days and run it on my local machine in a grammar ;)
moritz_ rakudo: say "yes" if 1 === 1|2 16:11
p6eval rakudo 2464dd: ( no output )
ash_ do junctions work yet? 16:12
moritz_ aye
ash_ rakudo: say "yes" if 1 == 1|2
p6eval rakudo 2464dd: OUTPUT«yes␤»
ash_ neat
moritz_ but not on ===, which is still defined in PIR
16:12 REPLeffect joined
moritz_ rakudo: say 1.WHICH 16:12
p6eval rakudo 2464dd: OUTPUT«1␤»
moritz_ rakudo: say "foo".WHICH 16:13
p6eval rakudo 2464dd: OUTPUT«foo␤»
moritz_ rakudo: say [].WHICH
p6eval rakudo 2464dd: OUTPUT«88573784␤»
ash_ lol, umm...
moritz_ rakudo: say [].WHICH
p6eval rakudo 2464dd: OUTPUT«88571920␤»
ash_ rakudo: say ().WHICH
p6eval rakudo 2464dd: OUTPUT«88583800␤»
ash_ () does it too 16:14
moritz_ sure; all "normal" objects do
cognominal ash_ : about the rakudo binder : use.perl.org/~JonathanWorthington/journal/39772 16:17
16:19 levengli joined, nihiliad left 16:23 nihiliad joined, pmurias joined
levengli anyone home? 16:25
moritz_ yes, but not for long :-)
levengli :)
what's the p5 equivelant of$0?
moritz_ $1, but it's really not the same
afk
levengli wrong question 16:26
ash_ \0 i think?
levengli that's the p6 equivalent of p5's $0
ash_ oh, sorry ignore me
levengli i.e what, if any, variable holds the invoking name of the script
ash_ $?FILE might be right.... but not always, thats the current file, not the file that was called 16:28
would it be in @*ARGS ? 16:29
it might be @*ARGS
snarkyboojum rakudo: say @*ARGS[0]
p6eval rakudo 38db52: OUTPUT«␤»
ash_ no, that didn't work for me locally either 16:30
mberends alpha: say $*PROGRAM_NAME 16:31
p6eval alpha 30e0ed: OUTPUT«/tmp/oFlx6bfjsI␤»
mberends rakudo: say $*PROGRAM_NAME 16:32
p6eval rakudo 38db52: OUTPUT«/tmp/8RKc3hxBCx␤»
levengli :)
mberends++
ash_ perlcabal.org/syn/S28.html ah, i see, mberends++ found it first its in there, look at perl 5 to perl 6 special variable translation
snarkyboojum doh - missed that :) 16:33
was looking at the same spec ;)
16:33 dual left
snarkyboojum rakudo: say @*ARGS.perl; 16:34
p6eval rakudo 38db52: OUTPUT«[]␤» 16:35
snarkyboojum rakudo: say $*PROGRAM_NAME;
p6eval rakudo 38db52: OUTPUT«/tmp/Bu0mYTkmOs␤»
snarkyboojum rakudo: say $*EXECUTABLE_NAME;
16:35 masak joined
p6eval rakudo 38db52: OUTPUT«../p/bin/perl6␤» 16:35
snarkyboojum nice
masak lol hai! o/
snarkyboojum hi masak! \o
masak hey snarky o/
mberends hi masak o/ 16:36
masak mberends!
just the person I needed.
mberends oh.
16:37 pmurias left
jnthn ;-) 16:37
mathw o/ 16:38
jnthn ash_: Rakudo subclasses Parrot's MultiSub PMC to implement the Perl 6 dispatch semantics.
ash_ jnthn: do you want me to submit a bug for the add_method thing?
masak rakudo: say -0; say -"0"
p6eval rakudo 38db52: OUTPUT«0␤-0␤»
masak submits rakudobug
:D
ash_ rakudo: say -+"0"; 16:39
p6eval rakudo 38db52: OUTPUT«-0␤»
masak snarkyboojum: I would be happily hacking away on Yapsi or Tardis right now, if it weren't for this whole Temporal business that got me distracted. I'll be un-distracted in a little while, I hope.
jnthn rakudo: say -0.0; 16:40
p6eval rakudo 38db52: OUTPUT«0␤»
Trashlord sup
snarkyboojum masak: excellent! Temporal looks very important :)
masak thinks so
jnthn rakudo: say :().WHAT
p6eval rakudo 38db52: OUTPUT«Signature()␤»
masak Trashlord: \o
jnthn rakudo: my %h = a => 42; given %h { when :(Int :$a) { say "lol int" }when :(Str :$a) { say "lol string" } } 16:41
p6eval rakudo 38db52: OUTPUT«lol int␤»
jnthn rakudo: my %h = a => '42'; given %h { when :(Int :$a) { say "lol int" }when :(Str :$a) { say "lol string" } }
p6eval rakudo 38db52: OUTPUT«lol string␤» 16:42
Trashlord masak: hey man
jnthn You can now smart-match against signatures, in order to dig into data structures to see what's in them. :-)
ash_ jnthn: ooooo very neat 16:43
:( ) makes a signature?
mathw jnthn: that is super cool
jnthn++
jnthn ash_: yeah, signature literals. 16:44
And then smart-matching as per S03. :-)
cognominal yea, I like that feature that is very like pattern matching in Haskell. jnthn++ 16:45
With Perl 6, we got the coolness of Haskell without the dreadful monads :)
jnthn Wonder if we have any tests for it... 16:46
pugssvn r30315 | lwall++ | [S02] clarify that object identity from WHICH may not be a mundane value type 16:47
jnthn std: my $x where { $x > 42 }; 16:50
p6eval std 30314: OUTPUT«===SORRY!===␤Two terms in a row at /tmp/JVidAiOiZE line 1:␤------> my $x ⏏where { $x > 42 };␤ expecting any of:␤ bracketed infix␤ infix or meta-infix␤ statement modifier loop␤ trait␤FAILED 00:01 109m␤»
jnthn alpha: my $x where { $x > 42 };
p6eval alpha 30e0ed: ( no output )
TimToady hmm 16:51
std: my (my $x where { $x > 42 });
p6eval std 30314: OUTPUT«===SORRY!===␤In parameter declaration, typename 'my' must be predeclared (or marked as declarative with :: prefix) at /tmp/l3Pnty0pbg line 1:␤------> my (my⏏ $x where { $x > 42 });␤FAILED 00:01 108m␤»
TimToady std: my ($x where { $x > 42 });
p6eval std 30314: OUTPUT«ok 00:01 108m␤»
TimToady STD currently requires parens to get full parameter syntax 16:52
jnthn aye
WE do in Rakudo master also. 16:53
alpha was sloppier though.
masak std: class A { has ($.b where { $!b > 42 }) } 16:54
p6eval std 30314: OUTPUT«ok 00:01 109m␤»
masak \o/
ash_ rakudo: class A { has ($.b where { $!b > 42 }) } 16:55
p6eval rakudo 38db52: ( no output )
masak std: 00
p6eval std 30314: OUTPUT«Potential difficulties:␤ Leading 0 does not indicate octal in Perl 6 at /tmp/ML012Src1J line 1:␤------> 00⏏<EOL>␤ok 00:01 106m␤»
16:55 M_o_C joined
ash_ rakudo: class A { has ($.b where { $!b > 42 }) }; my $a = A.new(b => 44); A.new(b => 21) 16:56
p6eval rakudo 38db52: ( no output )
masak TimToady: jnthn and I were talking about whether numification should employ the Perl 6 grammar or not.
TimToady well, yes and no :) 16:57
masak TimToady: if it turns out it will, I think it makes less sense to warn about things like '00' in a string numification context.
16:57 ruoso left, frettled sets mode: +o masak
masak TimToady: also, maybe it shouldn't do all the tricks that Perl 6 does, recognizing all manner of numbers. 16:57
TimToady smells arbitrary restrictions 16:58
16:58 levengli left
frettled Are they Julia-like? 16:58
TimToady more like Mandelbrot, I'm afraid 16:59
frettled kindof fuzzy, then
but they would be, in either case
TimToady I think there should be self-similarity between the current language's idea of numbers and the default number conversion routine 17:00
but it doesn't have to be identical
jnthn
.oO( mmm...юлия-like )
TimToady for instance, numeric conversion has to deal with trimming whitespace and extra +/- in spots
frettled I wonder how this could be made suitably dwimmy. 17:01
TimToady dwimminess does tend to get lost in the vagaries of the human condition 17:02
frettled which is: lazy
ash_ can you lazily determine dwim? 17:03
17:03 gbacon left
frettled I don't see how that could be eagerly determined. 17:04
pugssvn r30316 | jnthn++ | [t/spec] Add some basic tests for smart-matching against a signature. 17:07
dalek kudo: 08e1886 | jonathan++ | t/spectest.data:
Add S03-smartmatch/capture-signature.t to spectest.data.
17:13
pugssvn r30317 | lwall++ | [S02] rename ObjID to ObjAt to reduce possibility of collision with user types 17:16
r30318 | lwall++ | [reduce.t] fix parsefail 17:17
ash_ does infix:<eqv> check the meta instance? 17:18
masak rakudo: class A { class {} } 17:19
p6eval rakudo 38db52: OUTPUT«Null PMC access in invoke()␤current instr.: 'perl6;A;' pc -1 ((unknown file):-1)␤»
masak jnthn: ^
masak submits rakudobug
I can work around it for the mo.
jnthn std: my $foo = 'foo'; say $foo R~= 'foo'; 17:20
p6eval std 30315: OUTPUT«ok 00:01 109m␤»
jnthn rakudo: my $foo = 'foo'; say $foo R~= 'foo';
p6eval rakudo 38db52: OUTPUT«Cannot assign to readonly value␤current instr.: '&die' pc 17293 (src/builtins/Junction.pir:404)␤»
ash_ what should R~= doe? reverse the assignment semantics? so $a R~= $b becomes $b ~= $a ? 17:21
jnthn ash_: No, it's like 'foo' ~= $foo :-)
Thus the error. 17:22
I guess you'd have to write [R~]=
Though Rakudo doesn't support that just yet
arnsholt Hmm. Is there a way to find out when I got access to a GitHub repository? 17:30
CokeBot9000 arnsholt: If it happens to be in your feed, mebbe at something like: 17:33
github.com/coke
er, github.com/coke.atom
17:34 gbacon joined
arnsholt Yeah, it isn't my feed, unfortunately 17:34
jnthn -> noms 17:35
masak indian food & 17:36
17:36 masak left
ash_ my Int $a uses Int as the type constraint, is there a there a way to use a non class as a type constraint? or is that what "where" does? 17:36
dalek kudo: 3611f1b | masak++ | src/core/Temporal.pm:
[Temporal.pm] initial commit
17:39 gbacon left, colomon joined 17:40 ash_ left
colomon Temporal.pm \o/ 17:40
18:00 envi^home left 18:05 hercynium left 18:06 ShaneC joined 18:07 ShaneC left 18:10 rgrau joined 18:11 hanekomu left 18:13 kensanata joined 18:14 dual joined 18:21 pyrimidine left
pugssvn r30319 | lwall++ | [S05] rewrite misleading description of "thunk" 18:30
CokeBot9000 Is it too late at this point to give pugs a ^/trunk ? 18:31
18:39 ash_ joined, gbacon joined
TimToady rakudo: multi prefix:<-> (Pair $p) { ('-' ~ $p.key) => $p.value }; say (-foo => 42).perl 18:42
p6eval rakudo 3611f1: OUTPUT«"-foo" => 42␤»
TimToady sorear: ^^^
18:45 espadrine left
TimToady sorear: re Q:anything, I don't know if it would generalize that far, would have to think about it more. 18:50
ash_ is the default constraint on scalar containers Mu or Any? 18:54
TimToady it probably depends on how much we can abuse the mixin mechanism that Q is using for things that might not want mixing in.
Any
if you want your container to hold junctions, you have to say so
18:54 eternaleye left
TimToady rakudo: my $x = 1|2; 18:55
p6eval rakudo 3611f1: ( no output )
TimToady rakudo: my $x = 1|2; say $x;
p6eval rakudo 3611f1: OUTPUT«any(1, 2)␤»
TimToady hmm, I suspect that should fail
rakudo: my Any $x = 1|2; say $x;
p6eval rakudo 3611f1: OUTPUT«Type check failed for assignment␤current instr.: '&die' pc 17293 (src/builtins/Junction.pir:404)␤»
TimToady did someone back out that change? 18:56
rakudo: my $x; say $x.WHAT 18:57
p6eval rakudo 3611f1: OUTPUT«Any()␤» 18:58
18:58 cdarroch left
TimToady hmm 18:58
ash_ it seems to assign it to Any, but also seems to set the default constraint to Mu
[particle] is that alpha or ng?
ash_ hence, why i asked
TimToady default constraint should be Any, methinks
just like parameters 18:59
18:59 cdarroch joined, cdarroch left, cdarroch joined
TimToady maybe it was slowing things down too much :( 18:59
19:00 Woodi joined
TimToady but maybe that just means you should be using := instead, if you want speed 19:00
colomon seems more likely to be a bug which has cropped up? at least, I don't remember ever seeing any discussion on the change.... 19:01
TimToady likely
colomon wonders if there are any tests for this... 19:02
19:04 cdarroch left
TimToady doesn't look like it, offhand 19:06
there: eval_dies_ok 'my $a = (1 | 2 ^ 3)', '| and ^ may not associate';
*there's
but that's testing something else
otoh, if it allowed association it would die for the wrong reason 19:07
which is not good
19:08 hanekomu joined
pugssvn r30320 | mberends++ | [S32-temporal/Temporal.t] revise first 6 tests for new simplified spec 19:08
r30321 | lwall++ | [precedence.t] add a few needful Mu declarations to allow assignment of junction 19:10
mberends afk about an hour, will resume Temporal work when back 19:16
TimToady mberends++
dalek kudo: c41cf3f | (Martin Berends)++ | src/core/Temporal.pm:
[core/Temporal.pm] bring day-of-week, month-name and day-name from alpha
19:18 bkeeler_ joined 19:22 bkeeler_ is now known as keelerb
keelerb Hallo folks 19:22
19:24 keelerb is now known as bkeeler_ 19:30 astrojp left 19:33 cdarroch joined, cdarroch left, cdarroch joined 19:37 kensanata left 19:38 cotto_work left, cotto_work joined
TimToady rakudo: sub aaa (%h is rw) { %h = <a b c> Z 1,2,3 }; my %h = <x y> Z 5,4; aaa(%h); %h.perl.say 19:39
p6eval rakudo 3611f1: OUTPUT«{"a" => 1, "b" => 2, "c" => 3}␤»
TimToady that looks correct to me
bkeeler_ Me too
TimToady rakudo: sub aaa (%x is rw) { %x = <a b c> Z 1,2,3 }; my %h = <x y> Z 5,4; aaa(%h); %h.perl.say
p6eval rakudo 3611f1: OUTPUT«{"b" => 2, "c" => 3, "a" => 1}␤»
TimToady I don't know why finanalyst++ and moritz_++ thought it was wrong... 19:41
19:42 kensanata joined, eternaleye joined
moritz_ hm, what did I think was wrong? 19:45
there was an example that used sub a(%x is rw) { ... } my %x; $x = ... } 19:46
TimToady irclog.perlgeek.de/perl6/2010-04-04#i_2193258
moritz_ rakudo: sub aaa (%h is rw) { %h = <a b c> Z 1,2,3 }; my %h = <x y> Z 5,4; aaa(%h); %h.perl.say
p6eval rakudo c41cf3: OUTPUT«{"b" => 2, "c" => 3, "a" => 1}␤»
TimToady that is correct
moritz_ why? I thought the 'my' had no effect when it's in the same scope as an existing variable 19:47
TimToady it's not in the same scope
a sig belongs to the inner scope
it's the one exception to {...} delimitation of scopes
std: -> $x {...}; $x 19:48
p6eval std 30321: OUTPUT«===SORRY!===␤Variable $x is not predeclared at /tmp/WJFTR899W1 line 1:␤------> -> $x {...}; $x⏏<EOL>␤ expecting any of:␤ POST␤ postfix␤ postfix_prefix_meta_operator␤FAILED 00:01 109m␤»
TimToady std: sub aaa (%h is rw) { my %h } # this would be redundant 19:49
p6eval std 30321: OUTPUT«Potential difficulties:␤ Useless redeclaration of variable %h (see line 1) at /tmp/O61Zr3RRXp line 1:␤------> sub aaa (%h is rw) { my %h⏏ } # this would be redundant␤ok 00:01 108m␤»
TimToady it's no biggie, I'm just trying to understand the backlog :) 19:51
moritz_ std: sub aaa (%h is rw) { %h = a => 1; my %h; %h = a => 3 } 19:53
p6eval std 30321: OUTPUT«Potential difficulties:␤ Useless redeclaration of variable %h (see line 1) at /tmp/5GST7Q0tQ9 line 1:␤------> sub aaa (%h is rw) { %h = a => 1; my %h⏏; %h = a => 3 }␤ok 00:01 108m␤»
19:53 molaf left
moritz_ I don't see how the example was any different than that 19:53
TimToady rakudo: sub aaa (%h is rw) { %h = <a b c> Z 1,2,3 }; my %h = <x y> Z 5,4; aaa(%h); %h.perl.say 19:54
p6eval rakudo c41cf3: OUTPUT«{"a" => 1, "b" => 2, "c" => 3}␤»
TimToady the my is outside the block here
a signature declares lexicals inside its block, not outside 19:55
the namespaces are independent, so it's as if the parameter was a different name: 19:56
rakudo: sub aaa (%x is rw) { %x = <a b c> Z 1,2,3 }; my %h = <x y> Z 5,4; aaa(%h); %h.perl.say
p6eval rakudo c41cf3: OUTPUT«{"a" => 1, "b" => 2, "c" => 3}␤»
moritz_ ah 19:58
I somehow thought the my was *inside* the sub
mental parsing fail on my side
TimToady that would explain it. :)
at least we have curlies; imagine trying to talk to a python bot using indentation... :) 20:01
moritz_ :-)
frettled haha
TimToady rakudo: say [1,2] X~ <a b> # /me suspects a bug 20:03
p6eval rakudo c41cf3: OUTPUT«1a1b2a2b␤»
TimToady yes, a bug
[1,2] should not flatten in list context
moritz_ rakudo: .say for 1, [2, 3], 4 20:04
p6eval rakudo c41cf3: OUTPUT«1␤23␤4␤»
moritz_ and I know why... the signature of X and X~ says Iterable
TimToady I think X~ is taking liberties
20:04 rajeshsr joined
moritz_ reports 20:04
rakudo: say 1 X~ 2 X~ <a b> 20:05
p6eval rakudo c41cf3: OUTPUT«No applicable candidates found to dispatch to for 'crosswith'. Available candidates are:␤:(&op, Iterable $a-iterable, Iterable $b-iterable)␤:(&op, Any $a, Any $b)␤␤current instr.: 'perl6;Code;assuming_helper' pc 13140 (src/builtins/Str.pir:38)␤»
TimToady snarkyboojum++ gets the karma for running across it earlier
moritz_ and I assume that should work too? :-)
TimToady yep 20:06
moritz_ reports
20:06 rajeshsr left, molaf joined
colomon I don't think we have the tools to properly specify the signature for crosswith / Xop yet. 20:06
TimToady list infixes are supposed to take lists, and should be list associative as well
20:06 meppl left
TimToady could well be 20:06
moritz_ colomon: slurpy paramter of Iterables? 20:07
colomon I'd love to be wrong about that, mind you.
TimToady the parser probably needs to be handing off parcels (or degenerate items)
moritz_ or maybe with a signature of (\$x), and unpacking them manually... 20:08
colomon Isn't the proper signature something like **@a
TimToady rakudo doesn't really do slices yet
and that's what list infixes really are
moritz_ hm, right
20:08 buubot left
TimToady much like @a[1; 2; <3 4>] 20:08
or crosswith(&[~]; 1; 2; <a b>), give or take a semicolon 20:10
ash_ still is a bit fuzzy on the whole slice vs list thing
colomon also, of course, Rakudo definitely doesn't handle passing Positional types that are iterators properly.
moritz_ news.perlfoundation.org/2010/04/gra...-perl.html 20:13
rakudo: sub foo(:$w=4){say $w};foo('w'=>3);foo(w=>3);
p6eval rakudo c41cf3: OUTPUT«Too many positional parameters passed; got 1 but expected 0␤current instr.: 'foo' pc 209 (EVAL_1:81)␤»
TimToady anyway, when I see something like [1,2] X~ 3,4 it looks like @a[ [1,2]; 3,4 ] to me, which looks wrongish 20:14
ash_ moritz_++ neat article, i'll have to read that in depth
20:15 buubot joined, gavgpv joined 20:16 gavgpv left
colomon TimToady: what do you think [1,2] X~ 3,4 should output? 20:16
or rather, I was more worried about [1, 2] X~ <a b>
TimToady heh, add another implementor to your compiler and you'll get another pass in your compiler :)
moritz_ '1 23', '1 24' I'd guess 20:17
[1,2] is one item
TimToady correct
moritz_ which stringifies to '1 2'
so it's the same as '1 2' X~ 3, 4
TimToady rakudo: say ([1,2],) X~ <a b> 20:18
p6eval rakudo c41cf3: OUTPUT«1 2a1 2b␤»
TimToady the parser should probably be forcing those arguments to be parcels
pugssvn r30322 | moritz++ | [t/spec] test that quoted pair keys account for positional arguments, and calling a function the only excpect named parameters dies 20:19
TimToady since a slice is a list of parcels
colomon rakudo: my @a = [1, 2]; say +@a
arnsholt In nqp-rx's operator precedence parser, are the precedence levels strings or ints?
p6eval rakudo c41cf3: OUTPUT«1␤»
moritz_ (we probably had tests for that before, I but I couldn't find them in the obvious place)
arnsholt (Or rather, can I make them ints?) 20:20
TimToady or the binding for list infixes and other slices should be enforcing the parcel view on non-parcel lists
that's probably the better direction 20:21
moritz_ closes the 6th-oldest bug in the perl6 RT queue
TimToady needs to define how positional parameters interact with slice parameters though, and whether an extra ';' is needed 20:22
that is, should it be crosswith($op, @a; @b; @c) or crosswith($op; @a; @b; @c)
CokeBot9000 moritz_: do you typically cc the list on ticket mods? 20:23
moritz_ CokeBot9000: I typically use "reply", which does that, afaict
TimToady or something else again, like crosswith($op, (@a; @b; @c))
moritz_ rakudo: my $x = 1..Inf; say "alive"
p6eval rakudo c41cf3: OUTPUT«alive␤» 20:24
TimToady rakudo: my @x = 1..Inf; say "dead" 20:25
p6eval rakudo c41cf3: ( no output )
20:25 M_o_C left 20:26 molaf left
TimToady I still think arrays and iterators should basically be the same data structure, just with different api policy 20:26
moritz_ rakudo: class A { has $.a; method x(Str $x) {}; method all() { $!a } }
p6eval rakudo c41cf3: ( no output )
TimToady they both consist of a known part and an unknown part
20:27 kensanata left
colomon TimToady: interesting, I was just thinking that we should revive "List" as a wrapper around Iterator with (in your terminology there, if I understand it) no known part. 20:28
TimToady well, no known part till someone "unshifts" to it
the iterator api basically boils down to shift and unshift
m6locks rakudo: role A { our method !aa() { return 42; } }; class B does A { method foo() { self!aa(); } }; my $bb = B.new; say $bb.foo(); 20:29
p6eval rakudo c41cf3: OUTPUT«42␤»
colomon TimToady: my idea was that List very definitely would NOT remember earlier values from its iterator.
If you want that, you want a Seq. 20:30
TimToady and a List defaults to .get (read .shift) in list context rather than the non-destructive interpolation that an array does
colomon (Or at least, I don't know how a Seq is different from an Iterator that does have memory.
ash_ so... how private are $! variables?
rakudo: class A { has $!a }; my $a = A.new(a => 42); my $method = method { return $!a }; $a.$method();
p6eval rakudo c41cf3: ( no output ) 20:31
ash_ rakudo: class A { has $!a }; my $a = A.new(a => 42); my $method = method { return $!a }; $a.$method().say;
TimToady yes, a List forgets values *just* *like* *shift* does
p6eval rakudo c41cf3: OUTPUT«42␤»
ash_ should that be allowed?
20:31 Trashlord left
moritz_ ash_: rakudo doesn't really enforce privateness of attributes in any case 20:31
colomon TimToady: yes.
moritz_ ash_: but I don't think it should be allowed 20:32
ash_ well, in the ideal situation, is that wrong?
got ya
some languages have different ideas of 'private', but most languages with reflection end up having all their variables public, eventually
moritz_ rakudo: my $x = 0; $x++ for [,] 1, 2, 3; say $x 20:33
p6eval rakudo c41cf3: OUTPUT«1␤»
TimToady the compiler should have no idea what $!a means outside the class's block, I think
moritz_ rakudo: say +(1..Inf) 20:34
p6eval rakudo c41cf3: ( no output )
ash_ so, a bare "my $a = method { $!a }" would be a compiler error?
by bare i mean, outside a class definition 20:35
CokeBot9000 moritz_: rt.perl.org/rt3/Ticket/Display.html?id=65864 seems to no longer blow up.
TimToady outside of anyplace that doesn't define $!a
including inside a different class definition
CokeBot9000 rakudo: my (%h?)
p6eval rakudo c41cf3: ( no output )
moritz_ std: my (%h?)
p6eval std 30322: OUTPUT«ok 00:01 109m␤»
TimToady rakudo: say [,](1,2,3).WHAT
moritz_ CokeBot9000: thanks
p6eval rakudo c41cf3: OUTPUT«␤» 20:36
CokeBot9000 rakudo: sub foo($bar:) {};
p6eval rakudo c41cf3: ( no output )
moritz_ rakudo: my $x = [,] 1, 2, 3; say $x.WHAT
p6eval rakudo c41cf3: OUTPUT«Seq()␤»
TimToady seems like that would be a Parcel
colomon errr... that's interesting.
CokeBot9000 rakudo: sub postcircumfix:<[ ]>(Str $s: @i) { my $res =
""; for @i { $res ~= substr($s, $_, 1) }; $res }; say "OH HAI
p6eval rakudo c41cf3: OUTPUT«Unable to parse blockoid, couldn't find final '}' at line 11␤current instr.: 'perl6;Regex;Cursor;FAILGOAL' pc 1664 (ext/nqp-rx/src/stage0/Regex-s0.pir:907)␤»
CokeBot9000 curse you, cut and paste.
rakudo: sub postcircumfix:<[ ]>(Str $s: @i) { my $res = ""; for @i { $res ~= substr($s, $_, 1) }; $res }; say "OH HAI WORLD"[7,0,7,2,9,4,-1] 20:37
p6eval rakudo c41cf3: OUTPUT«Negative indexes to .[] not allowed in Perl 6␤current instr.: 'perl6;Positional[::T];postcircumfix:<[ ]>' pc 10553 (src/metamodel/GrammarHOW.pir:44)␤»
colomon rakudo: my $x = infix:<.>(1, 2); say $x.WHAT
p6eval rakudo c41cf3: OUTPUT«Could not find sub &infix:<.>␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
CokeBot9000 65904 looks better, too.
colomon rakudo: my $x = infix:<,>(1, 2); say $x.WHAT
p6eval rakudo c41cf3: OUTPUT«Seq()␤»
CokeBot9000 std: sub postcircumfix:<[ ]>(Str $s: @i) { my $res = ""; for @i { $res ~= substr($s, $_, 1) }; $res }; say "OH HAI WORLD"[7,0,7,2,9,4,-1]
p6eval std 30322: OUTPUT«ok 00:02 114m␤»
pugssvn r30323 | moritz++ | [t/spec] my (%h?)
TimToady rakudo: sub postcircumfix:<[ ]>(Str $s: @i) { my $res = ""; for @i { $res ~= substr($s, $_, 1) }; $res }; say "OH HAI WORLD"[7,0,7,2,9,4,*-1] 20:38
p6eval rakudo c41cf3: OUTPUT«Method 'Int' not found for invocant of class 'Block'␤current instr.: 'perl6;Mu;' pc -1 ((unknown file):-1)␤»
TimToady substr doesn't understand *-1 yet
moritz_ CokeBot9000: yes, I've taken RT #65904 which means it waits for spectests
CokeBot9000 hokay.
CokeBot9000 will double check that next dtime, danke.
20:38 Trashlord joined
CokeBot9000 s/dtime/time/ 20:38
20:39 Trashlord is now known as Guest83313
TimToady rakudo: say substr("XYZ", *-1, 1) 20:39
p6eval rakudo c41cf3: OUTPUT«Method 'Num' not found for invocant of class 'Block'␤current instr.: 'perl6;Mu;' pc -1 ((unknown file):-1)␤»
TimToady rakudo: say substr("XYZ", -1, 1)
p6eval rakudo c41cf3: OUTPUT«Z␤»
TimToady how...quaint... 20:40
colomon TimToady: I take it that is supposed to work? :)
oh, wait.
*-1 syntax is supposed to replace -1 in substr?
TimToady yes
colomon I think we have a badly broken substr.t test file, then.
TimToady could well be a broken spec too 20:41
colomon I don't see any sign of *-1 in the substr spec.
but then, there's no sign of -1 there either, I think.
frettled Spectest is broken, like the first specte-e-e-est. 20:42
colomon lots of references to StrPos, is that defined somewhere?
colomon has just been broken by frettled++
TimToady any place where we used to have magical negative semantics should probably switch to *-1 if possible
splice as well
CokeBot9000 moritz_: one liner to get get git revision of rakudo i'm working with? 20:43
(the short version) 20:44
ah. git show --abbrev-commit. whee.
TimToady it's a smell in Perl 5 that index can return a non-match that turns into a valid substr offset :(
CokeBot9000 moritz_: reply sends an email to the requestor by default, but not to the list. 20:45
colomon TimToady: I've added substr and splice to my personal to-do list. Pretty sure it will be a while before I get to them, though. 20:47
Might should add them to the Rakudo * todo list as well?
Seems like a smallish change that would be good to have in place before the hypothetical masses start using Perl 6.... 20:48
TimToady rakudo: index("foo","bar"); say 'alive'
p6eval rakudo c41cf3: OUTPUT«alive␤»
TimToady rakudo: my $x = "XYZ"; say substr($x,index("BLECH",$x),1)
p6eval rakudo c41cf3: OUTPUT«Substring 'XYZ' not found in 'BLECH'␤current instr.: 'perl6;Perl6Exception;throw' pc 14818 (src/builtins/Seq.pir:41)␤»
TimToady I guess that's right... 20:49
though perhaps LTA in explaining what happened 20:50
throwing an unthrown exception should really give more than one line number, potentially 20:51
the place where the Failure was used as a value could be completely elsewhere from where it was generated 20:52
and the throw should include something like "Failure was used as a value at foo line 42" plus the message from the original problem. 20:53
21:01 masak joined
masak Greetings gentlemen. 21:01
TimToady what about me? today I'm an irascible grouch. :)
masak no greetings for you! 21:02
:)
CokeBot9000 TimToady: ... today!?
TimToady mutters under his breath...
moritz_ masak: what about our gentleladies? :-)
and butterflies! don't forget the butterflies! 21:03
TimToady they are welcome on my lawn.
butterflies too...
masak moritz_: it's a line from an internet meme. in reality, I greet gentle-X for all possible values of X.
CokeBot9000 scurries away.
. o O (I am, of course, merely being a pain.) 21:04
masak CokeBot9000: it does not logically follow that I don't greet you, though :) 21:05
TimToady if he is merely being a pain, it follows that he can't be anything else
masak no, that's 'being merely a pain' :) 21:06
CokeBot9000 I am being little else today, that is true.
masak 'merely being a pain' just means that that's all he's doing at the moment.
TimToady thinks about whether that falls into the category of "gentle" 21:07
I guess he could be a gentlepain
sjohnson afternoon perl6 hackers
masak sjohnson: \o
TimToady o\ 21:08
colomon o/
masak TimToady: "gentlepain" sounds like a euphemism worthy of the Perl 6 community :)
sjohnson ( `ー´) 21:09
moritz_ and GITA is Gentlepain In The ...
CokeBot9000 GentlePain Coke, that's me.
21:10 Logo joined
TimToady not to be confused with GentlePane, which is the glass around the Coke 21:10
that was almost funny, so you should almost laugh.
masak 21:11
ash_ roflcopter?
masak, you make me sad i only know 1 language, (for communicating) 21:12
moritz_ we're down to 603 open tickets
masak ash_: don't be sad! I'm sure some language community will welcome you with open arms.
moritz_ time for some sleep
masak ash_: and claiming that I 'know' Mandarin feels like a wild exaggeration. :) 21:13
I know how to switch input modes in Emacs :P
ash_ thats probably as valid as me saying i know english
i am trying to convince my friends i don't actually know english, i am just really good at pretending i do, just like i know perl, until i dont, then i don't, otherwise, yes 21:14
masak :)
21:16 meppl joined, REPLeffect left
CokeBot9000 TimToady: rt.perl.org/rt3/Ticket/Display.html?id=60780 - I would imagine that on the last loop through, a would get 5, and b would get whatever undef is these days. 21:17
TimToady no, it just fails to bind, unless you declare the second parameter as optional 21:18
ash_ can you label your loops in perl 6? so if you have " while 1 { while 2 { last "outer?" ; } } 21:19
"
or something
CokeBot9000 (fails to bind) - just on the last iteration, yes?
masak ash_: yes. see S04. 21:20
TimToady rakudo: FOO: for 1..10 { say $_; last FOO when 5 }
p6eval rakudo c41cf3: OUTPUT«Confused at line 11, near "FOO: for 1"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
masak or see TimToady :)
sjohnson rakudo: say " happiness ".rtrim;
p6eval rakudo c41cf3: OUTPUT«Method 'rtrim' not found for invocant of class 'Perl6Str'␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
masak Rakudo doesn't do labels yet.
TimToady yes, just the last iteration
masak sjohnson: there's no rtrim. just trim. 21:21
TimToady for and map will eventually just be partial rebinding of the signature to a capture cursor or some such
rakdudo say " happiness ".trim-trailing
sjohnson masak: oic. any idea if ltrim / rtrim will ever become part of perl 6 whitespace trimming methods?
TimToady rakudo: say " happiness ".trim-trailing 21:22
p6eval rakudo c41cf3: OUTPUT« happiness␤»
masak ooh!
TimToady ltrim and rtrim are ambiguous in right-to-left languages
sjohnson thanks
colomon rakudo: say " happiness ".trim-trailing
p6eval rakudo c41cf3: OUTPUT« happiness␤»
masak (ssenerawa ltr)++
colomon rakudo: say " happiness ".trim-leading 21:23
p6eval rakudo c41cf3: OUTPUT«happiness ␤»
masak when did this happen? I completely missed it.
it's much better than anything p6l ever proposed :)
sjohnson probably was made to prevent me from ranting / whining on this chan :]
colomon in the early days of ng, I think.
TimToady it's been there for a month or so
masak huh.
sjohnson perl 6: surprising devs and users since 2000 21:24
CokeBot9000 loads up another coffee mug.
sjohnson <-- happy
colomon Huh, blame shows that's been in there a month, but I sure don't remember it being that recent. 21:25
TimToady mind you, it looks like someone implemented it without speccing it
21:25 ignacio_ left
masak :) 21:25
colomon
.oO(whistles quietly to himself, innocently...)
masak how rogue of someone.
CokeBot9000 sjohnson should totally have to spec it.
masak +1
CokeBot9000 runs away. 21:26
colomon There's also a comment to the effect that better names for the methods would be nice. :)
masak I like the names.
they huffman about right, too.
TimToady it's just about the smallest bikeshed in the world 21:27
masak 'the smallest bikeshed in the world' would be a good name for a rock band.
TimToady it sorta violates the notion that built-ins should be short enough not to need - or _ or ::
and the notion that those devices are for user-defined stuff 21:28
masak hm, yes.
TimToady that's my main qualm with the current names
[particle] use feature <:trim-ends>; 21:29
masak leadtrim, lagtrim :)
or leadtrim, trailtrim, I guess...
TimToady tr and im
[particle] trimhead trimtail
masak TimToady: ewww!
[particle]: no, too listy.
[particle] in rtl languages that's mi and rt
masak o.O 21:30
[particle] :)
masak [particle]: you hurt my brain :)
ash_ " foo".tl; #=> "foo"; "foo ".tt; #=> "foo" 21:37
masak "(You can also think of a thunk as a closure that uses the
+current lexical scope parasitically.)" TimToady++, an description of 'thunk' that I actually think I understand
ash_ where tl is short for trim-leading and tt is short for trim-trailing
or not
masak too short... 21:38
yeah, got that part :)
but .trim is the common one and has four characters. 21:39
it feels wrong to give the two less common ones fewer characters.
cognominal rakudo : my @t; for < a b > { @t.push( sub { $OUTER::_ } ) }; say $_() for @t 21:41
rakudo: my @t; for < a b > { @t.push( sub { $OUTER::_ } ) }; say $_() for @t
p6eval rakudo c41cf3: OUTPUT«Null PMC access in type()␤current instr.: '_block97' pc 692 (EVAL_1:282)␤»
masak submits rakudobug
rakudo: for 1,2 { $OUTER::_ }
p6eval rakudo c41cf3: ( no output ) 21:42
masak hm.
rakudo: for 1,2 { sub { $OUTER::_ } }
p6eval rakudo c41cf3: ( no output )
masak rakudo: my $a; for 1,2 { $a = sub { $OUTER::_ } }; say $a()
p6eval rakudo c41cf3: OUTPUT«Null PMC access in type()␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
masak there we go. 21:43
cognominal++
cognominal masak: I am trying to adapt Web/lib/Tags.pm
masak rakudo: my $a; for 1,2 { $a = sub { say $OUTER::_ }; $a() }
cognominal: nice!
p6eval rakudo c41cf3: OUTPUT«Null PMC access in type()␤current instr.: '_block64' pc 504 (EVAL_1:208)␤»
cognominal this should generate routines for tag names and export them
masak cognominal++
rakudo: (sub { say $OUTER::_ }).() 21:44
p6eval rakudo c41cf3: OUTPUT«Null PMC access in type()␤current instr.: '_block46' pc 300 (EVAL_1:127)␤»
cognominal so this test was a way to generate a routine.
colomon that reminds me.
masak rakudo: { say $OUTER::_ }
p6eval rakudo c41cf3: OUTPUT«Null PMC access in type()␤current instr.: '_block45' pc 282 (EVAL_1:124)␤»
masak can haz a golfed version
colomon rakudo: role Animal { method speak() { say "Blah"; } }; role Canine does Animal { method speak() { say "Howl"; }}; 21:45
p6eval rakudo c41cf3: ( no output )
colomon rakudo: role Animal { method speak() { say "Blah"; } }; role Canine does Animal { method speak() { say "Howl"; }}; class Dog does Canine { }
p6eval rakudo c41cf3: ( no output )
cognominal I would like to say something like : my @t; for < a textarea > { @t.push( sub is :named($OUTER::_) { "<$OUTER::_>..." } ) }; say $_() for @t 21:46
colomon rakudo: role Animal { method speak() { say "Blah"; } }; role Canine does Animal { method speak() { say "Howl"; }}; class Dog does Canine { }; Dog.new.speak
p6eval rakudo c41cf3: OUTPUT«Could not find sub &say␤current instr.: 'perl6;Canine[];speak' pc 972 (EVAL_1:377)␤»
colomon :\ 21:47
masak colomon: that seems wrong.
cognominal masak, I don't think define a way to name an anonymous routine.
*Perl defines
masak cognominal: in a parametric way? hm, use &eval?
cognominal I hate eval 21:48
masak cognominal: that's your problem :)
it's a solution in this case.
ash_ cognominal: is that perl 5 or 6? 21:49
colomon masak: my code or Rakudo's response?
cognominal not a clean one because ones parses as many times as there are tags to define.
masak ash_: it's Web.pm, so Perl 6.
colomon: Rakudo's not finding &say.
colomon: perhaps a result of jnthn's refactors today.
cognominal: unless you put together all the strings and eval at the end. 21:50
cognominal rakudo: BEGIN { say "toto" } # masak you mean that?
p6eval rakudo c41cf3: OUTPUT«Could not find sub &say␤current instr.: '_block11' pc 0 (EVAL_1:9)␤»
masak that seems wrong too.
but perhaps a bit more expected, given that I know that the setting is loaded at CHECK time :P 21:51
&say in methods in roles, however, should work fine.
cognominal anyway I can do with eval. Right now I want Web.pm to run not to be elagant. Masak I will keep you posted
21:52 Su-Shee left
masak cognominal: excellent. 21:52
colomon rakudo: role Animal { method speak() { say "Blah"; } }; class Dog does Animal { }; Dog.new.speak
p6eval rakudo c41cf3: OUTPUT«Could not find sub &say␤current instr.: 'perl6;Animal[];speak' pc 575 (EVAL_1:222)␤»
masak I also would prefer it running rather than elegant.
colomon masak: I was actually trying to duplicate the bug I got working on Numeric / Real a few days ago.
masak rakudo: class Dos { method speak() { say "Blah"; } }; Dog.new.speak 21:53
colomon I seem to have found an entirely different bug in the process.
p6eval rakudo c41cf3: OUTPUT«Could not find sub &Dog␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
masak rakudo: class Dog { method speak() { say "Blah"; } }; Dog.new.speak
p6eval rakudo c41cf3: OUTPUT«Blah␤»
masak colomon++
colomon: care to submit it to RT? or shall I?
colomon be my guest, I need to get back to packing. ;)
masak submits
colomon masak++ 21:54
arnsholt Is the interface to nqp-rx's operator precedence parser documented anywhere (beyond the code)? 21:56
masak arnsholt: doubt it. 21:57
arnsholt: sounds like you're volunteering to... :) 21:58
arnsholt masak: Well, for the moment there's my development diary of Parrotlog 21:59
But to write the docs I have to figure out how the interface works in the first place... =)
But the thought has occured to me, yeah
Incidentally, do you know when I was given a commitbit to the nqp-rx repo on GitHub? I didn't know I had it until I discovered it by accident earlier today ^^ 22:00
masak no, I don't know :) 22:02
arnsholt: I do know how the corresponding API works in PGE, and I'd guess that they might be similar.
arnsholt: if it helps, feel free to ask me, or to look at the GGE source.
s/or/and/
arnsholt Right now I'm looking at Partcl-nqp, which is looking promising 22:04
masak ok. 22:05
arnsholt Or, possibly not
masak huh. 22:06
ash_ arnsholt: nqp-rx's operator precedence comes directly from perl 6, its almost identical to rakudo and/or STD.pm 22:07
so you know
arnsholt Yeah, I'm looking at the Rakudo source as well
But Rakudo is pretty large, so I haven't been able to extract a whole lot of info yet 22:08
ash_ you know where thats set right? 22:09
arnsholt But the bit about STD.pm is good, thanks!
ash_ github.com/perl6/nqp-rx/blob/master...ar.pm#L421 is where it starts, its in the Grammar.O method that it happens 22:11
mberends I'm planning to make proto into Perl6::Proto::Installer, a Perl 5 module on CPAN. Any comments on that general idea?
ash_ will it auto install rakudo?
mberends yes, with some opportunity for overriding default settings 22:12
it will also use your existing Rakudo if found in $PATH
22:12 Logo left
mberends (you would actually tell it to install Rakudo with one command) 22:13
masak mberends: today it sounds like a rather good idea :) 22:14
22:14 Guest83313 left 22:15 wknight8111 joined
mberends the idea has been forming for a few days, I don't want to create something that clashes in some unexpected way 22:15
ash_ arnsholt: the O function is defined in the cheats, btw.
masak mberends: I don't know how strictly categorized the Perl6:: category is, but most of it actually contains Perl 5 code emulating Perl 6 behaviour.
mberends: perhaps better to just go with App::Proto or something. 22:16
mberends masak: I know, hence my question. I would rather have a P6:: namespace though. OTOH, proto *is* Perl 5 based. 22:17
ash_ arnsholt: in src/cheats/hll-grammar.pir there is an overview of the O function for defining precedence
masak mberends: yeah, but not with the aim to do Perl 6-y stuff in Perl 5. 22:18
at least not in the usual way :)
mberends sure, it's a borderline case. We have to think how Perl 6 will relate to CPAN overall.
masak I'd rather it didn't cram itself into a Perl6:: namespace. 22:21
22:21 ash_ left
masak particularly one that's already taken by a slightly different category. 22:21
mberends ok, before finalizing that decision, I also want to continue some of the trials moritz_++ did with packaging Perl 6 software into CPAN.
fair enough to leave Perl6:: alone because of existing usage, I respect that 22:23
P6:: or p6:: ?
masak what's the danger of not marking up the different lineage at all in the name? 22:25
you know, as we haven't done with Perl 6 applications outside of CPAN? :) 22:26
mberends if you mean a namespace hierarchy, it's just convention 22:27
masak I bet people are going to do it in all possible ways no matter what I think :) but I don't feel it's necessary to say 'by the way, this is Perl 6' in the namespace itself. 22:28
mberends I do, doubly so when Perl 6 is the purpose of the software 22:29
masak well, there is that.
mberends Also, the CPAN administration can more easily make special for Perl 6 software if it is clearly tagged
*special cases 22:30
22:30 SmokeMachine left
mberends there does need to be special treatment because of different testing, versioning, etc 22:30
masak didn't someone actually publish a pure Perl 6 module to CPAN (which rendered incorrectly, etc)? who was it, and what's the module? 22:31
mberends moritz_++
he blogged about the outcome, don't remember more right now
masak search.cpan.org/~moritz/JSON-Tiny-0.1.2_1/ 22:32
that's gotta be the one.
mberends yes
masak moritz_++
mberends: note the lack of Perl6:: prefix on the module name.
mberends masak: that does not mean it's good precedent 22:33
masak true.
but it means that the only Perl 6 module actually on CPAN right now does not follow the proposed scheme :)
mberends I want comment from a few more people before firming up decisions
masak nod. 22:34
mberends this is not a JFDI matter
masak perhaps ask on #toolchain on irc.perl.org...
I *think* that's a suitable forum.
mberends I won't have time today or tomorrow, I hope the #perl6 members will chip in by Wednesday 22:36
lue oh hai everybody 22:38
mberends anyhow, baby steps... with only one or two uploads, a bad can be undone
oh hai lue 22:39
lue YOU_ARE_HERE.pm looks interesting...
masak hai lue. 22:40
lue: apparently YOU_ARE_HERE.pm is a module so it'll fit into the pattern of the rest of the core/setting. 22:42
lue all it says is YOU_ARE_HERE; 22:43
masak lue: yes. you can read about that in the spec
22:44 ruoso joined
lue Nice work on Temporal.pm, as far as I can see. Glad I didn't write it, I don't even know what bless does :D 22:45
masak lue: have you ever considered how obbject is formed?
sorry 'how is obbject formed', I mean. 22:46
lue I don't come from Perl 5, and never *really* dealt with classes, so I don't. 22:47
bkeeler_ they need to do way instain metaclass 22:48
22:50 xabbu42 joined
sjohnson any of you guys ever heard of a TV show called Chuck? the camel book was shown on that tv show 22:51
22:51 masak left, nihiliad left
lue wonders if the spec would make a good wikibook... 23:09
23:09 Logo joined 23:17 xabbu42 left 23:22 astrojp joined
cognominal rakudo: my %a ; %a<toto>='tata'; my $a = \%a; say $a<toto> 23:24
p6eval rakudo c41cf3: OUTPUT«Null PMC access in type()␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
23:25 hanekomu left
cognominal I probably don't master Perl 6 references :( 23:25
TimToady rakudo: my a; %a<toto>='tata'; my $a = %a; say $a<toto> 23:26
lue rakudo: my %a; %a<toto>='tata'; my $a := %a; say $a<toto>
p6eval rakudo c41cf3: OUTPUT«Malformed my at line 11, near "a; %a<toto"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
colomon sjohnson: My wife and I follow Chuck.
p6eval rakudo c41cf3: OUTPUT«:= binding of variables not yet implemented␤current instr.: '&die' pc 17293 (src/builtins/Junction.pir:404)␤»
TimToady rakudo: my %a; %a<toto>='tata'; my $a = %a; say $a<toto>
p6eval rakudo c41cf3: OUTPUT«tata␤»
TimToady don't need the \
cognominal nice
thx 23:27
23:27 ShaneC joined
pugssvn r30324 | mberends++ | [S32-temporal/Temporal.t] revise all the remaining 11 tests to new spec 23:27
cognominal need sleep. Almost got Web to go past the listen and treat a request.. 23:28
TimToady basically, everything is already a reference
so there's not much point in thinking about references explicitly
lue What's the difference, then, between = and :=? 23:31
dalek kudo: 3b1d348 | (Martin Berends)++ | src/core/Temporal.pm:
[core/Temporal.pm] minor changes to pass all 17 existing tests - more required
cognominal rakudo: say "a" . "a" 23:32
p6eval rakudo c41cf3: OUTPUT«Confused at line 11, near "say \"a\" . "␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
sjohnson colomon: i believe it was the 3-D ep of season 2 of Chuck with had Programming Perl above his bed
lue \o/ mberends++
sjohnson i was impressed
cognominal rakudo: say( "a" . "a" )
p6eval rakudo c41cf3: OUTPUT«Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 11␤current instr.: 'perl6;Regex;Cursor;FAILGOAL' pc 1664 (ext/nqp-rx/src/stage0/Regex-s0.pir:907)␤»
TimToady := simply copies a reference to somewhere that holds a reference. = looks for container objects on its left and stuffs them with copies of whatever if has on its right, for some definition thereof 23:33
23:33 xuser joined
TimToady s/if/it/ 23:33
= is more about value semantics 23:34
cognominal yea but := is not there yet on rakudo
lue So if I wanted two spots in an array to be bound to the same number in the same location, would I use := ? (that's what I've always thought)
TimToady yes 23:35
:= merely makes new aliases, hence parameter passing is built primarily on binding semantics
mberends afk & # sleep
lue Good. It's one of the two reasons I switched from Python: references and switch statements.
TimToady o/ 23:36
lue goodnight o/
mberends o/
cognominal good night all.
lue o/
TimToady my o key is feeling vertiginous, like it's leaning to the side... 23:37
lue .u right 23:38
phenny U+22A2 RIGHT TACK (⊢)
frettled as long as it's not too tacky 23:45
.u tack
phenny U+22A5 UP TACK (⊥)
frettled .u tacky
phenny frettled: Sorry, no results for 'tacky'.
frettled phew
23:46 hercynium joined
lue TimToady: is there any way to represent the range of all real numbers ℝ in Perl 6 yet, or is that NYS? 23:47
TimToady get real :) 23:49
by which I mean, I'm not interested in compteing with Mathematica. 23:50
23:50 jhuni joined
TimToady *competing 23:50
lue be rational! :)
TimToady too late!
lue
.oO(There must be a way)
23:51
TimToady
.oO(if Perl 6 becomes the language of choice of mathematicians, it will almost by definition *not* be the language of choice for anyone else...)
23:52
lue A-hah! But it must be possible, as stated by the motto of the language!
TimToady ask your average programmer what ℝ is and they'll just look at you funny 23:53
that's one of those things I'll try to keep hard. :)
frettled I'll look at you funny anyway, since that's something I'd expect to find in Mathematica et al.
possibly Mathlab and Singular, too ;) 23:54
lue But Mathematica is not open-source, is it not?
frettled No, see Sage for that. 23:55
www.sagemath.org
TimToady but I'll tell you what. if you define ℝ and a .ACCEPTS method for it, then you can ~~ ℝ to your heart's content. 23:56
frettled I didn't know about Magma, heh.
lue: some people also use Octave, but I don't believe that is FOSS.
TimToady I've never tried FOSS, I hear it's a pretty good app... 23:57
frettled Oh, my mistake, it very much IS that, it's on gnu.org :)
frettled blushes appropriately.
lue Freed by Larry, Open Source Software (FLOSS)
TimToady I should use FLOSS more often... 23:58
23:58 [particle] left, rgrau left
lue OOF (Object-Oriented Failure) 23:58
frettled That's a good good-night note for me. :)
TimToady OOF is spelled FOO in France. 23:59
ruoso lue, it has been thought before that a "use Math::Symbols" would enable all the unicode math zoo
TimToady s/thought/thought with horror/