»ö« 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:01 atroxaper joined 00:03 bloomburgers left 00:05 atroxaper left 00:06 laouji joined 00:07 rurban joined
skids m: role a { method foo { ... }; }; class b does a { }; 00:14
camelia rakudo-moar 174049: OUTPUT«===SORRY!===␤Method 'foo' must be implemented by b because it is required by a role␤»
00:23 captain-adequate left 00:25 bloomburgers joined 00:26 rurban left 00:39 llfourn joined, laouji left 00:40 laouji joined 00:41 laouji left, laouji joined 00:44 llfourn left 00:54 silug_ left 00:57 bloomburgers left 01:05 silug_ joined 01:14 virtualsue joined 01:19 yqt left, rmgk is now known as Guest42091, rmgk_ joined, Guest42091 left, rmgk_ is now known as rmgk 01:26 virtualsue left, bloomburgers joined 01:27 bjz joined 01:28 dayangkun joined 01:30 vendethiel left 01:37 Colonel-X joined
Colonel-X m:say " 1 2 3 4 5" ~~ m:g /<:Digit>+/ 01:37
std: say " 1 2 3 4 5" ~~ m:g /<:Digit>+/ 01:39
camelia std 28329a7: OUTPUT«ok 00:00 139m␤»
Colonel-X p6: say " 1 2 3 4 5" ~~ m:g /<:Digit>+/
camelia rakudo-moar 174049: OUTPUT«「 」 「 」 「 」 「 」 「 」␤»
geekosaur m: say " 1 2 3 4 5" ~~ m:g /<:Digit>+/
camelia rakudo-moar 174049: OUTPUT«「 」 「 」 「 」 「 」 「 」␤»
Colonel-X what's wrong with <:Digit> in regex ???? 01:40
p6: say " 1 2 3 4 5" ~~ m:g /<:HexDigit>+/ 01:42
camelia rakudo-moar 174049: OUTPUT«「1」 「2」 「3」 「4」 「5」␤»
01:44 ilbot3 left 01:46 ilbot3 joined 02:03 Colonel-X left
ugexe your shift key 02:11
m: say " 1 2 3 4 5" ~~ m:g /<:digit>+/ 02:12
camelia rakudo-moar 174049: OUTPUT«「1」 「2」 「3」 「4」 「5」␤»
02:23 vendethiel joined
flussence it's kinda misleading that we have some randomly lowercase_and_maybe_underscore names there just because posix does them that way 02:37
02:39 gfldex left 02:40 llfourn joined
flussence m: say "abcdef".comb: /<HexDigit>/ 02:40
camelia rakudo-moar 174049: OUTPUT«Method 'HexDigit' not found for invocant of class 'Cursor'␤ in block <unit> at /tmp/Hr4XExTghd:1␤␤»
flussence m: say "abcdef".comb: /<:HexDigit>/
camelia rakudo-moar 174049: OUTPUT«a b c d e f␤»
flussence m: say "abcdefghi".comb: /<:HexDigit>/
camelia rakudo-moar 174049: OUTPUT«a b c d e f␤»
flussence m: say "abcdefghi".comb: /<:hexdigit>/ 02:41
camelia rakudo-moar 174049: OUTPUT«a b c d e f␤»
flussence m: say "abcdefghi".comb: /<:Digit>/
camelia rakudo-moar 174049: OUTPUT«a b c d e f g h i␤»
flussence m: say "abcdefghi".comb: /<:digit>/
camelia rakudo-moar 174049: OUTPUT«␤»
flussence m: say "abcdefghi".comb: /<:nonexistent>/ 02:43
camelia rakudo-moar 174049: OUTPUT«␤» 02:44
02:44 llfourn left
ShimmerFairy The <:rule> rules are unicode properties, so I'm not sure what posix has to do with it :) 02:48
flussence oh, wait a sec 02:49
m: say "abcdefghi".comb: /<xdigit>/
camelia rakudo-moar 174049: OUTPUT«a b c d e f␤»
flussence yeah that's the one I was thinking of...
.oO( why does unicode have two hexdigit rules? )
02:50
02:50 atroxaper joined 02:53 noganex_ joined
ShimmerFairy I'm not sure if the unicode properties are (supposed to be) case-sensitive, but there are two hex properties nonetheless :) There's <:HexDigit> and <:ASCIIHexDigit> 02:53
flussence with all these unicode ones, I'm wondering if the built in posix-character-class-equivalent stuff is just a fossil nowadays. 02:54
02:54 atroxaper left
ShimmerFairy In some ways, though <:alpha> won't match underscores like <alpha> does, for instance. 02:55
02:56 noganex left, chenryn joined
flussence m: say /<:ASCIIDigit>/ 02:56
camelia rakudo-moar 174049: OUTPUT«/<:ASCIIDigit>/␤»
flussence well... that's unexpected.
m: say /<:ASCIIDigit>/.WHAT
camelia rakudo-moar 174049: OUTPUT«(Regex)␤»
flussence wow, is Regex.gist really that good now?
m: say /<:ASCIIDigit> (x|y) 'foo'*/.gist 02:57
camelia rakudo-moar 174049: OUTPUT«/<:ASCIIDigit> (x|y) 'foo'*/␤»
flussence I dunno if it did that before, but that's *really* nice that it does. 02:58
++ to whoever made it work :)
(and :ASCIIDigit is way easier to remember than whether .digit is strictly ascii or not, I think I'll be using the unicode form from now on...) 03:00
anyway I think that's enough crazy rambling from me for today, carry on :) 03:01
ShimmerFairy flussence: Perl 6 is generally Unicode friendly, so if you want to restrict something to ASCII, you'll most likely have to say so explicitly :) 03:10
m: say "0" ~~ /<digit>/ 03:11
camelia rakudo-moar 174049: OUTPUT«「0」␤ digit => 「0」␤»
flussence that'd be the "misleading" part for me: those few builtins all have the same names as the standard posix char classes, which (afaik) are strictly ASCII in every other regex language 03:13
03:13 vendethiel left
ShimmerFairy flussence: To be fair, P6 regexes are explicitly not like every other regex language :P 03:14
(If you felt strongly that, say, <digit> should be just ASCII, you could always define a lexical digit regex in the grammar, much like how you can override <ws>)
03:28 llfourn joined 03:40 atroxaper joined 03:44 skids left 03:47 bloomburgers left 03:53 chenryn left 03:59 laouji left 04:09 kaare_ joined
BenGoldberg_ Maybe we should have a :posix-char-classes flag? 04:13
04:14 bjz left 04:26 chenryn joined 04:27 BenGoldberg_ left 04:28 govt left 04:35 bjz joined 04:36 khw left 04:42 atroxaper left, bjz left 04:44 bjz joined 04:47 obra joined 04:49 atroxaper joined 04:53 laouji joined 04:54 pyrimidine joined 04:57 atroxape_ joined, atroxaper left 05:03 aborazmeh joined, aborazmeh left, aborazmeh joined 05:29 TEttinger left 05:34 mr-foobar left 05:36 laouji left 05:37 davido__ joined 05:39 laouji joined, davido___ left 05:41 Grrrr joined 05:44 Averna joined 05:52 telex left 05:54 telex joined 05:55 chenryn left 05:57 chenryn joined 05:58 diana_olhovik joined 05:59 azawawi joined 06:04 pdcawley joined 06:06 FROGGS left 06:08 atroxape_ left 06:09 virtualsue joined
azawawi hi 06:10
azawawi begins wrapping github.com/atom/electron/blob/mast...i/shell.md 06:15
06:16 rurban joined 06:18 virtualsue left 06:22 RabidGravy joined 06:23 darutoko joined 06:24 mr-foobar joined 06:28 virtualsue joined
RabidGravy morning 06:31
azawawi RabidGravy: Good morning :) 06:35
RabidGravy rarr!
06:36 FROGGS joined 06:41 zakharyas joined 06:44 rurban left 06:55 rurban joined
azawawi Added shell API wrapper github.com/azawawi/perl6-atom-elec.../Shell.pm6 and example script github.com/azawawi/perl6-atom-elec...example.p6 06:57
06:58 azawawi left 06:59 azawawi joined 07:04 Ven joined 07:05 abraxxa joined 07:11 jkva joined, aborazmeh left
RabidGravy coo, it's 2015 and I just found a y2k bug in the .dbf driver of libreoffice 07:17
07:18 brrt joined, virtualsue left
FROGGS >.< 07:21
07:21 espadrine_ joined
nine RabidGravy: is it really still a y2k bug or rather a y2100 bug at this point? 07:22
07:23 Ven left
RabidGravy it's a classic "assuming the 1 byte years field is the tens part" (I assume the table I am looking at wasn't last updated in 1905) 07:23
obviously there is a y2155 bug too but I don't think I'll worry about that. 07:24
07:24 ChoHag joined
ChoHag [How] can I create traits which can be applied to attributes a la rw? 07:24
moritz m: sub trait_mod:<is>(Attribute:D, :$funny!) { }; class A { has $.x is funny }; 07:25
camelia ( no output )
RabidGravy ChoHag, "sub trait_mod:<is>( Attribute $a, :$foo!) { ..... # do something to the attribute }"
ChoHag Oh good.
RabidGravy for a specific example see e,g, github.com/jonathanstowe/AccessorF...rFacade.pm 07:26
moritz ChoHag: in the rakudo rep, you can do a git grep -A5 'trait_mod.*Attribute' to get an idea how they are implemented
*repo 07:27
ChoHag I still need to install rakudo on this setup. 07:28
RabidGravy that's a small hurdle
ChoHag I know.
Well. It's not quite as simple as it sounds, because nothing is installed any more without the process of doing so being reproducable, but I've done it before. 07:29
From doc.perl6.org/language/objects: When a role is applied to a second role, the actual application is delayed until the second class is applied to a class, at which point both roles are applied to the class. Thus 07:30
Should read 'second role'
Why is a punned role called a pun? Is it supposed to be some sort of pun? 07:31
RabidGravy "type punning" is a relatively old CS term, not sure of the etymology 07:35
azawawi Atom::Electron::Clipboard API is here: github.com/azawawi/perl6-atom-elec...example.p6
07:37 chenryn left
RabidGravy azawawi++ # making stuff 07:38
moritz PSA: I'll most likely be offline from Aug 06 to Aug 21 (Norge, her kommer jeg!) 07:41
dalek c: 47de357 | RabidGravy++ | lib/Language/objects.pod:
s/class/role/ from ChoHag++
07:42
moritz if anybody needs some infrastructure permissions (root on hack or so), please ask me for it well in advance
07:43 llfourn left, g4 joined 07:47 estrabd left, estrabd joined 07:52 llfourn joined, chenryn joined 07:54 rurban_ joined 07:56 dakkar joined
raydiak since a pun is using an expected word or similar-sounding word to mean something unexpected, being able to write/"talk about" a role where a class is expected seems rather similar to making a pun (sans the humor) 07:57
07:59 chenryn left, chenryn joined
DrForr wonders idly if we can work 'zeugma' in... 08:00
08:00 kaare_ left, kaare_ joined 08:06 Averna left
jdv79 any chance ThreadPoolScheduler.load could return the 3 counts as spec'd? 08:10
*loads
08:12 amurf left 08:19 dayangkun left 08:21 dayangkun joined 08:26 Ven joined
jnthn Sure, if someone implements it :) 08:33
jnthn can't remember what it ended up wanting in the design docs 08:34
nwc10 good *, jnthn
jnthn o/
jnthn teaching again today
(and tomorrow)
nwc10 is the coffee good? 08:35
jnthn I'm in Sweden. So yes. :)
Though a train delay also delayed the person who puts the coffee maker on in a morning's arrival 08:36
I moved away from here and the trains here are *still* screwing me over :P
nwc10 :-)
[I was trying to figure out a joke, but failed. Yours is much better than I would have managed]
jnthn Anyways, back to Prahy on Wed evening, and then I'll have lots of Perl 6 time 08:37
nwc10 except for all the curries that need cooking (as you previously informed us) 08:38
jnthn True :)
Though I tend to make a big load of it then it's food for two days :)
nwc10 higher order noms.
(and that pun was even better given the line you added) 08:39
(not that it was great)
jnthn :P
08:40 vendethiel joined, inokenty joined, espadrine_ left, estrabd left 08:41 estrabd joined
azawawi strange, I do not see any Alien:: namespace in modules.perl6.org. Is that intentional? 08:47
sjn hopes so. 08:49
08:49 silug_ left
sjn Alien::* is something that shouldn't be necessary at all 08:49
at best, the Alien modules should be considered as an emergency workaround when using software with broken dependency/deployment handling in hostile environments 08:51
azawawi true but what if i need to install electron for its wrapper API Atom::Electron 08:52
there is 'sudo npm install electron-prebuilt -g' but that means i need to depend on nodejs being installed
sjn install it yourself, until we get a better way of defining external dependencies
azawawi i figured it out, i will add instructions on installing nodejs and then installing electron since that command installs it in /usr/local/bin which is great :) 08:54
no need for Alien::Atom::Electron :) 08:55
sjn azawawi: is that the canonical way to install that package (meaning, isn't there a .deb or .rpm package of it?)
azawawi electron is distributed as a prebuilt binary or source
sjn: github.com/atom/electron/releases 08:56
sjn: i could write a Perl 6 installer but then we need https downloads so it is not worth the effort at the moment 08:57
09:02 llfourn left
azawawi tries installation procedures on linux and windows 09:02
09:02 silug_ joined 09:05 espadrine_ joined
sjn looks at the packaging discussion at github.com/atom/electron/releases 09:06
FROGGS sjn: we won't get rid of Alien::* me thinks... sometimes there is just no package at all for that platform
sjn FROGGS: :(
FROGGS that's not a bad thing 09:07
sjn the Alien::* concept is really, really, really horrible
FROGGS Perl was always a toolchain to get things working...
no, it isnt
09:07 brrt left
FROGGS depending on Alien::Foo promises that Foo is installed if the dependency is met... 09:07
RabidGravy sjn, totally disagree
FROGGS which is a distinct job, which fits very well the sense of a package 09:08
ChoHag I've not use perl6 in nearly a year. How (briefly) does the moarvm implementation stack up against the jvm?
FROGGS ChoHag: it is way faster for most stuff
sjn when you list an Alien package as a dependency, you basically say "we just have to get this stuff installed, and don't care about packaging downstream"
FROGGS and it has the most features
ChoHag It (mostly?) overtook the jvm then? 09:09
FROGGS ChoHag: moarvm is the leading backend for a long time now
09:09 brrt joined 09:10 vendethiel left
FROGGS ChoHag: we usually prototype/implement on moarvm first, and then port the stuff to jvm 09:10
sjn so if someone downstream sees you depend on [09:32] *** ilogger2 joined perl6
09:32 ChanServ sets mode: +v ilogger2
ChoHag I have no beef with RabidGravy. 09:32
RabidGravy unleashes the ponies
nwc10 Cool. Now, you definately *do* have my software installed. :-)
ChoHag Not even Tesco-quality beef.
jnthn
.oO( Is that the beef made of horse? )
09:34
ChoHag Ah I knew someone would get it. Ponies are sort of horse-like. 09:35
More than horses are cow-like, certainly.
09:35 llfourn joined
RabidGravy FROGGS, that's why I made LibraryCheck - to blow the poor user out with a helpful message before the tests all fail with a linker errors 09:37
azawawi IRC is total fun. You ask one small question about Alien:: namespace and then all hell breaks loose when you come back :) 09:42
RabidGravy in summary there are differences of opinion about whether it is a good thing 09:45
azawawi panda install Alien::XYZ XYZ::Wrapper # for usability and ease of use. 09:49
RabidGravy exactly, and if Alien::XYZ determines it doesn't have to do anything it's almost a no-op 09:50
09:50 Ven joined
azawawi now the other question, how can we download XYZ via a panda-based installation without including it in the github repo? 09:50
any p6 modules doing that? 09:51
RabidGravy I'd be much happier if there was a way of a module to declare external non module dependencies but there isn't yet
I'm off out
09:52 spider-mario joined
sjn RabidGravy: I agree about declaring external deps. that's something I've been pushing for a while now. :) 09:52
ChoHag That would depend on the world's myriad package managers having some semblence of working together. 09:53
sjn ChoHag: there's a way to do that, methinks. :)
ChoHag Oh yes there are plenty.
sjn or at least make it happen
azawawi or a script to do xyz like Makefile.PL or Build.PL in p5 land
timotimo well, there's PackageKit, which kind of unifies package managing a little bit 09:54
ChoHag But there are too many egos in the way.
Look how hard it was (and is!) to get rpm and dpkg to work together.
sjn isn't really a big fan of having complex build scripts (like perl5/cpan's), but sadly, they seem to be necessary :-/
ChoHag Very necessary. See: gnu autotools. 09:55
sjn ChoHag: instead of getting people to "work together", I think it would be more useful to create a super-simple common language, and make tiny tools to translate deps/metadata in that language to whatever is used locally 09:56
ChoHag You mean add another variable to the problem? 09:57
sjn nah, just standardize a grammar for declaring dependencies/metadata
azawawi DSLs always fail at doing a simple generic task when it falls past their original design goal and they simply become a burden to the programmer
sjn there are already a bunch out there, but in the last few years some common trends have been showing up 09:58
sjn sat with ingy at the QA hackathon a few months ago and looked at all kinds of different metadata spec files 09:59
azawawi starts working on github.com/atom/electron/blob/mast.../dialog.md (Atom::Electron::Dialog)
sjn (still need to flesh out that spreadsheet though)
09:59 leont joined 10:01 amurf joined
ChoHag Until the halting problem is solved, the best you can do is list certain dependencies of certain types and then resort to human-readable documentation. 10:01
Possibly bridging the gap with a script of some sort. 10:02
sjn ChoHag: yeah, that's true. There won't be a "perfect" solution
we *can* make our jobs easier though
10:06 amurf left 10:15 virtualsue joined 10:20 zakharyas1 joined 10:26 chenryn joined 10:31 chenryn left
azawawi anyone using rakudo on windows? 10:35
azawawi silence :) 10:37
Begi azawawi: I use Rakudo on Windows :) 10:38
azawawi: why ? 10:39
10:47 RabidMob joined
RabidMob Wahay! 10:47
No free wireless though
I think the last time I tried a mobile Including client was on a Nokia about ten years ago 10:50
10:56 RabidMob left, zakharyas1 left
ChoHag Found (and fixed) a bug in Rakudo's build. 10:57
MOAR in tools/build/Makefile-Moar.in is $(BIN_DIR)/moar but should be @moar@
(FSVO fixed because it still won't compile, but I'm willing to blame myself for that for doing things Differently) 10:59
azawawi Begi: build from source or ready msi? 11:02
Begi Actually, msi 11:03
azawawi FROGGS: ping 11:04
FROGGS pong
I can build the msi package, yes 11:05
azawawi FROGGS: well panda still has that weird .bat not being generated on windows
FROGGS weird indeed
11:06 jkva joined
azawawi i assumed it was fixed in github.com/tadzik/panda/issues/182 11:06
apparently it is still there 11:07
11:08 gfldex joined 11:12 llfourn left
azawawi FROGGS: what determines if an panda installation is under CompUnitRepo or not? 11:15
FROGGS: s/an/a
11:17 AlexDaniel joined, Ven left 11:18 Ven joined, Ven left
FROGGS azawawi: isnt it always a CompUnitRepo? 11:18
azawawi FROGGS: this is not true, github.com/tadzik/panda/blob/15613...ler.pm#L43 11:19
FROGGS thing is, a CUR::Local::Installation would create .bat files, but we are not using it atm
it still is a CUR, just not a CUR that can install stuff
a CUR::Local::File can't install stuff for example
azawawi so it is .can('install') is false 11:20
FROGGS so what we could do is either make CURLF allow to install stuff, or to extend panda to create batch files like CURLI does
aye
azawawi and panda on windows cannot be invoke since there is no panda.bat after rebootstrap
FROGGS eww
azawawi s/invoke/invoked/ 11:21
jdv79 *** Error in `/home/jdv/rakudo/install/bin/moar': double free or corruption (!prev): 0x00007f7818014870 *** 11:22
i guess the async stuff isn't that stable yet 11:23
i can't repro it though
brrt aw, that's a shame
FROGGS azawawi: the shortest fix is to spurt the content of a panda.bat to "$to/$bin.bat" on windows, around here: github.com/tadzik/panda/blob/15613...ler.pm#L75
jdv79 spoke too soon - repro'd
azawawi FROGGS: but somehow it is not working 11:24
FROGGS: i build rakudo from source and it used to work :)
11:26 chenryn joined 11:28 llfourn joined
jdv79 gist.github.com/anonymous/280daf527dd06de6d706 11:29
i can get a segfault in < 10 tries for that it seems atm
is it something i did?
11:30 cognominal joined 11:31 Begi1 joined, chenryn left
jdv79 huh. repro-ability seems to vary. 11:31
brrt jdv79: let me look
that's what always happens with concurrency issues, isn't it :-)
well, it' 11:33
s nicely short, that's one thing
unfortunately, we have
few people with deep knowledge of concurrency issues
:-(
(jnthn++ being probably the most significant)
jdv79 should i just bug it then? 11:34
brrt probably.... yes 11:37
:-)
it would be appreciated
jdv79 cool, thanks
11:39 Ven joined
jnthn It shouldn't segv (though I know why it does, and how to fix it), but even then it's still very dubious. 11:39
my $in := @in[$i];
my $out := @out[$i];
The $out there auto-vivs on assignment 11:40
And normal resizable arrays aren't (and won't be) safe for concurrent writes
Or at least, for concurent resizes
brrt hmm
ugh, that is a good point 11:41
jnthn So that code isn't going to work reliably even when the SEGV is gone.
Moving the assignment to $out inside the lock would fix it 11:42
I've probably mentioned this before, but auto-viv and concurrency really, really do not mix well.
11:45 zakharyas joined
jnthn Also, I'll bet that the MoarVM cross-thread write analyzer woulda caught this one :) 11:49
Sadly, I'm teaching and have no Rakudo build to hand to check it :)
11:50 colomon joined, amurf joined, chenryn joined
jdv79 is it a simple explanation why auto-viv isn't thread safe? 11:51
11:51 Foxcool joined
jdv79 i'm not an expert in either but that seems like it could be a common trip up 11:51
brrt jdv79: that would be a major pessimisation, methinks 11:52
unless we can figure some way to do it 'optimistically'
jnthn jdv79: Well, it's more "can't be made threadsafe" really. To ensure safety you need a transaction boundary. It's impossible to establish one here, because the indexing of the array returns something that, when assigned to *at any point in the future*, will have an effect on the array. 11:53
brrt to be fair, it *is* doable, just horribly inefficient, methinks 11:54
jnthn jdv79: It's only a common trip-up if you insist on not using the concurrency mechanisms Perl 6 suggests you use.
11:55 Begi joined
brrt you'd have to start a new transaction for the entire array anytime you wnated to do that 11:55
jnthn brrt: Well, technically yes, but also it is a bad idea because it only means you end up with more problems later
I wrote a detailed blog post on this stuff.
11:55 amurf left
jdv79 oh? 11:55
brrt ehm, did i read that perchance? when? :-)
jnthn 6guts.wordpress.com/2014/04/17/rac...ess-leads/
jdv79 well, i liketo play with low level stuff sometimes:) 11:56
brrt but yeah, it's fairly horrible, and java also doesn't give you that guarantee
jnthn: oh yes, i did read that :-)
11:57 Begi1 left
jdv79 what is the failure mode for this auto-viv/async issue? 11:57
brrt good post, still
jdv79 i'll read it now then
brrt jdv79: a crash, basically, in the good case
11:59 AlexDaniel left
jnthn In this case, most likely "wrong answers sometimes" 12:00
(Which is why I've been looking into tooling to spot such issues a bit.)
teaching again &
12:01 Begi left
jdv79 hmm, moving the autoviv line under the lock seems to stop the segv 12:01
nice 12:02
thanks
12:05 colomon_ joined 12:07 rurban joined, colomon left, rurban left 12:08 atroxaper joined 12:09 colomon_ left, atroxaper left 12:10 atroxaper joined
azawawi is there a DESTROY destructor in Perl 6? that is when it goes outside of scope 12:17
arnsholt There's a DESTROY, but it gets called on GC, not end of scope 12:18
moritz apart from that, LEAVE phasers exist 12:20
azawawi moritz: could you provide an example please? 12:21
moritz: and hi
moritz azawawi: sub f($filename) { my $fh = open :w, $filename; LEAVE $fh.close; work with $fh here; } 12:22
or maybe LEAVE $fh.close if $fh;
azawawi moritz: what about objects? 12:23
moritz azawawi: objects exist too :-)
for objects, DESTROY is what you want
azawawi :)
moritz LEAVE is cleaning up things in at the end of a scope 12:24
*is for
arnsholt But remember that there's no guarantees that DESTROY will be called, not when or in what order
azawawi the thing is i need to kill/destroy the electron process that im launching with A:E:App
moritz I just mention LEAVE, because p5 folks sometimes build scope guard to execute code on scope exit; in p6, that's what LEAVE is for
12:25 atroxaper left
arnsholt Yeah, LEAVE is generally going to be what people want, I think 12:25
jdv79 jnthn: finally got around to reading that post. what "higher level" constructs would avoid that then? 12:27
Woodi hi #perl6 :) 12:28
ChoHag So do objects have a way in and of themselves of knowing when they're no longer referenced by any active scope? 12:29
DESTROY fires only when GC'd, and LEAVE is part of the scope not part of the object. Right? 12:30
nine ChoHag: correct
Woodi in last years gap betwin traditional databases and shared memory shrinked - libraries like symas.com/mdb/ are realy fast. and if more sharing is needed then redis :)
jdv79 Woodi: ok 12:31
Woodi ...chapter 23: Major Emacs modes ;) 12:32
12:34 pmurias joined
pmurias re Alien modules shouldn't they have an option of telling the package manager what should it install? 12:34
12:34 laouji joined
azawawi i cant trigger that object DESTRUCTION under moar. Any way to force it? :) 12:34
arnsholt You probably need to generate enough garbage to trigger a GC 12:35
Destructors don't fire on interpreter tear-down
Or there's an op, I think. nqp::forcegc() or something
azawawi class Foo { submethod DESTROY { say "DESTROY"; } }; { my $o = Foo.new; LEAVE: "LEAVE".say; } 12:37
m: class Foo { submethod DESTROY { say "DESTROY"; } }; { my $o = Foo.new; LEAVE: "LEAVE".say; }
camelia rakudo-moar 174049: OUTPUT«LEAVE␤»
azawawi arnsholt: nqp::force_gc
12:38 chenryn left
moritz m: use nqp; class Foo { submethod DESTROY { say "DESTROY"; } }; { my $o = Foo.new; LEAVE: "LEAVE".say; }; nqp::force_gc() 12:39
camelia rakudo-moar 174049: OUTPUT«LEAVE␤»
12:40 atroxaper joined
azawawi so safest to do is the following: my $app = Atom::Electron::App.instance; LEAVE: { $app.destroy; } 12:40
Ven azawawi: leave is on block leave. maybe END is what you want here? 12:41
azawawi LEAVE or END will do fine 12:42
i like LEAVE more though since it is on a scope basis. You may be creating a window and then destroying it when button X is clicked 12:43
El_Che azawawi: you're creating a UI toolkit for perl 6? :) 12:48
12:51 virtualsue left 12:52 atroxaper left 12:54 virtualsue joined
hoelzro_ good morning, #perl6! 12:55
azawawi El_Che: hi there :) 12:56
El_Che: long time
El_Che: Please check github.com/azawawi/perl6-atom-elec...r/examples 12:57
itz git commit -m <(curl whatthecommit.com/index.txt ) 12:59
12:59 pmurias left
brrt nice itz :-) 13:00
13:01 kyun joined
azawawi :) 13:01
jnthn jdv79: Well, for your case I'd just my @outs = await do for @in -> $in { start { $in * 10 } }; 13:02
El_Che azawawi: yeah. Perl 6 is hip! :)
azawawi: great! 13:03
jnthn jdv79: In the future, my @outs = hyper for @in -> $in { $in * 10 }; is shorter.
Well, it's shorter now, but in the future it'll also be implemented :P
ChoHag If anyone's interested (I'm not - using the jvm is plan B) nearly every one of rakudo's nativecall tests has failed under the jvm on openbsd. I think because of the cc syntax. 13:04
Otherwise, moar, nqp and rakudo compiled without fuss.
Woodi ChoHag: you compiled with jit ? 13:06
13:06 laouji left
ChoHag If that's on by default, yes. 13:06
Woodi if host is >32 :) 13:07
jdv79 yeah. still be nice if this stuff was all doc'ed out if the implementation isn't able to warn
jnthn *nod*
jdv79 i honestly totally forgot about your post
though i know i read it back then 13:08
thanks
jnthn I know some work was done on doc.perl6.org on the concurrency stuff
Please file a ticket there on what's missing so somebody (perhaps me :)) can take care of it :)
13:08 llfourn left 13:10 jkva left, llfourn joined
ChoHag What's the rationale for repeat/(while|until) instead of do/(while|until)? 13:10
jdv79 will do 13:11
ChoHag Is repeat used for anything else? Is do somehow incompatible with the modifiers? How?
13:12 b2gills joined
jnthn ChoHag: design.perl6.org/S04.html#The_repeat_statement discusses it a bit 13:17
(And I don't know anything more than it says) 13:18
Woodi would be nice if: @outs = for @in -> $in { start { $in * 10 } }; work. but maybe s/for/something/ 13:22
13:22 dalek joined, ChanServ sets mode: +v dalek
moritz hack.p6c.org is back 13:22
it was hung; I rebooted it
jnthn Woodi: You need "do" to make it valid syntax
13:22 jkva joined
jnthn And then it does work, but gives you an arraty of Promise 13:22
*array 13:23
*Promises :)
Woodi jnthn: ok :) but you talking about how implemented atm or how it should be ?
jnthn Both :)
If you dont' want to write start/await, then "hyper" or "race" (when implemented) is what you want 13:24
Then a lot of the uses of the await do for ... start pattern will likely go away.
13:26 Util joined
Woodi why it can't be that: "if loop block starts with "start" then just create lots of Promises" ? 13:26
haevy DWIM... 13:27
heavy ? 13:28
jnthn doesn't follow
Example?
Woodi like one above: for @a { start { ... $_ } }
13:29 Ven left
Woodi *create and return bunch of promises 13:29
jnthn It does, it's just not valid syntax to write my @x = for ... 13:30
Woodi if it's incorect then ok, just dreaming
jnthn m: my @a = for 1..5 { 2 * $_ }
camelia rakudo-moar 174049: OUTPUT«5===SORRY!5===␤Word 'for' interpreted as a listop; please use 'do for' to introduce the statement control word␤at /tmp/M0boHGqHqm:1␤------> 3my @a = for7⏏5 1..5 { 2 * $_ }␤Unexpected block in infix position (two terms in a row)␤at /tmp/…»
jnthn m: my @a = do for 1..5 { 2 * $_ }; say @a
camelia rakudo-moar 174049: OUTPUT«2 4 6 8 10␤»
moritz you can always map 13:31
jnthn indeed :)
Woodi o, btw. do every snow flake is different ? 13:32
lizmat they do is different!
13:33 Ven joined
jnthn I never did two snowflakes that were alike so far... 13:33
Woodi *are :)
13:33 ggoebel joined
Woodi but can one count on this ? :) 13:33
lizmat one must test otherwise it does exist :-) 13:34
jnthn Take a system using Guids and replace them with snowflakes and see what happens :-)
Woodi you know, make lot of photos in the winter, digitize to numbers and use as "identifiers" for something... next winter repeat :>
damn jnthn++ ! 13:35
yes, MS use guids for apis numering, not for eg. objects 13:36
www.thefreedictionary.com/hyper- 13:37
dalek kudo-star-daily: e191e29 | coke++ | log/ (9 files):
today (automated commit)
13:42
rl6-roast-data: b270266 | coke++ | / (9 files):
today (automated commit)
13:42 [Coke] joined 13:51 skids joined
brrt notes that the global interpreter lock could be said to be exactly the newbie-friendly DWIM we reject in moarvm 13:54
re: the concurrency article :-) 13:56
13:59 Ven left 14:06 khw joined 14:08 atroxaper joined 14:12 ChoHag joined
ChoHag p6: say "anything" 14:14
camelia rakudo-moar 174049: OUTPUT«anything␤»
14:14 Ven joined
ChoHag Hooray! My unicode display capability is unbroken! 14:15
14:20 RabidGravy joined
RabidGravy boo 14:21
14:22 inokenty joined, jkva left 14:23 brrt joined
[Coke] wonders what discussions he was in, since irssi seems to have forgotten a few. 14:27
ugexe lizmat: the design docs use `inst:name<work>:/installed` as an example. Ignoring the correction needed for `inst#name`, should the second half be `<work>#/installed` or `<work>:/installed`? 14:28
brrt the discussion was, among other things, 'why are arrays and hashes not thread-safe by default' 14:43
and the answer was, among other things, 'containers'
14:44 jkva joined 14:45 khw left 14:49 PerlJam joined 14:50 telex joined
jnthn brrt: For "don't actaully make good use of my mutli-core CPU" meaning of DWIM, yes. :P 14:52
brrt yeah, i was talking from a newbie-standpoint 14:53
Real Developers Hate GIL
:-P
dalek ast: 41814eb | PerlJam++ | S04-declarations/will.t:
Add a test for RT#119109
leont GIL is even more useless than interpreter threads 14:56
nine Is there a way to create a sub via the MOP that also works as a method? 15:02
jnthn nine: If you add_method a Sub then provided it expects to receive an invocant parameter it'll work perfectly fine as a method. 15:04
m: Int.^add_method('foo', sub ($x) { say "a sub!" }); 42.foo 15:05
camelia rakudo-moar 174049: OUTPUT«a sub!␤»
dalek ast: 500e5c0 | PerlJam++ | S03-metaops/reverse.t:
Add todo test for RT#118791
15:06
nine jnthn: but then it won't be available as Int::foo; I need it to work in both ways because I just don't know if it's a sub, a package method or an object method (because Perl 5 does not differ). 15:07
jnthn nine: Then you'll need to install it in both places I guess 15:08
nine jnthn: if I just do ::($module).WHO{"&$name"} := sub (*@args) { } instead of ^add_method, it seems to work fine, but I'm not sure if that's intended or accident.
jnthn nine: Well, it will work, but then it won't be available as a (Perl 6) method 15:09
gotta go &
nine jnthn: thanks
15:15 ggoebel left 15:18 brrt left
dalek line-Perl5/p5_class_via_mop: 44b7044 | (Stefan Seifert)++ | lib/Inline/Perl5.pm6:
Replace EVAL by MOP calls to create Perl5Package classes

