»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by masak on 12 May 2015.
00:12 tinyblak joined
ugexe wise to remember that use lib with a relative directory is a free ticket to test failures, as you shouldnt expect the test to take place from a specific CWD 00:17
00:18 mohij_ joined
skids Testing almost always does happen with CWD set to the package root, and almost all packages presume it does when they look for test data files. It's the de-fact standard and I don't see where the entire ecosystem is going to adjust if some tool decides it wants to do otherwise. 00:20
In fact, it's an invitation to failure NOT to do it, as you are more likely to find stale copies of your lib in the install path. 00:21
ugexe its makes any kind of parallelization stupid if you have to watch what CWD you are in at all times 00:24
if you just invoke your tests with -I or PERL6LIB then a relative path is fine, as the user can control the path 00:25
skids But not all users do that, and that still leaves the issue of where to find data files.
ugexe whats wrong with $?FILE.IO.dirname.child('data') or wahtever 00:27
skids what's wrong with "use lib $?FILE.IO.dirname('lib')"?
ugexe you cant use a variable inside a use statement?
skids Well, maybe we should fix that instead. 00:28
Anyway I don't think the larger community is going to sacrific the convenience for the sake a parallelization.
00:29 DarthGandalf left
skids Better if any tool that wants to run outside the package root make sur it is in a directory with no './lib' present, then problem solved. 00:30
00:30 DarthGandalf joined
dalek kudo-star-daily: a783cb9 | coke++ | log/ (9 files):
today (automated commit)
00:30
rl6-roast-data: be291aa | coke++ | / (8 files):
today (automated commit)
ugexe precompiled code doesnt have to go in lib or any specific directory
skids Anyway, use lib "{$?FILE.IO.parent.dirname ~ '/lib'}" does in fact work. 00:41
(not that I advise using it.) 00:43
00:59 pullphinger joined 01:00 VinceDee joined 01:06 muraiki joined 01:09 BenGoldberg joined 01:10 yeahnoob joined
ugexe glad to see variable interpolation works in use lib now, sweet. but i wouldnt say the larger community holds a strong opinion on having to be in CWD, and as far as ive always experienced in perl5 you would be encouraged to do it the nearly the same way if reuse is an expectation: use lib $FindBin::Bin/../lib 01:13
skids It's just more convenient for the more hands-on users if they can cd there and not have to use -l/PERL6LIb to run tests. 01:14
If you use "use lib './lib'" the only time that blows up is if the user is in another directory with a ./lib with modules with your same name. 01:15
While automatic test tools can be coded to avoid that.
So it makes more sense to just put in "use lib './lib'"
ugexe you dont have to have a /lib. your tests would just fail when they cant find any of the modules 01:16
01:16 rmgk_ joined, rmgk_ is now known as rmgk
skids If you are running outside the package and running its test, it does not matter if there is a "use lib './lib'" in the test file. You have to supply the path if you choose to do that. 01:17
01:18 muraiki left
skids The only time it matters is if you try to run version A of the package while your CWD is in version B. 01:18
ugexe ah, i was speaking exclusively
i guess i just see it as your average user isnt cding into the project directory themselves and testing anything. they want to run 'install' and be done with it. and ive never felt it was too much for a developer familiar with his enviroment to add a -l or just code his use'es approrpriately 01:22
raiph .ask jnthn I'd love to be able to show off Grammar::Generative... github.com/jnthn/grammar-generativ...-121105324
yoleaux raiph: I'll pass your message to jnthn.
skids Well, personally I enjoy the convenience of not have to type it, and I'm a developer.
(kinda) 01:23
ugexe do you enjoy it more than all the users who just want to install a module and not have to deal with wierd failures?
that is what i am more concerned with 01:24
skids What weird failures? When will they happen?
ugexe when panda loses its CWD context through any number of ways 01:25
01:25 vendethiel joined
skids If panda is running tests on the package without caring about its CWD, it is using PERL6LIB, so the presence of a "use lib" in your test files does not matter to it. 01:26
raydiak raiph++ thanks for keeping that issue alive
01:27 kurahaupo joined
ugexe thats not how it works 01:27
skids I've had 0 problems and had "use lib './lib'" in my test files for years now. I fail to see any likely scenario where it would cause issues. 01:29
raiph raydiak: I wasn't aware of it. But I have what I consider a perfect use case for GG. I got excited, wrote the grammar first, and then...
ugexe maybe i just run a lot of tests
kurahaupo skids: what's the point of "./" there? 01:30
skids I don't think there are many packages with as many tests as Sum.
ugexe i dont think anyone runs more p6 tests than me
skids kurahaupo: so if you are in the package's directory you can just run "perl6 t/foo.t" 01:31
I just haven't seen an example of an actual problem.
01:31 tinyblak left
kurahaupo skids: no, that's what "use 'lib'" is for; I'm asking why you inserted the apparently superfluous "./" there 01:31
skids kurahaupo: it's self-documetary. 01:32
kurahaupo or is it not superfluous and actually does something?
raydiak raiph: I had started writing a shoddy version of something like it before someone pointed it out to me...sadly it hasn't worked for quite a while, it seems 01:33
kurahaupo skids: putting "use lib blah blah" at the top level is fine. Putting it inside lib files is fraught, because it then depends on what order they're loaded. (I've seen some truly nightmarish systems with multiple levels of overrides of lib files based on putting the same name in different directories...) 01:34
skids kurahaupo: I only use it in t files.
kurahaupo skids: which are top level, so that's fine 01:35
skids That's all I've been arguing for.
01:35 tinyblak joined
kurahaupo skids: but what happens when you run cd ~ ; perl6 /path/to/test/perl/t/foo 01:36
skids You have to set a PERL6LIB if you want to find the mods. Just like if the "use lib" was not there.
kurahaupo skids: ok, but what about cd /path/to/live/perl ; PERL6LIB=/path/to/test/perl perl6 /path/to/test/perl/t/foo 01:37
skids: is that "use 'lib'" going to override PERL6LIB ? 01:38
skids Dunno, haven't tried actually. But why would you have a stale copy of my mod in /path/to/live/perl/lib ? And if you do, you should know what you are doing. 01:39
Yes, the "use lib" goes before PERL6LIB so it will be used. 01:42
raiph raydiak: As I hint in the GH issue, GG looks eminently debuggable via jnthn's debugger by someone who knows what an $ast.rxtype is. 01:43
01:46 dayangkun joined 01:47 dayangkun left
ugexe so what happens when you want it to test against the blib instead 01:49
01:50 lsm-desktop joined
ugexe it would get the /lib version first, no? 01:50
skids Don't be in someplace that has someting you don't want to test in "./lib"?
(doctor that hurts...)
ugexe dont test the precompiled modules. got it 01:51
skids What?
01:51 dayangkun joined
ugexe how do you test against the blib/, the precompiled modules, if your tests are including 'lib' no matter what 01:52
skids What "blib"?
ugexe well, taking only panda into consideration, its the directory where your precompiled output goes 01:55
skids Right but the moduleloader finds precomps based on their compiled filename in the database, not by fs search. 01:56
ugexe you can test before installing it
skids I'm not following the implication. 01:57
ugexe its not in the database anywhere until you install it
01:57 dj_goku joined
ugexe hence prove having a -b/--blib flag 01:58
(for when you dont want to test -l)
raydiak raiph: I had thought about trying to track it down myself, but it's way over my head as-is, temporarily have a day job so lacking solid blocks of time for diving in the deep end like that 01:59
02:00 colomon joined, atroxaper joined
ugexe and fwiw, it does infact do a fs search for the precomp modules during CompUnitRepo::Local::Installation.install($path) 02:03
or rather, expects you to hand them over
and iterates over those 02:04
02:04 atroxaper left
raiph raydiak: Sure. I'm poking at it a bit. My first guess is it's some rejig of QAST structure, perhaps a Stmt/Stmts thing. I'll update the issue if I find anything interesting. 02:04
how does one search the commit messages of commits to a repo on GH? 02:06
02:06 aborazmeh joined, aborazmeh left, aborazmeh joined
raydiak raiph: exciting :) good luck! 02:06
skids Well, all I know is I have "use lib './lib'" in there and panda has no problem failing on compile-only bugs when installing. 02:08
*precomp-only 02:10
but perhaps it would be prudent to add 'blib' to the use lib statement. 02:11
02:12 noganex joined
ugexe if you assume it will always be precompiled to blib. if you use CompUnit.precomp directly it goes in /lib next to your source code 02:21
in otherwords, you shouldnt expect it to be in any specific spot
i have no problem with blib being assumed though. it just doesnt seem to be set in stone anywhere as of yet 02:24
skids All I expect is this: a) automated utilities will deal with it rather than making everyone else at large type -llib all the time B) people cding into the package and doing things will be abe to just perl6 t/test and C) anyone doing anythin unusual enough to have problems because of it should be prepared for unusual things. 02:27
ugexe i dont think typing -l is asking much of a developer vs user's ease of use, and even more so for the ability for any user to distinguish which lib he wants to test 02:34
or, just writing your tests in such a way that it doesnt matter what directory they are invoked from 02:35
dont even get me started on windows 02:36
skids Asking developers to repeatedly do that versus just coding it once into utilities is a no-brainer for the letter IMO. 02:37
*latter 02:38
ugexe asking developers not to be able to diferentiate between lib and blib is more insane
skids I dunno I never used a blib myself. FWIW it seems panda installs both source and mbc in blib/lib and then runs from inside blib. I think. 02:39
I think working with precomps is a rarer activity than working on source. 02:42
If they are going that deep they know how to work around it.
02:42 VinceDee left
ugexe if you expect your users to do all the extras so the developer doesnt have to, sure 02:43
skids When is a user going to have problems? 02:44
ugexe with?
skids (I don't mean to be argumentative, btw I'm just trying to understand the supposed issues so I can weigh the decision of what to do.) 02:45
What extras are the users supposedly doing? 02:46
ugexe you are asking the user to do whatever is required to fix the test so it can be tested against blib
skids I would call that a developer, no a user. A user is more likely to cd into the directory, say "hey these are test files let me perl6 them" and then say "hey why is it still behaving like the old package I used to have installed" 02:47
ugexe thats the type of person i expect to know better 02:48
skids I don't.
ugexe i expect a user to just do install essentially
most cpanm users do not do cpanm look, cpanm test, cpanm install
skids right, so, as long as the utilities work around it they never see a problem. 02:49
ugexe but they cant work around a test with use lib '../whatever' other than being in $*CWD
so if any of your dependencies or your module it self does a chdir and fails to return, you just end up with errors that wont immediately make sense 02:50
skids Sure they can. Don't be in the package directory and -lblib.
well -l/path/to/package/blib 02:51
ugexe heres the panda scenario that kept happening over smoke testing: indir 'whatever' { <tests some threaded code that crashes without exiting this block properly> } <now im in the wrong directory>
(indir is expected to return to its original directory at the end) 02:52
skids panda should probably stay in the same dir, then, and use explicit paths. 02:53
kanl b2gills: good to know, tyvm!
02:55 BenGoldberg left
ugexe then panda would have to download the repo over top of whatever directory you are in 02:55
skids No just stay in .panda_work
ugexe if you have dependencies you have to jump between those at least 02:57
skids just build them al in their own directory while never leaving .panda_work and add lots of search paths. 02:58
ugexe ive already overcome all of these problems myself, but other tooling hasnt 02:59
the solution is generally spawnning new processes. so it has a rather big drawback of being slow. it would be nice to not have to invoke a new p6 interpreter for each tests to get the neccesary CWD protections from modules gone haywire 03:00
skids Yeah well changing CWD in module code is cheezy IMO. 03:01
03:03 kaare_ joined 03:14 colomon left 03:16 telex joined 03:26 colomon joined
ugexe it may best be solved if/when { temp $*CWD = $&FILE.dirname; } does all the magic and makes it trivial for the user or the developer to work around expectations in an elegant manner 03:43
03:43 colomon left 03:45 lizmat joined
ugexe including whatever heisenbugs are able to break the usual implementations of that without using `temp` 03:45
tony-o i think trying to keep track of 20 search paths for spawning a process is a little more convoluted than just temporarily changing cwd to spawn a process in the directory it should be in originally - then youre hacking prove and whatever else is needed to be in the module root dir 03:46
03:47 tinyblak left
tony-o all the hooks, evwrything else kind of makes the assumption that youre in the root module dir 03:50
skids Well, anyway so far I've settled on 'use lib <blib/lib lib>' and using $?FILE to find data files since they will probably not be ripped out of t/ for any reason. I think that will be least-average-surprise. 03:52
ugexe use lib IO::Path.new-from-absolute-path("lib".IO.absolute(CWD => $&FILE.dirname).IO.resolve).child('MANIFEST').slurp andthen %(from-json($_)).<provides>>>.values>>.abspath; # this might be safest 03:58
skids I'll parse that tomorrow after sleep :-) 04:00
Thanks a lot for the discussion.
04:00 kurahaupo left
ugexe sure. ive taken up enough chat log for one day myself 04:06
04:10 TEttinger joined 04:18 skids left 04:21 AlexDaniel joined
AlexDaniel how can I create a new sub from a macro? 04:23
m: macro FOO { quasi { sub Bar { say 'woohooo'}; }; }; FOO; Bar(); 04:24
camelia rakudo-moar 533d1a: OUTPUT«5===SORRY!5=== Error while compiling /tmp/PGtnDGc7Nt␤Undeclared name:␤ Bar used at line 1. Did you mean 'Bag'?␤␤»
04:24 vendethiel left
AlexDaniel it might be a scoping problem? 04:24
04:25 vendethiel joined 04:27 atroxaper joined, atroxaper left, atroxaper joined
AlexDaniel m: macro FOO { "sub Bar { say 'woohooo'}" }; FOO; Bar(); 04:40
camelia rakudo-moar 533d1a: OUTPUT«woohooo␤===SORRY!===␤Too few positionals passed; expected 3 arguments but got 2␤»
AlexDaniel too few positionals? huh? 04:41
where?
ugexe m: "sub Bar { say 'woohooo'}" 04:44
camelia rakudo-moar 533d1a: OUTPUT«woohooo␤»
ugexe $string = "sub Bar" ~ do { say 'woohoo' } 04:46
04:47 kurahaupo joined
AlexDaniel ugexe: what's that? :) 04:47
ugexe the { and } in your double quoted string executes the code inside 04:48
AlexDaniel oooooh
m: macro FOO { ‘sub Bar { say 'woohooo'}’ }; FOO; Bar(); 04:49
camelia rakudo-moar 533d1a: OUTPUT«===SORRY!===␤Too few positionals passed; expected 3 arguments but got 2␤»
AlexDaniel nope, still don't get it
ugexe: that's not the case in single quotes? 04:50
ShimmerFairy m: macro foo { 1 }; foo; 04:51
camelia rakudo-moar 533d1a: OUTPUT«===SORRY!===␤Too few positionals passed; expected 3 arguments but got 2␤»
ShimmerFairy m: macro foo { quasi { 1 } }; foo;
camelia ( no output )
ugexe nope. "" interpolates
AlexDaniel ugexe: but then I don't get it at all 04:52
ugexe yeah i dont see anything wrong with your syntax after you changed it
ShimmerFairy Perl6 macros aren't string-based, so I don't know what you're hoping to accomplish there :) 04:53
AlexDaniel ShimmerFairy: not really?
"Macros may return either a string to be reparsed, or a syntax tree that needs no further parsing. The textual form is handy, but the syntax tree form is generally preferred because it allows the parser and debugger to give better error messages."
from design.perl6.org/S06.html#Macros 04:54
but yeah, I don't want to return a string. How can I create a sub? 04:55
ShimmerFairy The portion you quoted hasn't been touched since 2008. I'd be extremely surprised if that "string to be reparsed" is still considered a part of macros. 04:57
AlexDaniel m: macro FOO { 'say 1' }; FOO; 04:59
camelia rakudo-moar 533d1a: OUTPUT«===SORRY!===␤Too few positionals passed; expected 3 arguments but got 2␤»
AlexDaniel hm
ShimmerFairy m: macro FOO { quasi { sub Bar { say "woohooo"}; } }; FOO()()
camelia rakudo-moar 533d1a: OUTPUT«woohooo␤»
ShimmerFairy Of course, that's probably not what you're after :P
AlexDaniel ShimmerFairy: nope. 05:00
ShimmerFairy m: macro FOO { quasi { sub Bar { say "woohooo"}; } }; our &Bar = FOO(); Bar # you could use 'anon sub' or '->' instead of 'sub Bar' in this case 05:01
camelia rakudo-moar 533d1a: OUTPUT«woohooo␤»
ShimmerFairy I'm not familiar enough with macros to know how to make it work properly, or if it's a bug that the way you're trying isn't working.
AlexDaniel ShimmerFairy: all this trickery does not help, I need multiple dispatch to work in the end 05:03
unless there are tricks to make that work... 05:05
05:26 AlexDaniel left 05:29 kurahaupo left 05:35 ][Sno][ is now known as [Sno] 05:50 vendethiel left 05:55 davido___ joined 05:57 vendethiel joined
dalek ar: 6571779 | FROGGS++ | tools/star/release-guide.pod:
state that I did the 2015.06 release
06:12
06:17 FROGGS joined 06:21 vendethiel left 06:24 dayangkun left
JimmyZ FROGGS: 2013.03 moritz 06:29
+ 2013.06 FROGGS
FROGGS: it is 2015 now :)
moritz: ^^
FROGGS ewww 06:33
dalek ar: 40e2bfd | FROGGS++ | tools/star/release-guide.pod:
fix typo in release year, JimmyZ++
06:35
06:35 abraxxa joined 06:44 rindolf joined 06:45 diana_olhovik joined 06:47 zakharyas joined
moritz it is? 06:47
maybe that's why nobody's paying my invoices 06:48
FROGGS :P
FROGGS has to do that on his own too :o(
I want self-paying invoices!
06:49 zostay joined 06:52 verzz joined
moritz don't need to be self-paying; it's enough if somebody else reliably pays them 06:53
06:54 tinyblak joined 07:04 diana_olhovik left
FROGGS true 07:04
07:10 vendethiel joined 07:11 darutoko joined 07:13 kurahaupo joined 07:19 aborazmeh left 07:23 FROGGS left 07:29 RabidGravy joined 07:33 vendethiel left 07:38 FROGGS joined 07:39 vendethiel joined, tinyblak_ joined 07:43 tinyblak left 07:45 espadrine joined 07:48 amurf left 07:55 g4 joined, g4 left, g4 joined 08:00 vendethiel left 08:06 virtualsue joined 08:09 dakkar joined, vendethiel joined 08:10 coffee` joined 08:12 atroxaper left, ely-se joined
ely-se Hello, Perl! 08:12
DrForr Marnin'. 08:22
08:24 spider-mario joined
ely-se Why is MVM register-based instead of stack-based? 08:25
08:25 aborazmeh joined, aborazmeh left, aborazmeh joined
moritz ely-se: because it's easier to generate code for register-based machines 08:26
and in terms of performance, both are about the same
ely-se In my experience generating code for such machines is more difficult. 08:27
However I can imagine generating machine code _from_ them is easier. 08:28
08:29 yeahnoob left
jnthn wrote much of the QAST to JVM and QAST to MoarVM code-gen, and the MoarVM one was easier for me, at least :) 08:29
yoleaux 01:22Z <raiph> jnthn: I'd love to be able to show off Grammar::Generative... github.com/jnthn/grammar-generativ...-121105324
ely-se though maybe it depends on the source language
with order of evaluation and such
jnthn *nod*
ely-se I'm currently implementing a stack-based VM in JavaScript. 08:30
08:30 Woodi joined 08:32 vendethiel left, samgwise joined 08:36 vendethiel joined
ely-se it can already execute hello world xd 08:39
samgwise Hi #perl6 :) 08:40
kanl m: my %h = a => 1; %h<b> = %h.values; %h.say;
samgwise I've been trying to compile from source on win 7 without success :(
camelia rakudo-moar 533d1a: OUTPUT«(timeout)»
samgwise I'm using VS 2015 RC and I run into a failure at stirngs/unicode.c 08:41
the compiler is complaining that it's encountered fatal error c1026: parser stack overflow 08:42
moritz samgwise: sounds like a bug in the compiler 08:43
ely-se MSVC is well known for being buggy.
samgwise I've used the same 2015.06 source and built it on a windows 8 laptop useing the VS 15 RC any ideas?
08:43 dayangkun joined
jnthn samgwise: It seems it's an MSVC compiler bug that didn't exist in any previous version of MSVC :( 08:43
So "use an older version of MSVC" is the only known workaround at the moment. 08:44
08:46 atroxaper joined
samgwise OK, thanks, I'll give that a shot :) 08:46
moritz please report the bug to microsoft.
samgwise Good idea too :)
moritz (if MS makes that possible, that is)
samgwise I'll find out I guess. 08:47
ely-se moritz: yeah it does
here's my favourite bug report: connect.microsoft.com/VisualStudio...all-my-ram
FROGGS samgwise: I know it works with MSVC 2010 and 2012 08:48
samgwise Thanks FROGGS 08:50
08:52 bjz joined, verzz left
DrForr And the status tells you the rest you need to know: Closed as Won't Fix. 08:53
TEttinger samgwise: I had the same issue btw, 2013 worked fine
08:53 bin_005 joined
TEttinger (2013 community) 08:53
RabidGravy question of self-doubt here, if I had a method that may return either a Buf or a [ CArray[uint8], Int] depending on some named parameter it would be better to make it a multi irrespective of the return type taking part in the multi? 08:55
moritz the return type doesn't take part in multi dispatch 08:57
so you must distinguish it on the named param
and yes, a multi would be fine for that
RabidGravy yes, I knew all that, it was a "style question" (would it be better to make a multi or make the return Positional to handle both cases ;) 08:58
09:00 ely-se left
RabidGravy so "sub foo(:$raw?) returns Positional vs multi foo() returns Buf ... multi foo(:$raw!) returns Array" 09:00
09:00 yeahnoob joined, bin_005_d joined
jnthn RabidGravy: For me it'd depend on how different the implementations of the two were 09:01
RabidGravy to be honest the 'raw' case simply omits the copying the CArray into the Buf 09:02
09:02 bin_005 left 09:05 kurahaupo left 09:07 spider-mario left 09:09 spider-mario joined
RabidGravy already got four multis "foo(Array, Array), foo(Array), foo(CArray, CArray, Int), foo(CArray, Int)" so doubling them for each of the five cases (foo-short, foo-int, foo-long, foo-float and foo-double) for a total of eighty methods might be over-kill ;-) 09:10
moritz RabidGravy: ok, then I'd probably not do it as more multis 09:12
or find a way to generate them :-)
RabidGravy :-) 09:13
FROGGS TimToady: do you want to get the indirect object syntax in place before September? 09:14
moritz don't we already have indirect object syntax?
RabidGravy being able to multi on shaped arrays would help somewhat
jnthn m: say is-prime: 42 09:15
camelia rakudo-moar 533d1a: OUTPUT«5===SORRY!5=== Error while compiling /tmp/A_wiO51C81␤Calling is-prime() will never work with proto signature ($, $?)␤at /tmp/A_wiO51C81:1␤------> 3say 7⏏5is-prime: 42␤»
jnthn Hm, what was the syntax again... :)
moritz std: say is-prime: 42
camelia std 28329a7: OUTPUT«ok 00:00 137m␤»
jnthn oh, so that *is* the syntax 09:16
I too thought we did it
m: is-prime: 42
camelia ( no output )
jnthn Oh...it only works at statement level?
moritz m: say(is-prime: 42)
camelia rakudo-moar 533d1a: OUTPUT«5===SORRY!5=== Error while compiling /tmp/MoSxfcoiz4␤Calling is-prime() will never work with proto signature ($, $?)␤at /tmp/MoSxfcoiz4:1␤------> 3say(7⏏5is-prime: 42)␤»
FROGGS jnthn: implementing &?BLOCK.leave is hard :/ 09:20
jnthn: and I've not pushed yet my latest changes
jnthn FROGGS: Yeah, I'd been pondering how to do that 09:21
(no, I don't have a great answer yet) 09:22
FROGGS leave() works now, as well as Label.leave which worked yesterday already 09:23
09:24 vendethiel left
FROGGS Label.leave works because we use nqp::handle(..., 'RETURN', {...}) there 09:24
jnthn I'd rather we didn't steal RETURN for that... 09:26
But maybe we can make LEAVE control exceptions also check the code object of the current block against the "label"...
So if you put &?BLOCK in the label it just works out
FROGGS hmmm 09:27
surely we can use LEAVE instead 09:28
jnthn Yes, let's add LEAVE
FROGGS and yeah, I understand what you said
jnthn I think RETURN eventually wants to work through control exceptions too, not the magical lexotic mechanism we have today
09:30 araujo joined 09:33 vendethiel joined 09:36 amurf joined 09:40 yeahnoob left 09:41 amurf left 09:42 verzz joined 09:50 bjz left 09:55 samgwise left
kanl is Set no longer extendable? 09:58
m: class Foo is Set { method foo( $foo ) { self{$foo} = True; self } }; my $f = Foo.new.foo: 'a'; $f.say;
camelia rakudo-moar 533d1a: OUTPUT«Method 'BUILD' not found for invocant of class 'Foo'␤ in block <unit> at /tmp/75lUH25_wJ:1␤␤»
09:59 verzz left
kanl what (else) is an immutable hash-like container to extend then? 10:00
10:00 bjz joined
nine [TuxCM]: I couldn't reproduce my random test failures on my desktop at home, so I nuked my install directory on my work laptop and now they are gone here, too. 10:10
10:11 xfix joined 10:12 g4 left 10:14 g4 joined 10:16 domidumont joined
kanl question rephrased, how do i extend Hash and make it immutable? 10:16
10:17 xfix left, domidumont left
jnthn kanl: I think it's a bug that you can't inherit from Set. 10:17
10:17 domidumont joined
kanl jnthn, i'd suspect so. i remember seeing an example of Set being extended somewhere before. 10:18
[TuxCM] nine, were you able to reproduce the failures with an *installed* I::P5?
kanl jnthn: is there any way to realized my 2nd question though? 10:19
nine [TuxCM]: spoke too early :( Just took very long for the first failure to occur
kanl i.e. to extend a Hash/List and the like and make it immutable?
jnthn kanl: Well, you could use EnumMap, which Hash extends
kanl: Which doesn't put values in Scalar containers 10:20
kanl jnthn: thank you! i'll investigate.
oh, and i'll open a bug on Set not extendable. 10:21
is it by designed that this can't/shouldn't be done? 10:27
my %h = a => 1; %h<b> = %h.values; %h<b>.say;
the equivalent of which is legal in p5
jnthn It isn't legal Perl 6? 10:31
RabidGravy there's bug in there somewhere
jnthn m: my %h = a => 1; %h<b> = %h.values; %h<b>.say;
camelia rakudo-moar 533d1a: OUTPUT«(timeout)» 10:32
jnthn m: my %h = a => 1; %h<b> = eager %h.values; %h<b>.say;
camelia rakudo-moar 533d1a: OUTPUT«1␤»
jnthn ah
RabidGravy just sits there consuming increasing amounts of memory
I guess it would coredump when it ran out of memory 10:34
kanl so can the compiler advise in time before that happens? 10:36
jnthn How can it know?
kanl i thought not
jnthn But I think maybe it's a bug that the "eager" is needed there
But I'm not sure. 10:37
RabidGravy or = @ = if you don't like typing eager ;-) 10:38
right, rebboot 10:40
10:41 RabidGravy left 10:42 xfix joined, xfix left, xfix joined 10:50 atroxaper left, dayangkun left 10:56 Ven joined
cognominal When I juggle with too many balls in Perl 6, I am often confused about which particular ball I dropped and start making false assumption :( Probably a case of searching dropped keys under streetlights to use another metaphor. 11:01
moritz cognominal: juggling more than one ball is the real problem 11:04
kanl is Parcel "final"?
class Foo is Parcel { method foo { self = ( 1, 2, 3 ) } }; my $f = Foo.new.foo;
m: class Foo is Parcel { method foo { self = ( 1, 2, 3 ) } }; my $f = Foo.new.foo;
camelia rakudo-moar 533d1a: OUTPUT«Method 'foo' not found for invocant of class 'Parcel'␤ in block <unit> at /tmp/9CjbhH4lpG:1␤␤»
11:05 ely-se joined
FROGGS jnthn: instead of adding leave method to Block I can also just add it to Code, right? 11:07
11:07 pullphinger left
jnthn FROGGS: I'd put it on Block 11:08
FROGGS k
jnthn FROGGS: We use Code for thunks
FROGGS we then need it in Sub and Routine too...
but I'll care about that later
jnthn m: say Routine.^mro; say Sub.^mro
camelia rakudo-moar 533d1a: OUTPUT«(Routine) (Block) (Code) (Any) (Mu)␤(Sub) (Routine) (Block) (Code) (Any) (Mu)␤»
FROGGS ohh
jnthn :) 11:09
FROGGS :D
jnthn Code = thing we can invoke, Block = Code + lexical scope
Routine = Block + maybe multi-dispatch
:)
FROGGS yeah, that knowledge is in my head somewhere already :o)
ely-se is there an article on how to choose between arrays, lists and parcels? 11:10
jnthn I dunno if we had it that way in the very early days, I think at some point I remember figuring out it was the right factoring.
FROGGS jnthn: I don't know the early days... my first contact was back in 2012
so, I'm a n00b after all
jnthn I think my first Rakudo commit was around December 2007 and I didn't have a darn clue what I was doing :) 11:11
FROGGS jnthn: but you improved, slightly :P 11:12
jnthn pmichaud++ had made a pretty sane design overall
11:12 ely-se left
jnthn So it was quite learnable :) 11:13
11:13 domidumont left
jnthn I mean, in hindsight there was a bunch of things the design was never going to cope with, but we had to run with it for a while to see that. 11:13
FROGGS sure 11:14
11:14 atroxaper joined
FROGGS you need a working base, and way to try and change things while you learn how things are meant to work 11:14
jnthn The architecture we have today really is derived from the "nom" (new object model) time
Yeah, I think a lot of the time in software we too quickly try to build "the thing" and don't allow ourselves the space we need to learn the problem. 11:15
And when I came to Perl 6 it was like "arrgh this project is taking AGES" so there was a real pressure to deliver The Thing. 11:16
In hindsight, my first couple of years here were really about learning various ways to not build a Perl 6 implementation...and unlearning various assumptions from compiler classes at uni, I guess. :) 11:17
FROGGS jnthn: I try to teach the students here at work what the first step/milestone contain, and in what way it should allow evolution and what level of emplexity it should not contain 11:18
complexity*
11:18 atroxaper left
FROGGS they often try to tackle the hard bits, which are often enough just minor details 11:18
jnthn Tackling unknowns early is good generally, but it's actually sometimes hard to know where the hard problems lie 11:19
It took a while for me to realize how deep the whole "OK, so we're going to compile to bytecode *AND* have BEGIN time" problem actually goes. 11:20
11:20 atroxaper joined
jnthn And how to square that with meta-programming, optimization, etc. 11:21
FROGGS about tackling unknowns - tackling these early just because they seem hard when they are just a 'nice to have' is just wasting time IMO 11:22
jnthn Oh, you have to know if they're actually your core problem before spending time on them.
FROGGS getting the framework right, in a way to be able to involve in several ways ist a good approach to me
jnthn If you know they're a "nice to have" then yeah, sure, it's a waste of time.
FROGGS and I'm happy that I was able to do that for the last two big projects I did/do 11:23
jnthn *nod*
11:24 bin_005_d left, brrt joined
brrt \o 11:24
FROGGS++ 11:25
FROGGS hmm?
what have I done?
brrt on the LEAVE thingies :-)
FROGGS ahh :o)
brrt yesterday I guess
:-)
anyway
11:26 amurf joined
FROGGS brrt: I'm still working on it, searching for the right approach 11:26
jnthn: is leave() meant to return from that spot?
or are statements after leave() meant to get executed?
jnthn FROGGS: It has immediate effect 11:27
11:27 ely-se joined
ely-se ah 11:27
readying both doc.perl6.org/language/variables and doc.perl6.org/language/containers helps a lot
jnthn my $x = -> { my $y = &?BLOCK; sub foo() { $y.leave(42); say 'not here' }; foo(); say 'nor here'; }; $x()
FROGGS: Hopefully ^^ clears it up a bit 11:28
Uh, and if I made it 'say $x()' then it should give 42
FROGGS jnthn: so the other say()s are not executed? 11:29
then I got it right
ely-se though it says .map and .grep flatten
is that still the case?
jnthn FROGGS: Correct
ely-se: They shouldn't these days 11:30
ely-se nice
jnthn m: ((1, 2), (3, 4)).map(*.say)
camelia rakudo-moar 533d1a: OUTPUT«1 2␤3 4␤»
jnthn m: ((1, 2), (3, 4)).grep(*.say)
camelia rakudo-moar 533d1a: OUTPUT«1 2␤3 4␤»
11:30 amurf left
FROGGS ely-se: a method call usually sees the elements of the container if was called on 11:31
maybe that was meant
ely-se m: [[1, 2], [3, 4]].map(*.say) 11:32
camelia rakudo-moar 533d1a: OUTPUT«1 2␤3 4␤»
ely-se m: 1.map(*.say)
camelia rakudo-moar 533d1a: OUTPUT«1␤»
ely-se dangerous 11:33
11:33 aborazmeh left
jnthn It's pretty well established that an item will behave like a 1-element list if put in a list-y context. 11:34
Woodi hallo #perl6 :)
ely-se jnthn: how does it know which map too call? 11:35
Does it first look at the methods of Int, and if it can't find it, it looks at the methods of List?
moritz there's an Any.map
jnthn ely-se: No, Int ~~ Any and Any has a map method that does self.list.map
ely-se oh I see
not listed on doc.perl6.org/type/Any though 11:36
moritz feel free to correct that
Woodi [Coke]: about grants: for Perl6 part I would say: finished modules, finsihed modules, finished modules. even if that modules would be micro-grants and -Ofun optimized :)
[Coke]: but IMO whole Perl community have problems with GUIs... 11:37
11:38 iH2O joined 11:39 iH2O left
moritz just avoids them 11:43
ely-se I think we should never ship 1.0. 11:44
11:45 pecastro_ joined
ely-se Doing so would means having to care about backwards compatibility, rendering the language worse over time. 11:45
moritz the notion is tempting.
moritz will resist 11:46
ShimmerFairy I agree. If we ship Perl 1.0 , terrible confusion would result :P
ely-se Guido once asked the audience who used Python 2, then he asked who used Python 3. In the end there were still people who hadn't raised their hands yet so the only conclusion was that they were still using Python 1. :D 11:47
moritz or perl :-) 11:48
ely-se :O
11:48 skids joined
moritz (or myabe TCL) 11:49
ely-se I wanted to write a bug tracker in Tcl recently
FROGGS jnthn: is &?BLOCK identical to frame->code_ref or is this instead $!do from Code? 11:50
moritz ely-se: why?
ely-se YouTrack wasn't sufficient and JIRA is cluttered. But then I realised that writing bug trackers is incredibly boring :)
also I wanted to learn Tcl 11:51
moritz finds Jira not well-suited for bug tracking 11:52
jirs is good for Agil project management
*jira
which isn't quite the same
jnthn FROGGS: $!do is frame->code_ref
FROGGS jnthn: thanks :o)
jnthn FROGGS: &?BLOCK is the code object, so more like frame->code_ref->body.code_object or whatever we call it
FROGGS ahh 11:53
11:54 ely-se left 11:55 tinyblak_ left, colomon joined 11:58 TEttinger left 12:00 atroxaper left
kanl gurus, why is EnumMap inheritable while Parcel is not? 12:01
12:01 skids left
kanl i'm guess immutability isn't a concern here? 12:01
nine FROGGS: github.com/FROGGS/p6-Slang-Tuxic/c...cfeb8c6f8b is the reason for [TuxCM]'s "Merging GLOBAL symbols failed: duplicate definition of symbol HLL" error 12:10
FROGGS :o( 12:12
12:24 brrt left 12:26 brrt joined
[TuxCM] ouch 12:35
12:53 telex left 12:54 lucasb joined, telex joined 12:55 gfldex joined, tinyblak joined
FROGGS m: say 0x7f2449eaeaa0 - 0x7f244a0824a0 12:57
camelia rakudo-moar 533d1a: OUTPUT«-1915392␤»
jnthn Memory addresses? :) 12:58
FROGGS aye
12:58 domidumont joined
FROGGS nqp::getattr(nqp::decont(&?BLOCK), Code, "\$!do")) is not equal to nqp::getattr(nqp::decont(self), Code, "\$!do")) in Block.leave 12:59
13:00 tinyblak left 13:01 atroxaper joined 13:05 atroxaper left
FROGGS err, that's actually wrong 13:06
the thrown label (via self!$!do) in C is identical to &?BLOCK!$!do, but I don't see any fitting frame->code_ref 13:08
13:11 LLamaRider joined, LLamaRider left 13:12 oetiker left 13:13 oetiker joined 13:18 colomon left 13:20 colomon joined 13:22 colomon left 13:23 dolmen joined 13:37 JimmyZ__ joined 13:38 khw joined
PerlJam FROGGS++ (star msi) 13:41
14:01 RabidGravy joined 14:11 rindolf left 14:12 vendethiel left 14:14 vendethiel joined 14:21 dj_goku left, dj_goku_ joined 14:25 nowan joined 14:36 bjz left 14:37 vendethiel left 14:39 vendethiel joined 14:41 brrt left
dalek kudo/nom: b6fae27 | lizmat++ | src/core/ (3 files):
Make Set and friends subclassable

Fixes at least one part of #125611
14:41
synbot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=125611
14:43 bjz joined
hoelzro good morning, #perl6 14:47
jnthn o/ hoelzro 14:49
hoelzro o/ jnthn
masak good aft^Wmorning, #perl6 14:51
moritz good UGT morning, masak 14:52
masak yep. UGT. that's what I meant.
RabidGravy managed to procure a Raspberry Pi 2, I may now be able to start testing again on that 14:55
hoelzro greetings masak
jnthn
.oO( unspeakable get-up time )
DrForr Indeed, unspeakable :) 14:57
dalek kudo/nom: dd3bcc4 | lizmat++ | src/core/ (3 files):
Make attempt changing Set/Bag/Mix throw

Somehow the code example in #125611 would eat the failure of assigning to a Set silently. It does no longer with this change.
14:58
synbot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=125611
masak actually, I got up at 05:24... just been traveling all day.
jnthn masak: Unspeakable indeed :P 14:59
lizmat good *, #perl6 15:00
15:00 zakharyas left 15:01 khw left
masak jnthn: :P 15:01
15:02 zakharyas joined
jnthn o/ lizmat 15:02
lizmat fixing bugs before 8am still feels a bit jetlagged, but otherwise I seem to be doing ok now :-) 15:03
15:03 amurf joined
jnthn lizmat: Hope current location is either cooler or aircon'd :) 15:04
15:05 FROGGS left
lizmat airco'd, although, temp outside is still bearable as well 15:05
jnthn :)
Current location is...Portland?
lizmat indeed 15:07
15:08 amurf left
lizmat breakfast& 15:10
15:13 captain-adequate joined, jaffa4 joined, aborazmeh joined, aborazmeh left, aborazmeh joined
jaffa4 Hi all 15:13
I get this Missing or wrong version of dependency 'src/gen/m-CORE.setting' (from 'lib/File/Find.pm')
vendethiel o/
15:14 skids joined 15:15 tinyblak joined
itz jaffa4: probably bits left over from an earlier build .. maybe easiest to start again 15:19
timotimo i'm quite late to the party, but the indirect object syntax is about putting the : after the object the method is invoked on
m: say is-prime 42:; 15:20
camelia rakudo-moar 533d1a: OUTPUT«False␤»
jaffa4 `itz: What should I delete?
jnthn timotimo: oh, duh! 15:21
I shoulda had more coffee
timotimo++
timotimo :3 15:22
15:26 dolmen left 15:29 brrt joined, g4 left 15:31 zakharyas left 15:32 aborazmeh left
TimToady m: say $*OUT: 42 15:46
camelia rakudo-moar dd3bcc: OUTPUT«42␤»
TimToady makes more sense for things with arguments
vendethiel doesn't really like that what's before the colon changes its meaning 15:48
15:48 Ven left
TimToady well, don't use it on big things 15:49
there are other places in the language that change meaning retroactively 15:50
15:50 tinyblak left
TimToady a => 42 15:50
$x = stuff
15:51 tinyblak joined
TimToady and in the case of $*OUT: we're just treating it as a special comma that says the first arg is the invocant, corresponding to the : in a signature 15:52
which is also retroactive, now that I think of it :)
m: say($*OUT: 42)
camelia rakudo-moar dd3bcc: OUTPUT«42␤»
TimToady actually matches the declaration more closely than $*OUT.say: 42 15:53
operators are doing retractive stuff all the time via precedence too 15:54
*retroactive 15:55
15:56 tinyblak left
TimToady but I think all these things fall into the category of intentional genericity, which I consider to be okay, especially if the amibuities are resolved locally and quickly 15:58
*ambig, grr
vendethiel TimToady: I didn't mean that
TimToady obviously waiting for of coffee to brew
*his coffee
vendethiel I meant "foo A.b: 5;" vs "foo (A.b): 5;"
TimToady that should parse to foo (A.b: 5) 15:59
if it doesn't, it's a bug
vendethiel both? 16:00
I think the spec indicates the opposite
TimToady "nearest" is what it says, iirc
vendethiel I remember arguing with timotimo++ on the train about that, actually...
TimToady m: my @a; say @a.push: 42; say @a 16:01
camelia rakudo-moar dd3bcc: OUTPUT«42␤42␤»
TimToady S12:519 16:02
synbot6 Link: design.perl6.org/S12.html#line_519
vendethiel was looking at S02 16:03
16:04 JimmyZ__ left
TimToady well, S02 is a bit confused about the difference between "term" and "token" 16:06
m: my @a; say push @a[]: 42; say @a 16:07
camelia rakudo-moar dd3bcc: OUTPUT«42␤42␤»
TimToady one term is fine, even if it has multiple tokens as @a[] does
but that's really no more violence to the previous term than assignment turning an rvalue into an lvalue 16:08
cognominal m: my token ws { '#' }; say 'a#' ~~ m:s/ a $ /; # TimToady, shoud m:s// pick the lexical ws? adapted from yesterday discussion irclog.perlgeek.de/perl6/2015-07-13#i_10885672 16:13
camelia rakudo-moar dd3bcc: OUTPUT«False␤»
DrForr .tell masak sub eval($a,$op,$c,@exc) &'{ $a &,$op $c or &@,@exc } 16:14
yoleaux DrForr: I'll pass your message to masak.
cognominal m: my token ws { '#' }; say 'a#' ~~ m/ a <ws> $ /;
camelia rakudo-moar dd3bcc: OUTPUT«「a#」␤ ws => 「#」␤»
dalek rakudo/glrish: e1e0692 | TimToady++ | src/core/Array.pm:
rakudo/glrish: GLR emulation
rakudo/glrish:
rakudo/glrish: [] doesn't itemize
rakudo/glrish: [] doesn't flatten
TimToady killerfied dalek 16:15
16:15 dalek joined, ChanServ sets mode: +v dalek
cognominal glrish is such a gorish name 16:15
TimToady that's my branch that tries out some glr-like changes at a high level
it compiles, but Test won't import symbols for some reason 16:16
also, [] still flattens itself prematurely, I think
(the [] doesn't flatten note above means inside the []) 16:17
that is, [1,2,(3,4)] is a 3 element array in glrish 16:19
[1,2,[3,4]] should also be a 3 element array, but the inner [] autoflattens prematurely, I think 16:20
lemme double check that...
> p -e 'say [1,2,[3,4]].elems'
4
yeah
but something low-level is forcing that, and I haven't figured out how to turn it off yet 16:21
cognominal TimToady++ for working on GLR design. 16:22
TimToady well, glrish has to go through contortions to try to emulate glr because it's fighting the old low-level semantics in various spots 16:23
16:23 ely-se joined
jaffa4 TimToady: what do you modify? 16:23
TimToady these things should actually be much simpler when the lower level is fixed
well, various things 16:24
jaffa4: are you asking about the GLR design itself, or the glrish implementation?
16:24 salv0 joined
jaffa4 CLR 16:25
ely-se the girlish implementation
jaffa4 GLR
genelised LR 16:26
TimToady Great List Refactor
DrForr *NNNNooobody* inspects the GLRish implementation, in fact those who *do* inspect it... I'll come in again. 16:27
PerlJam DrForr++
TimToady jaffa4: there's a gist from pmichaud++ summarizing the current redesign ideas, which I seem to have misplaced... 16:28
16:29 tinyblak joined
TimToady github.com/perl6/specs/blob/84ff4f...-draft.pod 16:30
DrForr Just slipped out ;)
geekosaur that's what happens when you inspect it?
:p
mst to implement GLR, one must first sit ... in the comfy chair
TimToady because it wasn't a gist, it was a new S07 :)
Not GLRcup!
16:31 yqt joined 16:36 jeffreykegler joined, tinyblak left 16:37 tinyblak joined, atroxaper joined
PerlJam worries a little that post-GLR for ^10 { ... } will need to look more like for @(^10) { ... } 16:38
jeffreykegler TimToady: many years ago I mailed you a copy of Eco's _Search for a Perfect Language_
It was when I was moving, and I was culling my book collection, and I thought, "you know, book rate is cheap and this does seem like Larry's kind of book" 16:39
I mailed it care of ORA and I never did find out if it got to you. 16:40
16:41 tinyblak left, atroxaper left
jeffreykegler I just noticed you mention it in the Linux Voice interview, so apparently I guessed right. 16:42
16:45 abraxxa left
TimToady yes, one of my favorite books 16:46
and a good antidote to anyone who thinks "Similar things should look similar" is more important than "Similar things should look different." :) 16:47
16:47 Khisanth left
TimToady PerlJam: why would you need to do that? for and map will iterate any single iterable, as long as there's no extra comma 16:48
16:48 ely-se left
PerlJam TimToady: yeah, I was just re-reading S07-glr-draft and noticed what I'd missed before. 16:49
TimToady one of the underpinnings of the GLR redesign is that we distinguish iterators that throw away values from lists that don't, so @() would tend to keep values around unnecessarily in that case 16:50
PerlJam so: for ^10 { ... } # 10 iterations. for ^10, 7 { ... } # 2 iterations.
TimToady historically we've confused lazy lists with iterators, and we're trying to unconfuse them
16:50 Khisanth joined
TimToady yes, that's the current plan 16:50
currently, ranges and arrays autoflatten themselves, so the latter is busted, by GLR standards 16:51
m: .say for ^10, 7 16:52
camelia rakudo-moar dd3bcc: OUTPUT«0␤1␤2␤3␤4␤5␤6␤7␤8␤9␤7␤»
TimToady m: .say for (^10), 7
camelia rakudo-moar dd3bcc: OUTPUT«0␤1␤2␤3␤4␤5␤6␤7␤8␤9␤7␤»
TimToady m: .say for $(^10), 7
camelia rakudo-moar dd3bcc: OUTPUT«0..^10␤7␤»
TimToady should act more like that, only without the cat...er...the scalar
m: .say for [^10]<>, 7 16:53
camelia rakudo-moar dd3bcc: OUTPUT«0␤1␤2␤3␤4␤5␤6␤7␤8␤9␤7␤»
TimToady as you can see, unitemized Array also autoflattens, unlike () 16:54
m: .say for (0,1,2,3), 7
camelia rakudo-moar dd3bcc: OUTPUT«0 1 2 3␤7␤»
TimToady should work more like that
PerlJam And these tests gist.github.com/perlpilot/091488db934dd4b3d9da would need less $() which would jibe with how I tried to write them originally 16:55
jeffreykegler TimToady: so you did get it, or had you known of it earlier? 16:57
16:57 brrt left
TimToady I think it was probably the one you sent, but my brane has replasticized itself a few too many times to say for sure... 17:01
17:02 dakkar left
TimToady One of these days I'm gonna replasticize my brain, only to discover that I melted the old without solidifying the new... 17:05
17:08 jeffreykegler left 17:12 diana_olhovik joined 17:17 domidumont left
jaffa4 How do I refer to an attribute of a class? 17:29
vendethiel jaffa4: $a.b? $.b inside the class? 17:30
masak jaffa4: could you be more specific? what problem are you trying to solve?
yoleaux 16:14Z <DrForr> masak: sub eval($a,$op,$c,@exc) &'{ $a &,$op $c or &@,@exc }
jaffa4 self.options = %options;
masak m: class C { has %.options }; my $c = C.new(:options(foo => 1, bar => 2)); say $c.options.perl 17:31
camelia rakudo-moar dd3bcc: OUTPUT«{:bar(2), :foo(1)}<>␤»
jaffa4 options passed in , I would like to set class variable with the same name
masak jaffa4: does the above eval answer your question?
your term "class variable" confuses me currently. so maybe I'm missing your point.
jaffa4 has... 17:32
17:32 virtualsue left, mr-foobar joined
lucasb jaffa4: %!options = ... 17:32
jaffa4 yes, that is it lucasb 17:33
dalek rl6-roast-data: 21db85d | coke++ | / (8 files):
today (automated commit)
17:34
masak `%.options = ...` also works. the `!` variant assigns directly to the attribute slot; the `.` variant goes via an (overridable) rw accessor
DrForr masak: ^^ was a notion I had for relatively limited lisp-style macros. 17:40
masak DrForr: in the backlog? what should I grep for? 17:41
DrForr .tell masak sub eval($a,$op,$c,@exc) &`{ $a &,$op $c or &@,@exec } 17:42
yoleaux DrForr: I'll pass your message to masak.
DrForr Gah, forgot about the tell bit there.
masak that's ok, I'm right here :P
yoleaux 17:42Z <DrForr> masak: sub eval($a,$op,$c,@exc) &`{ $a &,$op $c or &@,@exec }
masak gah, should've said "computer, messages." :P
DrForr: I don't understand your example. it looks like something that could be understandable, given context. 17:43
b2gills m: say is-prime 42: 17:44
camelia rakudo-moar dd3bcc: OUTPUT«False␤»
lucasb oh, something like: &` == quasiquote, &, == unquote, &@, == unquote-splice ? interesting :) 17:45
DrForr From the inside out, &,$foo - &, acts as ,value would from Lisp, which is to say substituting the value of the expression into the surrounding code.
lucasb: Yep. I was thinking that $`,$, and $& are now free, then realized that & is sort of free...
masak oh, that makes sense. 17:46
I hear what you're saying, and it's good to know we *could* end up with something like that... :)
...but I think we'll end up with something that's less of a carbon copy of Lisp's macro syntax and more something that fits Perl 6 well. 17:47
DrForr It's limited to be sure, but at least it follows 'least surprise' for one group of hackers who know of macros.
masak or s/think/hope/, rather
DrForr Yeah, I know it's not the most ambitious, but I thought it might be a good starting point.
jaffa4 m : my @a= 1,2,3,4; say @a[1..2]; 17:48
m: my @a= 1,2,3,4; say @a[1..2]; 17:49
camelia rakudo-moar dd3bcc: OUTPUT«2 3␤»
17:49 virtualsue joined
masak DrForr: I want you to know that I've taken in what you've proposed above. still in the middle of discovering/weighing a lot of factors. we'll see where we land. 17:49
jaffa4 m: my @a= 1,2,3,4; say @a[1..]; 17:50
camelia rakudo-moar dd3bcc: OUTPUT«5===SORRY!5=== Error while compiling /tmp/c_GOlBSery␤Please use ..* for indefinite range␤at /tmp/c_GOlBSery:1␤------> 3my @a= 1,2,3,4; say @a[1..7⏏5];␤»
masak wow, we even have an error message for that bit of obsolete Perl 6.
jaffa4: where did you find that? in an old book?
or an outdated web page?
jaffa4 just guessing
masak heh
jaffa4: it used to be that way. 17:51
DrForr It's not a serious proposal by any means, I just felt that the & markers would be mnemonic and cue you in to the fact that there's function manipulation going on.
masak oh, wait.
no, it used to be 1..2 for finite things, and 1... for infinite things
DrForr: oh, that's why you chose them. I was wondering.
jaffa4 m: my @a= 1,2,3,4; say @a[1...];
camelia rakudo-moar dd3bcc: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Itwlviq6R2␤Missing required term after infix␤at /tmp/Itwlviq6R2:1␤------> 3my @a= 1,2,3,4; say @a[1...7⏏5];␤ expecting any of:␤ prefix␤ term␤»
TimToady yes, we never allowed .. to confuse term vs operator expections 17:52
except perhaps briefly in pugs
*tations 17:53
PerlJam DrForr: In a way, it's too bad Perl makes such heavy use of symbology; it leaves fewer unambiguous symbols for macros :)
TimToady
.oO(Nobody inquisites the Glrish expections...)
17:54
someone should go back in a time machine and expand ASCII
DrForr Well, #{ and #} have already gone away... :)
TimToady were they ever here? 17:55
.oO(Long, long ago, this galaxy was far away...)
17:56
jaffa4 How do I make a slice until the end of array?
ShimmerFairy I still like `...` as an alternative to {{{...}}}
PerlJam ShimmerFairy: too "invisible" 17:57
TimToady we need the grammatical category, so at best that would only be the default for nouns
DrForr o/' And I thought me and Quai-gon Jinn / could talk the Federation in / To maybe cutting them a little slack o/
ShimmerFairy TimToady: what if someone already went back to expand ASCII, and the best they could do was Unicode? :P 17:58
jaffa4 m: my @a= 1,2,3,4; say @a[1.*.];
camelia rakudo-moar dd3bcc: OUTPUT«5===SORRY!5=== Error while compiling /tmp/ozxYnX0eUa␤Confused␤at /tmp/ozxYnX0eUa:1␤------> 3my @a= 1,2,3,4; say @a[1.*7⏏5.];␤»
jaffa4 m: my @a= 1,2,3,4; say @a[1..*];
camelia rakudo-moar dd3bcc: OUTPUT«2 3 4␤»
masak m: my @a = 1, 2, 3, 4; say @a[1..*]
camelia rakudo-moar dd3bcc: OUTPUT«2 3 4␤»
masak jaffa4++ beat me to it ;) 17:59
PerlJam ShimmerFairy: then we need to jump time lines to get to the one where they do better than unicode.
ShimmerFairy Funny, I recall ..* blowing up in array slices...
TimToady as lvalues maybe
DrForr "A long long time ago, in a galaxy far, far away, a struggling filmmaker said 'I *will* create a character named Kit Fisto'" 18:00
masak ShimmerFairy: it's "more correct" to write `..*-1`, of course
ShimmerFairy: but the range auto-truncates, so both work
ShimmerFairy masak: I still remember ..* causing an error once, hopefully my memory isn't wrong here :P 18:01
masak isn't it weird that both Perl 5 and Perl 6 are 0-based from the beginning of the array, but 1-based from the end? :)
ShimmerFairy: I don't recall it giving an error.
TimToady masak: you're not thinking pythonically there :)
ShimmerFairy Or maybe I'm confusing slices with simple indexing...
18:01 araujo left
PerlJam ShimmerFairy: it caused an error before the advent of Whatever ;) 18:01
18:03 araujo joined 18:05 _sri joined
[Coke] DrForr: I just saw that weird al song in concert this weekend. *dreamy sigh* 18:17
DrForr I saw him in concert in '10 when he did his first European tour in a'dam. 18:18
[Coke] Great entertainer, loved it. 18:19
18:19 VinceDee joined 18:22 nebuchad` joined 18:24 nebuchad` is now known as nebuchadnezzar 18:25 hoelzro_ joined, danstone1 joined, btyler_ joined, telex left 18:26 telex joined, integral joined, integral left, integral joined, telex left 18:28 telex joined 18:30 dalek left, RabidGravy left, synbot6 left, hoelzro_trying_w left, flussence left, ugexe left, integral_ left, maettu left 18:32 rindolf joined, dalek joined, ChanServ sets mode: +v dalek
lucasb About these classes that can't be subclassed like Set, isn't the problem the fact they have an explicit .new constructor that calls nqp::create(self).BUILD(...) ? Shouldn't these classes let Mu.new do this job? There are more classes that are like these, just grep the source for this build idiom. 18:36
m: class S is Set { submethod BUILD {} }; say S.new 18:37
camelia rakudo-moar dd3bcc: OUTPUT«Type check failed for return value; expected 'Setty' but got 'Any'␤ in block <unit> at /tmp/o8xo_p97Gf:1␤␤»
18:37 spider-mario left
jnthn lucasb: That's most probably the issue, yes 18:37
Cheating is OK, but if it breaks inheritance the cheating should be done as a submethod too... 18:38
18:38 spider-mario joined
moritz moritz@pat:~/p6/rakudo$ git grep 'method BUILD' src/core/|grep -v submethod|wc -l 18:40
8
moritz tries a simple s/method/submethod/ for BUILD in Set 18:41
and spectests, no less :-)
18:41 Hor|zon joined
TimToady thinks the implementation of Sets is overcomplicated anyway 18:43
lizmat moritz: eh, I just changed the submethod to method to fix subclassing Set ??? 18:47
jnthn It's the cheating new that I meant may want to be a submethod... 18:48
lizmat ah...
jnthn But perhaps best is to avoid cheating. 18:49
:)
lizmat well, but then the subclass would need to do nqp magic anyway to set %!elems ? 18:50
TimToady: care to elaborate on the "overcomplicated" bit ?
afair, part of the complication was because of the requirement that a Set should be a valid key in a Set 18:51
aka, be kept as an object, not as a stringification
TimToady that's just object hash
doesn't need to map to a pair
mapping to a pair, as I understand it, is an optimization to make .pairs faster
and I think that's probably a false economy, if so 18:52
lizmat have you looked at object hash implementation? I mean, *that* looks like overcomplicated
jnthn I suspect it's 'cus our guts don't understand objects hashes properly yet.
lizmat keeping an internal has both for key as well as value ?
*has
*hash
jnthn You're making a write has of typing that... :P
But yeah, the object hash approach is no better, and memory wise perhaps worse.
Performance wise possibly worse too. 18:53
lizmat eh, my point exactly :-)
TimToady well, isn't that because we're really slow on .WHICH still?
we should fix that
lizmat having object hashes in the VM would solve most of this 18:54
jnthn TimToady: .WHICH is slow 'cus it has to construct a string, which in turn is because the VM level doesn't yet support object hashes.
And what lizmat++ said, and yes, I agree we *should* fix it, but because the current workarounds, well, work around, it never hit high enough on the priority list yet. 18:55
TimToady thinks bypassing object hashes is a premature optimization
sure, just sayin' :)
japhb jnthn: I used to understand why Parrot-specific code in Rakudo was different from the non-Parrot code (different object model details and such), but why are there so many differences still from jvm v. moarvm, when the different code paths appear to be simple transforms of each other? src/core/Mu.pm:416-426 is an example of this.
jnthn TimToady: You mean implementing Set in terms of object hashes?
japhb: Economics.
lizmat fwiw, object hashes did not work in core settings at the moment Sets/Bags/Mixes were implemented 18:56
TimToady jnthn: yes, I think object hashes are the natural fit to sets/bags
japhb jnthn: *blink* *blink* Wait, what?
lizmat this was pre-parameterize functionality in core
TimToady lizmat: sure, not quibbling with the history :)
18:57 tadzik joined
TimToady just saying we may have got to a bit of a false minimum on current set/bag simplicity 18:57
lizmat fwiw, I think the approach taken with Sets/Bags/Mixes are a natural fit or object hashes
until we have object hashes in the VM
*for
jnthn japhb: They paper over inconsistencies that take effort to fix, probably need somebody like me to make a design call, and the interest rate on the technical debt is low enough that it's not a useful use of anyone's time to deal with at the moment.
If somebody wants to patch them, sure, I'll take the patches. :) 18:58
They're just not hugely painful.
japhb jnthn: Oh. Is there any list of what those inconsistencies *are*, so someone who wants to go hacking doesn't unnecessarily break jvm?
jnthn japhb: No, but if I wanted one I'd grep for "#?if jvm" :) 18:59
japhb :-P
Well, I guess I'm trying to understand what actually makes those two chunks of code materially different from a VM point of view. 19:00
(As an example.)
It looks a bit chicken-wavey.
jnthn I suspect indecision on if nqp::clone should decont or not 19:01
dalek kudo/nom: ccb41d8 | moritz++ | src/core/Set.pm:
Change Set.BUILD to be a submethod
jnthn Though...that may not entirley explain it either.
The JVM one may well be losing the typedness of a container also 19:02
19:02 bin_005 joined 19:03 muraiki joined
lizmat japhb: the JVM version was the original version of the code 19:03
the MoarVM version was an improved version that fixed a bug, but which broke on the JVM 19:04
moritz: why are you only partiallly reverting b6fae27eceb094d5739f94 ? 19:05
moritzL and BTW, I'm pretty sure that #125611 is now broken again 19:06
moritz lizmat: sorry, I thought subclassing Set was broken because BUILD was not a submethod
lizmat it was broken because it *was* (afaik)
moritz lizmat: if it's meant to be overridable, it shouldn't be called BUILD
lizmat: and fwiw, no spectest broke due to my patch 19:07
m: class S is Set { }; say S.new
camelia rakudo-moar dd3bcc: OUTPUT«S.new()␤»
jnthn If we want to do cheating construction, maybe we should be declaring a private method to do it.
moritz jnthn: it's not so easy, because the role must call the one from the class it's mixed into
jnthn ah...
japhb lizmat, jnthn: OK, thank you for the explanation on that ('#?if jvm' in method clone).
lizmat moritz: no spectest broke due to my change either
dalek kudo/nom: ab137b7 | moritz++ | src/core/Set.pm:
Revert "Change Set.BUILD to be a submethod"

