»ö« 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! | Rakudo Star Released!
Set by diakopter on 6 September 2010.
jnthn sleep & 00:41
kthakore jnthn: NOOoooOooOOoOooOOooooo 01:53
sorear kthakore: ? 02:45
allbery_b silliness, I'm pretty sure 02:47
dalek ecza: b312ffc | sorear++ | v6/tryfile:
[v6] Optimize regex use in getsig a bit
02:55
ecza: af5fde9 | sorear++ | / (2 files):
Use a slightly faster Hash.at_key
ecza: cb623ff | sorear++ | / (3 files):
Abstract vivification away from simply subs
ecza: 115676a | sorear++ | / (4 files):
Use specialized WHENCE for Hash.at-key
dalek ecza: 78f0696 | sorear++ | / (4 files):
Implement explicit invocant syntax
03:21
dalek odel: 06a55fd | diakopter++ | dotnet/compiler/PAST2DNSTCompiler.pm:
[dotnet] finish/enable failure path for pasttype literal
03:30
odel: 2e8b472 | diakopter++ | dotnet/compiler/DNST (2 files):
[dotnet] implement DNST::JumpTable, a syntax tree of switch/case Computed Goto (uses an Assigned Goto jumptable in the C# emitter) control structures.
sorear diakopter: assigned goto? 03:33
diakopter I dunno; that's what the wikipedia article said
en.wikipedia.org/wiki/Goto#Assigned_GOTO
at compile-time, the labels in pmichaud's regex compiler are strings, and I wanted to preserve that representation 03:34
sorear that looks more like a switch statement than a real assigned GOTO 03:35
I would *love* an assigned goto in C#
diakopter in the code generated from his compiler (PIR) it's an assigned goto.
sorear if it wasn't horribly inefficient
diakopter ok ok, you caught me being handwavy with the terminology; it's assigned-goto at JnthnNQP compile-time. and a zero-indexed int switch/case in C#, which should be JIT to machine code as a jumptable 03:37
so, at compile-time in nqp: 03:38
diakopter pauses that last sentence indefinitely 03:42
$statements.push($jumptable.mark("some marker_34xxxx")); more code here $statements.push($jumptable.jump(ZZZ)); 03:43
where ZZZ is some expression returning an int, and code that's generated to make that expression hold different int values (an array lookup/pop usually) knows to use that jumptable to convert the names to integers. 03:44
(unpaused)
then of course $statements.push($jumptable); at some point into the same CLR method. 03:46
joyer play the latest rakudo.. help, plz. How to do pack/unpack in perl6?? 04:32
sorear I do not understand that sentence. 04:34
kthakore sorear: you did seen kthakore ... I thought you wanted to talk to msimple old me
sorear kthakore: I think masak wanted us to talk 04:37
joyer: Sorry, I don't understand you.
joyer: Are you talking about 'perldoc -f pack'? 04:38
kthakore sorear: I was telling him about the memory proplem of the current perl6, for writing game. So he suggested to talk to you about memory stuff in perl6 (for slimming it down)
joyer sorear: no, I mean -- perl6 -e 'my $m = "abc"; unpack("A2")' get an error 04:41
I want to do binary pack/unpack in perl6 04:42
sorear rakudo: say unpack("i", "abcd")
p6eval rakudo : OUTPUT«Could not find sub &unpack␤ in main program body at line 22:/tmp/XPQoIXArt7␤»
sorear unpack isn't implemented yet 04:42
I think masak was working on it
joyer is there any workaround? 04:43
here : rakudo.org/announce/rakudo-star/2010.08 it says `* Initial implementations of .pack and .unpack` 04:45
I thought it may be done after 3m.
sorear oh 04:49
"." pack
sorear rakudo: say "abcd".unpack("i") 04:49
p6eval rakudo : OUTPUT«Method 'unpack' not found for invocant of class 'Str'␤ in main program body at line 22:/tmp/42eLOSSx6C␤»
sorear rakudo: say "abcd".Buf.unpack("i") 04:50
p6eval rakudo : OUTPUT«Method 'Buf' not found for invocant of class 'Str'␤ in main program body at line 22:/tmp/9uifT41ET1␤»
sorear rakudo: say "abcd".encode.unpack("i")
p6eval rakudo : OUTPUT«Unrecognized directive i␤ in <anon> at line 4495:CORE.setting␤ in 'unpack' at line 1␤ in main program body at line 22:/tmp/Elq7lbrSBN␤»
sorear rakudo: say "abcd".encode.unpack("c")
p6eval rakudo : OUTPUT«Unrecognized directive c␤ in <anon> at line 4495:CORE.setting␤ in 'unpack' at line 1␤ in main program body at line 22:/tmp/s3TF32Yn1A␤»
sorear rakudo: say "abcd".encode.unpack("n")
p6eval rakudo : OUTPUT«24930␤»
sorear so that's how you make it work
TimToady rakudo: say 97*256 + 98 04:52
p6eval rakudo : OUTPUT«24930␤»
sorear joyer: still here? 04:55
joyer yes 04:56
trying to get the idea.
rakudo: say "abc".encode.unpack("A2") 04:57
p6eval rakudo : OUTPUT«ab␤»
sorear any questions? 04:58
joyer how about pack?
sorear rakudo: say "n".pack(123456) 05:04
p6eval rakudo : OUTPUT«Method 'pack' not found for invocant of class 'Str'␤ in main program body at line 22:/tmp/CNpFkvYMn8␤»
sorear rakudo: say 123456.pack("n")
p6eval rakudo : OUTPUT«Method 'pack' not found for invocant of class 'Int'␤ in main program body at line 22:/tmp/EXYMF2Jml2␤»
sorear rakudo: say pack("N", 123456) 05:05
p6eval rakudo : OUTPUT«Buf()<0x71b43f0>␤»
joyer .encode.unpack vs pack ? a bit odd.
sorear rakudo: say pack("N", 123456).decode("ISO-8859-1")
p6eval rakudo : OUTPUT«Malformed UTF-8 string␤␤ in 'decode' at line 4412:CORE.setting␤ in main program body at line 22:/tmp/L3mwCZfyHf␤»
sorear rakudo: say pack("N", 123456).contents 05:06
p6eval rakudo : OUTPUT«0122664␤»
sorear rakudo: say pack("N", 123456).contents.perl
p6eval rakudo : OUTPUT«[0, 1, 226, 64]␤»
joyer I see. Thanks a lot. 05:09
sorear std: True ?? die "Foo" !! 2 05:25
p6eval std a194beb: OUTPUT«===SORRY!===␤Ternary !! seems to be missing its ?? at /tmp/80cGbPuxh4 line 1:␤------> True ?? die "Foo" !!⏏ 2␤Parse failed␤FAILED 00:01 120m␤»
joyer std: my Str @s = <a b c>; @s.sort; 05:36
p6eval std a194beb: OUTPUT«ok 00:01 121m␤»
joyer rakudo: my Str @s = <a b c>; say @s.sort;
p6eval rakudo : OUTPUT«maximum recursion depth exceeded␤ in 'at_pos' at line 5:CORE.setting␤ in 'at_pos' at line 5:CORE.setting␤ in 'Any::postcircumfix:<[ ]>' at line 1742:CORE.setting␤ in 'at_pos' at line 5:CORE.setting␤ in 'at_pos' at line 5:CORE.setting␤ in 'Any::postcircumfix:<[ ]>' at line 174…
joyer Why does the last input die?
std: my Str @s = <a b c>; say @s.sort; 05:37
p6eval std a194beb: OUTPUT«ok 00:01 122m␤»
sorear joyer: because you're using a type on an array 05:39
there's a bug of some kind that makes my Type @array die 05:40
my @array works fine
joyer so, .sort can't be use on a typed array?
ok, so this is a wellknown bug. 05:41
sorear .sort isn't the problem, typed arrays are
joyer In python's interactive shell. One can inspect an object with "dir(obj)" or "help(obj)". What is the perl6 way of doing that thing? 05:44
sorear rakudo: Sub.^methods.say 05:47
p6eval rakudo : OUTPUT«assumingwrapunwrapcandocandidatesaritycountACCEPTSnewassumingcallwithmultinameperlsignaturedoStrofreturnsNumericRealIntRatNumabsexploglog10sqrtrootsto-radiansfrom-radiansfloorceilingroundtruncatesigncisunpolarchrrandsincostanseccoseccotansinhcoshtanhsechcosechcotanhasinacosatanatan…
sorear rakudo: say [Sub.^methods]
p6eval rakudo : OUTPUT«assuming wrap unwrap cando candidates arity count ACCEPTS new assuming callwith multi name perl signature do Str of returns Numeric Real Int Rat Num abs exp log log10 sqrt roots to-radians from-radians floor ceiling round truncate sign cis unpolar chr rand sin cos tan sec cosec cot…
sorear rakudo: say [Sub.^methods(:local)] 05:48
p6eval rakudo : OUTPUT«␤»
sorear rakudo: say [Sub.^parents(:all)]
p6eval rakudo : OUTPUT«Routine() Block() Code() Cool() Any() Mu()␤»
joyer what is the semantic of the magical []
sorear it's the same [] you know from Perl 5
changes a raw list of values into an anonymous array
say prints arrays with spaces, but doesn't for raw lists 05:49
joyer that is wonderful
sorear TimToady: How do I predeclare a constant? I'd like to return False from a method in Any 05:57
dalek odel: 3307a45 | diakopter++ | dotnet/compiler/ (3 files):
[dotnet] fix bugs in the last commit
06:26
joyer pugs: say "are you there"; 06:56
p6eval pugs: OUTPUT«are you there␤»
dalek ecza: 6250090 | sorear++ | / (3 files):
Give responsibility for vivifying the container to at-key
07:19
ch3ck3r !seen masak 07:25
!seen ch3ck
!seen dalek
!seen ch3ck3r 07:26
sorear aloha, seen ch3ck3r 07:26
aloha sorear: ch3ck3r was last seen in #perl6 25 seconds ago saying "!seen ch3ck3r".
sorear what made you think !seen would work?
ch3ck3r it does work 07:27
!seen sorear 07:28
-dalek- ch3ck3r: sorear (~root@209.9.237.164) was last seen saying "what made you think ..." on #perl6 on freenode on Sat Nov 27 07:26:49 2010, that was 1m 26s ago
chatting as root, hm 07:29
sorear $ary[$i] = $i until ($i++) == 1_000_000; # 0.66 us Perl 5 08:08
sorear 22637 us Rakudo. I wonder if I should file a bug for this, it's by far the largest perl 5 / rakudo speed difference I've seen 08:15
er, 2637 08:16
2263
messed up my division there
factor of 3000 is much more reasonable
dalek ecza: a7608c4 | sorear++ | / (2 files):
Move Array, Hash, List into bootstrap class list
09:17
ecza: 009826c | sorear++ | / (3 files):
Extend hash optimizations to arrays
dalek ecza: cafc254 | sorear++ | v6/tryfile:
[v6] Remove conflicting code
09:52
lichtkind hai 10:04
sorear hi 10:10
lichtkind sorear: thanks now i can better show the grantmanager that iv done something :) 10:17
karma HerbertBreunung 10:20
aloha HerbertBreunung has karma of 0.
lichtkind karma Herbert Breunung
aloha Herbert Breunung has karma of 93.
dalek ecza: 80a8307 | sorear++ | lib/ (2 files):
Use a Bloom filter to speed up contextual processing
10:58
ingy sorear++ # niecza build so easy 12:36
drake1 dynamic evaluation in perl6, how does that work? 14:06
and what about local globals? 14:07
jnthn rakudo: my $x = 'say(42)'; eval($x) # you mean this? 14:08
p6eval rakudo : OUTPUT«42␤»
drake1 yes
jnthn rakudo: my $x = 'say($y)'; my $y = 69; eval($x)
p6eval rakudo : OUTPUT«69␤»
jnthn It can see the outer lexical scope where eval was called.
*scopes
And $*foo vars too.
drake1 ok 14:10
perl6 doesn't have global variables like $/ and $. ? 14:17
jnthn $/, $! and $_ remain but are now lexical, not global. 14:22
drake1 ok. thats pretty clean 14:23
jnthn Yeah. There is a way to put stuff in to a global scope, but afaik Perl 6 puts nothing of its own there. 14:24
drake1 then it's faster to learn 14:25
like in C where a block can have local objects that hide away the globals 14:28
simply be redeclaration 14:29
(not to mention implicit / restrict pointers to temporary objects) 14:33
drake1 does perl6 use getc, putc, fread and fwrite from the local C library? 14:51
drake1 C library / stdio object. sry 14:53
tadzik drake1: it uses Parrot opcodes, not the C library itself 14:59
Parrot may use C under the hood
drake1: if by Perl 6 you mean Rakudo 15:00
drake1 fine heheh
tadzik Niecza for example uses .NET stuff, IIRC
drake1 up to the Parrot then
sometimes I have to ponder whether regular ascii strings are a slower base encoding than binary 15:04
of course with a optimized type system, things have to turn a bit faster 15:05
drake1 depends the amount of evaluation 15:08
drake1 not for rapid meta-programming, probably 15:15
drake1 can perl5 modules be used in perl6? 15:18
drake1 for example, I just updated a PSF module for console fonts in perl5. could that be used directly in perl6? 15:21
tadzik you cantry. Blizkost runs some of the modules 15:23
drake1 good idea
drake1 maybe a few include(``'')'s could ease the pain. heh 15:36
tadzik hm? 15:37
drake1 in a build system for both perl5 and 6
tadzik that's exactly what's wrong with the build system 15:40
drake1 this one has: cat common $(version_specific) common ... alike rules 15:41
without a proper viewer, the include(`') style is probably the most comprehensive 15:43
tadzik I don't think I understand your poing 15:46
s/poing/point/
drake1 when the cat concatenates the individual version according to macro options, some kind of viewer is needed to be able to see the whole thing 15:47
since the source is fragmented into version specific and common files 15:48
(that comprise the individual sections) 15:51
drake1 although # file_name headers could provide for the achor points, from a preprocessed version specific source 16:01
s/preprocessed/concatenated 16:02
drake1 does perl6 use the source files in the library files? 16:10
or Parrot bytecode?
TimToady define "use"
jnthn In general, source files are authoratitive and any compiled versions are "cash" 16:11
er
cache
TimToady source files are treated hygienically though, not like includes
jnthn aye 16:12
drake1 when a program is going to use / load a library in the beginning, are the library files taken from their source stage or parrot byutecode?
TimToady perl6 officially doesn't care
jnthn drake1: Implementation dependent.
drake1 ok 16:13
drake1 jnthn: sounds close to perl5 with a boost 16:15
drake1 just what if someone wanted to make cach on a library, would that someone have to provide the source to authorize the cache 16:19
drake1 cash 16:20
hopefully, the parrot bytecode stage wont require an authoritative parent source 16:24
TimToady for official modules Perl 6 requires only an unspoofable and immutable identity 16:26
drake1 does that even exist? 16:27
TimToady it will
drake1 maybe so
TimToady once you have a universal naming scheme for immutable objects, you can get copies of those objects from anywhere
this solves most of the module scaling issues 16:28
drake1 good point
TimToady essentially the same approach as git and .NET
drake1 for all the hosts that are your friends
TimToady the cryptochecksum can be recalculated against the source, if you're paranoid 16:29
drake1 some hosts should be allowed to provide a variety of compositions imo
TimToady dunno what you mean
drake1 like with individual contents and hashes 16:30
TimToady dunno what you mean
drake1 or else the identity scheme won't allow decentralized dynamic distributions
only in the master / slave sense 16:31
TimToady thinks that's someone else's problem :)
Perl 6's responsibility stops at identifying the desired module uniquely. 16:32
drake1 like everyone should trust the same authority
as long as it's just the path name, then you're right. completely left to the package manager 16:33
TimToady sure, except maybe there's no path 16:35
drake1 yeah 16:36
/usr/perl is a fine authority 16:37
TimToady but to the abstract database lookup to find the actual module contents, it's just a stringy part of the universal module indicator. 16:38
in fact, we might as well call them UMIs 16:39
drake1 whatever they like
might work with the HAT hash
TimToady as long as a given module longname (UMI) always maps to the same immutable chunk of code (or its derivatives), P6 is happy 16:40
flussence module name + version + sha256 would be a good start...
drake1 fine
TimToady wildcard "use" is a step before that to translate a short name to a long name 16:41
+ auth
drake1 no need for sha
maybe in the package manager
flussence yeah, that sounds about right
TimToady yes, at least there
drake1 the HAT is only to look them up fater
faster* 16:42
TimToady ENOCARE
flussence doesn't the Encode module in p5 work a bit like this already?
with encoding alias lookups and stuff
TimToady EDUNNO 16:43
drake1 I used it for file handle ties, so characters written were local to the mode of interpretation
flussence that was the first thing that came to mind, I had to do charset translation for some horrible embedded hardware a while back :)
TimToady any number of shortname schemes can be layered on top of a longname scheme, but the converse is not true 16:45
drake1 with the utf8 flag or not, basically
moritz_ there is not UTF8 flag, and Juerd is its prophet. 16:46
TimToady so the best approach is if there is a good 1::1 correspondence between longnames ("URI") and immutable identity, and all shortname schemes are considered customizations or intentionally declared generic code 16:48
accidentally generic (underspecified) code is what tends to break as we go forward 16:49
to the extent that the entire system (including runtime support) is specified using immutable code, it tends to be unbreakable 16:51
breakages happen if the code is not immutable 16:52
they also happen if you don't actually have the code anymore, but borken proxy links to it
so the source code is important in that respect
TimToady if the entire semantics of a program can be expressed bootstrappishly in Perl 6 (modulo a few primitives), then a snapshot of that entire code set is quite stable 16:54
of course, that will run very slowly, and optimizers also break code regularly :) 16:55
Juerd moritz_: Prophet of the UTF8 flag?! :)
TimToady so which newspaper will be the first to publish cartoons of Juerd? 16:57
Juerd It's best to pretend the flag doesn't exist. Something that doesn't exist may very well have prophets, but I'm certainly not one of them. 16:58
drake1 piston coffee is quite a bit more instant than made by regular machines 16:59
jnthn Doesn't it taste bad if it's been piston? 17:00
jnthn duck 17:01
s
TimToady Juerd: so from that I can deduce that you don't care to differentiate between something not existing and you pretending it doesn't exist :)
drake1 quite the same
Juerd TimToady: Entirely correct
dalek odel: 5c00aa5 | jonathan++ | dotnet/compiler/ (2 files):
[dotnet] Make DNST::Local behave a little more like other nodes. Also, now we have it, use it in a couple of places that I shoulda before.
17:02
TimToady must be convenient...
drake1 perl5 wouldn't work with the CTYPE environment afaik 17:03
drake1 equivalence classes and sh** would need explicit `use ..' statements etc. 17:05
drake1 no great wonder since glibc uses wicked locale files 17:16
allbery_b l10n is hard, let's go shopping 17:18
drake1 perl wouldn't easily be able to compile the pattern engine nor specify something sane
yeah, thats my own conclusion, allbery 17:19
TimToady it should be possible to ask for braindamaged semantics, but it shouldn't be the default 17:22
allbery_b sadly, I think that while that's a nice idea in principle, it limits interoperability with pretty much everything 17:23
drake1 until they turn straight, local compensations might be the best 17:25
drake1 when you can't change the whole world; then at least show a good example 17:32
TimToady all is fair if you predeclare, including "use StupidStuff;" 17:33
drake1 only a little bit cumbersome 17:34
drake1 like the read ends of the `tee' needs duplication 17:36
drake1 Im off to add a todo to a PSF module. bye 17:50
tadzik seen mberends? 17:59
aloha mberends was last seen in #perl6 3 days 11 hours ago saying "masak: o/".
dalek odel: d253bff | jonathan++ | dotnet/compiler/DNST.pm:
[dotnet] Oops, :name for DNST::Local is required.
18:15
odel: 7f69a02 | jonathan++ | dotnet/compiler/PAST2DNSTCompiler.pm:
[dotnet] Refactor emit_op that diakopter++ added, and then use it in various places in PAST2DNST.pm, which makes things neater/shorter.
dalek odel: f1d5648 | jonathan++ | dotnet/compiler/PAST2DNSTCompiler.pm:
[dotnet] A similar refactor for emit_call.
18:19
jnthn afk, noms 18:22
tadzik rakudo: class A { has $.method; }; say A.can('method') 18:24
p6eval rakudo : ( no output )
tadzik rakudo: class A { has $.method; }; say A.can('method'); say 'alive'
p6eval rakudo : OUTPUT«alive␤»
tadzik hmm, any PSGI-familiar person? 18:40
TimToady tadzik: try again not in the middle of a major netsplit :) 18:41
tadzik loliblogged! ttjjss.wordpress.com/2010/11/27/gra...p-further/ 19:05
moritz__ Juerd: more like "prophet of ignoring the UTF8 flag" 19:06
Juerd :) 19:06
tadzik oh, the advent calendar is close 19:20
drake1 look www.gangsterfreak.com/vcfed - Now with Perl6 / Rakudo directions 19:28
tadzik nice 19:36
sorear good * #perl6 19:53
tadzik hello sorear 19:55
sorear TimToady: How do I go from STD:auth<perl.org>:ver<6.0.0> to <xdigit>**64 ? 19:59
TimToady don't much care, as long as STD:auth<perl.org>:ver<6.0.0> always means the same thing everywhere 20:04
I've excapsulated library issues :) 20:05
`26 I've mental issues :)
rindolf Hi all. 20:14
tadzik hi rindolf 20:14
sorear Hello rindolf 20:14
tadzik while the netsplit is gone, and everyone's up again:
loliblogged! ttjjss.wordpress.com/2010/11/27/gra...p-further/ 20:15
rindolf tadzik: , sorear : What's up?
tadzik rindolf: fun :) 20:16
oha is it possible to declare a Q:FOO{foo $bar cuz} so that the user defined function is called with ("foo ", \$bar, " cuz") or something similar? are there plans for? 20:21
moritz_ oha: I'm sure you can do that with macros... eventually
oha are macros available on rakudo? 20:22
moritz_ no
that's why I said "eventually" :-) 20:23
sorear niecza: my $bar = 123; my @foo = do { sub infix:<~>(*@x) { @x }; "foo $bar cuz" }; say @foo.dump
p6eval niecza 80a8307: OUTPUT«["foo ", 123, " cuz"]␤»
sorear I'm not sure if this counts as a bug
but it's possibly relevant
moritz_ that's... evil. And cute. 20:24
oha sorear: i've tried with rakudo, but was not able to. 20:25
moritz_ rkaudo probably uses a lower-level concatenation for string interpolation
oha moritz_: yep, i've checked the grammar and it seems so to me. 20:26
moritz_ I think the specification is silent about that aspect. 20:28
oha moritz_: but i get lost and i was not sure
would be nice to have a Q:SOMETHING{ ... }
moritz_ rakudo: my $bar = 123; my @foo = do { our sub infix:<~>(*@x) { @x }; "foo $bar cuz" }; say @foo.perl 20:29
p6eval rakudo : OUTPUT«["foo 123 cuz"]␤»
sorear where did the space after 123 come from
moritz_ rakudo: my $bar = 123; say (do { our sub infix:<~>(*@x) { @x }; "foo $bar cuz" }).split(/\s+/).perl 20:30
p6eval rakudo : OUTPUT«("foo", "123", "cuz")␤»
moritz_ :-)
oha moritz_: but sorear is right, isn't there an unwanted space?
moritz_ oha: maybe the returned array is stringified, and that adds a space between the elements 20:32
oha rakudo: my $bar = 123; my @foo = do { our sub infix:<~>(*@x) { say "dbg> "~@x.perl; @x }; "foo $bar cuz" }; say @foo.perl 20:34
sorear but there's only the one space in foo $bar
p6eval rakudo : OUTPUT«(timeout)»
oha emh... i'm stupid :)
rakudo: my $bar = 123; { our sub infix:<~>(*@x) { say @x.perl; @x }; "foo $bar cuz" } 20:35
p6eval rakudo : OUTPUT«["123", " "]␤»
oha the trick which put back the space captured after $bar?
i've read it in the grammar
rakudo: my $bar = 123; { our sub infix:<~>(*@x) { say @x.perl; @x }; "foo[$bar]cuz" } 20:36
p6eval rakudo : ( no output )
oha interesting... 20:37
oha my @v; my $x=12; my $y='ab'; { our sub infix:<~>($a,$b) { push @v, $a; '?' }; say "select * from table where x = $x and y = $y ;", @v } 20:39
sorear .perl uses ~
oha (i'm sorry for the CPU which host p6eval :) 20:40
sorear you're not using any CPU now
oha rakudo: my @v; my $x=12; my $y='ab'; { our sub infix:<~>($a,$b) { push @v, $a; '?' }; say "select * from table where x = $x and y = $y ;", @v }
p6eval rakudo : OUTPUT«select * from table where x = ?and y = ?;12ab␤»
oha (forgot rakudo)
nice! 20:41
oha rakudo: my @v; my $x=12; my $y='ab'; { our sub infix:<~>($a,$b) { push @v, $a; '? ' }; say "select * from table where x = $x and y = $y ;", [@v] } 20:41
p6eval rakudo : OUTPUT«select * from table where x = ? and y = ? ;12 ab␤»
masak ahoj! 21:26
phenny masak: 26 Nov 23:07Z <eternaleye> tell masak Hey! I read HP & the methods of rationality too! I prticularly like how Draco was absolutely floored by muggles being the first humans on the moon.
masak eternaleye: :)
jnthn o/ masak 21:27
masak \o
tadzik ahoj masak! 21:29
masak if you haven't seen this, you probably should. interview with Grace Hopper. www.youtube.com/watch?v=57bfxsiVTd4 21:32
tadzik lovely lady 21:45
sorear hello masak! 21:48
masak good evening. 21:49
rakudo: say 4.roots.perl 21:52
p6eval rakudo : OUTPUT«Not enough positional parameters passed; got 1 but expected 2␤ in 'roots' at line 3414:CORE.setting␤ in main program body at line 22:/tmp/1G2Mb1llu_␤»
masak oh, right. 21:53
rakudo: say 4.roots(2).perl
p6eval rakudo : OUTPUT«(Complex.new(2, 0), Complex.new(-2, 2.44929359829471e-16))␤»
masak submits rakudobug
thanks to VienosNotes++ on twitter. twitter.com/VienosNotes/status/8632485453766656
tadzik masak: seen my blog toast? 21:57
masak tadzik: no; haven't backlogged yet. 21:57
is it about .roots?
tadzik no, about PSGI and grammars
masak ah; looks promising :) 21:58
I'll get to it. right now I need to focus on Web.pm
tadzik I thought about writing a dispatcher for Web in grammars, if that's possible 22:05
masak might well be. 22:06
sorear perl 6 PSGI ? 22:12
lue ohai o/ 22:14
masak hilue.
dd-sphere godkväll masak \o
masak god afton dd-sphere.
masak thought so :) 22:14
ch3ck :D
tadzik sorear: ttjjss.wordpress.com 22:15
masak rakudo: my $answer = [] but role { method postcircumfix:<( )>( ($arg) ) { say "You called me with argument $arg" } }; $answer(5) 22:18
p6eval rakudo : OUTPUT«You called me with argument 5␤»
masak rakudo: my $answer = 42 but role { method postcircumfix:<( )>( ($arg) ) { say "You called me with argument $arg" } }; $answer(5)
p6eval rakudo : OUTPUT«invoke() not implemented in class 'Integer'␤ in main program body at line 22:/tmp/4wO4WdYY7v␤»
masak submits rakudobug
masak rakudo: my $x = [] but role {}; say "alive" 22:19
p6eval rakudo : OUTPUT«alive␤»
masak rakudo: my $x = class {} but role {}; say "alive"
p6eval rakudo : OUTPUT«Attempt to use rebless_subclass where the new class was not a subclass␤ in 'infix:<does>' at line 7294:CORE.setting␤ in 'infix:<does>' at line 582:CORE.setting␤ in 'infix:<but>' at line 609:CORE.setting␤ in main program body at line 22:/tmp/i4TLL1ncR2␤»
masak submits rakudobug
jnthn Two bugs that couldn't happen in 6model... 22:20
masak :)
talk is cheap :P
masak hides
diakopter :P 22:21
jnthn calls up an Uppsala polar bear to go chase masak a bit
masak I think I may have deserved that. 22:22
the sad thing? I was just toying around trying to recall what to put in the parameter list of postcircumfix:<( )>
jnthn a capture
I'm a bit surprised that doesn't work... 22:23
jnthn OTOH I fear the way we handle overriding v-table invoke in Parrot is...weird. 22:23
masak I was surprised too.
jnthn I don't know that it shoudl matter though.
Hm
masak I've mixed other stuff into integers, and it worked fine.
rakudo: role R {}; my $x = class {} but R; say "alive" 22:24
p6eval rakudo : OUTPUT«Attempt to use rebless_subclass where the new class was not a subclass␤ in 'infix:<does>' at line 7294:CORE.setting␤ in 'infix:<does>' at line 582:CORE.setting␤ in 'infix:<but>' at line 609:CORE.setting␤ in main program body at line 22:/tmp/Q5q96Y3ZP0␤»
jnthn masak: That one is because of the way type objects are done. 22:25
masak rakudo: role R {}; my $x = (class {}).new but R; say "alive"
p6eval rakudo : OUTPUT«alive␤»
masak ah.
jnthn Yeah.
Trying to fix that was one of the things that told me, "OK, we need type objects to REALLY be the same type"
masak rakudo: my $x = (role {}) but role {}; say "alive"
p6eval rakudo : OUTPUT«Attempt to use rebless_subclass where the new class was not a subclass␤ in 'infix:<does>' at line 7294:CORE.setting␤ in 'infix:<does>' at line 582:CORE.setting␤ in 'infix:<but>' at line 609:CORE.setting␤ in main program body at line 22:/tmp/hhrZMRYBT_␤» 22:26
masak jnthn: same as what? 22:26
ah.
as their instantiated cousins.
yeah, that sounds like a good idea.
jnthn Right :) 22:28
sorear jnthn: care to elaborate? I was about to do the opposite
masak like how his demolishing things can contribute to developer discussion :) 22:28
jnthn sorear: Mixing a role into something means that it's had an in-place change of type.
diakopter rakudo: say (role role { say (role role { }).WHAT }).WHAT.perl.eval
p6eval rakudo : ( no output )
jnthn sorear: Which it turns out gets awkward at times. 22:29
masak and diakopter is his same old evil self, I see :P
jnthn sorear: er, I mean...
sorear: It gets awkward if you make the type object an instance with a role mixed in.
I argued it was OK for a while too, then saw myself having to put in a bunch of special cases. 22:30
SMOP called that one right. 22:31
lue Is there a nifty way to see if a string is valid pair notation? [writing a looong regex would be fine with me, but it doesn't seem like the smart way] 22:34
TimToady rakudo: say eval(':foo<bar>') ~~ Pair 22:38
p6eval rakudo : OUTPUT«1␤»
TimToady for some definition of "nifty" that isn't very
masak alternatively, run it through the built-in Perl 6 grammar and see what AST node pops out :) 22:39
TimToady rakudo: use STD;
p6eval rakudo : OUTPUT«===SORRY!===␤Unable to find module 'STD' in the @*INC directories.␤(@*INC contains:␤ lib␤ /home/p6eval/.perl6/lib␤ /home/p6eval/p1/lib/parrot/2.10.0-devel/languages/perl6/lib␤ .)␤»
lue that's pretty nifty. 22:40
jnthn rakudo: if Perl6::Grammar.parse(':foo<bar>', rule => 'colonpair') { say "yes" }
p6eval rakudo : OUTPUT«===SORRY!===␤Malformed regex at line 22, near "=> 'colonp"␤»
jnthn ffs
masak huh?
jnthn rakudo: if Perl6::Grammar.parse(':foo<bar>', :rule<colonpair>) { say "yes" }
masak ah!
p6eval rakudo : OUTPUT«yes␤»
masak 'rule'
jnthn rakudo: if Perl6::Grammar.parse(':foo<bar', :rule<colonpair>) { say "yes" }
p6eval rakudo : OUTPUT«yes␤»
jnthn Oh.
oh yeah
:foo *is* a colonpair.. :) 22:41
masak std: rule => 'colonpair'
p6eval std a194beb: OUTPUT«ok 00:01 119m␤»
jnthn rakudo: if Perl6::Grammar.parse('foo<bar', :rule<colonpair>) { say "yes" }
p6eval rakudo : ( no output )
jnthn Yeah, works.
masak we already have a similar RT ticket about things that don't autoquote correctly in pairs.
jnthn yeah
lue rakudo: say eval('foo => 1') ~~ Pair 22:42
p6eval rakudo : OUTPUT«1␤»
lue rakudo: say eval('Pear') ~~ Pair 22:42
p6eval rakudo : OUTPUT«0␤»
TimToady rakudo: say eval(':foo<bar') ~~ Pair 22:43
p6eval rakudo : OUTPUT«0␤»
TimToady we oughta have a parse primitive that uses the current language
jnthn $*LANG.parse ...?
TimToady $?LANG maybe
jnthn ah, yeah 22:44
compy time.
TimToady but it would be nice to have access to the various bits of eval
lue if only I could get that in a regex...
sorear %*LANG surely 22:47
sigil invariance
TimToady %?LANG then
sorear $~MAIN anyway
when are constants run?
TimToady but sub parse wants to be able to get at CALLER::<$~MAIN> 22:48
constant definitions always run at compile time
an enum is their prophet
all declarations are funny constant declarations, really 22:49
sorear what should I do about constant FOO = ... if my compiler doesn't have a Perl 6 interpreter available 22:52
TimToady re type objects, I've always thought of them as a kind of photon/gluon that carries a "type charge" on a massless object 22:53
sorear: write one
it is a requirement of Perl 6 compilers to be able to run code at compile time
constants are just a way to name a constant folding 22:54
in any case, it is required that BEGIN run as soon as parsed 22:55
masak due to BEGIN, a compiler needs to have a runtime. due to eval, a runtime needs to have a compiler. 22:56
TimToady yes, they are both extreme safety valves that we use to discover places where we haven't designed other, safer ways to do it 22:58
dalek odel: 40db931 | jonathan++ | dotnet/compiler/PAST2DNSTCompiler.pm:
[dotnet] Implement viviself for PAST::Var scope attribute.
TimToady so we see that, in theory, we can avoid the eval above with a sufficiently advanced parser interface
sorear hasn't figured out how to make BEGIN work sanely with a precompiler 22:59
TimToady likewise, suffiently advanced declarative magic prevents the need for most BEGINs
masak any sufficiently advanced parser interface is indistinguishable from Perl 6 :)
sorear if I'm running user code at compile time, I need to account for the possibility of module B changing module A's serialized data
TimToady just so
well, I've gotta decommute from SoCal now 23:00
jnthn sorear: That one worries me a lot too.
sorear: Before long, we've had to write an object version control system. :)
sorear or what if I load module B at runtime, but the main program has made significant changes to module A's serialized data and it no longer matches what B was linked against?
TimToady you mean you used MONKEY_TYPING on B? 23:01
then you get what you deserve
TimToady somewhere it's specced that the meaning of B should not depend on the main program 23:02
sorear more like
lue can you match pair notation inside a regex?
sorear module A { our $x = 1; }; module B { $A::x = 2 };
the precompiler runs the assignments
now use A; use B; say $A::x; 23:03
TimToady you used globals. you lose.
masak lue: you should be able to call the <colonpair> rule from inside a regex, yes.
jnthn The module body doesn't run at BEGIN time? 23:04
So that one ain't an issue...
dalek ecza: 670df6e | sorear++ | / (5 files):
Extend primitivization to most scalar operators
TimToady anyway, BEGIN is what it is, and I gotta run
well, drive...
sorear aww I missed you 23:05
TimToady bbl & # ~7 hours
sorear oh
if it's only 7 hours you weren't quite So enough, nm
\o/ parsed STD.pm6 in 59 seconds 23:06
diakopter wow 23:07
masak starcoder: where were you when we released Rakudo Star? :) 23:31
starcoder hehe 23:32
masak blog post! strangelyconsistent.org/blog/novemb...n-planning 23:33
masak goes home 23:38
dalek odel: e3468dd | diakopter++ | common/NQP/P6Objects.pm:
[common] fix regression due to jnthn++ 's real fix in Op.repr_defined
23:39
diakopter jnthn++ writing the tests that make my brain boil to think about writing 23:52
dalek odel: b2c6bf9 | jonathan++ | dotnet/runtime/Runtime/Ops/Metamodel.cs:
[dotnet] Simply repr_defined now that we have attr viviself and needn't work around NREs.
23:53
odel: 0094141 | jonathan++ | t/nqp/57-attributes.t:
[t] Add test to cover attribute auto-viv.
odel: 7bbf3f8 | jonathan++ | t/nqp/45-smartmatch.t:
[t] Add a muchly simplified version of 45-smartmatch.t. It's enough to make sure that I don't break the regex impl as it stands so far again, hopefully. :)
sorear what exactly is viviself? 23:55
jnthn sorear: It's an attribute on PAST::Var nodes that says what to do if the thing the lookup produces is null 23:56
diakopter while compiling, a way to track what sigil...yeah
sorear you can't use defined-or for that/ 23:58
diakopter but that's what it's compiling.. the way to test definedness
jnthn null = should never leak into userland
defined-or tests .defined 23:59
Well
sometimes we use repr_defiend directly but...
...that unless overridden boils down to repr_defined