»ö« 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:00 vendethiel joined
timotimo it's kind of amazing that none of the ~5k gc runs that happen during masaks send-more-money-subs is a full collection 00:03
and i'm not 100% sure that's really a good thing
hm. the collection time or the number of gen2 roots doesn't decrease after a full gc, so it doesn't seem so bad 00:07
(i reduced the threshold for a full gc run to be triggered way down and made it to a single full collection)
hmm. it might be sort of interesting to have the profiler also measure what objects get promoted to gen2 00:08
00:14 gfldex left 00:19 laouji joined
tadzik Indeed 00:20
00:23 vendethiel left 00:25 davido_ left 00:27 davido_ joined 00:28 larion left
timotimo there's an object that gets added to the gen2 roots that seems ... garbled 00:29
gist.github.com/timo/b3948e713e46d7923e39 00:30
its flags are "IS_STABLE" and "SECOND_GEN"
oh, an STABLE looks different from an object of course 00:31
the vast majority of things being added to the gen2 roots are MVMCode objects 00:34
at least during startup; when running the send-more-money-subs, more and more MVMCode get added, but also P6Opaque, VMArray, and a few VMHashes 00:35
i wonder if these MVMCode objects come just from taking closures?
jdv79 are a bunch of closures necessary? i haven't looked at that code. 00:36
00:39 laouji left, laouji joined 00:43 JustThisGuy joined 00:44 laouji left
JustThisGuy Hi all! What's the convention for posting code to ask a question about? 00:45
raydiak JustThisGuy: if it's more than a line, a github gist is common, or whatever pastebin you prefer
00:46 laouji joined
JustThisGuy OK, thanks. I'll be back in a few... 00:46
raydiak you're welcome
JustThisGuy OK, Here's the code: pastebin.com/raw.php?i=wm2jLWW3 00:52
When I run it through the REPL: my $gdbm = DBM::GDBM.new('foo', 0, 0o666); $gdbm.store('foo', 'bar'); 00:53
I get: Cannot modify an immutable Str in method store at /development/perl6/DBM-GDBM/lib/DBM/GDBM.pm6:66 in block <unit> at <unknown file>:1 in any <unit-outer> at <unknown file>:1
I saw in Arne Skjærholt's talk here: www.youtube.com/watch?v=ZPuU_jTnJC...p;t=17m25s 00:54
That value structs are not yet implemented. Is that what I'm running into, or am I doing something dumb? (entirely possible since this is day 4 of using Perl 6) 00:55
00:58 BenGoldberg joined
JustThisGuy Oh, I should probably mention that DBM::GDBM.new actually creates the gdbm file 'foo', and it appears to be valid, but empty, as expected. 00:58
raydiak hm...well, line 66 doesn't match the paste and idk much about DBM, but I'd try changing the 'is rw's in store's signature to 'is copy' instead, since you're passing literal strings in instead of mutable containers 01:00
JustThisGuy Yeah, sorry, I hacked out a bunch of commented out junk. The line is: my datum $key_datum = datum.new(dptr => $key, dsize => $key.chars); 01:01
I'll give that a try... 01:02
Thanks!
Still got the same error. 01:03
timotimo if you .store('foo', 'bar') you're passing in constant strings, and if you somehow assign to them, that'll go boom. but i don't really see where that'd happen 01:05
JustThisGuy Yeah, that's what's confusing me. 01:06
timotimo you tried "is copy" like raydiak suggested?
JustThisGuy Yes, I get the same error.
timotimo you restarted the repl properly, too?
raydiak yeah I don't see what on that line is trying to change a string, either... 01:07
timotimo if you run perl6 with --ll-exception, the stack trace will also contain internal methods
JustThisGuy Yes, I did restart it. Just did it again to make sure. :)
timotimo that could help figure out where things are going wrong
01:07 zhanggong joined
JustThisGuy Hmmm... I did this: PERL6LIB=. perl6 --ll-exception -M DBM::GDBM 01:08
and still got the same error with no extra info.
timotimo that should have helped 01:09
can you try 'use DBM::GDBM' instead of -M?
JustThisGuy Sure...
Same result. 01:10
timotimo :o
hm, we do read from PERL6LIB, right? could you put a say statement into the mainline of the module so we can see if the right file is being used? 01:11
JustThisGuy Sure...
timotimo i'm not really on top of my debugging game; it's 3am, i should probably try sleeping instead
JustThisGuy Yeah, I got my "Foo!!!" as soon as I typed in use DBM::GDBM; 01:12
So it's definitely the right file.
timotimo OK, good
JustThisGuy LOL, don't let me keep you up timotimo. :) 01:13
timotimo "is copy" is the only thing you changed?
JustThisGuy Yes, except for the say line I just added.
I know this is probably bleeding edge stuff, and that combined with the fact that I don't know what I'm doing could be the problem. :) 01:15
Is there anywhere more persistent I can post this question?
timotimo we have [email@hidden.address] 01:16
fwiw, the nativecall stuff and CStruct classes have been around for a long time
JustThisGuy OK, I'll give that a try. Thanks timotimo!
timotimo but being able to mark parameters to "is native" subs to be "is rw" is rather new
JustThisGuy Oh, that's good to know.
timotimo hm, so, where do i get libgdbm.so.3 01:17
yum yum ...
JustThisGuy I'm running Linux Mint 17, and the package is called libgdbm3. 01:18
timotimo oh, i have .4 01:19
i can get compat-gdbm
Error: compat-gdbm-devel conflicts with gdbm-devel-1.11-4.fc21.x86_64
JustThisGuy Yeah, that's one thing I was wondering about is how to handle versioned .so files.
timotimo oh, that's funny! 01:21
JustThisGuy What's that?
timotimo this comes from a BUILD method 01:22
JustThisGuy I haven't learned about BUILD methods yet, so I don't get the joke. :) 01:23
timotimo the funny thing was i first thought it was something completely unrelated 01:24
JustThisGuy Oh, gotcha.
timotimo creating the first datum in the store method blows up
raydiak m: use NativeCall; class Foo is repr('CStruct') { has Str $.str }; Foo.new: :str<foo> # golf 01:25
camelia rakudo-moar c2a57e: OUTPUT«Cannot modify an immutable Str␤ in block <unit> at /tmp/Ft7xb6JrS3:1␤␤»
timotimo well, that's convenient
who broke that! :P
JustThisGuy Not me! I don't know enough to be dangerous yet. :) 01:26
timotimo well, this worked once
JustThisGuy Oh cool! So there's hope! 01:27
timotimo star: use NativeCall; class Foo is repr('CStruct') { has Str $.str }; Foo.new: :str<foo>
camelia star-m 2015.03: OUTPUT«Cannot modify an immutable Str␤ in block at src/gen/m-CORE.setting:1009␤ in method BUILDALL at src/gen/m-CORE.setting:992␤ in method bless at src/gen/m-CORE.setting:981␤ in method new at src/gen/m-CORE.setting:967␤ in block <unit> at /tmp/PJaYJ…»
timotimo ... huh?!
we never had working Str inside CStruct?
that seems unlikely 01:28
01:35 fernando___ left, ggherdov left 01:36 preyalone left 01:37 zhanggong left
timotimo OK, sleep time now 01:39
o/
JustThisGuy OK, thanks for the help timotimo!
01:40 fernando___ joined
JustThisGuy Oh, and thanks to you too raydiak! 01:41
01:42 JustThisGuy left 01:47 ggherdov joined
dalek kudo/nom: c79bcc5 | hoelzro++ | src/ (3 files):
Save Regex source for .gist/.perl
01:48
01:53 preyalone joined 01:54 Sqirrel left 02:15 Akagi201 joined 02:16 SevenWolf joined 02:21 vendethiel joined 02:24 yqt left 02:29 rba_ left, rba__ joined 02:31 DarthGandalf left 02:32 DarthGandalf joined 02:35 rmgk is now known as Guest2154, rmgk_ joined, Guest2154 left, rmgk_ is now known as rmgk 02:40 noganex joined 02:43 vendethiel left, noganex_ left 02:48 zj joined 02:58 rba__ left, rba_ joined 03:12 bin_005_u_j joined 03:13 telex left 03:14 telex joined 03:21 davido_ left 03:22 davido_ joined 03:36 Sqirrel joined 03:40 [particle] left, [particle] joined 03:45 zj left 03:53 bin_005_u_j left 03:55 koo6 left 03:56 BenGoldberg left
moritz hoelzro: how much does that increase rakudo setting compilation and baseline memory consumption? 04:00
hoelzro moritz: I tried loading Perl5::Grammar (the largest I could find) into a rakudo with and without the patch; the difference was negligible (a few hundred KB) 04:12
04:13 zhanggong joined
hoelzro which is suspicious, to say the least 04:13
hoelzro sleeps 04:15
04:16 census left
moritz hoelzro: good night 04:18
wow, perl 5.22 has hex float literals 04:19
04:21 zhanggong left 04:30 laouji left 04:47 laouji joined 04:57 amurf joined 05:47 domidumont joined 05:51 domidumont left 05:52 domidumont joined 05:56 kaare_ joined 05:57 rba_ left 06:00 diana_olhovik_ joined 06:01 kurahaupo1 joined 06:21 skids left 06:22 domidumont left 06:23 espadrine joined 06:26 _mg_ joined 06:27 mr-foobar left 06:40 quester joined 06:50 amurf left, mr-foobar joined 06:52 lizmat joined 06:53 colomon left 06:56 FROGGS joined 07:01 Ven joined 07:02 SevenWolf left 07:05 rba_ joined 07:06 zakharyas joined 07:10 mtj_ left 07:11 mtj_ joined
masak morning, #perl6 07:13
FROGGS morning
masak m: say 0x5.8 # do we have hex float literals?
camelia rakudo-moar c2a57e: OUTPUT«5===SORRY!5=== Error while compiling /tmp/ymEl0W5u7c␤Confused␤at /tmp/ymEl0W5u7c:1␤------> 3say 0x5.7⏏058 # do we have hex float literals?␤ expecting any of:␤ dotty method or postfix␤»
masak nnnnope.
FROGGS m: say pi.fmt('%#x') 07:14
camelia rakudo-moar c2a57e: OUTPUT«0x3␤»
FROGGS fair enuff
masak "engineer's pi" :P 07:15
nwc10 test 07:16
FROGGS :D
ok 1 - test
nwc10 er, nah.
the joke is
"what's pi?"
er.
correctin
"what's the value of pi?"
FROGGS hehe 07:17
nwc10 mathemetician: well, it's Pi, isn't it
physicist: 3.1, within experimental error
engineer: allowing for a small safety factor - 18
FROGGS engineers++ 07:18
07:20 jack_rabbit joined
moritz nah, the pysiciist says pi = 3.1 +- 0.05 07:21
s/ii/i/
07:21 RabidGravy joined
moritz "I'm 69% confident that pi is in range [3.05, 3.15]" 07:21
FROGGS and I know what jnthn++ would say :o)
nwc10 moritz: I think you're actually right, but the joke was never told to me that way. 07:22
and your way actually works better.
07:22 rba_ left
nwc10 goes back to "break all the things" at work. 07:23
(this isn't the plan. It's very much what I'm trying *not* to do)
moritz happens to have studied physics, a long time ago
lizmat good *, #perl6! 07:28
lizmat realizes she did dabble in physics a longer time ago :-)
FROGGS morning lizmat 07:29
07:32 jack_rabbit left
lizmat FROGGS o/ 07:32
07:43 cognominal joined
lizmat timotimo++ # P6W 07:46
07:47 rindolf joined
moritz timotimo++ # indeed 07:50
another change we had last week was the new front page layout for design.perl6.org/, and that the pod6 files are now automatically turned to HTML too
DrForr Oh, I've just been using module.perl.org for that. 07:51
07:53 FROGGS left
dalek kudo/nom: 2cc3afe | lizmat++ | src/core/Regex.pm:
Fix calling Regex.gist/perl on a type object
08:02
tadzik What's the dillema, isn't Pi half Tau? :) 08:05
08:06 FROGGS joined
moritz DrForr: using module.perl.org for what? 08:06
FROGGS yay! a p6w 08:07
DrForr reading synopses. Someone posted it as a link, or I tyop'ed it a while back. 08:09
08:09 darutoko joined
FROGGS timotimo: btw, -3 and friends show up often in match results... does it make sense to adjust the int cache? 08:10
dalek Heuristic branch merge: pushed 23 commits to rakudo/newio by lizmat 08:11
08:11 colomon joined 08:13 espadrine left
FROGGS domm++ # "[...] And as of 2015-06-02T10:00:00 I'm using Perl6 in production" 08:15
tadzik Where's that from? 08:18
masak his blog post? 08:19
domm.plix.at/perl/2015_05_a_very_si...cript.html 08:20
yep :)
tadzik Oh, I didn't notice it in there
masak also very encouraging: "My plan for the next months: Port a few more of my various helper scripts and tools to Perl6!" 08:21
moritz seems to be a later update, since the blog post was written in May
masak domm should hang around here, so that we can help him more! :) 08:22
tadzik He seems fairly self-sufficient, thanks to error messages :) 08:23
masak well, yes and no.
moritz MAIN did help
masak note that he got help from both FROGGS++ and smls++ along the way.
tadzik Ah :) 08:24
08:24 spider-mario left 08:26 spider-mario joined, torbjorn left
RabidGravy is there any particular reason there isn't a 'mode' to go along with 'chmod' in IO::Path or is it just no-one got to doing it yet? 08:27
dalek ecs: 2cd06fd | (Stéphane Payrard)++ | S99-glossary.pod:
S99: added P6W, spotted in #perl6. Fixed a typo
FROGGS RabidGravy: is that something portable? 08:28
RabidGravy well all the bits appear to be there in nqp - so if nqp::stat is portable it would be 08:29
08:30 fhelmberger joined
FROGGS RabidGravy: how would the result of calling .mode look like? 08:30
RabidGravy a number
FROGGS like 0777? 08:31
RabidGravy yeah
FROGGS err, 0o777
RabidGravy: and on windows?
RabidGravy who knows, I don't want to go look in the uv code to go that far 08:33
08:34 espadrine joined, laouji left
FROGGS I just think that squeezing things into unix-isms is not always the best thing we can do 08:35
that's why I like the .IO.e and .IO.x methods... these tell properly what is going on 08:36
lizmat afk&
tadzik +1
RabidGravy sure but there is already chmod
FROGGS true 08:38
08:38 cschwenz joined 08:39 colomon left
RabidGravy and, except for the most simple cases, chmod isn't very useful without knowing what the mode of the file already was 08:40
moritz RabidGravy: I disagree; when deploying files, you usually want them to have specifically defined permissions after the deploy, indepently of how the copying mod()ed them before 08:44
08:44 laouji joined 08:45 gfldex joined
RabidGravy you're not always deploying files though 08:46
08:47 larion joined 08:51 spider-mario left, aborazmeh joined, aborazmeh left, aborazmeh joined, mr-foobar left
FROGGS hmmm, I'm also under the impression that I usually want to e.g. +rwx a file, no matter what the flags are currently... 08:56
08:56 mr-foobar joined
RabidGravy yeah, in the case I am looking at the moment I want to ugo+x a file keeping the other permissions 08:57
so if it was 0o644 it becomes 0o755 etc 08:58
09:05 itz_ joined
RabidGravy now I'm curious as to what uv_fs_stat returns for mode on non-Unix like systems, but I can't be arsed to get the Windows laptop, install a compiler, swear at it a lot and see 09:06
09:06 xfix joined, xfix left, xfix joined 09:08 Ven left
itz_ which windows compiler is needed? is there a free one? 09:10
moritz iirc there is a visual studio "Free as in beer" version 09:12
FROGGS itz: visual studio 2012 express will do
RabidGravy: I can test stuff on windows for you 09:13
09:15 Akagi201 left, larion left 09:22 mephinet joined 09:25 bin_005 joined, xfix left 09:38 bin_005 left 09:39 quester left
RabidGravy FROGGS, I was just curious as to what nqp::p6box_i(nqp::stat(nqp::unbox_s("somefilepath"), nqp::const::STAT_PLATFORM_MODE)) would return on windows 09:40
FROGGS let's see 09:41
itz_ why does the recent win * disable jit? 09:43
FROGGS C:\MoarVM>perl6-m -e "use nqp; say nqp::p6box_i(nqp::stat(nqp::unbox_s('VERSION'), nqp::const::STAT_PLATFORM_MODE))"
33206
RabidGravy: ^^
itz: it is only disabled on 32bit systems
itz_ ah
FROGGS or even more correct: it was never implemented for other than 64bit systems 09:44
m: given 42 { .fmt('%#d').say; .fmt('%#x').say; .fmt('%#o').say } # there should be '0o52', right? 09:46
camelia rakudo-moar c2a57e: OUTPUT«42␤0x2a␤052␤»
RabidGravy FROGGS, which is exactly what it returns on Linux for rw-rw-rw 09:47
FROGGS bbiab # lunch
09:47 koo6 joined 09:49 AlexDaniel joined 09:51 bin_005 joined, _mg_ left
RabidGravy (libuv people)++ # got that thing down 09:52
09:55 achauvin left 09:58 colomon joined, achauvin joined 10:01 kurahaupo1 left
RabidGravy I'm going to think about it in the pub for a bit, but I think that there should be an IO::Path.mode and it should return some abstraction like an IO::Path::Mode 10:04
and that it should be a multi which will accept one and do chmod as appropriate 10:05
right, off out pet shop --> supermarket --> pub 10:06
10:11 RabidGravy left 10:15 brrt joined 10:20 brrt left 10:22 amurf joined 10:27 amurf left 10:28 zengargoyle left 10:29 cschwenz left 10:37 aborazmeh left, rindolf left 10:40 lizmat left 10:42 Sqirrel left 10:51 Sqirrel joined, bin_005 left 10:52 lizmat joined 10:53 zengargoyle joined 10:57 salva left 10:59 cognominal left 11:01 koo6 left 11:03 salva joined
masak m: say :16<a0.8> 11:04
camelia rakudo-moar c2a57e: OUTPUT«160.5␤»
11:04 larion joined
masak oh. that's how you do non-int hex numbers in Perl 6. fair enough. 11:04
maybe `0xa0.8` should suggest that syntax, though? 11:05
m: say 0xa0.8
camelia rakudo-moar c2a57e: OUTPUT«5===SORRY!5=== Error while compiling /tmp/tRD4pNOsNE␤Confused␤at /tmp/tRD4pNOsNE:1␤------> 3say 0xa0.7⏏058␤ expecting any of:␤ dotty method or postfix␤»
masak it's a little too unprepared for that (hexa)decimal point :)
11:08 Ven joined 11:16 _mg_ joined 11:22 bbkr_ joined 11:23 smls joined
smls Why is there an ASSIGN-KEY, even though AT-KEY already returns an rw container suitable for assigning? 11:25
masak I think ASSIGN-KEY is deprecated. 11:26
smls well, it's used though. 11:27
masak hm, no. I read that wrong.
it's the lower-case version that's deprecated.
smls ah, found some relevant discussion: irclog.perlgeek.de/perl6/2015-03-13#i_10275156 11:28
seems it's just for optimization purposes. 11:30
11:34 vendethiel joined
smls m: my $x := Proxy.new(:FETCH(-> $ { say "fetch"; 42 }), :STORE(-> $, \val { say "store {val}" })); $x++; say $x 11:44
camelia rakudo-moar c2a57e: OUTPUT«fetch␤fetch␤fetch␤fetch␤fetch␤fetch␤fetch␤fetch␤store 43␤fetch␤fetch␤fetch␤fetch␤fetch␤fetch␤fetch␤fetch␤fetch␤fetch␤fetch␤42␤»
smls ^^ how come Perl 6 is so fetch happy? :P
11:44 Ven left
masak m: my $x := Proxy.new(:FETCH(-> $ { say "fetch"; 42 }), :STORE(-> $, \val { say "store {val}" })); say $x 11:44
camelia rakudo-moar c2a57e: OUTPUT«fetch␤fetch␤fetch␤fetch␤fetch␤fetch␤fetch␤fetch␤fetch␤fetch␤fetch␤42␤»
masak m: my $x := Proxy.new(:FETCH(-> $ { say "fetch"; 42 }), :STORE(-> $, \val { say "store {val}" })); 5 11:45
camelia ( no output )
masak smls: I guess the short answer is "because a bunch of things inside how `say` is implemented don't cache the value" 11:46
ditto postfix:<++>
Woodi hallo today :) 11:56
smls Hello
Woodi so, Intel bought Altera, FPGA company... reprogrammable/general-purpose CPUs soon ? :) 11:57
11:58 vendethiel left
Woodi but about Perl6 vs Debian... I remember some discusion that including some libraries (with patches) makes MoarVM impossible to unclude in Debian... 12:00
s/some_u/i/
no idea how to deal with that... 12:01
12:02 larion left 12:08 vendethiel joined 12:10 rmgk left 12:11 muraiki joined, rindolf joined 12:12 rmgk joined
dalek kudo-star-daily: f5ca1c1 | coke++ | log/ (2 files):
today (automated commit)
12:18
12:22 smash joined
smls Didn't we have something like a ONCE phaser? 12:27
i.e. like INIT, but executed when it is first reached by the control flow.
Or was that just speculation?
grondilu m: for ^10 { once say "ok" } 12:30
camelia rakudo-moar c2a57e: OUTPUT«ok␤»
12:30 kjs_ joined, vendethiel left
smls ah 12:30
grondilu interestingly: 12:31
m: once say "ok" for ^10
camelia rakudo-moar c2a57e: OUTPUT«ok␤ok␤ok␤ok␤ok␤ok␤ok␤ok␤ok␤ok␤»
12:31 larion joined
grondilu is not sure this is a bug or not 12:31
smls maybe phaser-like statement prefixes simply have looser precedence than the 'for' statement suffix? 12:32
grondilu m: INIT say "ok" for ^10
camelia rakudo-moar c2a57e: OUTPUT«ok␤ok␤ok␤ok␤ok␤ok␤ok␤ok␤ok␤ok␤»
grondilu seems so
12:35 kjs_ left
masak yes, they do. 12:36
you should read it as `once (say "ok" for ^10)`
this is what characterizes statement prefixes.
m: (once say "ok") for ^10 12:37
camelia ( no output )
masak m: { once say "ok" } for ^10
camelia rakudo-moar c2a57e: OUTPUT«ok␤»
masak wonders why that first one didn't work
smls m: start 42+1
camelia rakudo-moar c2a57e: OUTPUT«Type check failed in binding &code; expected 'Callable' but got 'Int'␤ in block <unit> at /tmp/XdO4zTrDGk:1␤␤»
FROGGS Woodi: there already is a moarvm package for debian in a review queue (with hundreds of other packages)... so there should be no issue
smls S04:1390 suggests start is one of these statement prefixes too, but it doesn't seem to be in Rakudo. 12:38
synbot6 Link: design.perl6.org/S04.html#line_1390
masak smls: please submit that as a rakudobug
FROGGS Woodi: and we support linking against packaged libtommath and other libs, so they dont have to use our patched versions
smls well, maybe I'm misinterpreting the design docs?
it's not super explicit about it. 12:39
masak "They parse the same as phasers" and `try` already working that way both seem to point to your conclusion. 12:40
also, it makes sense to me that `start` would take a blorst.
12:42 RabidGravy joined 12:44 Ven joined, brrt joined
RabidGravy boom 12:44
12:45 dalek left 12:46 dalek joined, ChanServ sets mode: +v dalek 13:01 smls left
itz_ feels stupid for not trying the "hub" command line utility earlier 13:05
brrt what is the hub command line utility
itz_ hub.github.com/ 13:06
masak hub.github.com/
13:06 Akagi201 joined
itz_ snap! 13:06
masak sorry, lag :)
13:06 Akagi201 left 13:07 Akagi201 joined
RabidGravy that's quite cool 13:09
13:10 flaviusb left 13:12 mr-fooba_ joined 13:13 mr-foobar left 13:14 justSomeone joined 13:19 justSomeone left 13:24 stux|RC-only left 13:25 stux|RC-only joined 13:26 RabidGravy left 13:30 RabidGravy joined 13:31 muraiki left, Tux__ is now known as |Tux| 13:33 muraiki joined
arnsholt Wow. Return of vengeance of the Python object model 13:38
Because looking things up via the type hierarchy would be too easy: gist.github.com/arnsholt/a753bdbb8faf430a105b
masak .oO( Venceance of the Python object model II ) 13:43
arnsholt Yeah
That was an odd one 13:44
I thought instance creation was relatively simple, but turns out it isn't
masak waitwait 13:45
the more I look, the less surprised I am 13:46
arnsholt Oh, wait
I derped, didn't i?
Accidentally the inheritance >.<
masak the list of argument passed to `D(...)` has to match the __init__
in your first snippet, it doesn't.
13:47 espadrine_ joined
arnsholt If I add the inheritance (which is what I was supposed to be testing!) it works as expected 13:47
masak \o/
arnsholt I just happened to be a marroon
masak Python is less surprising than you started to fear! :P
arnsholt Oh. Except having an __init__ but not a __new__ actually has to do something like installing a __new__ for you 13:49
Since "class C: def __init__(self, a, b, c): pass; C()" doesn't complain about too many arguments
Hmm. 13:50
Woodi FROGGS: I didn't know that. so probably around January 2016 things will look better :)
13:51 espadrine left, laouji left
FROGGS Woodi: hopefully before that point :o) 13:51
we need more testers
masak got linked to this SEND + MORE = MONEY post in Factor: re-factor.blogspot.se/2015/06/send-...money.html
13:51 brrt left
masak "backtrack vocabulary". interesting. 13:51
Factor is interesting.
13:54 virtualsue joined, araujo left 13:57 Akagi201 left
lizmat commute to Amsterdam.pm& 13:59
13:59 lizmat left 14:00 araujo joined, amurf joined, Akagi201 joined 14:01 araujo left
masak just saw a really good point being made on Reddit: 14:02
itz_ resolve stage failed for IO::Socket::SSL: Dependency OpenSSL is not present in the module ecosystem"
masak Perl isn't dying, or legacy, or passé. the correct term is "established".
itz_ what is the status of https support in web client libs? 14:03
masak itz_: I know it works, and I know sergot was working on it a few summers ago.
14:05 amurf left 14:06 Ven left
masak also just noticed: even though I covered November 22 three times in my November blog posts, none of them (strangely) mentions the JFK assassination. 14:06
PerlJam masak: at least you're strangely consistent! :) 14:07
itz_ hmmm OpenSSL isn't in the eco system but the tests pass 14:08
masak PerlJam: serve, smash :P 14:10
14:15 ][Sno][ left 14:16 ][Sno][ joined
moritz ... hulk. 14:16
14:17 telex left 14:18 telex joined, salv0 joined 14:20 FROGGS left 14:21 salv0 left 14:34 gfldex left
itz_ error:1408F119:SSL routines:SSL3_GET_RECORD:decryption failed or bad record mac 14:44
14:49 araujo joined, araujo left
masak itz_: maybe someone better at SSL can help you with only that little information. I can't. :/ 14:50
itz_ it seems to resemble an existing problem github.com/sergot/openssl/issues/1 14:51
arnsholt masak: In case you wondered, I found an exegetic comment about the __new__/__init__ behaviour in the CPython sources =) 15:04
Confusion cleared =D
itz_ m: use IO::Socket::SSL; my $sock = IO::Socket::SSL.new(:host<p6weekly.wordpress.com>, :port(443) 15:06
camelia rakudo-moar c2a57e: OUTPUT«===SORRY!===␤Could not find IO::Socket::SSL in any of:␤ file#/home/camelia/.perl6/2015.05-29-gc2a57ec/lib␤ inst#/home/camelia/.perl6/2015.05-29-gc2a57ec␤ file#/home/camelia/rakudo-inst-2/share/perl6/lib␤ file#/home/camelia/rakudo-inst-2/share…»
masak arnsholt: nice :) 15:07
arnsholt: are you able to summarize it for us interested-but-lazy onlookers?
moritz speaking of python, OO, and confused... 15:09
in def __init__(self, stuff):\n super().__init__(stuff)
masak .oO( pythoonfused )
moritz where/how does super() get its reference to self?
RabidGravy magic 15:10
arnsholt moritz: It's the Zen of Python! Implicit is better than explicit!
(Or something along those lines ;)
masak :P
"magic" is the explanation I recall too, yes.
arnsholt But what RabidGravy said, more or less
masak arnsholt: by the way -- I didn't mention before -- as a Python 2 user I've trained myself to always inherit from object, so I don't end up with the old (non-)MOP. 15:11
arnsholt Basically a zero-arg call to a function named super() will magically get two arguments: the first argument passed (and looked up in the actually bound arguments, *not* by name!) and __class__
Yeah, I recently learned about old-style classes when trying to figure out why my descriptors weren't called 15:12
masak: Exegesis: github.com/python/cpython/blob/mas...3341-L3377 15:13
masak I just tried on the Python REPL.
apparently it's `super(D)` (for your class D)
and the object you get back is a <type 'super'>, that is, a special magic object
arnsholt Basically, object.__new__ compares cls.{__new__,__init__} to object.{__new__,__init__} and only complains in some cases 15:14
Oh, in this case Python 3 and Python 2 are different
Python 3 has a magical zero-arg super(), but Python 2 doesn't
masak aha.
arnsholt Because reasons, presumably 15:15
masak where does Python 3 get "the current class" from?
arnsholt It's implicitly inserted, of course! =)
masak but you can also provide it explicitly? 15:16
arnsholt If your function mentions super() or a variable __class__ you automatically get a variable __class__ (containing the current class, obv)
Yeah, there's a two-arg form of super too
"__class__ is an implicit closure reference created by the compiler if any methods in a class body refer to either __class__ or super. " 15:17
RabidGravy the bunch of __name__ things is what upsets me most about python
masak I used to not like them.
but then I realized they're basically equivalent to Perl's "pipes sticking out". 15:18
it's just that Perl likes symbols, like $. and $/
and Python really likes underscores
15:19 andreoss joined
RabidGravy this is true 15:20
15:20 larion left 15:27 diana_olhovik_ left, g4 left
geekosaur hm, I'd have compared them to uppercase 15:30
they tend to be the magic names invoked automatically by various things
15:30 zakharyas left
masak that's also a nice comparison 15:31
except Perl 6 uppercases all kinds of things, like EVAL :P
arnsholt Yeah, they're not too bad. And descriptors are really neat 15:32
masak Python's attribute access feels very close to JavaScript's. but for some reason I like Python's better.
probably mostly because Python gets the "bound method" waterbed wrinkle very right. 15:33
JavaScript, Perl 5 and Perl 6 all fail at that, all in different ways.
rjbs descriptors? 15:39
Oh yes! 15:40
I had forgotten all about those, gosh.
arnsholt Yeah the whole method thing confused me a lot until I got it
15:41 smls joined
moritz it just seems weird that calling a method is accessing an attribute + calling it, but then there's magic (descriptors) to make the attribute access itself call a method 15:41
15:45 salva left
PerlJam masak: please blog on the subject and include (possibly rebut) moritz's observation :-) 15:46