This reverts commit ccb41d81b8534ddfc89b67261f8d328efdb56505.
19:08
19:08 flussence joined
moritz lizmat: ok, my approach would be to rename BUILD to INIT or so, so that we don't break the assumption that BUILD is a submethod 19:08
19:08 flussence left 19:09 flussence joined
japhb My *original* question was: What guarantees is 'method clone' suppose to supply? As far as I understand the code, it looks like "clone the top level of attributes (both private and public), make sure the *containers* for the attributes are cloned, not just the contents, and allow override of values for public attributes". Is that the true intent? 19:10
lizmat moritz: well, there's about 16 files in core that call .BUILD inside .new themselves
moritz lizmat: and they all shouldn't be using BUILD
19:10 flussence left
moritz lizmat: I know the early ones are left over from before we had submethods 19:10
lizmat well, then we should go in and change that
19:11 flussence joined
moritz tries 19:11
lizmat goes sightseeing&
moritz m: say Set.new('a', 'b')
camelia rakudo-moar dd3bcc: OUTPUT«set(a, b)␤»
lucasb lizmat++, moritz++: thanks for taking a look at this; and sorry for starting this confusion :) 19:12
jnthn japhb: Yes, but I think we need to be smarter on what "container" means perhaps
jaffa4 Is it possible to have an object id of nqp object? 19:17
masak japhb: dunno if this helps, but my perspective on `.clone` is slightly different: $o.clone(|%new-attrs) == $o.new(|%o-attrs, |%new-attrs) 19:18
jaffa4: what are you trying to accomplish?
jaffa4 to make it a key of a hash 19:19
jnthn my %h{Mu}; # now you can store objects as keys
masak jnthn++
jaffa4 It seems to crash
masak golf'd or it didn't happen
jnthn m: my %xy{Mu};
camelia ( no output )
jnthn Looks OK to me 19:20
moritz lucasb: you didn't start the confusion, you just uncovered it
jnthn m: class x { }; class y { }; my %h{Mu}; %h{x.new, y.new} = 'problem' xx 2; say %h.perl
camelia rakudo-moar dd3bcc: OUTPUT«Hash[Any,Mu].new(x.new => "problem", y.new => "problem")␤»
jnthn Note the keys there are objects, not strings. 19:21
moritz m: my %xy{Mu}; %xy{1&2} = 3; say %xy.perl 19:22
camelia rakudo-moar ccb41d: OUTPUT«Hash[Any,Mu].new(1 => 3, 2 => 3)␤»
moritz bug
jnthn hah...I wonder if the postcircumfix sub is to blame... 19:23
masak submits rakudobug 19:24
jnthn masak++ 19:25
jaffa4 here it is gist.github.com/jaffa4/fc077b6ba4b62781b836
masak think of it this way: I'm not so much increasing the RT ticket count, as keeping down the number of discovered but unreported bugs :P
jaffa4: that's... relatively golfed, actually. kudos. 19:26
19:26 atroxaper joined
masak jaffa4: from a quick scan, that looks like it should survive. 19:27
jaffa4: a stylistic tip is to use `:exists`, not `.KEY-EXISTS`
(but that likely won't fix your crash)
jaffa4 and sometimes walking through the tree leads to infinite loop 19:28
Is that likely, jnthn?
jnthn it'd have to be %visited_objects.KEY-EXISTS($tree)
japhb: It's not strictly a tree
oops
jaffa4: ^^ 19:29
A QAST::BVal can reference a QAST::Block elsewhere for example
masak jaffa4: if you are walking the tree, you need to handle loops yourself.
jnthn And some things share sub-trees
masak jaffa4: basically like Data::Dumper does.
jaffa4 So loops are logical, to be expected?
masak jaffa4: yes.
jnthn NQP objects don't have a .WHICH, though, so dunno how putting them in a Perl 6 object hash will work out... 19:30
jaffa4 I just need to get a unique id out of them
jnthn jaffa4: It depends exactly what you traverse.
jaffa4 Is there any?
jnthn nqp::objectid(...) may cut it
19:30 atroxaper left
masak jnthn: people are bound to want to put foreign-language objects in Perl 6 hashes, though... 19:30
19:31 kaare_ left
jnthn masak: Yeah, but making Perl 6 things work with Perl 6 things is apparently providing us with quite enough work at the moment ;) 19:31
We can do better overall on NQP/Perl 6 interop
masak might prove an interesting guiding example for any-lang/Perl 6 interop :) 19:33
masak .oO( "why doesn't this interop work?" -- "well, you just hit one of the 'not quite' parts..." ) 19:34
jnthn :P
nine++ seems to be doing a very nice job on Perl 5 and Python interop :) 19:35
masak ooh! oooooh! has anyone made Perl 5 interop *with Python* *through Perl 6* yet?
that's a lightning talk all on its own!
jnthn++ # I read your sentence wrong first, which gave me the idea :P 19:36
jaffa4 jnthn: I am reading The use of nqp::operations has been deprecated for non-CORE code. 19:40
What is not portable about it? 19:41
jnthn jaffa4: It's specific to Rakudo
jaffa4: And even in Rakudo we don't commit to any back-compat 19:42
(Though a lot of things are highly unlikely to change.)
(And to the degree NQP is intended as a compiler construction toolkit, we may well commit a little more strongly at some point in the future. 19:43
)
tadzik masak: I think nine already did a talk that did that :) 19:45
maybe even on FOSDEM
I vaguealy remember seeing it
masak oh! nine++ 19:46
19:49 [TuxCM] joined, vytas joined, maettu joined, Foxcool joined, RabidGravy joined, ggoebel joined 19:52 Spot__ joined, timotimo joined, yogan joined, retupmoca joined, hoelzro_trying_w joined, ugexe joined 19:55 zostay left, zostay joined 19:56 diana_olhovik left, isacloud joined
dalek kudo/nom: fbdc745 | moritz++ | src/core/Set (2 files):
Improve Set construction

