»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend!
Set by sorear on 4 February 2011.
alec yeah, i read from your blog ages ago, you got laid off at your university it job or something after being sick, geekosaur? 00:00
geekosaur I'm employed again now but thr US banking system turns out not to think much of folks who built up debt while unemployed... I have 3 paychecks I can't get any money out of :/ 00:01
alec ahhh, that's a shame 00:02
collections? 00:03
doy Ayiko: yeah, that's also a bit weird
S05 doesn't seem to talk about substitutions barely at all 00:07
Ayiko r: my $foo = 'foo'; say $foo ~~ s/f//, (so $/); 'a'~~/b/; say $foo ~~ s/b//, (so $/); #ugly hack 00:08
p6eval rakudo c8de2e: OUTPUT«TrueTrue␤TrueFalse␤»
doy r: my $foo = "foo"; $foo ~~ s/f//; say so $/; $foo ~~ s/a//; say so $/ # how is this different? 00:09
p6eval rakudo c8de2e: OUTPUT«True␤True␤»
doy oh, missed the 'a'~~/b/ part in there 00:12
Ayiko I warned you it was ugly (and a bit hidden) 00:17
00:22 thou joined 00:34 bluescreen10 left
Ulti blogs.msdn.com/b/kirillosenkov/arch...otype.aspx having a structured editor for perl6 would be cool :) 00:39
00:43 sid_ joined
sid_ hi 00:43
hello?
Ulti hi
sid_ my name is sid, i like everything computers, i was wondering how i could help out w/ perl 6 00:44
i can do some basic c#, python, basic java... but i'll happily learn anything that I need to learn 00:45
Ulti heh I'm not the right person to ask, but just trying it out and writing some programs with one of the main implementations is a good way to start
sid_ iight thanks
rakudo: 00:46
my b
Ulti if you know c# then you might want to check out github.com/sorear/niecza targetting the .net runtime 00:47
00:49 raiph joined 00:50 denisboyun_ left 00:51 pmurias left
sid_ i went to this link 00:52
github.com/sorear/niecza
but i wasn't too sure what exactly do to do aftewards
00:52 aindilis left
sid_ is theres something i should install first to use in visual studio? 00:52
00:53 aindilis joined 00:58 anuby joined 01:10 Chillance left 01:11 Chillance joined 01:15 hypolin joined, sid_ left 01:17 gcole joined 01:18 raiph left 01:22 atrodo left 01:23 thou left 01:32 Kharec left 01:51 aindilis left, aindilis joined 01:58 whiteknight left 02:44 FROGGS_ joined 02:48 FROGGS left
[Coke] pretty sure there's no build files for VS for niecza. 03:01
just a makefile. 03:02
03:06 orafu left, orafu joined 03:21 REPLeffect left
xenoterracide hi alec 03:54
03:54 xenoterracide left, xenoterracide joined 04:00 colomon left 04:22 thou joined 04:43 Chillance left 04:48 fgomez joined, crazedpsyc joined 04:55 fgomez left 05:00 kaleem joined 05:07 aindilis left 05:12 telex left 05:17 sivoais is now known as msivoaisw 05:19 msivoaisw is now known as sivoais 05:20 telex joined 05:26 thou left 05:27 thou joined 05:33 telex left 05:35 telex joined 06:08 fgomez joined 06:14 fgomez left 06:20 araujo left 06:28 drbean_ joined 06:31 drbean_ is now known as drbean 06:37 SamuraiJack joined 06:45 quester joined 07:13 xinming_ joined 07:15 xinming left 07:36 arkydo joined 07:42 thou left 07:45 Kharec joined 07:48 kaare_ joined
Woodi Ulti: realy nice improvement in code visualization just by changing font-bg-color :) and drag&drop such 'ractangles' is nice extract-foohere refactoring... but still 2D only :) 08:05
morning :) 08:06
anyway, what happen to GUIs in last years ?? eg: import QtQuick 1.0\n Rectangle {\n width: 100\n ... looks like every GUI now a) should be done in SDL-like-shape; b) need to be implemented from scratch 08:12
moritz \o
quester Does anyone know if "make -j2" is a good idea for a Rakudo Star build? 08:13
Woodi not necessarily bad for new languages on the block :)
moritz quester: it's not 08:14
erm wait
for 'make' it's OK, but not for 'make install' 08:15
flussence I've been using -j4
08:15 quester left
flussence (I should probably stop using it for the install part...) 08:16
08:16 quester joined
moritz it's fine in rakudo, just not in star 08:16
quester Oh. Okay. Thank you very much, moritz++ and flussence++ 08:18
moritz star: say 'oh hai'
p6eval star 2012.12: OUTPUT«oh hai␤»
moritz p6eval update to star 2012.12 08:19
08:38 drbean left 08:43 drbean joined 08:44 GlitchMr joined 08:48 arkydo left 09:14 quester left 09:16 MayDaniel joined
Woodi moritz: Star v2012.12 announcement typo: Rakudo 2012.12 not 2012.11, (link links correctly to v12) 09:18
09:21 Nola joined
Nola good morning 09:21
FROGGS_ morning 09:42
09:42 FROGGS_ is now known as FROGGS 09:44 Patterner left 09:46 Psyche^ joined, Psyche^ is now known as Patterner 09:50 TreyRust joined 09:52 SmokeMachine joined 09:54 SmokeMachine left
Nola Is there a way to pass multiple arrays to a subroutine without having them flatened or using references to arrays? 09:54
I tried using the "slurp" mechanic (sub foo(*@arrays) {...}) but it seems to flatten them.
09:55 SmokeMachine joined
sorear sub foo(@x, @y, @z) { ... } 09:57
if you want a variable number, use arrays of arrays
also, we don't really say "references" here 09:58
in perl 6, everything is a reference so nothing is
Nola Okay 09:59
[D[A[C[A[D[B[B[C[A[D
encoding fail on my part.
10:01 hypolin left
doy is there a reason that class stubs are written as "class Foo {...}" but method stubs are written as "method foo {*}"? 10:02
sorear doy: true method stubs use {...}. {*} is used for multimethods 10:04
doy hmmm 10:06
seems like "method foo {*}" could stand to have a warning or something
Nola sorear: pastebin.com/iE3BkaXP - Do you mean like this? Or can you think of a better way? 10:16
10:19 anuby left
doy is there a decent perl6 vim syntax file somewhere? 10:32
hoelzro doy: github.com/vim-perl/vim-perl is where it's being developed 10:33
it's a WIP
doy yeah, that's what i'm using now 10:34
it's a bit buggy
hoelzro it works pretty well for now, but I intend to improve it when I get the tuits
doy: if you find bugs that aren't already in the tracker, feel free to add them =)
I'll get around to them when I can
doy also, syntax files that auto-enable folding are pretty hateful 10:36
hoelzro doy: does the perl6.vim in vim-perl do that? 10:37
afaik, only my branch does ATM, and I have it on by default for ease of debugging 10:38
I intend to have it off by default before I merge that into master
doy github.com/vim-perl/vim-perl/blob/....vim#L2246 10:39
hoelzro thanks for pointing that out!
10:43 TreyRust left
doy part of the bugginess is really just vim's syntax engine being awful i think 10:46
"syntax sync fromstart" doesn't seem to really mean "fromstart" 10:47
hoelzro ah
doy if i have a comment with a single quote in it, things are highlighted properly when the comment is visible on the screen, but they act like there's an open single quote if the comment has scrolled off the top
moritz Woodi: fixed 10:48
hoelzro how odd
doy: would you mind directing me to the file that's causing this issue? 10:50
doy any file, just have a line with «# '» in it, followed by some perl 6 code 10:51
hoelzro sure enough
thanks for pointing that out; I'll add it to the bug tracker 10:52
masak greetings, #perl6 10:53
hoelzro ahoy masak
11:09 araujo joined, araujo left, araujo joined 11:25 klaus___ joined, klaus___ is now known as muixirt
muixirt good morning 11:25
doy r: role Foo { has $.bar; submethod BUILD (:$!bar) { } }; class Baz does Foo { }; say Foo.new(bar => "BAR") 11:28
p6eval rakudo c8de2e: OUTPUT«Can not get attribute '$!bar' declared in class 'Foo' with this object␤ in submethod BUILD at /tmp/9hxFlqanBm:1␤ in method BUILDALL at src/gen/CORE.setting:738␤ in method bless at src/gen/CORE.setting:723␤ in method new at src/gen/CORE.setting:708␤ in at src/…
doy r: role Foo { has $.bar; submethod BUILD (:$bar) { $!bar = $bar } }; class Baz does Foo { }; say Foo.new(bar => "BAR")
p6eval rakudo c8de2e: OUTPUT«Foo.new(bar => "BAR")␤»
doy shouldn't these be equivalent?
or am i misunderstanding something
muixirt the command 'panda --installed list' prints nothing (Rakudo Star 2012.12). Why? 11:29
hoelzro muixirt: did it print something with Rakudo Star 2012.11? 11:30
there was a recent change in the default value for @*INC, iirc
I think that was from 10 -> 11, though
11:32 GlitchMr left, Nola left
doy actually, that's not even useful, since defining BUILD in a role will just break things anyway if the class defines any attributes 11:32
muixirt hoelzro: no, 2012.11 doesn't print something either 11:33
hoelzro muixirt: and 2012.10?
doy BUILD in general seems quite hard to actually use effectively
11:33 am0c joined
muixirt hoelzro: i don't know 11:34
hoelzro muixirt: I'm not 100% sure, but I'm pretty sure that the default lib dir and installation stuff was changed in 2012.11
muixirt hoelzro: i have to admit that i don't know what it is supposed to print, maybe only modules that are installed via panda 11:37
hoelzro that's what I think 11:38
FROGGS muixirt: right, the panda that is shipped with rakudo star doesnt know what already is installed 11:40
its database file is empty
dont know if that is intended or not
muixirt hoelzro, FROGGS ok, thanks 11:41
masak doy: I feel your pain. there are certainly kinks to iron out. 11:43
especially in the area you're currently investigating, object initialization and roles. 11:44
I'm not sure the extent to which it has been designed.
doy this may just be my moose background coloring my opinions, but the way that BUILD is used for both attribute initialization and other things to do at construction time seems odd
(moose separates this out with BUILDARGS vs BUILD) 11:45
masak .oO( background-coloring my opinions ) 11:46
doy: yeah, tadzik and TimToady has had that discussion at least twice. see the backlog. 11:47
doy: ISTR TimToady saying something to the effect of "I can't help it if Moose uses BUILD for that thing, we're still not doing that".
and he invokes efficiency as one of his design criteria. 11:48
but the backlog will have more.
doy yeah, i don't particularly care if the moose design is what is used, but as it currently stands, there are some things that you just are unable to do at all as far as i can tell 11:49
masak at some point, some of us should probably sit down and enumerate the problems with the current factoring. 11:50
11:53 colomon joined 11:56 bbkr left 12:07 arkydo joined
colomon resolve stage failed for File::Find::Duplicates: File::Find::Duplicates depends on File::Find, which was not found in the ecosystem 12:09
:(
moritz I guess that star simply installs stuff without registering it with panda 12:10
12:16 MayDaniel left
doy r: role Foo { method bar {...} }; say Foo.perl 12:17
p6eval rakudo c8de2e: OUTPUT«Method 'bar' must be implemented by Foo because it is required by a role␤ in at src/gen/Metamodel.pm:2127␤ in compose_method_table at src/gen/Metamodel.pm:2118␤ in any apply at src/gen/Metamodel.pm:2136␤ in at src/gen/Metamodel.pm:2271␤ in any compose at src…
doy ^^ bug?
r: role Foo { method bar {...} } 12:20
p6eval rakudo c8de2e: OUTPUT«Method 'bar' must be implemented by Foo because it is required by a role␤current instr.: '' pc 23697 (src/gen/perl6-metamodel.pir:10767) (src/gen/Metamodel.pm:2127)␤called from Sub 'compose_method_table' pc 23492 (src/gen/perl6-metamodel.pir:10696) (src/gen/Metamod…
doy hmmm
masak that doesn't feel like it should error out. 12:24
r: role Foo { method bar {...} }; say 42
p6eval rakudo c8de2e: OUTPUT«42␤»
masak oh, it has something to do with role Foo being used as a return value or something.
doy yeah
masak and evaluating it causes it to auto-pun itself into an anonymous class, maybe? 12:25
if so, then that's the part that feels wrong.
it must be possible to talk about a role with unimplemented methods without it throwing an error.
masak submits rakudobug
doy i'm not sure why that second one gives a parrot stack trace either
masak probably because the mainline block returns to the Rakudo internals. 12:26
that's just a guess, but it feels like a safe one. 12:27
n: role Foo { method bar {...} }; say Foo.perl
p6eval niecza v24-12-g8e50362: OUTPUT«Unhandled exception: Method 'bar' must be implemented by 'Foo' because it is required by role 'Foo[curried][...]'␤ at /tmp/eJUSqd8EGZ line 1 (mainline @ 4) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4218 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.…
masak n: role Foo { method bar {...} }
p6eval niecza v24-12-g8e50362: ( no output )
masak Niecza half agrees. 12:28
unless the spec absolutely *mandates* that a role should auto-pun to a class when .perl'd, I think it's a bad idea.
12:29 werwerwer_ left
doy all of the stringification methods have the same issue, which is why i ran into this 12:30
timotimo hello all you happy perl6 people 12:31
masak timotimo! \o/ 12:32
FROGGS hi kresi... err, timotimo 12:34
masak FROGGS: my thought exactly ;) 12:35
doy r: class Foo { }; say Foo.HOW.^methods 12:36
p6eval rakudo c8de2e: OUTPUT«No such method 'gist' for invocant of type 'NQPRoutine'␤ in method gist at src/gen/CORE.setting:5047␤ in sub say at src/gen/CORE.setting:7514␤ in block at /tmp/8DPMpjnynI:1␤␤»
doy how do i see what metamethods are available 12:37
12:38 sorear left 12:39 sorear joined
doy also: its not just stringification methods, it seems that calling any method at all on a role with required methods is broken 12:39
r: role Foo { method bar {...} }; say Foo.^name
p6eval rakudo c8de2e: OUTPUT«Method 'bar' must be implemented by Foo because it is required by a role␤ in at src/gen/Metamodel.pm:2127␤ in compose_method_table at src/gen/Metamodel.pm:2118␤ in any apply at src/gen/Metamodel.pm:2136␤ in at src/gen/Metamodel.pm:2271␤ in any compose at src… 12:40
masak :/
r: role Foo { method bar {} }; say Foo.^name
p6eval rakudo c8de2e: OUTPUT«Foo␤»
masak adds that to the ticket
sometimes it feels like a consolation that even when I can't fix people's problems, I can file them away in RT for later fixing. 12:41
12:50 MayDaniel joined
doy masak: on another note, do you have any ideas about how to tell if a substitution succeeded or not? 12:56
12:56 hash_table joined
masak rn: say "foo".subst(/f/, 'ph') 12:57
p6eval rakudo c8de2e, niecza v24-12-g8e50362: OUTPUT«phoo␤»
masak rn: say "foo" ~~ s[f] = "ph"
p6eval niecza v24-12-g8e50362: OUTPUT«Unhandled exception: Writing to readonly scalar␤ at /home/p6eval/niecza/lib/CORE.setting line 593 (Cool.subst @ 88) ␤ at /tmp/Sx1s9KDdiu line 1 (mainline @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4218 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/C… 12:58
..rakudo c8de2e: OUTPUT«Cannot assign to a non-container␤ in sub infix:<=> at src/gen/CORE.setting:12183␤ in block at /tmp/m1xiog3HyD:1␤␤»
masak oh, right.
rn: $_ = "foo"; say s[f] = "ph"
p6eval rakudo c8de2e: OUTPUT«phoo␤»
..niecza v24-12-g8e50362: OUTPUT«True␤»
masak doy: in niecza, you'll get True back.
rn: $_ = "foo"; say s[q] = "ph"
p6eval niecza v24-12-g8e50362: OUTPUT«False␤»
..rakudo c8de2e: OUTPUT«foo␤»
masak if it succeeded.
moritz I could try to teach Rakudo the same behavior
doy r: my $foo = "foo"; say $foo ~~ s/a//; say $foo; say $foo ~~ s/f//; say $foo 12:59
p6eval rakudo c8de2e: OUTPUT«True␤foo␤True␤oo␤»
doy rakudo seems to return a boolean in some cases too, it's just always True 13:00
moritz no, it's the ~~ that returns a Boolean 13:01
not the s///
13:01 kaleem_ joined
doy so s/// on its own returns something different from $_ ~~ s///? 13:01
moritz yes 13:02
doy weird
why?
13:03 kaleem left
moritz because $a ~~ $b is short for something like do { my $_ = $a; $b.ACCEPTS($_) } 13:03
doy well, i guess i mean: why is it useful for them to return different things? 13:05
moritz it's not, in this particular case
doy okay
moritz but in the big picture, the current factoring has some benefits
though I'm not totally happy with it 13:06
doy seems like both s/// and $foo ~~ s/// should return something that boolifies to "did the substitution succeed" 13:08
13:09 hash_table left 13:13 rindolf joined
moritz when I fix s/// to return True or False, that'll happen 13:17
though it won't fix the $str ~~ m:g// case
masak trying to please too many use cases at the same time. 13:21
doy r: my $foo = try { die "foo"; CATCH { warn $_; default {} } }; say "alive"; say $foo // "bar" 13:29
p6eval rakudo c8de2e: OUTPUT«foo in block at /tmp/uVw2MG1iy0:1␤␤alive␤foo␤ in block at /tmp/uVw2MG1iy0:1␤␤»
doy why is the block returning the exception there?
moritz r: my $foo = try die 'foo'; say $foo 13:31
p6eval rakudo c8de2e: OUTPUT«Nil␤»
moritz no idea
but it shouldn't, afaict
doy rakudobugs 13:36
13:36 Chillance joined
moritz r: $_ = 'abc'; s/a/A/; s/X/Y/; say $/ 13:39
p6eval rakudo c8de2e: OUTPUT«「a」␤␤»
moritz another rakudobug
n: $_ = 'abc'; s/a/A/; s/X/Y/; say $/
p6eval niecza v24-12-g8e50362: OUTPUT«#<match from(0) to(1) text(a) pos([].list) named({}.hash)>␤»
moritz hm, niecza doesn't reset $/ on failure either
rn: $_ = 'abc'; m/a/; m/X/; say $/ 13:40
p6eval niecza v24-12-g8e50362: OUTPUT«Match()␤»
..rakudo c8de2e: OUTPUT«#<failed match>␤»
masak submits rakudobug 13:42
13:47 am0c left 13:49 PacoAir joined
masak oh! oh! last day to sign up for strangelyconsistent.org/blog/the-20...ng-contest ! 13:52
(after which I will stop nagging y'all about it)
we *almost* have the same number of signups as last year.
seems we've hit some kind of saturation level for signups :)
hoelzro looks
doy r: role Foo { method bar { "ROLE:" ~ (self.defined ?? "D" !! "U") } }; class Bar does Foo { method bar { "CLASS:" ~ (self.defined ?? "D" !! "U") ~ "-" ~ self.Foo::bar } }; say Bar.new.bar 13:54
p6eval rakudo c8de2e: OUTPUT«CLASS:D-ROLE:U␤»
masak nice prize lineup. significant quantities of Amazon bookage.
doy ^^ bug? 13:55
or is there another way i'm supposed to be doing that call
masak doy: in-ter-es-ting. 13:56
doy++
masak submits rakudobug
r: role Foo { method bar { say self.WHICH } }; class Bar does Foo { method bar { say self.WHICH; self.Foo::bar } }; Bar.new.bar 13:58
p6eval rakudo c8de2e: OUTPUT«Bar|549956910␤Foo␤»
masak I'd argue 'self' should still be the original invocant, even in the role method.
doy agreed
masak r: role Foo { method baz { say self.WHICH } }; class Bar does Foo { method bar { say self.WHICH; self.baz } }; Bar.new.bar 13:59
p6eval rakudo c8de2e: OUTPUT«Bar|1974449900␤Bar|1974449900␤»
masak ...and it's particular to the self.Role::meth syntax. bingo.
hoelzro masak: is that related to the role punning thing I found a few months ago?
masak hoelzro: url? 14:00
hoelzro S12-methods/qualified.t
hoelzro wonders if he actually submitted a rakudobug for that...
masak & 14:02
hoelzro is there a way to sort these tickets by date?
doy r: role Foo { method bar { return self.defined ?? "D" !! "U" } }; class Bar does Foo { method baz { my $bar = Foo.^find_method('bar'); return self.$bar } }; say Bar.new.baz 14:06
p6eval rakudo c8de2e: OUTPUT«Nominal type check failed for parameter ''; expected Foo but got Bar instead␤ in method bar at /tmp/52qL89bcEj:1␤ in method baz at /tmp/52qL89bcEj:1␤ in block at /tmp/52qL89bcEj:1␤␤»
moritz you can click on date column of the head row to sort by date 14:07
hoelzro that doesn't seem to work for me... 14:08
moritz you might need to be logged in
doy i'm not entirely sure what that error message is trying to say, but i don't think it should be erroring at all
14:09 Nola joined
hoelzro doy: what's happening is a fake object with the role is being created and being used as the invocant 14:09
moritz fails to fix s///
hoelzro it's called role punning, I guess
doy a fake class, you mean? 14:10
Nola Hello!
hoelzro doy: basically
moritz it loops before entering Str.subst (which IMHO is really weird)
hello Nola
Nola I tried to read a file (using open() and get()) and I get an exception of malformed UTF-8.
hoelzro well, it's an empty object with just the role in question applied
Nola I know that the file is not utf-8, but how can I set the encoding?
doy hoelzro: so is this basically the same issue as the previous one then 14:11
hoelzro doy: I think so, yes
doy okay
moritz Nola: open($filename, :encoding('ISO-8859-1')) or so
hoelzro I'm sad to see it's still not fixed =/
I reported it in July, I think
Nola moritz: Thanks I am going to try it.
14:12 PacoAir left
hoelzro apparently, you *do* need to be logged in to sort? 14:12
how silly
moritz hoelzro: we have 4 year old bug reports open 14:13
hoelzro also, I think I *did* forget to file a rakudobug for this
14:13 Nola left
doy well, luckily, masak++ just did 14:13
hoelzro moritz: it's more something I wished worked than a criticism of the Rakudo team
doy (:
hoelzro indeed, masak++
doy hmmm 14:14
so i wonder what i can do to work around this problem
14:14 jlhg joined, jlhg left
moritz self.Foo::methodname doesn't work? 14:14
hoelzro doy: let me know if you figure it out; it halted my chatbot's development =(
doy moritz: no, it passes the Foo type object as the invocant 14:15
moritz r: s/a/b/i 14:18
p6eval rakudo c8de2e: OUTPUT«No such method 'subst' for invocant of type 'Any'␤ in block at /tmp/eI7cwaCdpa:1␤␤»
moritz std: s/a/b/i
p6eval std a8bc48f: OUTPUT«===SORRY!===␤Unsupported use of suffix regex modifiers; in Perl 6 please use prefix adverbs at /tmp/TOH6ArPfuc line 1:␤------> s/a/b/i⏏<EOL>␤Other potential difficulties:␤ Unsupported use of /i; in Perl 6 please use :i at /tmp/TO…
moritz r: m/a/i
p6eval rakudo c8de2e: OUTPUT«===SORRY!===␤Unsupported use of /i; in Perl 6 please use :i␤at /tmp/e_o3DaFFvF:1␤------> m/a/i⏏<EOL>␤»
14:18 eiro left
arnsholt I wonder when the Perl 5 compiler will start to catch sixisms... =) 14:19
</idle-pondering>
moritz it already does 14:20
erm, at least 'use v6;' :-)
arnsholt Oh, that's fun. Didn't know that
moritz though it's the same general mechanism used for 'use 5.010;' and stuff 14:21
arnsholt Yeah, that makes sense 14:22
14:23 eiro joined
moritz japhb: the rakudo docs/ROADMAP has an item 'Failure changes (japhb)'. What does that mean? 14:24
14:24 grondilu left 14:25 GlitchMr joined, att__ left
dalek kudo/nom: a11bad6 | moritz++ | src/Perl6/Grammar.pm:
catch p5 regex adverbs after s///
14:27
kudo/nom: 69bbd1a | moritz++ | docs/ROADMAP:
[ROADMAP] add two missing language features
14:28 att__ joined 14:29 PacoAir joined 14:35 jlhg_ joined, jlhg_ left 14:37 jlhg joined, jlhg left, jlhg joined 14:38 jlhg left
doy is there any built-in way to do lazy attributes (where the values aren't assigned until the first time the accessor is called)? 14:41
the default values, that is
14:45 brrt joined
brrt hi folks, merry christmas and all that; why are for loops lazy? 14:45
hoelzro I'd guess too much pie and beer. 14:46
14:47 stopbit joined 14:48 yves_ joined
doy that is a question that has come up several times lately 14:52
arnsholt Because they're lazy, I think 14:53
There was a bug I saw in the scrollback that made me think there might be some interaction with sink context as well 14:54
hoelzro on line 227 of S05-regex.pod in the spec, it talks about :sigspace; shouldn't this be talking about :samecase instead? 15:09
(same goes for L232)
15:10 atrodo joined
Ulti Woodi you want a 3D text editor? 15:15
15:17 dayangkun left 15:23 rindolf left, rindolf joined 15:30 kaleem_ left
hoelzro is there a variable I can query in Rakudo to ask what the version is? 15:33
$?PERL.version *should* say something, right?
moritz r: say $?PERL.perl 15:34
p6eval rakudo 69bbd1: OUTPUT«===SORRY!===␤Variable $?PERL is not declared␤at /tmp/6yqSUhc1Dw:1␤------> say $?PERL.perl⏏<EOL>␤ expecting any of:␤ method arguments␤ postfix␤»
moritz r: say $*VM
p6eval rakudo 69bbd1: OUTPUT«("name" => "parrot", "config" => {"git_describe" => "RELEASE_4_10_0", "sha1" => "08a70fe50d07fc932b5505b13f09fa74b01622e9", "a" => ".a", "ar" => "ar", "ar_extra" => "", "ar_out" => "", "archname" => "i486-linux-gnu-thread-multi-64int", "arflags" => "cr", "as" => "a…
moritz r: say $*VM.keys
p6eval rakudo 69bbd1: OUTPUT«name config␤»
doy r: multi sub foo (Pair $p) { say "pair" }; foo(a => 1) 15:37
p6eval rakudo 69bbd1: OUTPUT«Cannot call 'foo'; none of these signatures match:␤:(Pair $p)␤␤ in block at /tmp/DUF4fTXMJz:1␤␤»
doy would it make sense for that to fall back to looking for a Pair signature
if no candidates are available for named arguments?
considering that this works
r: multi sub foo (Pair $p) { say "pair" }; foo([] => 1)
p6eval rakudo 69bbd1: OUTPUT«pair␤»
15:43 isBEKaml joined
masak rn: say "0b100000 signups!" 15:47
p6eval rakudo 69bbd1, niecza v24-12-g8e50362: OUTPUT«0b100000 signups!␤»
masak rn: say "{0b100000} signups!"
p6eval rakudo 69bbd1, niecza v24-12-g8e50362: OUTPUT«32 signups!␤»
masak \o/ 15:48
15:48 mtk left, mtk joined
masak doy: no, there's no way to make attributes lazy at present. 15:50
I don't know the metaobject protocol well enough to say if it's possible to hack something up that does that.
doy seems like it'd be a fairly easy addition 15:51
masak r: say Attribute.can('get_value')
p6eval rakudo 69bbd1: OUTPUT«get_value␤»
masak seems to me if you override this one in the right way... 15:52
r: say Attribute.can('set_value')
p6eval rakudo 69bbd1: OUTPUT«set_value␤»
masak and maybe this one...
15:55 xinming_ left 15:57 xinming joined
doy hmmm 15:58
can't seem to figure out how dynamic variables work
masak r: sub foo { my $*dyn = "like this! :)"; bar }; sub bar { say $*dyn }; foo 15:59
p6eval rakudo 69bbd1: OUTPUT«like this! :)␤»
arnsholt doy: Instead of lexical position the scope is along the call stack (essentially) 16:00
If that's what you were curious about
doy arnsholt: no, i meant how you actually use them(:
arnsholt Oh, right =)
doy masak: i guess what i'm doing is a bit more complicated
masak ...but that's the only way to use them... ;) 16:01
arnsholt Do you have an example of what you're doing?
masak ...and why are you making it so complicated? :P 16:02
doy that is what i do d:
and working on getting a simple example
16:04 hash_table joined
doy r: sub foo (Array $thing, Callable $body) { my $*dyn; if $*dyn { $thing.push($*dyn) }; $*dyn = $thing; $body.(); $thing }; say foo([1, 2], { foo([3, 4], { foo([5, 6], sub {}) }) }).perl 16:05
p6eval rakudo 69bbd1: OUTPUT«[1, 2]␤»
doy basically, i'm looking for something like this, except that it gives me [1, 2, [3, 4, [5, 6]]] 16:06
16:08 isBEKaml left
arnsholt doy: my $*dyn inside foo establishes a new binding 16:09
doy right
arnsholt It's like "my $foo; { my $foo; ... }"
doy i understand why that version doesn't work, but that doesn't get me to what exactly would work
(:
arnsholt I think just nuking the "my $*dyn" declaration in foo should do it 16:10
Just access $*dyn directly
masak well, you need to declare it somewhere.
probably in the top scope.
r: say $*dyn
p6eval rakudo 69bbd1: OUTPUT«Dynamic variable $*dyn not found␤ in method gist at src/gen/CORE.setting:10337␤ in sub say at src/gen/CORE.setting:7514␤ in block at /tmp/hKzrs08mzM:1␤␤» 16:11
masak not declaring it does not work.
arnsholt If there exists a binding up the call stack it will use that binding, or it will error out if none exists
doy r: my $*dyn; sub foo (Array $thing, Callable $body) { if $*dyn { $thing.push($*dyn) }; $*dyn = $thing; $body.(); $thing }; say foo([1, 2], { foo([3, 4], { foo([5, 6], sub {}) }) }).perl
p6eval rakudo 69bbd1: OUTPUT«[1, 2]␤»
arnsholt Yeah, right. And add a declaration before the call
Huh. Didn't expect that 16:12
skids
.oO(needs an else?)
16:13
erm, nevermind, ENOCAFFEINE. 16:14
doy oh, no, i'm just being dumb 16:15
my $*dyn; sub foo (Array $thing, Callable $body) { if $*dyn { $*dyn.push($thing) }; $*dyn = $thing; $body.(); $thing }; say foo([1, 2], { foo([3, 4], { foo([5, 6], sub {}) }) }).perl
the .push was backwards
r: my $*dyn; sub foo (Array $thing, Callable $body) { if $*dyn { $*dyn.push($thing) }; $*dyn = $thing; $body.(); $thing }; say foo([1, 2], { foo([3, 4], { foo([5, 6], sub {}) }) }).perl
p6eval rakudo 69bbd1: OUTPUT«[1, 2, [3, 4, [5, 6]]]␤»
arnsholt Right, right =)
masak r: sub foo(@thing, &body) { [@thing, &body()] }; say $body.(); $thing }; say foo([1, 2], { foo([3, 4], { foo([5, 6], sub {}) }) }).perl
p6eval rakudo 69bbd1: OUTPUT«===SORRY!===␤Variable $body is not declared␤at /tmp/oMolWCn6KL:1␤------> ody) { [@thing, &body()] }; say $body.()⏏; $thing }; say foo([1, 2], { foo([3, 4]␤ expecting any of:␤ dotty method or postfix␤ argument li…
masak r: sub foo(@thing, &body) { [@thing, &body()] }; say foo([1, 2], { foo([3, 4], { foo([5, 6], sub {}) }) }).perl
p6eval rakudo 69bbd1: OUTPUT«[1, 2, [3, 4, [5, 6]]]␤»
masak my way is simpler. look ma, no dynamicals. 16:16
arnsholt Neat!
doy hmmm 16:17
still getting "dynamic variable not found" in my real code when i do that though
wonder what's different
masak must be you're referring to a dynamic variable somewhere. 16:18
doy by "that" i mean the thing i pasted, not the thing you pasted(: 16:20
masak well, assuming you don't have a very old version of Rakudo where dynamicals are mis-implemented, what's happening to you is very simple. 16:22
you're accessing a dynamical without being somewhere in the call stack where one had been declared.
r: sub foo { my $*dyn }; sub bar { baz }; sub baz { flooz }; sub flooz { say $*dyn }; bar 16:23
p6eval rakudo 69bbd1: OUTPUT«Dynamic variable $*dyn not found␤ in method gist at src/gen/CORE.setting:10337␤ in sub say at src/gen/CORE.setting:7514␤ in sub flooz at /tmp/Bejec2IicP:1␤ in sub baz at /tmp/Bejec2IicP:1␤ in sub bar at /tmp/Bejec2IicP:1␤ in block at /tmp/Bejec2IicP:1␤␤»…
masak like that.
r: sub foo { my $*dyn }; (sub bar { baz })(); sub baz { flooz }; sub flooz { say $*dyn } 16:33
p6eval rakudo 69bbd1: OUTPUT«Dynamic variable $*dyn not found␤ in method gist at src/gen/CORE.setting:10337␤ in sub say at src/gen/CORE.setting:7514␤ in sub flooz at /tmp/zAsvkqOlzo:1␤ in sub baz at /tmp/zAsvkqOlzo:1␤ in sub bar at /tmp/zAsvkqOlzo:1␤ in block at /tmp/zAsvkqOlzo:1␤␤»…
16:34 thou joined
doy r: gist.github.com/3dc5fb0153bf69a83c6d 16:36
p6eval rakudo 69bbd1: OUTPUT«===SORRY!===␤Two terms in a row␤at /tmp/ZdgIDRgHvx:1␤------> https⏏://gist.github.com/3dc5fb0153bf69a83c6d␤ expecting any of:␤ argument list␤ postfix␤ infix or meta-infix␤ infix stopper␤ sta…
doy r: gist.github.com/3dc5fb0153bf69a83c6d 16:37
p6eval rakudo 69bbd1: OUTPUT«===SORRY!===␤Two terms in a row␤at /tmp/h3AkxZsYd1:1␤------> http⏏://gist.github.com/3dc5fb0153bf69a83c6d␤ expecting any of:␤ argument list␤ postfix␤ infix or meta-infix␤ infix stopper␤ stat…
doy i thought p6eval could do gists
masak it can. something's off. 16:38
but I see the problem in your gist.
line 13.
you're declaring $*dyn.
that declaration is *not* in the dynamically surrounding scope of its usage. told you :) 16:39
doy so... what do i do?
(:
masak I would recommend going back to the drawing-board and understanding dynamic variables. let me know if I can help.
doy well 16:40
masak from the way you're using them, I'm not sure they're actually what you want.
doy right
that was more my question
i tried using dynamic variables because this worked via our and local in perl 5
masak by line 22, $*dyn goes out of (dynamic) scope, and doesn't come back in.
doy but if there's a better way of doing it, i'd be interested in that too
masak as far as I know, you'd have the same problem in Perl 5. 16:41
doy nope
masak an 'our' variable might serve you in this case.
but to be honest, I'm a bit wary of doing anything with modules. I prefer to bake process information such as this into objects.
then I have more fine-grained control. 16:42
doy aha
yeah, just converting it to our/temp makes it work
masak r: gist.github.com/4380959 16:43
hoelzro anyone going to FOSDEM next year?
p6eval rakudo 69bbd1: OUTPUT«Nominal type check failed for parameter '@dependencies'; expected Positional but got Array instead␤ in method new at /tmp/NSeQDO9eIS:6␤ in block at /tmp/NSeQDO9eIS:27␤␤»
masak r: gist.github.com/3dc5fb0153bf69a83c6d
p6eval rakudo 69bbd1: OUTPUT«===SORRY!===␤Two terms in a row␤at /tmp/xXlasF0asb:1␤------> https⏏://gist.github.com/3dc5fb0153bf69a83c6d␤ expecting any of:␤ argument list␤ postfix␤ infix or meta-infix␤ infix stopper␤ sta…
masak seems p6eval doesn't recognize the new, extended gist URL format.
16:44 brrt1 joined
doy gist.github.com/46da99bcb774f2eb98fa # this works 16:44
16:44 brrt left
doy i'll come back to this stuff to see if there are better ways of doing things later 16:44
just trying to see how much effort getting things working at all would be first 16:45
masak *nod* 16:46
16:46 arkydo_ joined
masak doy: it's fascinating to see what things you run into. you obviously have a good grasp of Perl 5 and Moose. 16:47
16:47 brrt1 left 16:48 arkydo left
doy i've been hanging out here long enough, figured i should at least give something a shot to see how well things work these days 16:52
16:52 arkydo_ left
masak :) 16:54
you haven't considering doing p6cc this year? :)
considered*
doy figured i'd be more likely to stay motivated if it was something that might actually be useful 16:55
16:55 denisboyun_ joined
masak fair enough. 16:55
moritz r: say <<foo :bar(2)>>.perl 17:01
p6eval rakudo 69bbd1: OUTPUT«("foo", "bar" => 2)␤»
moritz closes a three year old masakbug 17:03
masak \o/
moritz rakudo: sub infix:<!+>(*@a) is assoc('list') { [*] @a }; say 7 !+ 6 !+ 10
p6eval rakudo 69bbd1: OUTPUT«420␤»
moritz rakudo: sub infix:<!+>(*@a) is assoc('list') { @a.perl }; say 7 !+ 6 !+ 10 17:04
p6eval rakudo 69bbd1: OUTPUT«Array.new("Array.new(7, 6)", 10)␤»
masak o.O
moritz that doesn't look very list-assocy
rakudo: sub infix:<!+>(*@a) is assoc('right') { @a.perl }; say 7 !+ 6 !+ 10
p6eval rakudo 69bbd1: OUTPUT«Array.new("Array.new(7, 6)", 10)␤»
masak also, that there is a... string.
eeew.
moritz that's ok 17:05
arnsholt Eeew, indeed
moritz the return value from .perl
masak oh. right.
not as bad as I feared ;) 17:06
arnsholt Oh, right
moritz huh, I don't even see where the precedence or assoc information is used 17:07
... is used 17:14
skids rakudo,star: sub infix:<!+>(*@a) is assoc("list") { @a.perl }; say 7 !+ 6 !+ 10
hrm what's star's p6eval hook?
17:15 denisboyun_ left
moritz star: 17:15
skids because on star the output is different, and all I changed was 'list' -> "list"
moritz star: sub infix:<!+>(*@a) is assoc("list") { @a.perl }; say 7 !+ 6 !+ 10 17:16
p6eval star 2012.12: OUTPUT«Array.new(7, 6, 10)␤»
moritz r: sub infix:<!+>(*@a) is assoc("list") { @a.perl }; say 7 !+ 6 !+ 10
p6eval rakudo 69bbd1: OUTPUT«Array.new("Array.new(7, 6)", 10)␤»
moritz so it's a regression since the release? 17:17
doy r: multi foo (Str $name, *%params) { say "named params" }; multi foo (Str $name, Any $value) { say "value" }; foo('bar', (a => 1, b => 2))
p6eval rakudo 69bbd1: OUTPUT«value␤»
doy lack of list flattening does take some getting used to
17:17 FROGGS left
moritz lists flatten, but not everywhere 17:17
doy yeah
where do they flatten, exactly? 17:18
moritz on list assignment
and on list methods that flatten
17:19 muixirt left 17:20 Abcxyz joined 17:21 denisboyun_ joined
skids r: sub infix:<!+>(*@a) is assoc("not_a_specced_assoc") { @a.perl }; say 7 !+ 6 !+ 10 17:23
p6eval rakudo 69bbd1: OUTPUT«Array.new("Array.new(7, 6)", 10)␤»
dalek kudo/nom: 9303692 | moritz++ | src/core/traits.pm:
work around missing sink context from traits

fixes "is assoc"
17:26
japhb moritz: I'm guessing the Failure changes ROADMAP item was making some operations that currently error return Failures instead, once we had sink context right. (Note: I haven't backlogged yet, so if someone else commented on that, I haven't seen it yet.) 17:30
moritz japhb: ok, makes sense 17:32
pmichaud good morning, #perl6 17:33
moritz good am, pm
skids
.oO(non-lazy paradigms frontload all your calculations so you do even the ones you would throw away. Lazy paradigms rear-load them so they all the churn happens right when you would rather have a quick response time. Quandry.)
17:34
17:34 slavik1 joined
masak pmichaud! \o/ 17:41
17:42 raiph joined
pmichaud moritz++ # 2012.12 star release 17:43
I have the .msi on my calendar for tonight
17:43 hash_table left
raiph happy merry #*f adopted this as season's greet 17:46
17:48 nyuszika7h left 17:49 nyuszika7h joined 17:52 nyuszika7h left 17:59 FROGGS joined
moritz std: no strict; $x 18:01
p6eval std a8bc48f: OUTPUT«===SORRY!===␤Variable $x is not predeclared at /tmp/VXARs3kDQt line 1:␤------> no strict; ⏏$x␤Check failed␤FAILED 00:00 41m␤»
Abcxyz What is the advantage (or even difference) of a scripting language over a compiled language providing the eval keyword / function? 18:05
moritz Abcxyz: what exactly is a scripting language?
doy hrm, now i have "warn $!foo.defined; $!foo //= "foo"; warn $!foo.defined", where both of the warns are printing False 18:06
not entirely sure how to reproduce this on its own
18:07 nyuszika7h joined
skids doy: is $!foo rw? 18:07
doy skids: does that matter? 18:08
it's generated from "has $.foo", and i don't want the public foo accessor to be rw
moritz the $!foo form is writable wherever it is visble 18:09
doy yeah, that's what i thought
skids (aside, generally I find private attribs to be problematic due to NYI role trusts, and the occasional quirk.) 18:11
masak Abcxyz: if you have eval, you have some dynamism that's very hard to recreate without it.
doy it's a public attribute, i'm just writing a custom accessor for it
skids Right, but I've found working with the $! forms to sometimes be a bit treacherous. 18:12
masak Abcxyz: that said, eval is one of those sharp-edged tools which computer science seems happy to replace with slightly less powerful, safer tools as we go along.
Abcxyz: in JavaScript, the general consensus seems to be "eval -- don't do it". in Perl 5/6, it's more "eval -- it's there if you want it, but mind the risks". 18:13
skids doy: That is, there are some things not yet quite up to spec with them. 18:14
doy if i do "my $foo = $!foo", i can also reproduce it with $foo 18:15
18:17 rking left, rking joined 18:18 avar left, groky left 18:22 avarab joined, groky joined 18:23 avarab is now known as avar
skids doy: I can try to golf it, if you have a gist... 18:23
18:24 SamuraiJack left, mtk left, mtk joined
doy aha, found it 18:42
r: role Foo { }; class Bar { has Foo $.foo; method baz { my $foo = $!foo; my $replacement = Foo.new; say $replacement.defined; say $foo.defined; $foo //= $replacement; say $foo.defined } }; Bar.new.baz 18:44
p6eval rakudo 930369: OUTPUT«True␤False␤False␤»
doy role type constraints seem to break things
masak submits rakudobug 18:45
doy++ # nicely golf'd
r: role Foo {}; my $x = Foo; $x //= Foo.new; say $x.defined 18:46
p6eval rakudo 930369: OUTPUT«False␤»
masak r: role Foo {}; say Foo.new.defined
p6eval rakudo 930369: OUTPUT«True␤»
masak yeah. definitely something wrong there.
r: role Foo {}; my $x = Foo; $x = $x // Foo.new; say $x.defined 18:48
p6eval rakudo 930369: OUTPUT«False␤»
skids r: role Foo { }; my Foo $x.= new(); $x.defined.say # also this. 19:10
p6eval rakudo 930369: OUTPUT«Cannot assign to a non-container␤ in method dispatch:<.=> at src/gen/CORE.setting:949␤ in at src/gen/Metamodel.pm:1277␤ in block at /tmp/5h2_CfCZAb:1␤␤»
19:11 Chillance left, Chillance joined
doy all of the stringification methods not being able to handle recursive data structures is a bit annoying when debugging 19:12
masak I'm a bit surprised we haven't fixed that yet. 19:13
rn: my $a = []; $a[0] = $a; say $a.perl
doy s/recursive/cyclical/
p6eval niecza v24-12-g8e50362: OUTPUT«(timeout)» 19:14
..rakudo 930369: OUTPUT«maximum recursion depth exceeded␤current instr.: 'print_exception' pc 94134 (src/gen/CORE.setting.pir:44736) (src/gen/CORE.setting:9354)␤called from Sub 'flattens' pc 255839 (src/gen/CORE.setting.pir:115657) (src/gen/CORE.setting:5724)␤called from Sub '' pc 249168 …
skids Bug or feature? Could be viewed as a generator. Maybe what's missing is Cat? 19:15
masak skids: no, .perl should by definition produce code that generates the structure.
it's a finite structure, it just happens to link to itself. 19:16
skids OK, I'll buy that for .perl.
But Str?
masak possibly .Str should just loop forever on it, yes. 19:18
personally, I don't think having good Cat support is going to make this issue go away.
how does it know it's in an infinite regress and needs to produce a Cat? 19:19
doy i'm not sure why looping forever is a reasonable behavior for any kind of printing of a finite data structure
masak besides, we asked for a .Str
skids No of course not :-) .oO(some Cats don't even make mice go away)
masak: but as to the decision as to when to produce a Cat in such a situation, I don't see why finite Cats are not permissible. 19:22
doy r: class Foo { method bar { "BAR" } }; class Baz { has $.foo handles 'bar'; method foo { $!foo //= Foo.new; $!foo } }; say Baz.new.bar
p6eval rakudo 930369: OUTPUT«No such method 'bar' for invocant of type 'Any'␤ in method bar at src/gen/CORE.setting:267␤ in block at /tmp/TLZqaU2zdA:1␤␤»
doy shouldn't delegation be using the accessor?
or do i actually have to declare the delegation on the accessor in this case 19:23
if i'm writing my own
skids well, before that, you might want to actually invoke method foo. 19:25
doy the $.foo attribute handles the bar method
so i assumed it would get the value out of the $.foo attribute using the foo method
skids it might be specced that way... 19:26
It's a matter of when classes are allowed to optimize to direct access to attributes within their own code. 19:31
doy right
19:31 quester joined
skids The spec says that "has $tail handles 'wag';" generates the equivalent of "method wag (|$args) { $!tail.wag(|$args) }" so yes probably you want the method form of delegation. ISTR that might have been just recently implemented. 19:34
doy yeah, that's reasonable enough 19:36
and yeah, it works
skids r: class a { method b handles "say" { 1 } }; a.new.say; #caveat 19:39
p6eval rakudo 930369: OUTPUT«1␤»
skids r: role a { method b handles "say" { 1 } }; a.new.say; #caveat
p6eval rakudo 930369: OUTPUT«===SORRY!===␤Method 'add_method' not found for invocant of class 'Perl6::Metamodel::GenericHOW'␤at /tmp/TjBOSV8Q59:1␤------> ␤»
19:43 GlitchMr left, GlitchMr joined
Ayiko r: for ^0 { FIRST say 'first'; LAST say 'last'; LEAVE say 'leave'; } # should this LAST be run? 19:45
p6eval rakudo 930369: OUTPUT«last␤»
masak Ayiko: S04 says "at loop termination time". even an empty loop could be said to terminate. 19:46
r: for ^0 { my $a = 42; LAST { say $a }
p6eval rakudo 930369: OUTPUT«===SORRY!===␤Unable to parse expression in block; couldn't find final '}'␤at /tmp/0twlDG6Xpp:1␤------> for ^0 { my $a = 42; LAST { say $a }⏏<EOL>␤ expecting any of:␤ postfix␤ infix or meta-infix␤ infix st…
masak r: for ^0 { my $a = 42; LAST { say $a } }
p6eval rakudo 930369: OUTPUT«Any()␤»
Ayiko but then FIRST runs at loop initialization time, shouldn't that run too then?
19:47 Vlavv` joined, Vlavv_ left
Ayiko I understand there's a logic to it, it just happens to interfere with my current use case... 19:47
masak Ayiko: I may be wrong. 19:49
it also says "after any LEAVE", which would indicate that it is indeed tied to block entry/exit.
I definitely agree that FIRST and LAST should behave similarly.
masak submits rakudobug 19:50
today is a good day for rakudobugs :)
skids well, I wouldn't say "after any LEAVE" ties it that way, but would tend to agree whichever way they should behave, FIRST/LAST should be consistent.
Ayiko that's what I'd expect too (though I can see a use for a LAST2 that also runs on empty loops :)
masak eeew 19:51
just put the bloody code after the loop! :P
flussence
.oO( maybe &wrap should work on control structures )
Ayiko my @result isn't defined there :(
19:55 am0c joined 19:56 quester left
Ayiko r: do for m:ov/aa/ -> $m { say "$m $_"; } given 'aaaa'; 20:00
p6eval rakudo 930369: OUTPUT«===SORRY!===␤Unsupported use of do...given; in Perl 6 please use repeat...given␤at /tmp/HYePDD4wFf:1␤------> /aa/ -> $m { say "$m $_"; } given 'aaaa'⏏;␤ expecting any of:␤ postfix␤ infix or meta-infix␤ in…
Ayiko r: repeat for m:ov/aa/ -> $m { say "$m $_"; } given 'aaaa';
p6eval rakudo 930369: OUTPUT«===SORRY!===␤Missing block␤at /tmp/QBcxUuVhsK:1␤------> repeat ⏏for m:ov/aa/ -> $m { say "$m $_"; } give␤ expecting any of:␤ statement list␤ parameterized block␤»
labster good *, #perl6 20:04
skids o/ 20:05
labster \o
Last night, I was looking for a way to find the inodes of files (since I'm looking for duplicates, and thus hard links) 20:06
masak ohayo, labster
labster ohaiyo gozaimasu, masak 20:07
IO.stat isn't implemented yet, though it is in nqp, so I can just call nqp::stat for a single part of it, though I have no idea how to call the entire buffer 20:09
masak the two oldest masakbugs that are still open: rt.perl.org/rt3/Ticket/Display.html?id=61602 and rt.perl.org/rt3/Ticket/Display.html?id=62086
browsing through the very oldest masakbugs, it's encouraging to see how many were actually resolved (or, sometimes, rejected). 20:10
moritz r: say Inf.Int
p6eval rakudo 930369: OUTPUT«Cannot coerce Inf to an Int␤ in method gist at src/gen/CORE.setting:10338␤ in sub say at src/gen/CORE.setting:7515␤ in block at /tmp/NM9FRbZvnd:1␤␤»
moritz r: say NaN.Int
p6eval rakudo 930369: OUTPUT«0␤»
moritz I'd argue that Inf.Int is correct now 20:11
and NaN.Int should do the same
it's likely a small patch
20:12 GlitchMr left
labster but is IO::stat a place where we actually want to a stat buffer, or should we return an object to get .stat.inode, .stat.d, etc? 20:12
moritz and the other one ... it might actually be correct to throw an exception from ~
labster: the atter
masak moritz: according to that ticket, the spec considered Inf to be a valid Int.
moritz *latter
masak moritz: if it still does, then a coercion error is surely wrong.
moritz masak: but according to the spec, Inf is also a Num 20:13
ETYPEERROR
masak moritz: S02:701
20:13 SmokeMachine left
masak yes, I'm aware of the difficulties of Inf and NaN. 20:13
I haven't heard a good solution. 20:14
but still. that is what the spec says. to make it work somehow.
not to throw an error.
do we have prior art on this kind of problem? ten years ago, we would have said "junctive type! Int|Num" 20:15
we don't do that any more. we aim for saner solutions.
what would be a sane-but-still-permissive/interesting solution here?
rn: say +^1 20:17
p6eval rakudo 930369, niecza v24-12-g8e50362: OUTPUT«-2␤»
masak :)
skids doesn't grep -i any nan/inf in libtomath so no guidance there. 20:20
masak looking outside of numbers, Inf is meant to work with strings as well. 20:21
20:21 spider-mario joined
masak something like `-Inf before "foo" before Inf` is supposed to hold, for any "foo". 20:22
though I don't think it goes deeper than that -- I mean, Inf can probably be a number type and still do that.
arnsholt Is -Inf < -Inf (or <=, for that matter)? 20:23
masak rn: say -Inf < -Inf
p6eval rakudo 930369, niecza v24-12-g8e50362: OUTPUT«False␤»
masak rn: say -Inf <= -Inf
p6eval rakudo 930369, niecza v24-12-g8e50362: OUTPUT«True␤» 20:24
masak no, and yes. :)
arnsholt rn: say -Inf == -Inf
p6eval rakudo 930369, niecza v24-12-g8e50362: OUTPUT«True␤»
skids
.oO(why do we insist on asking computers questions that explode human heads and expect any different.)
masak arnsholt: I think this is in line with 754.
arnsholt skids: Because poking at the hard problems in life is fun =) 20:25
masak skids: oh, come on. Georg Cantor was the last human whose head needed to explode in order for us to grok infinities.
arnsholt masak: Right, right. That makes a lot of sense
doy "Cannot put a type constraint on an 'our'-scoped variable" # why is that? 20:27
masak doy: because the point of declaration isn't unique.
20:29 lue left
rindolf Hi all. 20:29
masak ohaiyo, rindolf. 20:30
rindolf masak: iowa!
masak: what's up?
arnsholt Having Inf/NaN in line with 754 makes a very much sense, really. The full mathematical reality would force the equality test to be ternary
masak rindolf: roof. night sky. space. :) 20:31
rindolf masak: www.shlomifish.org/humour/fortunes/...t-chuck-35 20:32
masak rindolf: did you come up with that before or after people here on #perl6 started answering you literally when you asked "what's up?" :P 20:34
rindolf: actually, even considering the actual meaning of that question, I'm not sure what answer you are expecting... 20:35
flussence
.oO( up is where I come from when I don't tie my shoelaces )
masak "well, it's the 13th year. we're still developing the language. it's going fine."
rindolf masak: I said various variations using /me is .
masak: but I added this factoid to my site about a month ago. 20:36
masak: it's original AFAIK.
20:36 atrodo left 20:48 spider-mario left 20:49 spider-mario joined
doy r: our $thing = False; proto foo {*}; multi foo { temp $thing = True }; sub bar { die "???" if $thing }; foo; bar; 20:53
p6eval rakudo 930369: OUTPUT«???␤ in sub bar at /tmp/RpPbtuBs5A:1␤ in block at /tmp/RpPbtuBs5A:1␤␤»
doy r: our $thing = False; sub foo { temp $thing = True }; sub bar { die "???" if $thing }; foo; bar;
p6eval rakudo 930369: ( no output ) 20:54
doy seems like temp doesn't work properly in multisubs?
masak submits rakudobug 20:55
tadzik 1247 masak | doy: yeah, tadzik and TimToady has had that discussion at least twice. 20:59
the moment I saw it I knew it has to be about BUILD
(good evening #perl6) :) 21:00
masak tadzik! \o/
tadzik: we all have our "favorite" discussion topics... :)
tadzik hehe
I'm no longer discussing BUILD, since whenever I do I get shouted at, and probably for good reason :P 21:01
skids
.oO(Hrm, maybe if BUILD were a multi instead of an only, BUILDALL could just be calling all candidates (still in an order)) # /me sees if he can get shouted at.
21:06
tadzik after 'BUILD' => { ... }; oh,-wait(...) 21:07
std: sub oh,-wait() { }
p6eval std a8bc48f: OUTPUT«===SORRY!===␤Malformed block at /tmp/o06pni52LI line 1:␤------> sub oh⏏,-wait() { }␤ expecting any of:␤ new name to be defined␤ routine_def␤Parse failed␤FAILED 00:00 41m␤»
tadzik dang ;)
skids r: sub prefix:< oh,-wait > (|d) { {"HIYA".say} }; oh,-wait(); 21:17
p6eval rakudo 930369: OUTPUT«HIYA␤»
21:17 buubot_backup left 21:26 telex left 21:28 telex joined 21:31 TreyRust joined 21:45 snearch joined
masak 'night, #perl6 21:54
rindolf masak: night. 21:55
timotimo i wish i had started doing more with perl6 much earlier, i could totally do a lightning talk about perl6 at the 29c3 tomorrow :| 21:56
skids timotimo: well, starting earlier also meant putting up with much less complete implementations. 21:59
timotimo that is true, but i don't even know the basics
i tried demonstrating how nice perl6 is to a friend last week and it was pretty pityful
skids I think your timing is pretty good, actually.
timotimo i do, too. 22:00
arnsholt If you plan your talk it can probably go fairly well 22:05
22:05 sjohnson left, sjohnson joined
arnsholt And I think there are some slides available from other people's more in-depth intros to Perl 6 22:05
For a lightning talk, you can get away with "look at these awesome features! Come play with us!" 22:06
timotimo right. but i couldn't really back them up with "come find me in the hackcenter afterwards to play with cool stuff" ;)
22:10 Kharec left, Kharec joined 22:13 Kharec left 22:14 Kharec joined
arnsholt Yeah, that might be a bit more limited 22:32
timotimo and everyone is going to sleep so early around here ;) 22:33
22:33 pmurias joined
timotimo (here being the irc, in relation to the congress) 22:33
22:33 lue joined
arnsholt Which congress? 22:34
22:34 rindolf left
timotimo 29c3 22:35
arnsholt I had to Wikipedia it, but now it makes sense 22:36
CCC, that's very cool!
timotimo it always is :) 22:37
but there's a lot of sexism going on in the hacker jeopardy right now, i hear :(
at least people are massively complaining about it on twitter. not sure if they are also speaking up in the hall, too
arnsholt Unfortunately, I'm not surprised =/
That's a good first step, at least 22:38
timotimo there's an official harrassment response team this year around, but the 'creeper move cards' (which come from a separate group) are getting quite a bit of ridicule :|
arnsholt Hopefully people keep doing it 22:40
*will keep 22:41
22:41 am0c left
timotimo they do have a point about the creeper move cards. they are hard to take seriously. the way they are used is you give people you already like green cards and use the red cards for trolling or as jokes 22:42
i have no idea how to fix the cards
but the harassment team (and their internal/external dect number) are a good start for sure.
arnsholt Yeah, that's a good idea 22:43
22:43 snearch left
arnsholt The cards are a good idea if they're used as intended, I think 22:43
timotimo yes, but i don't see that work at all any time soon :( 22:44
22:49 thou left
jnthn evening, for a moment o/ 22:58
phenny jnthn: 23 Dec 20:37Z <FROGGS> tell jnthn that this is my questionable patch: github.com/FROGGS/rakudo/commit/eb...213da2b43d
arnsholt Yeah, there's that. But on a more positive note, you can start planning a talk (maybe submitting a full-length one, even) for next year's CCC ;)
jnthn phenny: tell FROGGS the reason you get odd results is probably 'cus it looks like you add the other proto to the candidate list, rather than the other proto's dispatchees. 23:02
phenny jnthn: I'll pass that on when FROGGS is around.
jnthn phenny: tell FROGGS also you should only do this auto-merging for onlystar dispathcers; real competition to "own the proto" is a problem, I suspect. 23:03
phenny jnthn: I'll pass that on when FROGGS is around.
jnthn masak: the "temp" issue is a well known one of LEAVE/multi interaction, which is already field. 23:04
23:05 MayDaniel left
pmurias jnthn: if I want to insert info into a setting so I can load it when compiling other units how should I do that? 23:05
jnthn "insert info"?
pmurias jnthn: I want to compile a setting both to pir and javascript and have a mapping between object in both of that forms 23:06
jnthn: stuff that says "this object is compiled to OBJ143 in javascript"
jnthn Settings just become outer lexical scopes, so anything the setting puts in scope is visible, if that makes any sense.
pmurias yes
doy hmmm, can i dump a compiled regex somehow? 23:07
timotimo i talked to the talker here: events.ccc.de/congress/2012/Fahrpla...04.en.html
jnthn It sounds like you're about to re-invent the existing serialization stuff I already invented once... :)
timotimo i said perl6 has a .net based interpreter
jnthn That's *exactly* what the serialization context stuff does: gives objects indexes.
timotimo can niecza be embedded like ironpython for instance? 23:08
pmurias jnthn: that makes sense
jnthn: how can I get the serialization context index for a given object in the setting? 23:09
jnthn pmurias: mmm...hm
There's an op to do it I *think*
Look for where QAST::WVal is compiled
doy r: rx/foo.*bar/.perl
p6eval rakudo 930369: ( no output )
doy r: say rx/foo.*bar/.perl
p6eval rakudo 930369: OUTPUT«regex(Mu : Mu *%_) { ... }␤»
doy not particularly helpful(:
jnthn doy: Well, apart from if we make .perl dump the actual body we'd just have to include the whole program source. 23:10
Which I've resisted doing by default.
doy (:
something for .gist though would be nice 23:11
jnthn Certainly for Rakudo, there's not a good way to work back from the compiled output back to a source representation (ala deparse)
At the moment I suspect it just does whatever it does for any method (since regexes are really methods)
doy yeah 23:12
carrying around the originally parsed string maybe?
having something to look at would be pretty useful for testing and debugging 23:13
jnthn Just for regexes, or for methods in general?
doy hmmm
good question!
pmurias jnthn: do we only have on serialisation context? are the serialiasation ids unique?
jnthn pmurias: There is an SC per compilation unit. 23:14
23:14 thou joined, Kharec left
jnthn The contexts themselves have unique names; to fully resolve a reference you need to know both the name and the index. 23:14
I may have been thoughtful enough to explain some of this in the serialization format docs, fwiw. :) 23:15
23:16 MayDaniel joined
jnthn doy: At the "is it hard to implement" level, it'd be a very easy feature to add. 23:16
doy is that a hint?
(:
pmurias jnthn: nqp_get_sc_object returns a context which should provide both a context name and a index
jnthn More just clarifying that it's unimplemented due to me wondering if it should be, rather than 'cus it's hard to do :) 23:17
23:17 PacoAir left
jnthn pmurias: I think that's the op that actually does the lookup... 23:17
23:17 PacoAir joined
jnthn pmurias: github.com/perl6/nqp/blob/master/s...r.nqp#L946 23:18
$node.value is the object
After the operations you see there, $handle is the SC name and $idx is the numerical index. 23:19
23:19 stopbit left
jnthn It code-gens a nqp_get_sc_object to actually do the lookup 23:19
pmurias .handle is the context name? 23:20
jnthn Yeah
pmurias that's what I need, thanks 23:21
jnthn It's fairly consistently called "handle"
pmurias nqp_get_sc_object will work for stuff which is loaded from a setting? 23:22
timotimo please tell me again how i can tell someone who's AFK something using the bot?
jnthn phenny: tell timotimo that you use phenny like this
phenny jnthn: I'll pass that on when timotimo is around.
jnthn pmurias: yes 23:23
pmurias: So long as it got loaded at some point, all is good
pmurias: I just have a global in-memory "registry" of all the loaded ones.
23:23 MayDaniel left
jnthn pmurias: It works out even for nqp because I ensure that different bootstrap stages end up with different handles. 23:23
(otherwise you could get all kinds of confusion :)) 23:24
timotimo phenny: tell sorear events.ccc.de/congress/2012/Fahrpla...04.en.html this guy wrote a neat protocol analysis/fuzzing/MITM gui software using .net and i was telling him about niecza. can niecza be embedded like ironpython? 23:25
phenny timotimo: I'll pass that on when sorear is around.
timotimo: 23:22Z <jnthn> tell timotimo that you use phenny like this
sorear timotimo: I'm sure it's *possible* 23:27
phenny sorear: 23:25Z <timotimo> tell sorear events.ccc.de/congress/2012/Fahrpla...04.en.html this guy wrote a neat protocol analysis/fuzzing/MITM gui software using .net and i was telling him about niecza. can niecza be embedded like ironpython?
timotimo oh, there you are :)
the question was is the api similar? 23:28
sorear I doubt it 23:29
23:32 kaare_ left
pmurias jnthn: how can I check what the handle of a current unit is? 23:32
23:33 nyuszika7h left 23:35 nyuszika7h joined
jnthn pmurias: At compile time? 23:35
World exposes it, I think 23:36
Yes, .handle
23:38 Abcxyz left
jnthn time for some sleep & 23:45
23:46 grondilu joined
grondilu rn: my $n = 4; $n [+>]= 2; 23:47
p6eval niecza v24-12-g8e50362: ( no output )
..rakudo 930369: OUTPUT«===SORRY!===␤Preceding context expects a term, but found infix = instead␤at /tmp/87fIYgtr0e:1␤------> my $n = 4; $n [+>]=⏏ 2;␤»
grondilu rn: my $n = 4; say $n [+>]= 2;
p6eval rakudo 930369: OUTPUT«===SORRY!===␤Preceding context expects a term, but found infix = instead␤at /tmp/6SZBCJCyDT:1␤------> my $n = 4; say $n [+>]=⏏ 2;␤»
..niecza v24-12-g8e50362: OUTPUT«1␤»
grondilu rn: my $n = 4; say $n +>= 2;
p6eval rakudo 930369, niecza v24-12-g8e50362: OUTPUT«1␤»
grondilu rn: my @n = 1, 2, 4 ... 16; say @n X[+>] 2 23:48
p6eval rakudo 930369, niecza v24-12-g8e50362: OUTPUT«0 0 1 2 4␤»
23:54 denisboyun_ left