Wrapper classes for imported Perl 5 modules are now better introspectable. Instead of <anon> the subs and methods now have a proper name.
15:25
nine Should I merge this or not? ^^^
15:27 inokenty left 15:28 amurf joined 15:32 amurf left
dalek line-Perl5/p5_class_via_mop: 800701b | (Stefan Seifert)++ | / (3 files):
Replace EVAL by MOP calls to create Perl5Package classes

Wrapper classes for imported Perl 5 modules are now better introspectable. Instead of <anon> the subs and methods now have a proper name.
15:33
15:34 mr-foobar joined
nine In any case, I think this is now the most complete example of using the MOP to create a completely new class. 15:35
15:35 notjack joined, notjack is now known as n0tjack
n0tjack I've been following the perl6 tag on SO more closely recently. Today someone asked a question about accessors, but I can't figure out where in the docs/blogs/advent calendar I should go to get an answer for it 15:36
nine n0tjack: what was the question?
n0tjack This is the question: bit.ly/1Ip7HT1 . But my question is, being a complete n00b to p6, where should I go if I wanted to answer it myself 15:37
(besides here, of course)
15:38 jkva left
nine n0tjack: doc.perl6.org is a pretty decent resource nowadays. 15:38
15:38 araujo joined, araujo left, araujo joined, araujo left
Ven I guess I'd use a "where", but I think those might still be NYIs 15:38
n0tjack nine: thanks 15:39
Ven m: class A { has $.str is rw where *.elems == 3 }; my A $a .= new; $a.str = "hey"; say $a.str; $a.str = "heyyy";
camelia rakudo-moar 174049: OUTPUT«Type check failed in assignment to '$!str'; expected '<anon>' but got 'Str'␤ in block <unit> at /tmp/qxBmzHUYc0:1␤␤»
15:39 araujo joined
Ven m: class A { has Str $.str is rw where *.elems == 3 }; my A $a .= new; $a.str = "hey"; say $a.str; $a.str = "heyyy"; 15:39
camelia rakudo-moar 174049: OUTPUT«Type check failed in assignment to '$!str'; expected '<anon>' but got 'Str'␤ in block <unit> at /tmp/ypnku3mZex:1␤␤»
n0tjack the search on that site isn't working for me in Chrome, but I can use google
Ven uhhhm. what?
arnsholt A where only lets you check the validity of an input argument, though
15:39 araujo left
Ven arnsholt: as opposed to? 15:40
arnsholt It doesn't really let you attach custom logic to go along with the update
Ven ah, yes, indeed. I don't know how tu do that without a Proxy :)
arnsholt Or, you could hack it in via a where, I suppose
But that feels wrong
15:40 araujo joined 15:42 araujo left
nine btw. better error message: 15:43
m: subset PositiveInt of Int where * >= 0; class Foo { has PositiveInt $.mana is rw; }; Foo.new(:mana(-3))
camelia rakudo-moar 174049: OUTPUT«Type check failed in assignment to '$!mana'; expected 'PositiveInt' but got 'Int'␤ in block <unit> at /tmp/ixsgEzuSnL:1␤␤»
15:43 araujo joined
Ven nine: yeah, indeed :-) 15:43
n0tjack so you guys are approaching this through the type system rather than through traditional accessor wrappers?
what if you wanted to do arbitrary logic, perhaps with reference to other fields? 15:44
if you had a Point(x,y) type, and you wanted to ensure the Cartesian distance from origin was never more than MAX_DIST 15:45
you'd have to have logic in the setters for both x and y which ensured sqrt(x^2 + y^2) <= MAX_DIST 15:46
can that be done?
nine m: class Foo { has Int $.strength; has Int $.mana is rw where * > $.strength; }; Foo.new(:strength(3), :mana(3))
camelia rakudo-moar 174049: OUTPUT«5===SORRY!5=== Error while compiling /tmp/WxgbZT9gdG␤Virtual call $.strength may not be used on partially constructed objects␤at /tmp/WxgbZT9gdG:1␤------> 3as Int $.mana is rw where * > $.strength7⏏5; }; Foo.new(:strength(3), :mana(3))␤ …»
nine I guess that fails due to ordering issues on initialization. The compiler would have to know that certain fields have to be initialized before the others. 15:47
15:48 zakharyas left
RabidGravy n0tjack, the subset thing can cover quite a lot of the validations you might want, for anything even madder (say the validation is dynamic) you can use e.g. a Proxy 15:48
but that stuff is not well documented
nine Which brings us back to the original question of where to find the documentation 15:49
n0tjack RabidGravy: Agreed on the subset thing, it's something I've wanted in programming languages for a long time. I've not heard of Proxies before, I'll go check em out
15:49 virtualsue left
n0tjack I've honestly found the Advent Calendar the best and most motivating p6 documentation so far 15:50
I also started reading the book, but the problem is I want to focus on the cool new stuff, and of course the book also has to cover the old standard stuff
RabidGravy the language docs are getting there but it's mostly on a best effort basis
n0tjack I tried writing my own little language using grammars, but it was too much work 15:51
nine Everything in Perl 6 is on a best effort basis :) Which I guess is better than a mediocre effort basis ;)
n0tjack well, if this thing is going to ship by Dec, someone has to be tagged with getting user docs up to snuff
uptake will be rocky with a solid compiler but no docs
RabidGravy I'm actually beginning to thing that object attributes could be the subject of a whole doc page on their own 15:52
think
15:52 virtualsue joined
RabidGravy or thing at option 15:52
nine RabidGravy: if you think something deserves a whole page on its own, you are most probably right. 15:53
dalek c: 2ba77e5 | (Steve Mynott)++ | lib/ (3 files):
fix minor typos
15:54
RabidGravy by my thumb in the air metric I'd say about 50% of the questions people who are new to the subject ask is "how do I do * (with|to) an attribute" 15:55
15:56 diana_olhovik_ joined
ChoHag Programming is almost entirely about managing data. 15:58
Attributes are where the data is stored.
50% seems rather low.
And on that note, how can I go about attaching some piece of data to an attribute, eg. Bool $!set_by_constructor 16:00
I seem to recall when I was playing with perl 6 last year I ended up using a Proxy somewhere/how, but I'm completely out of the loop now. 16:01
RabidGravy usually "submethod BUILD() { $!set_by_constructor = True }" obviously expanded to your logic 16:04
if you just want it to be passed to the constructor then just add it as an argument to the BUILD 16:06
16:06 rurban joined
ChoHag Yeah I didn't think that was specific enough: How can I do this: class Foo { has $!a; has $!b; has $!c }; $f = Foo->new(a=>3); $foo.a.set_by_constructor #|<returns True>; $foo.b.set_by_constructor #<returns False>; $foo.c.set_by_constructor #<raises an exception because c is a normal attribute> 16:06
I don't want to know if something is setby the constructor, I'm trying to simplify the problem somewhat. 16:07
16:08 Calibellus joined
nine ChoHag: where's the difference to $foo.a.defined? 16:09
16:09 TEttinger joined
RabidGravy ah 16:10
it doesn't track that but it's doable with some trait on the accessor itself (which you would have to make yourself)
ChoHag nine: Because I couldn't expand that to 'was_set_while_the_user_was_eating_lunch' 16:11
16:11 abraxxa joined 16:12 khw joined
ChoHag I achieved something similar to what I want in Moose by defining a new method (extra_has) which added a trait, other attributes to contain the data I was interested in and fudged the trigger. 16:13
RabidGravy I'm not feeling the love for the actual requirement so I'm not going to chase it down but I think you'd want to create a trait that added a role to the attribute MOP thingy you cared about which could store the information
ChoHag Then I could do extra_has 'special_attribute' => ( isa => 'Int', ... )
moritz you could just write a separate new method 16:15
ChoHag I don't want to know if an attribute was set in a constructor.
RabidGravy so you'd do "sub trait_mod:<is>(Attribute $a, :$my_special_stuff!) { $a does MySpecialRole }" where MySpecialRole adds the additional metadata to the attribute MOP object 16:16
moritz ChoHag: then I don't understand what you want to do
RabidGravy then "has $!foo is my_special_stuff" etc
16:16 hoelzro_ii joined
ChoHag I want to have an attribute in a class which has 'some flag or other' associated with it such that I can have, among other things, $instance.attribute.flag or in a pinch $instance._attribute_flag. 16:16
RabidGravy which I just decribed 16:17
ChoHag RabidGravy: Right. So where does my_special_stuff store its data?
RabidGravy the role can have its own attributes which it stores in the attribute MOP object, just like moose basically 16:18
ChoHag [Where] is there documentation on traits?
RabidGravy no
or in the design documents
16:19 kyun left 16:21 robinsmidsrod joined
RabidGravy the detail may or may not be firm enough for user documentation yet 16:24
16:28 yqt joined 16:29 jonathan_ joined
jonathan_ boo 16:30
16:32 RabidGravy left 16:33 jonathan_ is now known as RabidGravy
RabidGravy silly internet 16:33
timotimo silly interpreter 16:35
ChoHag Can I have Foo export the symbols Foo::Bar exports? 16:37
(And Foo::Baz, and Foo::Bing, and Foo::Some::Other::Thing)
16:37 Ven left 16:47 Ven_ joined
moritz ChoHag: do you want to address it as Foo::Bar or as Bar in the code where it was exported to? 16:49
ChoHag Foo::Bar 16:50
I just want to be lazy and have only one 'use' in the consuming code.
dalek line-Perl5: 800701b | (Stefan Seifert)++ | / (3 files):
Replace EVAL by MOP calls to create Perl5Package classes

