»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend! Set by moritz on 22 December 2015. |
|||
AlexDaniel | Xliff: not really, show us some code! | 00:00 | |
00:05
labster left
00:08
raiph joined
00:09
labster joined,
pyrimidine joined
00:13
Actualeyes joined
00:14
pyrimidine left
00:18
pyrimidine joined
00:19
cpage_ joined
00:21
nadim left,
kyclark_ joined
00:23
pyrimidine left
00:28
pyrimidine joined
00:33
pyrimidine left
00:34
dataf3l_ joined
00:38
pyrimidine joined
00:41
kyclark_ left
|
|||
Xliff | AlexDanie: gist.github.com/Xliff/4a5418933efc...10a6c45a6a | 00:42 | |
00:43
pyrimidine left,
BenGoldberg joined
|
|||
AlexDaniel | Xliff: and the input file? | 00:47 | |
00:48
pyrimidine joined
|
|||
Xliff | Look at this gist for an example. Check the string at the bottom. gist.github.com/Xliff/fef6642960e6...42d9b71914 | 00:51 | |
input file is filtered for blocks of that form and then passed to the grammar. | 00:52 | ||
00:52
pyrimidine left
|
|||
Xliff | s/and/and the results/ | 00:52 | |
00:53
girafe left
|
|||
AlexDaniel | committable6: stdin gist.githubusercontent.com/AlexDan...f17c/input | 00:55 | |
00:55
chris2 joined
|
|||
committable6 | AlexDaniel, STDIN is set to «XSLTPUBFUN void XSLTCALL xsltApplyAttributeSet (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, const xmlChar *attributes);» | 00:55 | |
AlexDaniel, Successfully fetched the code from the provided URL. | |||
AlexDaniel | committable6: gist.githubusercontent.com/AlexDan...7c/code.p6 | ||
committable6: HEAD gist.githubusercontent.com/AlexDan...7c/code.p6 | |||
committable6 | AlexDaniel, Successfully fetched the code from the provided URL. | ||
AlexDaniel, gist.github.com/2a0a5dc93e030e0be8...4ba14bf2ff | |||
AlexDaniel | dang it | ||
committable6: HEAD gist.githubusercontent.com/AlexDan...9e/code.p6 | 00:56 | ||
committable6 | AlexDaniel, Successfully fetched the code from the provided URL. | ||
AlexDaniel, gist.github.com/efecfbbf285055e8ca...da59b1cabd | |||
AlexDaniel | so the first error is about Nil… | ||
00:57
pyrimidine joined
|
|||
AlexDaniel | Xliff: $<typePrefix> is nill | 00:58 | |
Nil* | |||
I know it's not relevant, but come on… it's the first error :) | 00:59 | ||
01:01
labster left
|
|||
AlexDaniel | Xliff: to fix it I guess you have to use @!params | 01:02 | |
01:02
pyrimidine left
|
|||
AlexDaniel | but I'm not sure why | 01:03 | |
01:03
pyrimidine joined
01:05
aborazmeh joined,
aborazmeh left,
aborazmeh joined
01:06
labster joined
01:08
kent\n left,
kent\n joined
01:12
pyrimidine left
01:21
Vynce_ joined
|
|||
Vynce_ | perl6: say so <a b c>.any eqv all(<b y>.any, <c z>.any) | 01:22 | |
camelia | rakudo-jvm 8d357a, rakudo-moar d989d9: OUTPUT«True» | ||
Vynce_ | perl6: say so <a b c>.any eqv any(all(<b y>.any, <c z>.any)) | ||
camelia | rakudo-jvm 8d357a, rakudo-moar d989d9: OUTPUT«False» | ||
Vynce_ | wtf | ||
01:23
labster left
01:24
Vynce joined
01:25
Vynce_ left
|
|||
Vynce | perldoc junctions traps | 01:26 | |
01:27
pyrimidine joined
01:30
itaipu left
01:31
pyrimidine left
01:32
dataf3l_ left
01:33
pyrimidine joined
01:34
labster joined
01:36
thundergnat left,
itaipu joined
01:41
pyrimidine left
|
|||
Vynce | welp. will document, i guess. | 01:42 | |
01:46
pyrimidine joined
01:51
pyrimidine left
|
|||
MasterDuke | Vynce: some discussion with TimToady about junctions that might be relevant: irclog.perlgeek.de/perl6/2016-08-21#i_13061694 | 01:52 | |
01:54
Rawriful left
01:56
pyrimidine joined
01:59
kyclark_ joined
|
|||
Vynce | i'm aware of not-raising (which is also counterinuitive to me in code, fwiw) but this isn't that. | 01:59 | |
01:59
kyclark_ left
|
|||
BenGoldberg | perl6: dd <a b c>.any eqv any(all(<b y>.any, <c z>.any)) | 02:13 | |
camelia | rakudo-jvm 8d357a, rakudo-moar d989d9: OUTPUT«any(any(all(any(Bool::False, Bool::False), any(Bool::False, Bool::False))), any(all(any(Bool::True, Bool::False), any(Bool::False, Bool::False))), any(all(any(Bool::False, Bool::False), any(Bool::True, Bool::False))))» | ||
Vynce | does that help? ( : | 02:14 | |
BenGoldberg | On the one hand, I can see why that boolifies to False. | 02:15 | |
02:15
cdg left
|
|||
BenGoldberg 's not sure why the other boolified to True, yet, still thinking. | 02:16 | ||
perl6: dd <a b c>.any eqv all(<b y>.any, <c z>.any) | |||
camelia | rakudo-jvm 8d357a, rakudo-moar d989d9: OUTPUT«all(any(any(Bool::False, Bool::False), any(Bool::True, Bool::False), any(Bool::False, Bool::False)), any(any(Bool::False, Bool::False), any(Bool::False, Bool::False), any(Bool::True, Bool::False)))» | ||
Vynce | False is the expectation, to my brain. | ||
but $X ~~ $Y !== $X ~~ any($Y) is ... counterintuitive. | 02:17 | ||
BenGoldberg | perl6: dd .eqv all(<b y>.any, <c z>.any) for <a b c> | ||
camelia | rakudo-jvm 8d357a: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Two terms in a rowat <tmp>:1------> 3dd .eqv7⏏5 all(<b y>.any, <c z>.any) for <a b c> expecting any of: infix infix stopper postfix statement end …» | ||
..rakudo-moar d989d9: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Two terms in a rowat <tmp>:1------> 3dd .eqv7⏏5 all(<b y>.any, <c z>.any) for <a b c> expecting any of: infix infix stopper postfix statement end …» | |||
BenGoldberg | m: dd .eqv: all(<b y>.any, <c z>.any) for <a b c> | 02:18 | |
camelia | rakudo-moar d989d9: OUTPUT«No such method 'eqv' for invocant of type 'Str' in block <unit> at <tmp> line 1» | ||
BenGoldberg | m: dd $_ eqv all(<b y>.any, <c z>.any) for <a b c> | ||
camelia | rakudo-moar d989d9: OUTPUT«all(any(Bool::False, Bool::False), any(Bool::False, Bool::False))all(any(Bool::True, Bool::False), any(Bool::False, Bool::False))all(any(Bool::False, Bool::False), any(Bool::True, Bool::False))» | ||
BenGoldberg | m: say so $_ eqv all(<b y>.any, <c z>.any) for <a b c> | ||
camelia | rakudo-moar d989d9: OUTPUT«FalseFalseFalse» | ||
BenGoldberg | m: say so <a b c>.any eqv $_ for <b y>.any, <c z>.any | 02:20 | |
camelia | rakudo-moar d989d9: OUTPUT«TrueTrue» | ||
BenGoldberg | Aha, the right side of eqv is autothreading before the left side, and since all(True, True) is true, the output is true. | 02:21 | |
Vynce | i don't know what you mean by "before" here. | ||
BenGoldberg | m: say so <a b c>.any eqv all(<b y>.any, <c z>.any) | 02:22 | |
camelia | rakudo-moar d989d9: OUTPUT«True» | ||
BenGoldberg | m: say so all(<b y>.any, <c z>.any) eqv <a b c>.any | ||
camelia | rakudo-moar d989d9: OUTPUT«True» | ||
BenGoldberg | Hmm, or maybe not. | ||
I'm confused. | |||
Vynce | I kindof understand what's going on. I don't understand it well enough to explain it in terms of the language, though. ( : | 02:23 | |
the real surprise to me was that adding a pointyblock with the all in it didn't "fix" my problem; I had to -> Str $letter {} wrap it, because the pointy is perfectly happy to accept the junction as the implicit argument | 02:25 | ||
but yes, this is equivalent to "ALL(<abc> overlap <by>, <abc> overlap <cz>)" vs "some one (or more) of <abc> overlap ALL(<by>, <cz>)" | 02:27 | ||
02:27
itaipu left
|
|||
Xliff | AlexDaniel: Dammit. I missed the Nil message because it was mixed in with the output from Grammar::Tracer | 02:37 | |
Thanks. | |||
m: my $a; say $a:v; | 02:39 | ||
camelia | rakudo-moar d989d9: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Variable '$a:v' is not declaredat <tmp>:1------> 3my $a; say 7⏏5$a:v;» | ||
Xliff | Is there a way to combine a Nil check and string compare in an elegant manner without having to use .defined? | 02:43 | |
02:45
perlawhirl joined
|
|||
geekosaur | m: say so (Nil // 'a') eq 'a' | 02:49 | |
camelia | rakudo-moar d989d9: OUTPUT«True» | ||
geekosaur | m: say so ('c' // 'a') eq 'a' | ||
camelia | rakudo-moar d989d9: OUTPUT«False» | ||
Xliff | AH! I keep forgetting // | 02:50 | |
geekosaur++ | |||
AlexDaniel: OK, so I have fixed the Nil issue, but I am still getting the positionals error. | |||
02:53
dataf3l_ joined
|
|||
Xliff | The problem here is the magic in Grammars. I cannot see what is getting passed to the action method, so I can't effectively debug the issue. | 02:54 | |
According to everything I've read, methods on Action classes always have signature ($/), and grammars always call the method name that corresponds to the matching rule. | 02:56 | ||
AlexDaniel | Xliff: it's not related to grammars | ||
Xliff | Then what is it related to. | ||
AlexDaniel | Xliff: your problem is with accessing @!params | ||
irclog.perlgeek.de/perl6/2016-11-11#i_13548322 | |||
change @.params to @!params and the problem goes away, but I have no idea why to be hones | 02:57 | ||
t | |||
Xliff | :-O | ||
Oh that is soooo LTA. | |||
AlexDaniel | yes maybe it is | 02:58 | |
Xliff | AlexDaniel++ | ||
AlexDaniel | I mean, it definitely is… | ||
Xliff | That error message has me chasing the wrong thing. | ||
Which is seriously bad. | |||
But problem solved. Thank you. | |||
AlexDaniel | Xliff: it would've been cool if you figured out why is this happening | 03:03 | |
m: grammar Foommar { rule TOP { ‘a’ } }; class Fooctions { has @.blah; method TOP($/) { push @.blah, 42 } }; say Foommar.parse(‘a’, :actions(Fooctions.new)) | |||
camelia | rakudo-moar d989d9: OUTPUT«「a」» | ||
AlexDaniel | that seems to work | ||
Xliff | AlexDaniel: I will circle back and try, but I have another priority. | 03:04 | |
Namely getting this working. | |||
Another piece of weirdness. I have this at the top of a method: my $tp = $/<typePrefix>.defined ?? $/<typePrefix>.made !! ''; | 03:12 | ||
Yet there are code paths where $tp is Any | 03:13 | ||
O I C | |||
03:21
erdic left
03:23
erdic joined
|
|||
Xliff | OK. Its working now. Still trying to figure out why I need to do $/[0].Str to extract the value from a Match object. | 03:27 | |
Juerd | As opposed to what else? | 03:34 | |
03:35
cibs left,
pierre_ left
03:36
cibs joined
03:46
noganex joined,
dataf3l_ left
03:48
wamba left,
mayathecat joined
03:49
noganex_ left
03:56
mayathecat left
04:01
mayathecat joined
04:08
mayathecat left
04:12
pyrimidine left
04:13
AlexDaniel left,
Actualeyes left
04:14
pyrimidine joined
04:17
Actualeyes joined
04:19
pyrimidine left
04:21
pierre_ joined
04:23
pierre_ left
04:24
pyrimidine joined
04:25
Actualeyes left
04:30
pierre_ joined
04:32
pyrimidine left
04:34
Vynce left,
pierre_ left
04:38
Vynce joined
04:39
Actualeyes joined
04:41
pyrimidine joined
|
|||
MasterDuke | nqp: if "a1b2" ~~ /(.)/ { say("matched: " ~ $/[0]) } | 04:42 | |
camelia | nqp-moarvm: OUTPUT«matched: » | ||
MasterDuke | ^^^ what am i doing wrong? | ||
04:43
grondilu joined
|
|||
geekosaur | nqp doesn't appear to set $/ at all | 04:46 | |
perlawhirl | m: say (:this(3.5) :that(5.3)) | 04:50 | |
camelia | rakudo-moar d989d9: OUTPUT«===SORRY!===Unknown QAST node type NQPMu» | ||
yoleaux | 4 Nov 2016 12:51Z <gfldex> perlawhirl: objects can be made aware of being subscripted with class C { method subscript(|c){ say "subscript of: ", c.perl } }; multi sub postcircumfix:<[ ]>(C:D \SELF, \pos){ SELF.subscript(pos) }; C.new.[1,42]; | ||
perlawhirl | interesting bug | ||
m: say (:this(3) :that(5)) # works fine with ints | |||
camelia | rakudo-moar d989d9: OUTPUT«(this => 3 that => 5)» | ||
perlawhirl | m: say (:this(3.5), :that(5.3)) # worsk fine with comma | ||
camelia | rakudo-moar d989d9: OUTPUT«(this => 3.5 that => 5.3)» | ||
04:52
vendethiel left,
pyrimidine left
04:53
vendethiel joined
05:03
pyrimidine joined
05:08
pyrimidine left
|
|||
seatek | anyone know if any of the module http servers can handle https? | 05:11 | |
MasterDuke | geekosaur: it doesn't seem to do so for regexes, but it does for grammars, it's used in the nqp source itself | ||
(however i just want to use a quick regex) | 05:12 | ||
05:13
pyrimidine joined
05:18
cpage_ left,
pyrimidine left
05:23
pyrimidine joined
05:24
Cabanossi left
05:28
pyrimidine left,
Cabanossi joined
05:29
lizmat left
05:30
lizmat joined
05:31
troys_ left
05:32
pyrimidine joined
|
|||
dalek | c: 8c05697 | coke++ | xt/code.pws: ignore new code |
05:33 | |
perlawhirl | FYI: I rakudobug'd the above #130069 | 05:35 | |
synopsebot6 | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=130069 | ||
05:37
pyrimidine left
05:39
aborazmeh left,
Vynce left
05:43
pyrimidine joined
05:46
pierre_ joined
05:48
pyrimidine left
05:50
pierre_ left
05:54
pyrimidine joined
05:57
pierre_ joined
05:59
pyrimidine left
06:00
rurban joined,
rurban left
06:07
pyrimidine joined
06:14
Vynce joined
06:17
pyrimidine left,
ggoebel left,
wamba joined
06:18
dataf3l_ joined
06:21
Tonik joined
06:24
pyrimidine joined
06:25
skids left
06:26
rurban joined
06:29
dataf3l_ left
06:30
dj_goku left
06:31
pyrimidine left
06:33
pierre_ left
06:36
pierre_ joined
06:38
nadim joined
06:40
pyrimidine joined
06:43
labster left
06:46
ufobat joined,
pyrimidine left
06:49
RabidGravy joined
06:51
pyrimidine joined
|
|||
seatek | wow - Using Crust modules - HTTP::Server::Tiny getting ~80 requests/sec (just printing hello).. but when using SCGI getting about 340 requests/sec | 06:53 | |
Concurrent requests on HTTP::Server::Tiny kill it if you have more than 15 ... | 06:56 | ||
06:56
perlawhirl left,
pyrimidine left
07:00
ChoHag joined
07:02
pyrimidine joined
07:05
BenGoldberg left
07:06
labster joined,
pyrimidine left
|
|||
Xliff | Hrm. How do I specify a literal '$' in a qq:TO// heredoc? | 07:08 | |
seatek | Is the '\' not working? | ||
07:09
pyrimidine joined
|
|||
Xliff | Nope. | 07:10 | |
The entire heredoc is breaking my code. Weird. | 07:12 | ||
seatek | I just tried it and it works | 07:13 | |
Maybe you're doing something funny? | |||
qq:to/HERE/; | 07:14 | ||
Then whatever \$you want | |||
HERE | |||
07:15
Vynce left
|
|||
seatek | I think you have to watch out for mustaches too | 07:16 | |
can't remember all the qq qw combos ;) | |||
07:16
pyrimidine left
|
|||
Xliff | Well. I will have to gist and let you see what I am talking about. | 07:17 | |
gist.github.com/Xliff/517baac50d57...3a9af11c9f | 07:20 | ||
I am too tired to convert that into a standalone. | |||
I will update it later with a better use case. | |||
Now I must sleep. | |||
BTW - seatek: qq == Double quoted heredoc. | 07:21 | ||
seatek | you've got lots of $'s that you didn't \$ on! | ||
oh that's what you want | |||
Xliff | Those are supposed to be there. | ||
Yes! ;) | |||
seatek | where' sit go bad? | ||
07:21
pyrimidine joined
|
|||
Xliff | Just about everywhere. | 07:25 | |
parser treats much of the heredoc as code instead of... a heredoc. | |||
seatek | I think you have to put <> hash stuff in {} blocks | ||
Xliff | Hmm.... | ||
I do that, then the parser comes back with "Confused" | |||
07:25
Tonik left
07:26
pyrimidine left
|
|||
Xliff | Yup. | 07:26 | |
07:26
obra joined
|
|||
Xliff | And there is no reason it should be confused. | 07:26 | |
Let me rakudobrew and see if there was a fixed bug in the parser. | |||
07:27
obra left
|
|||
seatek | that's pretty weird. i've been playing with it, assigning some of those variables... | 07:28 | |
07:29
abraxxa joined,
vendethiel- joined
07:30
vendethiel left
|
|||
Xliff | seatek: Are you seeing it too, then? | 07:31 | |
seatek | yes it's like ignoring the qq:to// thang | ||
Xliff | Yup! | ||
seatek | you broke perl | 07:32 | |
Xliff | Even replacing the qq:to// with " will generate the same errors!!! | ||
Xliff points to himself and says "YOU BASTARD!" | |||
seatek | it's like magic words that can't be ignored | ||
07:32
firstdayonthejob joined
|
|||
Xliff | So yeah. I'mma call it a night. | 07:33 | |
Take care, seatek. | |||
07:33
abraxxa left
|
|||
seatek | k - nite Xliff | 07:33 | |
07:35
pyrimidine joined
07:39
firstdayonthejob left,
imcsk8 left
07:44
imcsk8 joined,
pyrimidine left
07:45
abraxxa joined
07:47
pyrimidine joined
07:49
pierre_ left
07:52
pierre_ joined
07:54
pyrimidine left
|
|||
Ulti | kyclark if you wanted more structure in there you could maybe create a markov chain of the probability of one kmer following another | 07:57 | |
07:59
pyrimidine joined
08:00
bjz joined
08:06
pyrimidine left
08:07
neuraload joined
08:10
cyphase left
08:11
pyrimidine joined
08:13
canopus left
08:15
cyphase joined
08:16
pyrimidine left,
bjz left
08:20
pyrimidine joined
08:25
pyrimidine left
08:26
wamba left
08:30
pyrimidine joined
08:31
bjz joined
08:34
zakharyas joined
08:35
pyrimidine left
08:37
domidumont joined
08:40
pyrimidine joined
08:41
domidumont left,
domidumont joined
08:42
AlexDaniel joined
08:45
pyrimidine left
08:46
rindolf joined
08:54
pyrimidine joined
08:58
pyrimidine left
09:02
Vynce joined,
ocbtec joined
09:03
brrt left
09:04
AlexDaniel left,
wisti left
09:05
BigBear joined
09:09
domidumont left
09:10
pyrimidine joined
09:12
bjz_ joined,
bjz left
09:14
pyrimidine left
09:19
pyrimidine joined
09:26
pyrimidine left
09:31
pyrimidine joined
09:36
neuron joined,
pyrimidine left
09:37
Vynce left
09:49
pyrimidine joined
09:53
pyrimidine left
09:54
itaipu joined
09:57
dataf3l joined
|
|||
dataf3l | after some googling, I’m still confused as to how to define a variable with type: array of strings, something like an ArrayList<String> in java. is that even possible? | 09:58 | |
DrForr | my Str @arr; | ||
09:59
pyrimidine joined
|
|||
dataf3l | COOL! :) | 09:59 | |
seatek | m: my Str @a; @a[1] = False; | 10:00 | |
camelia | rakudo-moar d989d9: OUTPUT«Type check failed in assignment to @a; expected Str but got Bool (Bool::False) in block <unit> at <tmp> line 1» | ||
dataf3l | Thank you, DrForr | ||
10:00
obra joined
|
|||
DrForr | Man, I've got a bad sense of timing. Howdy, obra | 10:01 | |
obra | Hey DrForr (irssi died. autojoin ftw) | ||
10:02
labster left,
darutoko joined
|
|||
DrForr | Finally decided to check out the dark side, eh? I've got to get lunch but I'll be back in a few. | 10:03 | |
obra | heh. nah. this is my usual setup. just bad luck | ||
DrForr | Right, no worries. | 10:04 | |
obra | :) | ||
10:05
pyrimidine left
10:06
itaipu left
10:09
maybekoo2 joined,
dataf3l left,
dataf3l_ joined
10:12
araujo joined,
araujo left,
araujo joined
10:18
pyrimidine joined
10:20
neuron left
10:22
pierre_ left,
itaipu joined
10:23
pyrimidine left
10:24
Rawriful joined
10:27
itaipu left
10:38
pyrimidine joined
10:43
pyrimidine left
10:48
pyrimidine joined
|
|||
seatek | Dealing with this "circular module loading" is not always easy! | 10:57 | |
it's not circular... it's... thorough... ;) | |||
11:02
dataf3l_ left,
cyphase left
|
|||
seatek | m: class A::B::C { has $.d }; my $z = A::B::C.new; say so $z.^name ~~ /A\:\:B/; | 11:04 | |
camelia | rakudo-moar d989d9: OUTPUT«True» | ||
seatek | anyone know of a better way to do that? I can't use just the ~~ against the raw base class name, because it requires that you "use" that module, and that results in the horrifying "circularity" | 11:05 | |
11:05
dataf3l joined
|
|||
timotimo | you can .isa("Foo" | 11:06 | |
) | |||
it's extremely slow | |||
but it should to be right | |||
seatek | think it would be slower than that regex? | ||
timotimo | no | ||
seatek | hehe ok | 11:07 | |
i'll try that thanks timotimo++ :) | |||
11:10
dataf3l left,
domidumont joined
|
|||
TimToady | Xliff: qq interpolates {} as well as $ so maybe you want qs instead, or use q and then force interpolation with \qq[$f] | 11:14 | |
timotimo | oh hey TimToady. any clue on whether .chrs should also support lists of Strs-that-look-like-Ints? | 11:17 | |
(like what you'd get if you >>.base(16)'d a bunch of Ints | 11:18 | ||
for example) | |||
11:18
aindilis left
11:21
aindilis joined
|
|||
TimToady | with what semantics? | 11:21 | |
timotimo | it'd .Int.chr elements that can't be nqp::chr'd immediately | 11:22 | |
TimToady | oh, you said chrs, not chr...not awake yet... | 11:23 | |
sure, it'd be fine if chrs coerced each value to integer | |||
timotimo | yay | ||
i have Word Of God and now can start implementing | |||
when it asplodes, should it "fail" instead of throwing exceptions, just like it currently does when something's not-an-int? | 11:24 | ||
well, prefix-+ already fails. so i just return that if it's a failure | |||
TimToady | seems reasonable here; it's not like we're likely to blow up someone's parallel algorithm this way | 11:26 | |
11:28
neuraload left
|
|||
timotimo | i haven't worked with roast much since the errata/non-errata split ... where do i put tests for this new behaviour? | 11:29 | |
11:29
seatek left
|
|||
timotimo | oh, another thing: :16(*) producing a WhateverCode equivalent to {:16($_)}, yea or nay? | 11:32 | |
11:32
rurban left
|
|||
moritz | timotimo: tests for new behvior go iint the master branch | 11:35 | |
11:36
itaipu joined
|
|||
timotimo looks if an existing spec test breaks | 11:39 | ||
cool, it's cleant | 11:42 | ||
clean* | |||
er, but i'm on the master branch probably | |||
11:42
espadrine joined
|
|||
timotimo | how should i run these? spectest.data would probably have to be different, no? | 11:43 | |
lizmat | timotimo: no | ||
just do make spectest :-) | 11:44 | ||
still, new behaviour, isn't that supposed to be 6.d ? | |||
just playing devil's advocate (again) | |||
timotimo | *shrug* | ||
lizmat | because it feels to me we're getting further and further away from a language spec and jfdi :-) | 11:45 | |
*instead | |||
11:45
cognominal left
|
|||
timotimo | seems like, yeah | 11:45 | |
really, to get all these things that have since been added, you ought to be using something like 6.d.1 or what we call those | 11:46 | ||
11:46
bjz_ left
11:47
bjz joined
11:48
Lucas_One left
|
|||
dalek | c: bae5700 | timotimo++ | doc/Language/5to6-perlfunc.pod6: mention prefix:<+> alternative for perl5:<oct> |
11:53 | |
synopsebot6 | Link: doc.perl6.org/language/5to6-perlfunc | ||
jnthn | Language versions are just snapshots of the spectest suite. So whenever you add a test to master, you're writing part of the spec that will make up the next language version. | 11:54 | |
11:54
Lucas_One joined
|
|||
dalek | c: f6daf45 | timotimo++ | doc/Type/Int.pod6: mention :16("f00") and :100[1,2,3] in Int's class doc |
11:56 | |
synopsebot6 | Link: doc.perl6.org/type/Int | ||
jnthn | It'll always be the case that implementation and bleading edge use will precede having a "use 6.x" to write in order to be sure that feature is present. | 11:57 | |
Right now, there's just a high incentive to use bleading edge versions due to improving performance, many fixes, etc. | 11:58 | ||
timotimo | mhm | ||
it seems we don't have a perl6 specified thingie for UNBASE aka radix notation with variable radix ":$foo($bar)" | 12:06 | ||
well, we do have +":$foo\<$bar>" | 12:07 | ||
but ... ugh :) | |||
12:18
rurban joined
|
|||
masak | today's mini-challenge: read in a bunch of numbers; output mean value and standard deviation. | 12:31 | |
handling edge cases (such as too few numbers) is optional. | |||
strive towards clear, elegant code more than anything else. | 12:32 | ||
(and I won't mind it if we end up in a discussion about whether it should be `$N` or `$N - 1` in the denominator) :P | |||
hi, #perl6 | |||
timotimo | m: my @nums = <1 4 9 8 7 6 0 1 9 4 5>; say "mean: ", ([+] @nums) / @nums.elems // 'no numbers'; say "median: ", @nums.sort[* div 2]; say "i don't do std dev." | 12:33 | |
camelia | rakudo-moar 9a6ad4: OUTPUT«mean: 4.909091median: 5i don't do std dev.» | ||
timotimo | m: my @nums = <1>; say "mean: ", ([+] @nums) / @nums.elems // 'no numbers'; say "median: ", @nums.sort[* div 2]; say "i don't do std dev." | ||
camelia | rakudo-moar 9a6ad4: OUTPUT«mean: 1median: 1i don't do std dev.» | ||
timotimo | m: my @nums = (); say "mean: ", ([+] @nums) / @nums.elems // 'no numbers'; say "median: ", @nums.sort[* div 2]; say "i don't do std dev." | ||
camelia | rakudo-moar 9a6ad4: OUTPUT«Attempt to divide by zero using div in block <unit> at <tmp> line 1Actually thrown at: in block <unit> at <tmp> line 1» | ||
timotimo | m: my @nums = (); say "mean: ", ([+] @nums) / @nums.elems || 'no numbers'; say "median: ", @nums.sort[* div 2]; say "i don't do std dev." | ||
camelia | rakudo-moar 9a6ad4: OUTPUT«Attempt to divide by zero using div in block <unit> at <tmp> line 1Actually thrown at: in block <unit> at <tmp> line 1» | ||
timotimo | m: my @nums = (); say "mean: ", ([+] @nums) / @nums.elems orelse say 'no numbers'; say "median: ", @nums.sort[* div 2]; say "i don't do std dev." | ||
camelia | rakudo-moar 9a6ad4: OUTPUT«Attempt to divide by zero using div in block <unit> at <tmp> line 1Actually thrown at: in block <unit> at <tmp> line 1» | ||
timotimo | i can't defuse it? :\ | 12:34 | |
masak | that's unexpected. | ||
timotimo BBL | 12:35 | ||
jnthn | orelse is low prec, maybe it needs more parents | 12:36 | |
*parens | |||
MasterDuke | github.com/MattOates/Stats | ||
masak | m: my @t = <75.033 72.302 72.602 72.637 72.208 72.756 72.541 73.000 72.834 73.604>; sub mean { [+](@t) / @t }; say mean; say sqrt(1/(@t - 1) * [+] @t.map: { ($_ - mean) * ($_ - mean) }) | 12:39 | |
camelia | rakudo-moar 9a6ad4: OUTPUT«72.95170.828451708510118» | ||
masak | my submission :) | ||
hm... | |||
m: my @t = <75.033 72.302 72.602 72.637 72.208 72.756 72.541 73.000 72.834 73.604>; sub mean { [+](@t) / @t }; say mean; say sqrt 1/(@t - 1) * [+] @t.map: { ($_ - mean) * ($_ - mean) } # fewer parens | |||
camelia | rakudo-moar 9a6ad4: OUTPUT«72.95170.828451708510118» | ||
jnthn | Why ($_ - mean) * ($_ - mean) instead of ($_ - mean) ** 2 ? :) | 12:46 | |
masak | jnthn: some kind of superstition, I think | ||
jnthn | Just felt nice to me using explicit squaring then sqrt is also being used :) | ||
Also means you can probably write @t.map: (* - mean) ** 2 | 12:47 | ||
To declutter it some further :) | |||
masak | m: my @t = <75.033 72.302 72.602 72.637 72.208 72.756 72.541 73.000 72.834 73.604>; sub mean { [+](@t) / @t }; say mean; say sqrt 1/(@t - 1) * [+] @t.map: (* - mean) ** 2 | ||
camelia | rakudo-moar 9a6ad4: OUTPUT«72.95170.828451708510118» | ||
masak | lookitthat | ||
getting really nice now :) | |||
yeah, that's really not a lot of code for stddev. cool. | 12:48 | ||
that statement does the listop thing 4 times, if I count correctly :) | 12:49 | ||
arnsholt | Perl 6 hasn't specced a mean function, has it? | 12:50 | |
masak | no, but somehow I don't mind defining it every time | 12:51 | |
"mean value" is one of those concepts that can be argued many ways | |||
or at least "average" is | |||
arnsholt | Well, arithmetic mean then, if you will =) | 12:52 | |
Apparently the algorithm for calculating it accurately with floats is *not* sum(@values)/+@values | |||
moritz | m: my @a = 1..5; say sum(@a) / @a | ||
camelia | rakudo-moar c541b3: OUTPUT«3» | ||
arnsholt | Because numerical stability | ||
moritz | fuck those floats | ||
arnsholt | Quite =D | ||
masak | lately I've come to the opposite conclusion | ||
after having used floats a bit more | |||
floats are *massively* misunderstood | 12:53 | ||
arnsholt | Yeah, that's more than likely | ||
masak | and people end up in trouble for many reasons, but most often because they shouldn't have used floats in the first place | ||
12:53
itaipu left
|
|||
masak | it's like, people enter a contract which they don't read | 12:53 | |
arnsholt | Yeah, that's definitely true | ||
masak | and then they're upset when the terms are upheld like the contract states | ||
moritz | which we don't even do, in real life, right? | 12:54 | |
arnsholt | Heh | ||
masak | :) | ||
moritz | like, do you always read the TOS when you sign for your credit or debit card? | ||
masak .oO( never! -- never? -- well, hardly ever! ) | |||
masak .oO( arithmetic meanness ) | 12:55 | ||
moritz | if I were just a bit more contrarian, I'd *always* pay with debit card, and *always* read the whole thing before signing | ||
masak | it doesn't take much to conclude that reading through the whole thing is actually the right thing to do, even though basically no-one does | 12:56 | |
moritz | just to annoy the cashier and the people behind me in the line | ||
masak: there are valid arguments against that. Consumer protection laws, for example | |||
masak | "no no, wait, this is important! I'm on page 24." | ||
moritz | (I'm talking about the case where you sign the bill, not where you sign up for a new credit card) | 12:57 | |
also there is some kind of agency that coordinates all Electronic Cash payments in .de, and it imposes rules on the participating shops | |||
arnsholt | You get a ToS document when paying by card in Germany? | 12:58 | |
Pretty sure we don't get that here | |||
moritz | one of them being that you can't have a lower limit for EC transactions, but I hope they also have rules that you can't screw over people when they pay | ||
arnsholt: here it's a legal disclaimer on the back of the receipt | 12:59 | ||
arnsholt | Ah | ||
moritz | arnsholt: and if you pay with debit card, you either have to enter a PIN or sign | ||
(but not your choice, it's the shop's choice) | |||
bilder.t-online.de/b/41/56/13/42/id.../index.jpg that's what it looks like | 13:00 | ||
13:00
itaipu joined
|
|||
arnsholt | I'm not sure who chooses here. But signature is basically never used, except when the payment terminal can't reach the bank servers | 13:00 | |
Yeah, we don't do that | 13:01 | ||
masak | interesting. I like in a country much like arnsholt's :P | 13:05 | |
arnsholt | Who'd a thunk it? =D | ||
13:22
mscha joined
|
|||
mscha | m: say 4 ~~ 1,3...Inf; # that's odd... | 13:23 | |
camelia | rakudo-moar c541b3: OUTPUT«(...)» | ||
mscha | m: say "yes" if 4 ~~ 1,3...Inf; # that's odd... | ||
camelia | rakudo-moar c541b3: OUTPUT«yes» | ||
masak | mscha: precedence | ||
infix:<...> is very loose | |||
m: say "yes" if 4 ~~ (1,3...Inf) | 13:24 | ||
camelia | ( no output ) | ||
mscha | m: say "yes" if 4 ~~ (1,3...Inf); # that's even... | ||
camelia | ( no output ) | ||
masak | needs parentheses for a lot of things | ||
13:26
ggoebel joined
13:28
itaipu left,
bjz left
|
|||
masak | m: class C { method fool-me() { state $fooled-once = False; die "fool me can't fool me again" if $fooled-once++; say "fool me once, shame on me" } }; C.fool-me for ^2 | 13:29 | |
camelia | rakudo-moar c541b3: OUTPUT«fool me once, shame on mefool me can't fool me again in method fool-me at <tmp> line 1 in block <unit> at <tmp> line 1» | ||
masak | just had some use for this pattern | ||
kind of a singleton method call :> | |||
viki | timotimo, FWIW, ISAGN for radix sub/method. It'd just be two lines of code caaling nqp::radix or whatever it is too. | ||
The :16(x) thing feels very awkward as a generic way to conver and more of a way to write a literal | 13:30 | ||
13:31
kurahaupo joined
|
|||
moritz | masak: as a safeguard to the destroy-earth method? | 13:35 | |
:-) | 13:36 | ||
13:37
cibs left
13:38
tushar joined
13:39
cibs joined
13:44
BigBear left
|
|||
masak | moritz: the method in question is called .bootstrap, on a small MOP I'm writing | 13:44 | |
viki | m: "42".base: 3 | 13:45 | |
camelia | rakudo-moar c541b3: OUTPUT«No such method 'base' for invocant of type 'Str' in block <unit> at <tmp> line 1» | ||
masak | moritz: though I ended up doing it on a different criterion (whether the type registry is empty) | ||
m: 42.base: 3 | |||
camelia | ( no output ) | ||
masak | m: say 42.base: 3 | ||
camelia | rakudo-moar c541b3: OUTPUT«1120» | ||
masak | viki: there's a bit of a "resistance" in place for .base, so that people don't accidentally re-base strings which are already in some base | 13:46 | |
i.e. .base wants to make sure the user realizes that this is Real --> Str, not Str --> Str or something else | |||
viki | I see | 13:47 | |
m: say :16<FF> | 13:49 | ||
camelia | rakudo-moar c541b3: OUTPUT«255» | ||
viki | "FF".base(16) -> 255 | ||
Is that too confusing? | |||
13:50
tushar left
|
|||
masak | viki: oh yes | 13:50 | |
viki | OK :) | ||
masak | see, that's not what .base does at all | ||
viki hasn't woken up yet | |||
masak | disregarding non-Ints for a while, | 13:51 | |
.base takes an *Int* (which you can think of as having no intrinsic base representation) and renders it as a Str in some base | |||
viki | Takes a Real | 13:52 | |
m: say pi.base: 16 | |||
camelia | rakudo-moar c541b3: OUTPUT«3.243F6B» | ||
masak | point still holds for Reals | ||
viki | which is pretty weird | ||
masak | one of the quirks of Perl 5 base conversion -- which I'm glad we avoided to a large extent -- is that `bin()`, `oct()` and `hex()` tempt you into thinking of them as `to_bin()` etc | ||
but they're actually `from_bin()` etc | 13:53 | ||
arnsholt | viki: Why is that weird? Positional notation is the same regardless of base | ||
masak | in Perl 6, converting *from* a base is a special syntax, and converting to a base is a method conveniently called `.base` | ||
viki | masak: I'd say in Perl 6, converting *from* a base—as a generic thing—is a *hack* that involves abusing string interpolation. | 13:54 | |
We don't have anything to convert $x in radix $r to, say, base 10 representation., | |||
m: my $x = "FF"; my $r = 16; say +":$r\<$x>" | 13:56 | ||
camelia | rakudo-moar c541b3: OUTPUT«255» | ||
MasterDuke | m: my $x = "FF"; my $r = 16; say :$r<<$x>> | 13:57 | |
camelia | rakudo-moar c541b3: OUTPUT«((Mu))» | ||
13:57
skids joined
|
|||
viki | m: say .15.base: 16 | 13:58 | |
camelia | rakudo-moar c541b3: OUTPUT«0.266666» | ||
viki | arnsholt: dunno, just doesn't fit my brain :) | ||
masak | viki: for the few cases when this is needed, how about putting the hack in a local sub? I see what you're saying, and yes it *is* a hack, but it's one of those <1% things that maybe doesn't need fixing globally | ||
viki | .1 is what... "one sixteenth"? | ||
MasterDuke | m: my $x = "FF"; my $r = 16; say :$r«$x» | ||
camelia | rakudo-moar c541b3: OUTPUT«((Mu))» | ||
masak | MasterDuke: :$r«$x» doesn't mean what you think it does | 13:59 | |
MasterDuke: so, yes, viki is right as far as that goes | |||
14:00
pyrimidine left
|
|||
MasterDuke | masak: yeah, i thought there was some way that didn't involve that string interpolation, but i guess not | 14:00 | |
14:00
pyrimidi_ joined
|
|||
viki | masak: I think your <1% is underestimating the real numbers. I wrote little Perl 6 code in my life and I have a module that needs that feature. I've seen at least a couple of people ask for it on IRC. And there's a Twitter thread mocking our hack: twitter.com/wonkden/status/797011467530801152 | 14:00 | |
arnsholt | viki: 3.244F6B is simply 3 + 2*16**-1 + 4*16**-2 + 4*16**-3 + :16<F>*16**-5 ... | ||
viki | masak: I'd think it's as common as .base | ||
14:01
skids left
|
|||
viki | arnsholt: ok, now it kinda fell into place and I understand why base 16 pie is "larger" than base 10 | 14:02 | |
14:02
aborazmeh joined,
aborazmeh left,
aborazmeh joined
|
|||
viki | masak: I mean, even the hack aside, the :16<FF> notation is weird and jarring. There's little to compare to it with the rest of Perl 6 code. | 14:03 | |
masak | viki: I can't recall ever having an actual use case where I needed the base to vary | ||
viki | It wants to be a method on Str. | ||
masak: I use it in my Color module to convert dec to hex and back | 14:04 | ||
masak | viki: agree as far as that goes. I don't think I'd mind if it were a method on Str -- as long as it doesn't increase the confusion I meantioned above | ||
viki | "FF" -> 255 | ||
masak: what would be a good name? What do you think of Str.radix? | |||
masak | viki: but there the base takes on two fixed values | ||
viki | vike: right, true. I misremembered about needing the hack, but I recall the :16($str) being a weird thing to write. | 14:05 | |
masak | viki: .base and .radix don't have anything to distinguish them -- you can't tell which one is Str --> Real and which is Real --> Str | ||
moritz | .format-base | ||
viki | masak: fair enough | ||
masak | viki: it's weird; the syntax has been "stolen" for that use. but once you get over that, it does fit quite nicely. | ||
moritz | .parse-base | ||
viki | +1 on .parse-base | ||
moritz | masak: the problem with the syntax is that it doesn't work well if your base is in a variable | ||
Str.parse-base, Int.format-base | 14:06 | ||
masak | moritz: yes, as discussed above :) | 14:07 | |
moritz: I like those two suggestions. | |||
viki | With .format-base being a replacement for .base? | 14:08 | |
moritz | or an alias | 14:09 | |
14:09
tushar joined,
aborazmeh left
|
|||
masak | AngularJS has a pair of things that it calls format/parse, so it's instantly recognizable to me. | 14:10 | |
14:17
kyclark_ joined
|
|||
tadzik | ...spherical earth sucks | 14:38 | |
timotimo | you don't have to believe the earth is spherical | ||
c'mon, you don't want to be a Globetard, do you? | 14:39 | ||
tadzik | it's worse, I'm a programmer :( | ||
I'm writing a geocaching app | |||
doing the "get the bearing from my position to a place X" and so | |||
14:39
ocbtec left
|
|||
eythian | great circle distance and bearing calculation functions are surely all over the palce | 14:39 | |
tadzik | and it sometimes comes out off, like when I'm south of something it'll tell me to go south to reach it | 14:40 | |
and I keep checking the order of arguments and so, and now it hit me: it's not wrong | |||
14:40
kyclark_ left
|
|||
eythian | I suppose that works if you don't mind taking the scenic route :) | 14:40 | |
tadzik | it may take me a few years to go all around the earth, but it's not wrong | ||
now I am impressed that it's ever actually right, since really any bearing would be correct unless it's a right angle | 14:41 | ||
eythian: yes, exactly :o how do you deal with this? | 14:42 | ||
eythian | depends on your algorithm I guess. I've never implemented one myself, so I not really speaking from a position of expertise :) | 14:43 | |
tadzik | I'm ripping off wikipedia tbh :P en.wikipedia.org/wiki/Azimuth#Calc...ng_azimuth | ||
masak | tadzik: I've been thinking a lot about spheres lately too | 14:44 | |
mspo | en.wikipedia.org/wiki/Dijkstra%27s_algorithm ? | ||
tadzik | mspo: well, that'd require representing earth as a graph | 14:46 | |
14:46
kyclark_ joined
|
|||
masak | mspo: that's one of the most unexpected suggestions I've heard :P | 14:46 | |
jnthn | Just cover the globe in a graph of lattitude/longitude lines. :P | 14:47 | |
moritz thought of a node for each atom, and edges for k nearest neighbours | 14:48 | ||
timotimo | that'll help | ||
jnthn | Their intersections are graph nodes :P | ||
But yeah, there's surely a better way :) | |||
masak | tadzik: I think you would enjoy the "Hairy ball theorem" :) | ||
timotimo | :D | ||
perlpilot | Math::Trig has great circle distance and related stuffs | 14:49 | |
tadzik | I think for this one time I'm gonna be the flat earthist | 14:50 | |
but hey, I learned something today | |||
once again, trying to make your programming actually reflect reality is a path to pain and suffering | 14:51 | ||
masak | +1 | 14:53 | |
14:53
cibs left
|
|||
tadzik | also, now I can replace all this complicated math with one atan() :> | 14:54 | |
14:55
cibs joined
|
|||
eythian | there _must_ be a library somewhere that you can use or port that will do the stuff for you, including dealing with corner cases. | 14:55 | |
tadzik | I think so, but is it worth the effort? | 14:56 | |
when people pull out a map and rotate it so that they face the right direction, they're doing pathfinding on a flat earth too, pretty much | 14:57 | ||
viki | m: my \term:<∏> = ^∞ .grep: *.is-prime; say ([*] ∏[2*2, 2*2, 11, 11*3]).base: ∏[3*3] | ||
camelia | rakudo-moar c541b3: OUTPUT«PERL» | ||
viki | Perl constructed with nothing but prime numbers \o/ | ||
Yes, yes I do have too much time on my hands :) | 14:58 | ||
DrForr | Gaussian field FTW? | ||
14:58
rurban left
14:59
abraxxa left
|
|||
tadzik | :D | 15:00 | |
15:04
tushar left,
vendethiel- left
|
|||
tadzik | now that I think of it, on a naive flat earth model it'd still show you the "long way around" for anything past | 15:06 | |
15:07
kyclark_ left
|
|||
tadzik | * past 90/-90 longitude | 15:07 | |
15:11
dataf3l joined
15:12
davido joined
15:14
tushar joined
15:16
mattn_jp joined
|
|||
viki | Divide it into three equal parts and calculate three calculations and pick the shortest one? | 15:17 | |
tadzik | I figure: if the delta of longitudes is over 180 I can sort of "flip them around" | ||
DrForr | masak: WRT Brouwer Fixed-Point you have my attention as well. | ||
tadzik | subtract 180 from the bigger, add 180 to the smaller | 15:18 | |
and pretend that I'm looking at the other half of the earth now | |||
DrForr | Maybe looking at them in radians? | 15:19 | |
15:19
wamba joined
|
|||
DrForr | Damn, an interesting math discussion *had* to start when I have to get going... | 15:19 | |
timotimo | have a good one, DrForr | ||
15:20
cyphase joined
|
|||
tadzik | I don't think we're at the angles part yet | 15:21 | |
it's like, if you take a flat map of the earth, the way to get from australia to brazil will always be "to the left" | 15:22 | ||
because the world ends if you walk "to the right" | |||
DrForr | If you're doing distances as well you'll need spherical geometry; might make an interesting test of the hyperbolic trig methods. | ||
tadzik | I guess you have to glue the map back together and tear it somewhere else, pretty much | ||
DrForr | Flip one of the edges over and create a Klein map. | 15:23 | |
grondilu | Fun fact: if you look at it with enough speed, the Earth is indeed flat. | ||
tadzik | I have my math for distances and it's doing the right thing(for now, but now that you mention it I'm scared) | ||
15:23
raiph left
|
|||
DrForr | grondilu: Lorentz contraction? | 15:24 | |
grondilu | DrForr: yes | ||
15:24
raiph joined
15:25
Rawriful left
15:26
skids joined
15:32
mattn_jp left
15:36
dataf3l left
15:37
neuron joined,
mattn_jp joined,
mattn_jp left
15:38
mattn_jp joined
15:41
mattn_jp_ joined,
mattn_jp_ left,
mattn_jp left,
mattn_jp joined
|
|||
viki | m: say "34\x[308]5".Int | 15:44 | |
camelia | rakudo-moar c541b3: OUTPUT«3» | ||
viki | m: say +"34\x[308]5" | 15:45 | |
camelia | rakudo-moar c541b3: OUTPUT«Cannot convert string to number: trailing characters after number in '033⏏054̈5' (indicated by ⏏) in block <unit> at <tmp> line 1Actually thrown at: in block <unit> at <tmp> line 1» | ||
viki | wc | ||
15:45
dj_goku joined
15:49
raiph left
15:50
raiph joined,
dataf3l joined
15:53
raiph left
15:54
raiph joined
16:00
dataf3l left,
dataf3l joined
|
|||
dalek | c: d9f1d14 | timotimo++ | doc/Type/Int.pod6: make possibility of using variables more obvious |
16:04 | |
synopsebot6 | Link: doc.perl6.org/type/Int | ||
Cole_ns | m: class C { has str $.s }; my %h; my $c = C.new; %h{$c.s} = $c; say 'done' | 16:06 | |
camelia | rakudo-moar c541b3: OUTPUT«(signal SEGV)» | 16:07 | |
viki | heh | ||
moritz | Cole_ns: wow, that's a nice short one! | ||
16:07
dataf3l left
|
|||
Cole_ns | Uh, yay? | 16:07 | |
16:07
dataf3l joined
|
|||
Cole_ns | :D | 16:07 | |
neuron | Yay, I made perl6 working on Solaris :) | 16:08 | |
Actually not that much work necessary, only some configuration issues | |||
stmuk_ | neuron++ | 16:09 | |
16:09
mattn_jp left
|
|||
dalek | c: 6ffc43a | moritz++ | doc/Language/objects.pod6: Mention that TWEAK is a new feature |
16:10 | |
synopsebot6 | Link: doc.perl6.org/language/objects | ||
viki | Cole_ns: I'll raise you: | ||
Cole_ns | neuron++; # solarising? solarisising? solarisizing? | ||
viki | m: my %h{class { has str $.s }.new.s} = 1 | ||
camelia | rakudo-moar c541b3: OUTPUT«===SORRY!===QAST::Block with cuid 2 has not appeared» | ||
viki | :) | ||
m: my %h; %h{class { has str $.s }.new.s} = 1 | 16:11 | ||
camelia | rakudo-moar c541b3: OUTPUT«(signal SEGV)» | ||
viki | Golfed segv | ||
Cole_ns: would you rakudobug it? Just email to [email@hidden.address] | 16:12 | ||
Cole_ns | I'll do that. | ||
viki | Cole_ns++ thanks | ||
timotimo | m: my str $a; my %h; %h{$a} = 1 | ||
camelia | ( no output ) | ||
timotimo | kind of interesting | ||
we'd expect that to give the same semantics as if the string had been "", right? | |||
neuron | Cole_ns: I wanted to give some short presentation about perl 6 for colleagues, but they insisted on having a native library available :) | 16:13 | |
16:13
cibs left
|
|||
viki | Possibly. The segv goes away if you give the attribute a default | 16:13 | |
16:13
dataf3l left
|
|||
viki | OTOH, other natives require a default | 16:13 | |
m: my int $x | |||
camelia | ( no output ) | ||
viki | oh wait. I'm confusing things | ||
neuron | p6: say "$OSNAME" | 16:14 | |
camelia | rakudo-moar c541b3: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Variable '$OSNAME' is not declaredat <tmp>:1------> 3say "7⏏5$OSNAME"» | ||
timotimo | yeah, it's getting a low-level null as the value for the key | ||
neuron | Hmmm, shouldn't that be set according to docs.perl6.org/language/5to6-perlvar? | ||
viki | m: say $*DISTRO | ||
camelia | rakudo-moar c541b3: OUTPUT«opensuse (13.2.Harlequin)» | ||
16:14
cibs joined
|
|||
timotimo | no, the text below $^O is the explanation | 16:15 | |
viki | neuron: no, $OSNAME is listed there as Perl 5 thing, and the paragraph under it tells you what the Perl 6's variants are | ||
timotimo | the presentation of that stuff is ... weird | ||
viki | Yeah | ||
neuron | viki, timotimo : ah, I didn't catch that | 16:16 | |
timotimo | yeah, can't blame you | 16:17 | |
16:18
rurban joined
|
|||
neuron | Well, technically you can ... :) | 16:18 | |
timotimo | okay. i blame you for that! | ||
viki | neuron: all those vars are listed here: docs.perl6.org/language/variables#..._variables | 16:19 | |
And the next section: docs.perl6.org/language/variables#..._variables | |||
neuron | viki, thanks, that's what I was looking for | ||
16:25
isacloud left
16:26
isacloud joined
16:28
matt_ joined
16:29
matt_ is now known as Guest73014,
leedo joined,
Guest73014 is now known as matt_
|
|||
neuron | ./perl6 ./t/01-sanity/53-transpose.t | 16:29 | |
Segmentation Fault (core dumped) | 16:30 | ||
meh :) | |||
16:31
dataf3l joined
16:32
dataf3l left
16:33
dataf3l joined
16:35
dataf3l left
16:40
domidumont left
16:42
domidumont joined
|
|||
grondilu | neuron: can't reproduce it on my install | 16:42 | |
16:42
dataf3l joined
|
|||
grondilu | $ perl6 --version | 16:42 | |
This is Rakudo version 2016.10-254-gd989d96 built on MoarVM version 2016.10-43-gb4cd2a6 | |||
implementing Perl 6.c. | 16:43 | ||
neuron | grondilu: Do you use solaris? | 16:44 | |
16:44
maybekoo2 left
|
|||
neuron | Also I'm on development version of solaris, so I can't really blame noone but me | 16:45 | |
timotimo | perl6 -e 'my %h; %h{class { has str $.s }.new.s} = 1' | 16:57 | |
MVMHash representation requires MVMString keys | |||
better than a crash | |||
though i'll put "definite" or "defined" in there. | |||
16:58
FROGGS joined
16:59
Rawriful joined
|
|||
timotimo | i don't feel like writing a test because it segfaults and i don't want to do the bump dance | 16:59 | |
Cole_ns | timotimo: What's the bump dance? | 17:05 | |
viki | Cole_ns: bumping MoarVM version used by nqp and then bumping NQP version used by Rakudo | ||
timotimo | yep, one commit to nqp, and another commit to rakudo | 17:06 | |
viki | .oO( sounds like a job for a simple alias.... ) |
17:07 | |
timotimo | no, i don't have trouble making the stuff | 17:08 | |
i don't want to push the commits | |||
viki | ¯\_(ツ)_/¯ | 17:09 | |
Makes bumps more atomic... "Bump version to bring a bunch of MoarVM fixes" is kinda meh | 17:10 | ||
MasterDuke | Zoffix! to the botmakingmobile! we need a bump dancing bot! | ||
neuron | what is the best way to create patches against rakudo, nqp and moarvm? | 17:11 | |
github pull requests? | |||
viki | neuron: yes | ||
17:11
gregf_ left
|
|||
neuron | perfect, thanks viki | 17:11 | |
see you later guys | |||
viki | neuron: for Rakudo, ensure the PR passes the spectest. You can run it as TEST_JOBS=4 make spectest; You can also run a longer, but more comprehensive test: TEST_JOBS=4 make stresstest | 17:12 | |
Increate TEST_JOBS value to about $number-of-your-processor-cores*1.2 | |||
17:12
pmurias joined
|
|||
neuron | viki: Is it described somewhere? | 17:13 | |
viki | m: 30/24 | ||
camelia | rakudo-moar d540fc: OUTPUT«WARNINGS for <tmp>:Useless use of "/" in expression "30/24" in sink context (line 1)» | ||
viki | m: say 30/24 | ||
camelia | rakudo-moar d540fc: OUTPUT«1.25» | ||
viki | neuron: umm... nothing that sticks in my mind. I keep planning to write a proper blog post for all this stuff. You can get it piece-meal if you read the "Perl 6 Core Hacking" posts on perl6.party | ||
But they go over specific bugs, so the procedure isn't generic. | 17:14 | ||
neuron: I see we have CONTRIBUTING.md, maybe it's in there: github.com/rakudo/rakudo/blob/nom/...IBUTING.md | |||
neuron | viki: is there a way to ask someone to run the tests for me? I have fixes to make perl6 compile on solaris, but the tests are failig so far there (core files mostly) | ||
Or maybe I should get myself virtual linux machine and run the tests there with my fixes | 17:15 | ||
viki | neuron: you can just mention on the pull request that someone needs to run the spectest. | 17:16 | |
neuron | That would be great | 17:17 | |
Many thanks | |||
bye | |||
17:17
neuron left
|
|||
viki | God dammit... I've just learned all of Canada, EXCEPT for my province and the neighbouring one have a day off today. | 17:28 | |
You just had to be different, Ontario, eh?! | |||
17:29
cibs left
17:30
canopus joined,
cibs joined
|
|||
viki | "Americans eat about 1.25 billion chicken wings annually during Super Bowl Sunday." en.wikipedia.org/wiki/Public_holid...celebrated | 17:31 | |
That's like 675 million chickens! | |||
In one day. | |||
17:34
dataf3l left,
dataf3l joined
17:37
domidumont left
17:42
kyclark_ joined
17:44
ufobat left
17:46
ufobat joined
17:49
Louis_ joined
17:54
dataf3l left
17:55
nadim left
|
|||
timotimo | holy shick | 17:59 | |
18:00
tushar left
18:04
kyclark_ left
18:07
pyrimidi_ left,
pyrimidine joined
18:10
labster joined,
labster left,
labster joined
18:14
tushar joined
18:17
Actualeyes left
|
|||
viki | NeuralAnomaly: blockers | 18:25 | |
NeuralAnomaly | viki, There is 1 release blocker. See perl6.fail/release/blockers | ||
viki, perl6.fail/130031 : gmake install step fails under Windows for 2016.10 with the Strawberry Perl buildchain | |||
viki | .ask stmuk_ would you be able to retest RT#130031 with HEAD rakudo? I believe that bug has been fixed | ||
synopsebot6 | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=130031 | ||
yoleaux | viki: I'll pass your message to stmuk_. | ||
18:26
Actualeyes joined
18:30
raiph left
18:31
raiph joined
18:32
raiph left
18:36
raiph joined
18:37
raiph left,
raiph joined,
firstdayonthejob joined
18:39
wamba left
|
|||
RabidGravy | Harr! | 18:39 | |
Finally Friday evening | |||
viki | Is it? | ||
Seems to be still afternoon :P | |||
mst | that's because you're in an inferior timezone | 18:41 | |
RabidGravy | we live in the Mother Of All Timezones | ||
viki | :) | 18:42 | |
RabidGravy | I could almost walk to the meridian if I could be arsed | ||
there may be something weird going on with the order of the modules on modules.perl6.org/ | |||
viki | yeah | 18:43 | |
18:45
pyrimidine left
18:46
pyrimidine joined
|
|||
viki | prolly something due to this: github.com/perl6/modules.perl6.org...50cab7eb65 | 18:46 | |
viki leaves to do a designer emergency :'( | |||
Perfect end to a Friday work day :( | |||
18:46
cognominal joined
|
|||
RabidGravy | I actually refused to merge a change this afternoon | 18:47 | |
18:53
mscha left
18:54
pyrimidine left
18:59
pyrimidine joined,
itcharlie joined
19:02
rurban left
19:03
raiph left,
raiph joined
19:04
pyrimidine left
19:05
raiph left,
firstdayonthejob left
19:06
raiph joined
19:08
firstdayonthejob joined
19:09
pyrimidine joined,
raiph left
19:10
labster left
19:11
mohae joined
19:13
raiph joined
19:14
mohae_ left,
pyrimidine left
19:15
raiph left,
raiph joined
19:16
itcharlie left
19:17
raiph left,
raiph joined
19:22
bjz joined
19:23
nowan left
19:25
Actualeyes left
19:26
nowan joined
19:28
Actualeyes joined,
pyrimidine joined
19:33
pyrimidine left
19:35
tushar left,
tushar joined
19:38
pyrimidine joined
19:42
pyrimidine left
19:45
darutoko left
19:53
seatek joined
19:54
ocbtec joined
19:55
Actualeyes left
19:57
pyrimidine joined
20:02
cyphase left
20:03
pyrimidine left
20:07
cyphase joined,
pyrimidine joined
20:08
rindolf left
20:12
pyrimidine left
|
|||
seatek | Interesting - doing this $obj.isa('Class::Name') ?? appears to be execute just as fast as $obj.^name ~~ /Class\:\:Name/ ?? yet the second gives you much more flexibility | 20:13 | |
geekosaur | seatek, until you are working with a subclass of Class::Name | 20:14 | |
seatek | using a giant cludge mallet timer ;) | ||
geekosaur: I was! | 20:15 | ||
20:15
rindolf joined,
pyrimidine joined
|
|||
viki | Well, then your regex match is bupkis | 20:15 | |
seatek | Just 1 subclass down though | ||
viki | You're conflating a name with subclassing | ||
seatek | i'm being practical ;) | 20:16 | |
viki | m: class Foo::Bar {}; class Some::Other is Foo::Bar {}; dd [ Some::Other.isa('Foo::Bar'), Some::Other.^name ~~ /'Foo::Bar'/ ] | ||
camelia | rakudo-moar 4ae3f2: OUTPUT«[Bool::True, Any]» | ||
viki | If by practical you're introducing hard to find bugs, sure ;) | 20:17 | |
*you mean... | |||
Job security, amiright? :) | |||
geekosaur | seatek, IO::Socket is a subclass of IO::Handle | ||
(in p5, and I think p6) | 20:18 | ||
think about this | |||
20:18
cognominal left
|
|||
seatek | I understand the difference between them completely | 20:18 | |
I'm talking about heavily loaded requests happening, and the speed at which they can happen | |||
viki | Though to be fair, we have some iffy things in core on this topic :P | 20:19 | |
seatek | It was surpsing to me because I always hear about how horrificly slow using regexes make things | 20:20 | |
yet there was no difference using the name with regex, and calling .isa | |||
(in timing the application which is a big of a big club ;)) | |||
viki | seatek: there's .contains() FWIW | 20:21 | |
FROGGS | regexes arnt that slow... interpolation in regexes is | ||
20:21
sftp left
|
|||
seatek | yeah, this came up because i'm having to deal with the fatal nightmare of circular module loading now | 20:22 | |
mspo | codegolf.stackexchange.com/question...1863#31863 | ||
synopsebot6 | Link: rt.perl.org/rt3//Public/Bug/Displa...l?id=31863 | ||
20:22
pyrimidine left,
sftp joined
20:24
bjz left
20:25
ufobat left
20:27
pyrimidine joined,
Actualeyes joined
20:31
nowan left
20:32
pyrimidine left
20:34
tomaw_ joined
20:35
Actualeyes left,
pyrimidine joined,
canopus left
20:37
tomaw_ left
20:38
nowan joined
20:39
espadrine left
20:41
pyrimidine left,
canopus joined
20:46
FROGGS left
20:47
pyrimidine joined
|
|||
timotimo | seatek: btw, if you have $obj.^name ~~ /Class\:\:Name/, it might be about 1000x faster to just .contains("Class::Name") | 20:48 | |
seatek | timotimo: I noticed that :) | 20:49 | |
20:50
shlomif joined
|
|||
seatek | I tried putting in "artificial" subclassing (that gave a common ancestor), so that i could use .isa .. but it was not faster. | 20:52 | |
completely happy using the regex. it lacks purity... but it has a certain.. rustic charm ;) | 20:54 | ||
and i'm secretly rebelling against the fatality of circular module use's ;) | 20:55 | ||
dalek | c: 857fab3 | coke++ | doc/Type/Int.pod6: use actual spelling to pass spell test |
21:20 | |
synopsebot6 | Link: doc.perl6.org/type/Int | ||
timotimo | whoops | 21:23 | |
21:23
river joined
|
|||
timotimo | thanks you | 21:23 | |
there's probably a make target in the repo that'll spellcheck for me? | |||
river | what's perl 6 written in? | ||
21:24
shlomif left
|
|||
timotimo | perl6 is written in a bunch of NQP (not quite perl6) and a bunch of perl 6 | 21:24 | |
we have our own custom VM to run the language on called MoarVM, which is written almost completely in C89 | |||
river | that's interesting | ||
timotimo | and stuff for our support of the JVM is written in java, unsurprisingly | ||
river | oh well, can't have everything | 21:25 | |
timotimo | the compiler of nqp and its runtime is also written completely in nqp | ||
river | that does all seem rather complicated | ||
timotimo | it's not terribly bad. it allows us to have a few cool things | 21:26 | |
21:27
Actualeyes joined
|
|||
timotimo | perl6.party/post/Perl-6-is-written-in...-Perl-6 - i think this post shows a bit of that | 21:27 | |
i seem to recall another article about the coolness of that fact, but i don't remember who wrote it or what it was called | 21:29 | ||
21:32
uncle_ joined
21:37
AlexDaniel joined
|
|||
uncle_ | hello, does anyone know if there's a rakudo 2016.10 installer for Windows? rakudo.org/downloads/star/ does not have it... | 21:38 | |
seatek | uncle_: I looked for one very briefly the other day and couldn't find one. Also tried compiling it with Cygwin briefly which failed. | 21:41 | |
I didn't need the video game distraction anyway. ;) | 21:43 | ||
21:43
river left
|
|||
timotimo | i think we have trouble on cygwin so can't support it | 21:43 | |
seatek | Does it take a microsoft compiler of some sort? I have no idea really about the Windows world, except what I've had to learen | 21:44 | |
(and video games) | 21:45 | ||
OSX is probably much easier since its unixy | 21:46 | ||
uncle_ | installers for older versions were provided on Windows before, so I wonder why 2016.10 doesn't have one | ||
timotimo | with MSVC and strawberry perl you can do it | ||
21:47
zakharyas left
|
|||
seatek | i heard something about windows 10 being able to run a Ubuntu command line now... ;) | 21:48 | |
timotimo | yup | ||
i think people have been able to compile rakudo with that | |||
tadzik | yep, it's quite nice | ||
timotimo | i don't remember if it requires any patches or tweaks | ||
seatek | i'm gonna have to play with that eventually | 21:49 | |
21:49
Actualeyes left,
pyrimidine left
21:50
ft left
|
|||
stmuk_ | uncle_: because that version didn't "make install" correctly | 21:52 | |
yoleaux | 18:25Z <viki> stmuk_: would you be able to retest RT#130031 with HEAD rakudo? I believe that bug has been fixed | ||
synopsebot6 | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=130031 | ||
21:52
Actualeyes joined
|
|||
stmuk_ | .tell viki thanks! I think you are right (and that 2016.10 problem fixed by a moar bump) | 21:53 | |
yoleaux | stmuk_: I'll pass your message to viki. | ||
21:54
skids left
|
|||
stmuk_ | I plan to try and build a working windows MSI either this or next weekend | 21:54 | |
21:55
pyrimidine joined
|
|||
uncle_ | stmuk_: that would be nice :) | 21:56 | |
Cole_ns | stmuk_++ | ||
timotimo | yay! | 21:58 | |
22:00
pyrimidine left
22:04
rurban joined
22:05
pyrimidine joined
22:09
pyrimidine left
22:10
RabidGravy left
|
|||
grondilu | "how many moves can players think ahead?" omg he did ask this question | 22:10 | |
the most cliché chess question ever | |||
oh sorry wrong chan | 22:12 | ||
22:12
tushar left
|
|||
masak | grondilu: I'm guessing, something like 2 moves? :P | 22:12 | |
grondilu | it's a dumb question. GrandMasters can play a whole game in their head, but they can inspect all branches. How deep they inspect the move tree depends on the position. | 22:14 | |
22:15
pyrimidine joined
|
|||
grondilu | s/but they can/they can not/ | 22:15 | |
22:15
bjz joined
|
|||
masak | yes, of course | 22:16 | |
seatek | I play chess by using The Force, not thinking ahead. | ||
geekosaur | yeh. one of the things grand masters have over computers is they can tell which branches to prune immediately; the computers have to compute all of them | ||
masak | perhaps Monte Carlo Tree Search might give some insight here | ||
grondilu | Kasparov used to answer sarcastically: "I don't know, just one?" | ||
seatek | hehe | 22:17 | |
geekosaur | the AI folks keep playing with various forms of chunking (pattern matching on the high level) to try to reproduce what the players do | ||
masak | in the sense that trying out all of the branches in the game tree isn't the point; only the ones that are interesting/relevant | ||
geekosaur | well, the problem is nobody knows (or knows *consciously* which ones are relevant | ||
22:21
pyrimidine left
22:23
pierre_ joined
22:27
pierre_ left
22:29
davido left,
pyrimidine joined
22:32
rurban1 joined
22:34
pyrimidine left
22:35
pyrimidine joined
22:36
rurban left
22:39
pyrimidine left
22:41
uncle_ left
22:43
perlpilot left
22:44
pyrimidine joined
22:45
perlpilot joined
22:47
Actualeyes left
22:49
pyrimidine left
22:54
pyrimidine joined,
Actualeyes joined
22:58
pyrimidine left
23:03
ribasushi left
23:04
pyrimidine joined
23:08
pyrimidine left
|
|||
seatek | .keys doesn't seem to care what order keys were created. nor does it sort its return. yet it remains consistent... | 23:12 | |
can i count on that forever and ever i wonder? | |||
jnthn | I wouldn't. | 23:13 | |
seatek | hehe | ||
23:13
perlpilot left
|
|||
seatek | that means more work then :( | 23:13 | |
23:14
rurban1 left
|
|||
seatek | or pie | 23:14 | |
i think pie. yes. | |||
23:15
perlpilot joined
23:17
perlpilot left,
perlpilot joined
23:23
pyrimidine joined
|
|||
masak | seatek: congratulations, you've discovered the unorderedness of hash keys. | 23:23 | |
seatek: here, have a level-up :) | |||
timotimo | we had a very short snippet that gave you an ordered hash | 23:25 | |
i seem to recall masak wrote it | 23:26 | ||
seatek | masak: hehe thanks :) but... they seem ordered in some way... that is, they are consistent across tests... but i can't figure out why they've taken the order they have | ||
geekosaur | well. technically "ordered" in the sense that the hash value determines the order. but the hash function may change, and there are hash impls in other languages that deliberately permute the hash function to prevent attacks based on ordering | ||
23:26
ribasushi joined
|
|||
seatek | ah ok | 23:27 | |
jnthn | We'll do that permuting in the future too | ||
The only reason we didn't so far is "nobody had time" | |||
seatek | that explains the seeming "randomness" when they go in, but not when they come out | ||
geekosaur | basically you should not rely on the hash function always behaving in a particular way | ||
masak | seatek: hashes sacrifice consistent ordering in favor of fast lookup | ||
23:27
pyrimidine left
23:28
kyclark_ joined
23:30
perlpilot left
23:32
Tonik joined
23:33
firstdayonthejob left,
pyrimidine joined
23:34
perlpilot joined,
Actualeyes left
23:37
wamba joined
23:38
pyrimidine left
23:41
kyclark_ left
23:43
ocbtec left,
pyrimidine joined
23:48
pyrimidine left
23:52
pyrimidine joined
23:57
pyrimidine left
|
|||
timotimo | halite.io/index.php - potentially interesting? | 23:59 | |
23:59
pyrimidine joined
|
|||
seatek | yeah the hash order doesn't matter for me at all really, except that unit tests doing text generation... well, i gotta test those strings :) | 23:59 |