make Setty.BUILD a submethod, remove Set.BUILD. This way, Set is still subclassable, and the assumption that BUILD is a submethod still holds.
20:04
20:04 ggherdov joined
dalek ast: bb2d247 | moritz++ | S02-types/set.t:
RT #125611: basic test for Set subclassability
20:04
20:05 domidumont joined 20:10 zakharyas joined 20:11 muraiki left, araujo left 20:14 lucasb left
dalek ast: f94e52b | moritz++ | S02-types/bag.t:
RT #125611: Test subclassability of Bag
20:16
kudo/nom: 8957fc5 | moritz++ | src/core/Baggy.pm:
Uncheat in Bag constructor

this preserves subclassability, and makes BUILD a submethod again
20:17
20:18 araujo joined 20:23 bougyman joined
bougyman getting an error with panda install Test::Star that's pretty obvious: "# Connect failed with error DBD::mysql connection failed: Access denied for user 'testuser'@'localhost' (using password: YES) 20:23
"
is there a particular password it wants?
20:23 araujo left
moritz bougyman: yes; see t/25-mysql-comon.t for the configuration 20:24
20:24 darutoko left
moritz bougyman: though it should skip the tests if the connection fails 20:24
20:24 domidumont left
bougyman moritz: it doesn't skip them 20:25
thanks. had to find where it buried that in ~/.rakudobrew
first I had to install sqlite and mysqlite devel (already had pg) 20:26
then had to start mariadb, create testuser. now it looks like he needs privs granted.
moritz bougyman: please nopaste the output you get 20:27
(from before you created the user)
20:28 araujo joined 20:30 jaffa4 left
bougyman moritz: gist.github.com/bougyman/1831a4fa9a7705486ce0 20:32
that was before I even installed mysql/sqlite -devel packages
you want it from after, too?
20:32 zakharyas left
moritz bougyman: no thanks, that's fine 20:33
bougyman um, hrm.
I put the output post-install of the -devel libs in a comment and gh marked it up, heh.
moritz bougyman: actually, most of these tests still pass
bougyman yes, but DBIish does not install.
dalek Iish: da430bf | moritz++ | t/99-common.pl6:
Avoid superstious use of capture
20:34
moritz can't spell 20:35
20:36 xfix left
dalek Iish: 250acbb | moritz++ | t/35-Pg-common.t:
Fix skipping of Pg tests
20:38
vendethiel m: subset File of Str where .IO.e; "a" ~~ File; 20:45
camelia ( no output )
vendethiel m: subset File of Str where .IO.e; say "a" ~~ File;
camelia rakudo-moar fbdc74: OUTPUT«False␤»
vendethiel m: "a".IO.WHAT.perl.say
camelia rakudo-moar fbdc74: OUTPUT«IO::Path␤»
vendethiel a subset of a type weighs more in MMD than the parent type, correct? 20:46
moritz bougyman: should be fixed now
vendethiel: right
bougyman just pull or just run panda again?
doing panda install Task::Star, atm. 20:47
moritz bougyman: should be fine
20:47 AlexDaniel joined
bougyman it didn't do any git updates 20:47
and failed again.
I think I need to update the git manually
yep, that did it.
thanks a lot 20:48
vendethiel m: slurp "a";
camelia rakudo-moar fbdc74: OUTPUT«Failed to open file /home/camelia/a: no such file or directory␤ in block <unit> at /tmp/n6PmzSw3EH:1␤␤»
vendethiel ^ seems dangerous?
m: subset File of Str where .IO.e; sub read(File $f) { say slurp $f; } 20:49
camelia ( no output )
vendethiel ^ outside from race conditions (if someone deletes the file while we're entering the sub), this is exception-free, right? (if we do enter the sub)
moritz vendethiel: you could still get a "permission denied"
20:50 TEttinger joined
jnthn vendethiel: Just 'cus the file exists I guess doesn't automatically mean you'll be able to read it 20:50
moritz or it could be not UTF-8 (which slurp assumes by default)
jnthn Or that
vendethiel right. :P I'll put '"almost" exception free' there
moritz :-)
jnthn If you know races are possible, then "forgiveness is better than permission" is generally good advice though :) 20:51
vendethiel say slurp $f; # (almost) exception-free (forget about race conditions, permissions, encoding, ...)
^ I'll leave it at that :D.
jnthn There's no race there :)
vendethiel jnthn: well, I'm demonstrating the "File $f" subset thingie, so there could be
jnthn It's a race if you ask if you can, then do, and the answer can change between asking and doing.
vendethiel: Ah, then yes, there can be one with that :) 20:52
AlexDaniel Hi! I've already asked this question 15 hours ago but maybe it was not crowdy enough. I'm trying to create a sub using a macro. Here are my attempts: 20:54
m: macro FOO { quasi { sub Bar { say 'woohooo'}; }; }; FOO; Bar();
camelia rakudo-moar 8957fc: OUTPUT«5===SORRY!5=== Error while compiling /tmp/3T9nS7fCPC␤Undeclared name:␤ Bar used at line 1. Did you mean 'Bag'?␤␤»
AlexDaniel and another one trying to return a string:
m: macro FOO { ‘sub Bar { say 'woohooo'}’ }; FOO; Bar();
camelia rakudo-moar 8957fc: OUTPUT«===SORRY!===␤Too few positionals passed; expected 3 arguments but got 2␤»
masak the error message could be better.
but returning strings from macros is NYI.
AlexDaniel masak: ok, now it makes sense 20:55
masak and will be until that kind of macros gets a champion.
AlexDaniel because it should be possible according to the spec but does not work at all
masak is the AST kind of macro champion
vendethiel m: macro FOO { ‘sub Bar { say 'woohooo'}’ }; FOO;
camelia rakudo-moar 8957fc: OUTPUT«===SORRY!===␤Too few positionals passed; expected 3 arguments but got 2␤»
AlexDaniel masak: ok, my champion, how can I create a sub?
vendethiel okay, yes :).
AlexDaniel: can't
AlexDaniel ummm.. why..? 20:56
masak lately I've been wondering if macros oughtn't be *un*hygienic by default. so that people can create their bloody subs.
AlexDaniel because I really want to :)
masak it seems a common enough use case.
and hygiene (according to "Let Over Lambda") isn't a panacea anyway.
will write a blog post about this at some point.
PerlJam masak: iterative hygiene should work well :) 20:57
masak if by that you mean "hygiene should be opt-in", then we are in agreement.
PerlJam yeah 20:58
masak I'm starting to think that, yes.
"hygiene on by default" *sounds* good, and I've always assumed it's the way it should be in Perl 6. but now I'm not so sure. 20:59
people's Least Surprise actually seems to be unhygiene.
PerlJam indeed.
well ... that's least surprise until it surprises someone
masak something like `quasi { sub {{{$ident}}} { ... } }`
vendethiel masak: it's always such a fight between CL and scheme-like 21:00
masak: www.reddit.com/r/lisp/comments/3act...er_lambda/ 21:01
masak vendethiel: yeah, I got that feeling too.
so I guess the question is: is Perl 6 more like CL, or like Scheme? :P
PerlJam Maybe we should have 2 macro mechanisms
masak oh, I'm counting something like 4 so far.
but I'm still designing/prototyping. 21:02
vendethiel masak: read groups.google.com/forum/#!topic/pl...cMVPkGsueo :)
masak reads, and saves URLs for later
AlexDaniel masak: 4? 21:03
vendethiel masak: passing identifiers is another solution ;-) 21:04
masak AlexDaniel: thereabouts. 21:05
vendethiel macro F(\id) {}; F(my &id);
masak AlexDaniel: and I didn't count the textual macros, because I don't count textual macros.
21:06 danstone1 is now known as danstoner 21:14 atroxaper joined
[Coke] wonders why people want to create subs from macros instead of via MOP. 21:15
vendethiel [Coke]: subs, not methods
masak MOP is for the object system.
[Coke] ok, rephrasing:
[Coke] wonders why people want to create subs from macros instead of methods via MOP. :)
masak [Coke]: but you're right -- there is often an overlap between macros and MOP. I want to learn more about how we can make those two co-exist peacefully. 21:16
jnthn I already showed how to write a module that generates subs on import.
[Coke] if it has to be subs, EVAL seems like the evil of choice that works today.
jnthn++
jnthn It's somewhere in jnthn.net/papers/2015-fosdem-static-dynamic.pdf 21:17
No EVAL required :)
PerlJam EVAL is the poor-man's macro system
masak EVAL is to structured code building as textual macros are to macros. 21:18
neither composes very well. 21:19
21:19 atroxaper left
[Coke] reads the dynamic sub export trick again. very nice. 21:21
21:24 rindolf left
masak "Like training wheels on a bicycle, hygiene systems are for the most part toys that should be discarded after even a modest level of skill has been acquired." -- Let Over Lambda, quoted in groups.google.com/forum/#!topic/pl...cMVPkGsueo 21:26
PerlJam because the experienced programmer always knows what they are doing, right? 21:30
jnthn Sure. Programming! 21:31
vendethiel if only :)
21:32 spider-mario left 21:35 RabidGravy left
masak well, if there's anything that shouldn't necessarily come with safeties turned on to the max, it's macros. 21:36
their job is basically to cause interesting changes. 21:37
AlexDaniel yea, like create subs... 21:39
masak aye.
the way the spec stands right now, you're expected to install the sub in the COMPILING:: namespace. 21:40
PerlJam you also don't want the safeties completely absent such that the intrepid programmer slices off an virtual appendage on first use without realizing how or why
jnthn "stick it in COMPILING::" sounds quite reasonable to me. 21:41
Heck, if we could even make basic cases of sub generation work without any quasi stuff by using COMPILING, if I understand it right :)
masak I... think it still needs to go in the quasi... 21:43
each macro invocation needs to create a completely new sub. not just a new clone of an existing sub. 21:44
jnthn Why?
masak maybe not in the general case. but often you want to name the sub with `sub {{{$ident}}} { ... }` 21:45
jnthn True
But that only counts for introspection :)
You can install it in COMPILING under a name of your choice. 21:46
masak also true. 21:49
but... you can access COMPILING:: from outside the quasi? 21:50
I clearly need to understand more about COMPILING::
since the quasi runs at a completely different phase, I had just assumed that it was the one with a COMPILING:: namespace, but not its outside.
jnthn Ah 21:54
I'd thought it was reachable in a BEGIN too
masak if it's reachable in a BEGIN, it probably is in a macro. 21:57
this sounds like something we've talked about before :)
masak checks the spec 21:58
Within code that is being run during the compile, such as C<BEGIN> blocks,
or macro bodies, or constant initializers, the compiler variables must be
referred to as (for instance) C<< COMPILING::<$?LINE> >> if the bare
C<$?LINE> would be taken to be the value during the compilation of the
currently running code rather than the eventual code of the user's
compilation unit.
that's from S02.
vendethiel jnthn: "we" (and that means masak and me, I guess?) are wondering a bit about MOP / macros implications 21:59
masak For instance, within a macro body C<$?LINE> is the line
within the macro body, but C<< COMPILING::<$?LINE> >> is the line where the
macro was invoked.
so, that's pretty clear. COMPILING:: works outside of a quasi.
jnthn vendethiel: That's a bit too general for me to answer ;) 22:02
vendethiel jnthn: well, it'd be a long discussion to have
masak one I look forward to having
vendethiel (and TimToady weighing in that one would be great as well, I guess)
masak need more data, though
vendethiel the snake is biting its tail!
jnthn :) 22:04
I'm too tired to do it now.
vendethiel Yeah, I guessed as much
masak me too. 22:05
'night, #perl6
22:08 flussence left, flussence joined
jnthn sleep & 22:14
AlexDaniel jnthn: running sleep in the background? 22:15
not sure if this is going to work
22:24 bin_005 left 22:26 espadrine left 22:28 salv0 left 22:29 hoelzro_ is now known as hoelzro 22:53 pat_js joined 23:02 Ven joined 23:18 amurf joined
TimToady lolihazinterviewed www.linuxvoice.com/interview-larry-wall/ 23:25
23:33 pyro- joined 23:40 virtualsue left 23:43 ribasushi joined 23:47 laouji joined 23:49 cognominal joined 23:56 bjz left 23:57 bjz joined
skids m: try fail "foo"; my $f = $!.backtrace; say ($f.Str ~ "//") for ^5; # what i'm trying to hunt down at present 23:58
camelia rakudo-moar 8957fc: OUTPUT« in block <unit> at /tmp/oQq6YqFse4:1␤//␤ in any command_eval at src/Perl6/Compiler.nqp:1␤//␤ in any MAIN at src/gen/m-main.nqp:39␤ in any <mainline> at src/gen/m-main.nqp:35␤ in any <main> at /home/camelia/rakudo-inst-2/share/perl6/runtim…»