Wrapper classes for imported Perl 5 modules are now better introspectable. Instead of <anon> the subs and methods now have a proper name.
line-Perl5: 79ef766 | (Stefan Seifert)++ | / (4 files):
Support exporting Perl 5 subs o Perl 6 users

This works now:
use Digest::MD5:from<Perl5> <md5>; say md5('foo');
16:51
nine Yes, yes, yes! :)
moritz ChoHag: then it already works
ChoHag: 'our' packages are global, no need for extra exporting
nine Another slide in my talk replaced with "yes, it just works as you'd expect" 16:52
ChoHag It works with the class Foo::Bar {} but not the multi trait_mod:<is>(Attribute $a, :$special) is export { ... which succeeds it.
16:53 pullphinger joined
ChoHag To get 'has $!thing is special' to work, I need to use Foo::Bar explicitely. 16:53
RabidGravy it should do as that's how traits work largely
dalek kudo/nom: 6a3e09c | skids++ | src/core/Parameter.pm:
Fix Parameter.perl when $!nominal_type is not a nominal type

The :elide-type logic introduced a problem with captured types and types like ::?CLASS. This disallows eliding said types. 2db0596 | ugexe++ | src/core/Proc.pm: Allow non-default %*ENV for `Proc`
16:54
16:54 dalek left, n0tjack left
RabidGravy you also need to specify :$special! or it won't select that on the multi 16:54
16:55 dalek joined, ChanServ sets mode: +v dalek
kudo/nom: 3e88cf2 | moritz++ | src/core/Proc.pm:
Merge pull request #482 from ugexe/patch-13

Allow non-default %*ENV for `Proc`
ChoHag Now I have 2 problems! 16:56
RabidGravy only two?
llfourn ChoHag: You could try exporting '&traitmod:<is>' from sub EXPORT { } in Foo.pm
ChoHag Two so far.
llfourn I have never tried exporting a multi from EXPORT though
ChoHag Is there a preferred paste site for this place? 16:57
llfourn docs.perl6.org/language/modules <- see EXPORT
RabidGravy github gists mostly preferred
dalek c: 677aba6 | moritz++ | lib/Type/Proc.pod:
Mention :env in run()
16:59
llfourn afaik there is "re-exporting" in the spec it's just not yet implemented
I may have read it wrong though
ChoHag gist.github.com/ChoHag/3645dd1638a73b32430d 17:00
RabidGravy if I can guess what you are trying to do, I'd say "module Foo { role Bar { ... } ; multi sub trait_mod:<is>(Attribute $a, :$special!} { $a does Bar; } }" is probably the thing
with an is export in there 17:01
ChoHag My two problems are that I need to use SAD::Special in SAD/Thing.pm, and I don't know what difference the ! RabidGravy told me to use on line 20 makes.
Also that site is a PITA to paste text into. 17:02
Also also I'm not good at naming things. 17:03
But pretty good at naming things things.
RabidGravy the ! means it is required, without it may select anouther multi 17:04
named parameters are optional by default
ChoHag What other multi *could* 'is special' select?
RabidGravy er 17:05
llfourn how can I edit the gist? 17:07
RabidGravy it's a subroutine like any other 17:08
ChoHag llfourn: There's a comment box underneath. Maybe you need to be logged in to it. 17:09
llfourn ChoHag: ok I think i've solved one of your problems
one sec
17:10 khw left 17:12 khw joined
llfourn ChoHag: take a look 17:12
ChoHag RabidGravy: But if a variable is qualified with 'is special', how could it get into any other trait_mod unless its signature also includes :$special? 17:13
dalek rl6-roast-data: f8f7165 | coke++ | / (9 files):
today (automated commit)
17:14
ChoHag llfourn: That does it thanks.
RabidGravy because named parameters like ":$special" are optional unless made required by the ! 17:15
17:15 Alina-malina joined
llfourn ChoHag: No worries :) 17:16
ChoHag So if there was a trait_mod<is>(Attribute $a, :$funky!) {}, could 'has $!foo is special is funky' call that trait_mod and not the original (:$special) one? 17:17
17:17 inokenty joined
RabidGravy you can have multiple traits without a problem 17:20
17:20 Ven_ left
ChoHag Then I don't understand the circumstances under which my original trait_mod sub would *not* be called against any attribute which was qualified by 'is special'. 17:21
[Coke] hurls stackoverflow.com/questions/3166538...s-in-perl6 for someone to answer. 17:22
[Coke] sees it's in review (but still unanswered on SO)
llfourn can you write custom accessors? I mean like override a $.attr's default accessor 17:26
17:27 [TuxCM] joined, atroxaper left
RabidGravy llfourn, yes. you can make a "multi method attr() is rw { }" etc ec 17:29
llfourn RabidGravy: eh method attr is rw? 17:30
ChoHag Protip: When testing whether your dish is salty enough, don't use the spoon with which you added the salt.
RabidGravy same goes with chilli ;-)
ChoHag Also, especially with chilli, don't scratch your eyes. 17:31
RabidGravy llfourn, yeah the last lvalue becomes writable
ChoHag You only make that mistake once with Scotch Bonnets...
llfourn RabidGravy: That's cool!
17:32 mpapec joined
llfourn We should document that! 17:32
mpapec hi, is someone reading [email@hidden.address] 17:33
geekosaur an accessor is just a method with the same name as an attribute, no?
moritz geekosaur: correct 17:34
[Coke] (info@) I would imagine maybe pmichaud? 17:35
17:35 mpapec left
ChoHag Can you get to the Attribute class which backs an attribute other than through $instance.^attributes, which is a list? 17:35
17:38 Ven_ joined
dalek line-Perl5: db3c4af | (Stefan Seifert)++ | lib/Inline/Perl5.pm6:
Mark required :$perl5 parameter for improved error message
17:39
llfourn hmm but it seems by making a method 'is rw' you still don't get access to whatever it's being assigned to 17:46
within the method
or is there some special variable I'm not aware of... 17:47
RabidGravy If you want to separately capture control on get as opposed to set then you need to have a Proxy as it currently stands 17:48
llfourn RabidGravy: Makes sense 17:49
RabidGravy llfourn, eg: 17:52
m: class Foo { has $!bar; method bar() is rw { Proxy.new( FETCH => sub ($) { $!bar; }, STORE => sub ($, $b) { $!bar = $b; }); } }; my $foo = Foo.new; $foo.bar = "zub"; say $foo.bar; my $r = Foo.new; say $r.bar; 17:53
camelia rakudo-moar 3e88cf: OUTPUT«zub␤(Any)␤»
RabidGravy not entirely ideal
17:56 yqt left 17:57 Ven_ left
llfourn RabidGravy: can't we just .wrap the method after it has been created via class.^find_method 17:58
anyways I'm out 4am here :) 17:59
17:59 abraxxa left
llfourn I started writing the answer to SO but then realised I'm too tired :S gist.github.com/LLFourn/2d1b407f06c486a12173 17:59
feel free to use :)
18:00 llfourn left
RabidGravy please don't take anything I say as canonical ;-) 18:00
[Coke] that rw method doesn't work here. updating rakudo to double check.. 18:02
RabidGravy it wants to work as half the universe depends 18:04
18:05 brrt joined 18:11 hoelzro_ii left
ugexe should Proc::Async.start switch paramater :$ENV to :$env? 18:16
hoelzro I came across some interesting behavior this morning while working on my Xapian bindings; when I add a definition for an existing operator (ex. sub infix:<==>) to a unit, it's not visible in an importing unit unless I specify is export 18:18
I understand why, but I was thinking how this might trip up someone new to Perl 6
18:23 hoelzro_ii joined
RabidGravy I actually like that behaviour 18:23
18:24 atroxaper joined
hoelzro RabidGravy: the behavior I just described? 18:24
[Coke] m: class Wizzard { has Int $.mana is rw; method mana is rw { say "running out of mana" if $!mana < 20; $!mana; } } ; my Wizzard $gandalf .= new; $gandalf.mana = 2; say $gandalf.perl; 18:25
camelia rakudo-moar 3e88cf: OUTPUT«Invocant requires a 'Int' instance, but a type object was passed. Did you forget a .new?␤ in method mana at /tmp/06kTejG8vD:1␤ in block <unit> at /tmp/06kTejG8vD:1␤␤»
[Coke] ^^
dalek ast: f23ee5a | lizmat++ | S06-signature/introspection.t:
Unfudge now passing tests
RabidGravy hoelzro, yeah it causes you to think what you are doing :) 18:27
hoelzro RabidGravy: I don't mind the behavior, but I'm betting that newbies will be working with Perl 6, wondering why their operator overload doesn't work =/ 18:28
maybe it's up to a linter, though
18:28 atroxaper left
RabidGravy better documentation is the key :) 18:29
hoelzro, I think it would be covered by "by default all subroutines are only visible to their lexical scope (this includes operator and trait definitions.)" 18:38
18:38 domidumont joined
RabidGravy then explaining the use of either "our" or "is export" 18:38
18:41 domidumont left 18:42 domidumont joined 18:44 brrt left
lizmat hmmm... going through S02, I found something that will make [TuxCM] happy 18:45
[TuxCM] is all ears …
lizmat S02:672 states: "C<Int> automatically supports promotion to arbitrary precision, as well as holding C<Inf> and C<NaN> values."
[TuxCM] ah, so I can haz Ranges :) 18:46
nine, FROGGS, any view on fixing Merging GLOBAL symbols failed: duplicate definition of symbol HLL ?
lizmat well, maybe: it appears to be added quite recently (with e608859d ) to be precise
which is a formatting change 18:47
ah well
[TuxCM] YAPC::EU asked if I could shorten my p5/p6 CSV talk from 50 to 20 minutes. I prepared 58 slides :( 18:48
lizmat the original version dates to 2008: 16b83354 18:49
DrForr My talks are both 20 minutes, otherwise I'd offer to sacrifice.
[TuxCM] test 50000 47.058 46.960
test-t 50000 46.398 46.300
ShimmerFairy lizmat: there's an old ticket concerning Inf and NaN wrt Int and such; I can try finding it for you if you like :)
lizmat ShimmerFairy: thank you, but no need 18:50
[TuxCM] ShimmerFairy, my point is that this is fail: my Int $i = Int.Range.max; 18:51
hoelzro RabidGravy: it's consistent with export rules, but I don't know if it'd be obvious to a newbie
[TuxCM] I understand
hoelzro since the == operator is already in scope, just not the candidate that's provided by the module
ShimmerFairy Yeah, the old bug is about how Inf/NaN aren't able to be stored in Ints (and possibly other types). 18:52
hoelzro so they'll get &infix:<==>(Any, Any) behavior instead of &infix:<==>(MyType, MyType) behavior, and they might scratch their head as to why
[TuxCM] IMHO there should be types Inf and NaN's :)
[Coke] not just an old bug - the oldest bug.
[TuxCM]: so how would you store an Inf in a Num if Inf was a separate type? 18:53
lizmat I only see a VM-level solution, or some role mixin magic kludge
[TuxCM] auto up/downgrade
[Coke] (I think it ends up having to be a separate special value like Nil)
ShimmerFairy if only we had something like class Int = RealInt | Inf | NaN (assuming Inf and NaN as types, and RealInt as current Int) 18:54
[Coke]: Hm... A Nil/Empty/etc.-like value might make the most sense, come to think of it. Inf (and possibly NaN) certainly apply to more than one type. 18:55
RabidGravy hoelzro, but overloading operators is not newbie stuff, you'd expect them to have read some docs before they discovered it
moritz isn't aware of any language that successfully and retroactively added union types 18:56
RabidGravy tum ti tum
18:56 rangerprice joined
rangerprice hi guys 18:57
RabidGravy erp
ShimmerFairy moritz: yeah, I don't think adding union types would be a good move at this point, at least not without a serious need and plenty of considerations given. 19:02
19:04 brrt joined 19:05 colomon joined, level0 joined 19:06 amurf joined
level0 from S03->Note that unlike Perl 5's flipflop, numeric values are not automatically checked against the current line number. (If you wish to have those semantics for your smartmatches, you could mixin a numeric value to $_ to create a chimeric object that is both integer and string. Conjecture: lines() should have an option that does this.) 19:06
Is such option in lines() available? 19:07
RabidGravy I don't think so 19:09
19:10 amurf left, zakharyas joined 19:11 Hor|zon joined
RabidGravy has today been the day of the x/y problem? 19:11
19:14 colomon_ joined 19:16 colomon left
lizmat
.oO( x/x problems are much friendlier :-)
19:16
19:17 colomon joined 19:18 colomon_ left
geekosaur .oO{ and z/w problems are for the birds } 19:19
19:20 Begi joined
moritz for lines().kv -> $no, $line { next unless $line ~~ 5..12; ... } 19:22
19:22 Begi left
dalek ast: e6487c5 | skids++ | / (3 files):
unskip some passing tests and make is-perl-idempotent more useful

Also test some new cases which would have failed before PR#481
19:22
lizmat moritz: did you not intend $no ~~ 5..12 ? 19:23
moritz erm, yes
lizmat++
lizmat ok *phew* :-)
19:23 brrt left, rurban_ joined
moritz lizmat: re RT #125705, afaict Lock is meant to be re-entrant 19:25
19:27 level0 left
lizmat S17:940 indeed states: C<Lock> is reentrant. 19:27
but it doesn't state the semantics of the reentrancy
one would hope that the inner $lock usage would be a noop and not unlock until the outer scope is exited 19:29
19:30 colomon_ joined
moritz iirc it means you can acquire the lock a second time from within the thread it was acquired in first 19:30
19:31 colomon left, colomon_ is now known as colomon
moritz though note that the outer $protect only protects the call to .cue, not the inner block that's passed to .cue 19:31
hoelzro RabidGravy: ok, fair point 19:32
RabidGravy it's easy for us who know all sorts of things which aren't documented :) 19:33
19:35 colomon_ joined 19:36 colomon left, colomon_ is now known as colomon, colomon left
hoelzro =) 19:44
19:46 yqt joined 19:48 telex left 19:49 ely-se joined, ely-se left 19:50 telex joined
hoelzro could someone working on Windows do me a favor and test Linenoise on Windows for me? I'd like to see if it works so I can propose it for inclusion into Rakudo Star 19:52
DrForr Reminds me, I need to polish off the Readline stuff. 19:54
19:55 zakharyas left 19:57 FROGGS joined 20:02 Begi joined 20:03 ChoHag left
Begi What's the best choice to code a website with Perl 6 ? Bailador ? Web ? 20:04
moritz hasn't used either, but has the impression that Bailador development is more active 20:05
20:08 pullphinger left
Begi Bailador was my favorite. Is there any documentation except GitHub for Perl 6 modules ? 20:08
RabidGravy if the author made any then p6doc Foo may work 20:09
(don't actually know tbh)
I always document my stuff as if someone will read it but I don't know how they do 20:10
DrForr perl6 -doc filename # as well I think. Maybe --doc, check the app. 20:11
20:16 zostay joined
jnthn evening, #perl6 20:16
RabidGravy erp
itz perl6 module doc is usually README.md rather than embedded pod at the moment (which is a bit unfortunate) 20:17
hoelzro I would love it if we could make docs that are generated from a file in the repo separate from the .pm file, but available via .WHY
[Coke] Thanks to all the p6 people for keeping my brain working!
hoelzro we could then do the same for Rakudo
[Coke] PERL6MANPATH 20:18
itz I have wondered if panda should install README.md and p6doc parse it
RabidGravy itz that would encourage bad 20:19
itz yeah the proper solution is proper pod 20:20
20:20 jkva joined
RabidGravy pod in the .pm files yeah, readme is just enough to sell the module and get it installed :) 20:20
jnthn continues to be very unconvinced we'll see a resolution to the Int holding Inf thingy 20:21
In 7 years nobody has proposed anything close to a viable concrete implementation strategy
RabidGravy we need the pony man to make Pod::Coverage for p6 20:22
itz actually the modules.perl6.org/ icons have badges for README.md and none for POD 20:23
RabidGravy jnthn, does it stop anyone from making working software or does it just offend purists? 20:24
itz, probably easily fixed
[Coke] m: Inf.Int.say 20:25
camelia rakudo-moar 3e88cf: OUTPUT«Cannot coerce Inf or NaN to an Int␤ in block <unit> at /tmp/_KpHQ836Nk:1␤␤Actually thrown at:␤ in block <unit> at /tmp/_KpHQ836Nk:1␤␤»
[Coke] m: my Int $a = Inf;
camelia rakudo-moar 3e88cf: OUTPUT«Type check failed in assignment to '$a'; expected 'Int' but got 'Num'␤ in block <unit> at /tmp/WGTtI7jvVd:1␤␤»
jnthn RabidGravy: Well, it apparently causes issues 'cus of the Int.range thing, but nobody had implemented that that we'd be fine :P
*but if
That's a fairly recent addition.
RabidGravy perfect
jnthn The real problem is "what type is Inf, if not Num?" 20:26
[Coke] That's pretty much the extent of the request. I would be happy if the request was rejected and we said that Inf and NaN are just Num-my.
20:26 Hor|zon left
jnthn [Coke]: If it were up to me we'd have already done that. ;) 20:26
20:26 Hor|zon joined
[Coke] Who is it blocking on? TimToady ? 20:27
RabidGravy NaN should probably be failurely
jnthn [Coke]: Mostly I'm saying, "I'm willing to be convinced, but you need to stop waving your arms and dreaming and show me a solution that isn't a kludge I'm going to refuse to implement" :)
ShimmerFairy jnthn: the cheating option would be to make Int.range.max return NaN, since arguably there is no "max" integer, thus the maximum value is not a number (and I'd imagine not being able to store NaN in an Int is more acceptable than Inf when it comes up) :P
jnthn [Coke]: Well, TimToady++ is one person who might be able to come up with a solution, yes. 20:28
The thing that drives me nuts is solutions that act like cheating/hacks in the type system won't hurt later.
We already have Failure and Nil wanting to be special. 20:29
[Coke] Perhaps Int.range.max could return Whatever. 20:30
jnthn points out that this isn't assignable to Int either, so won't satisfy that use case...
RabidGravy is that 'wha-ever" 20:31
[Coke] If Int.range.max needs to return something typed to an Int, we're scrod. 20:32
RabidGravy :)
[Coke] Perhaps it could return something more abstractly numeric?
ShimmerFairy jnthn: I heard a suggestion that Inf/NaN could be special values like Nil. Aside from that, atm I only see either rejecting the ticket, or some truly ugly change to the type system where e.g. NaN is the base numeric type, Inf inherits NaN, and everything else inherits Inf.
RabidGravy er 20:33
jnthn ShimmerFairy: I'm going to push back pretty hard against "magic". :P
And special values sound like magic.
RabidGravy fetches the ducking stool
jnthn [Coke]: I'm not saying it has to, just noting that it's a pain point for somebody that it doesn't, so we might want to consider that. 20:34
ShimmerFairy jnthn: yeah, the special value makes sense in a "multiple types want this" sort of way, but I think it'd be better if we were clearer about how each type handles infinity, if at all.
RabidGravy Inf only becomes a problem in my mind if you want to know what If - 1 is 20:35
jnthn Inf :P 20:36
ShimmerFairy (I imagine one possibility is that Inf and NaN could be types that can be coerced to each numeric type's idea of infinity/non-numbers, though I guess that's suspiciously similar to "magic"/"special values" :P)
jnthn Well, that one kinda runs into the "types are constraints not coercions" (except coercion types) thing 20:37
If we *really* want to do it that way, then maybe we need to formalize type check failover somehow
Since Nil relies on failing the type check and then saying "oops...but hey, wait!"
I'm just not overly fond of such things. That one is a special case in assignment. 20:38
But not in argument passing.
ShimmerFairy I imagine Int.infinity and infinity(Int) would be easy (as well as for other numeric types), it's wanting a term for infinity and NaN that's causing us grief, since multiple types want those terms. 20:39
jnthn *nod* 20:40
RabidGravy this beginning to get like when I wen to an A level maths class on acid, you never need to evaluate inf you just don't check the upper bounds until you run out of time 20:43
20:44 Begi left
ShimmerFairy jnthn: One solution might be to make Inf and NaN terms of type Num (for example), and then other numeric types would have to do NaN.Rat or Inf.Int . I'm not sure how nice of a solution that would be, but it's kinda similar to having to do DateTime.new(now) , in my mind 20:44
nine [TuxCM]: sorry, no news :/
jnthn Well, we tried this problem for 7 years without any acid, so maybe... :P 20:45
timotimo only NaN, Inf, -Inf and -0 are Num but at the same time typecheck against Int! what a smart idea! 20:46
jnthn: can i interest you in looking at my broken "lexicalref lowering" nqp branch? 20:47
it complains that the code's trying to build localrefs of obj-typed locals, it seems
jnthn ugh, that shouldn't happen
timotimo i was trying to make it not happen :)
FROGGS :D 20:48
timotimo but it also made me wonder if/why we can't support obj localrefs
i suppose obj attrrefs are a bit harder due to write barriers
but localrefs may even be possible?
jnthn Wait, nqp branch?
FROGGS ation .oO( mistakes - that should not happen )
gah!
timotimo er, rakudo branch
RabidGravy m: say 1/0
camelia rakudo-moar 3e88cf: OUTPUT«Attempt to divide 1 by zero using div␤ in block <unit> at /tmp/tBbpfNpYqh:1␤␤Actually thrown at:␤ in block <unit> at /tmp/tBbpfNpYqh:1␤␤»
jnthn ah
timotimo i merged the nqp branch that puts the code gen in 20:49
ShimmerFairy is certainly interested in hearing TimToady's thoughts on Inf/NaN :)
timotimo (turned out the code gen was correct all along, but the test was b0rked)
RabidGravy so you can't get Inf by evaluating an expression
timotimo I'm rather interested in getting closer to fglock's perl5-to-java translator benchmark thingie 20:50
jnthn github.com/rakudo/rakudo/commit/cb...453281R655 20:51
RabidGravy so the only place you care about Inf is a limit to a range, so turn up the bounds check 20:52
jnthn are you really really sure that everything that is not lexical is lexicalref in the else?
(I mean, it probably shoudl be, but...)
timotimo oh, hm, let's see
it was very late when i wrote that code :) 20:53
but to be fair
jnthn "# Also must not lexicalref it - except if it's a native var."
That's...odd too
timotimo before i put that change in it just turned it into "local" from whatever it was
oh and also, it refers to $new_name
20:53 domidumont left
jnthn Any code-gen that's using lexicalref must *already* be doing it on a native var 20:53
Ohterwise the code would already not compile
So that checking seems a bit bogus 20:54
timotimo oh, new name refers to what it was before, so it doesn't get set to something else explicitly
ah, that's an interesting insight
this'll lead me further towards the solution!
thanks a lot already :)
can we get an nqp::note that desugars into nqp::sayfh(nqp::getstderr, ...)? :) 20:55
jnthn I'd find the smallest example you can and then study the QAST tree before/after the opt
nqp-m: note('I can note!') 20:56
camelia nqp-moarvm: OUTPUT«I can note!␤»
jnthn ;)
timotimo ooooh!
nice 20:57
anyway, at that point in the code - in the else cause - we actually get lexicalref, localref, and local as the scope
20:59 jkva left
jnthn um....the latter two sound "interesting", that means we're re-visiting things o.O 21:00
timotimo thought so 21:02
well, yeah
if we have a Want anywhere, for example
21:03 jkva joined
timotimo we usually share the QAST subtree between the void and non-void, don't we? or at least we only visit one of the branches 21:05
something like that, anyway
jnthn We go to some effort not to re-walk that though 21:06
timotimo hm 21:07
well, i'll try to do the "simplest thing that breaks" + compare 21:08
by compiling the setting with --optimize=off
jnthn OK. Good luck! I'm going to rest up for the last day of teaching. :)
RabidGravy break all the things
jnthn 'night o/
timotimo good rest! 21:09
RabidGravy toodlepip
timotimo RabidGravy: i'm working in a branch, of course!
RabidGravy wuss
timotimo hahaha
you're cute
RabidGravy I hadn't understood a word of the previous ten minutes so you carry on ;-) 21:11
timotimo hehe
if you want, i can explain a bit of it
21:12 brrt joined
RabidGravy optimising the scope saving but I don't need to know the gory details 21:13
timotimo oh damn 21:14
This container does not reference a native integer
at src/gen/m-CORE.setting:10214 (./CORE.setting.moarvm::93)
even before it tries to optimize
i will have to --optimize=off (like i said above) rather than --optimize=0 21:15
RabidGravy I was surprised that 0 and off aren't the same BTW 21:17
timotimo 0 only does some analysis, but is supposed to not change anything
21:17 jkva left 21:18 jkva joined, skids left 21:19 diana_olhovik_ left
timotimo things are still broken, though ... 21:20
RabidGravy o/ some times things get complicated o/ 21:21
21:21 dolmen joined
timotimo yeah, things tend to do that :| 21:22
21:22 jkva left 21:33 raiph joined 21:37 inokenty left 21:40 p6-riche joined 21:46 brrt left 22:00 atroxaper joined 22:04 atroxaper left, rurban_ left 22:19 dolmen left 22:23 vike joined 22:26 virtualsue left 22:30 spider-mario left 22:33 hoelzro_ii left 22:36 rurban left
ugexe can i override a sub using a runtime mixin? im trying to do this with copy but get collisions problems 22:37
timotimo lexically, you can always do it; you can also wrap and later unwrap the copy sub 22:41
ugexe or maybe someone has a better suggestion... i want to override copy(*@_) for a specific class so i can modify each parameter and then redispatch to the original copy
22:43 amurf joined
ugexe my $curli = CompUnitRepo::Local::Installation.new(%*CUSTOM_LIB<site>); role CP[$cwd] { &copy = sub { nextwith($^a.IO.absolute($cwd), $^b); }; }; $curli does CP[$*CWD]; 22:45
m: my $curli = CompUnitRepo::Local::Installation.new(%*CUSTOM_LIB<site>); role CP[$cwd] { &copy = sub { nextwith($^a.IO.absolute($cwd), $^b); }; }; $curli does CP[$*CWD];
camelia rakudo-moar 3e88cf: OUTPUT«Cannot find method 'collisions'␤ in any apply at src/gen/m-Metamodel.nqp:2633␤ in any compose at src/gen/m-Metamodel.nqp:2810␤ in any generate_mixin at src/gen/m-Metamodel.nqp:1294␤ in any at src/gen/m-Metamodel.nqp:1215␤ in any mixin at sr…»
dalek ast: 74d1cb1 | skids++ | S06-currying/misc.t:
Test needs to be skipped on moar as well.
ugexe what am i overlooking regarding collisions?
22:47 amurf left
RabidGravy nighty night boys and girls 22:48
timotimo maybe we want to make copy a multi in the core setting 22:50
22:52 RabidGravy left
ugexe fwiw it seems related to applying at runtime 22:53
m: my &copy = sub { $^a.say; $^b.say }; copy($*CWD,$*CWD)
camelia rakudo-moar 3e88cf: OUTPUT«"/home/camelia".IO␤"/home/camelia".IO␤»
22:55 skids joined
timotimo huh, you're trying to override a sub for inside the lexical scope of a class? 22:56
or do you want to change a method? in that case you have to go via the MOP
ugexe i want to intercept sub copy(|) inside a single method ideally, but i'd settle on lexical to the class as well 22:59
github.com/rakudo/rakudo/blob/nom/...on.pm#L134
22:59 cognominal left
ugexe its first argument is passed a relative path. i need to be able to pass a absolute path 22:59
timotimo can't add lexicals to a class after the fact 23:04
all you can do is wrap the copy that it uses 23:05
ugexe i suppose that works just as good for me 23:07
timotimo right 23:08
timotimo disappears into bed
after not really having done anything for the optimizer at all 23:09
rangerprice eating lemon 23:47