»ö« 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. |
|||
00:00
zacts joined
00:02
rindolf left,
edehont left
|
|||
AlexDaniel | tbrowder: hi | 00:13 | |
dalek | c/signature-test-option: fbe8525 | Altai-man++ | / (18 files): This commit adds new pod config option: 'signature', and adapts current type documentation to it's usage instead of brackets addition. |
||
AlexDaniel | tbrowder: I see there's “Perl_6” on the experimental page (with underscore) | 00:14 | |
tbrowder: I'm not sure why, but my guess is that you probably mistaken in to which is displayed as a colored underscore in emacs | 00:15 | ||
it* | |||
tbrowder: being non-breaking space | |||
sena_kun | tbrowder, if you're using emacs, you can easily add non-breaking spaces with "C-x 8 space". Just number "8" and then normal space will do the trick. | 00:16 | |
AlexDaniel | sena_kun: 「C-x 8」, right! I should probably use it more | 00:18 | |
tbrowder | You both are correct. Can one of you correct that, please? | ||
AlexDaniel | sure | ||
00:18
cognominal joined
00:19
wamba left
|
|||
sena_kun | AlexDaniel, I wonder how people work without emacs. Vim, probably. | 00:19 | |
00:19
pierre_ joined
|
|||
dalek | c: 6dd293b | (Aleks-Daniel Jakimenko-Aleksejev)++ | doc/Language/experimental.pod6: Change Perl_6 to Perl 6 Sometimes it's not too hard to confuse non-breaking space with an underscore in emacs, as both are displayed as an underscore (one being different color). |
00:20 | |
AlexDaniel | sena_kun: I'm not sure if I'm with you on this. The thing is, I have solved so many problems that vim/emacs are trying to solve, but I did it on completely different levels (keyboard, layout, OS), so in my view if you do all that, then you don't really need emacs or vim. | 00:23 | |
00:23
canopus left
|
|||
AlexDaniel | for example, I don't need 「C-x 8 space」 because I can type it | 00:23 | |
sena_kun | AlexDaniel, it can be. Anyway, not again this emacs/vim/anything flame. | 00:24 | |
AlexDaniel | it is not a flame, it is just a different point of view :) | ||
my point is that you can like your editor as much as you want, but you should always be open to other solutions to common problems. | 00:26 | ||
Xliff | I'm getting this error "Cannot unbox a type object" when attempting to pass a type object to a nativecall sub. | 00:27 | |
Isn't that allowed? | |||
sena_kun | AlexDaniel, more importangly, can you help me, please, with github.com/perl6/doc/pull/814? I'm worring about the CONTRIBUTING.md changes. | ||
Xliff | Rebuilding rakudo... just in case. | 00:30 | |
AlexDaniel | sena_kun: I don't think that I am more native, but perhaps it would be better if it specified what kind of “body” it is talking about. Or maybe “don't do this” example can help? | 00:31 | |
sena_kun: but it is not that important really, people are more likely to look at other parts of the documentation to see what they should be doing | |||
00:32
BrassLantern joined,
canopus joined
|
|||
dalek | c: 3f64990 | (Tom Browder)++ | doc/Language/experimental.pod6: use title case for title words for consistency |
00:33 | |
AlexDaniel | sena_kun: oh! | ||
sena_kun | AlexDaniel, thanks. What's the matter? | ||
00:33
golee joined
00:34
travis-ci joined
|
|||
travis-ci | Doc build passed. Altai-man 'This commit adds new pod config option: 'signature', and adapts current type documentation to it's usage instead of brackets addition. | 00:35 | |
travis-ci.org/perl6/doc/builds/150192383 github.com/perl6/doc/commit/fbe852570cef | |||
00:35
travis-ci left,
avenj left
|
|||
AlexDaniel | sena_kun: sorry, nothing :) | 00:35 | |
sena_kun: I was thinking about supporting multiline signatures, but I cannot really find any of these, so OK | 00:36 | ||
sena_kun | AlexDaniel, okay. I'm done for today anyway. If we have multiline signature, then I'll sooner or later rewrite it, since sucn signature won't compile. And we want to compile everything. (: | 00:37 | |
AlexDaniel | sena_kun: actually, here: github.com/perl6/doc/blob/master/d....pod6#L177 | ||
00:38
avenj joined
|
|||
AlexDaniel | sena_kun: nvm I will leave a comment | 00:38 | |
sena_kun: good night! | |||
sena_kun | AlexDaniel, I haven't touched Str.pod6 yet. | ||
AlexDaniel, my current goal is to make all Type/* compilable, so sooner or later I'll solve this anyway. | 00:39 | ||
AlexDaniel | sena_kun++ | ||
00:41
lambd0x left
00:51
zacts left
|
|||
dalek | c: 8d9793b | (Tom Browder)++ | doc/Language/experimental.pod6: correct spelling |
00:53 | |
00:55
sena_kun left
00:58
RabidGravy left
|
|||
tbrowder | AlexDaniel: ref emacs: I am still modding my init.el to handle unicode, and I need to add handling the non-breaking space to show it to me as something other than the underscore. That can and will be done. | 01:00 | |
b2gills | .tell bronco_creek Windows has always accepted both kinds of slashes, it's only some programs that have a problem with forward slashes. | 01:01 | |
yoleaux | b2gills: I'll pass your message to bronco_creek. | 01:02 | |
dalek | c: 63b121d | (Tom Browder)++ | CONTRIBUTING.md: remove spurious ellipsis |
01:06 | |
01:14
BrassLantern left
01:26
BenGoldberg joined
01:30
araujo__ joined
01:32
araujo__ left
01:33
araujo__ joined
01:34
araujo_ left
01:38
margeas left,
sufrostico left
01:40
sufrostico joined
01:42
kalkin-_ joined,
kalkin- left,
freezerburnv_ left
01:45
ilbot3 left
01:47
ilbot3 joined
01:49
njmurphy left,
araujo_ joined
|
|||
AlexDaniel | tbrowder: just change the face to make it more prominent | 01:51 | |
01:51
araujo_ left
01:52
araujo_ joined
|
|||
awwaiid | m: say <1/2> ; say < 1/2 > # hm! | 01:53 | |
camelia | rakudo-moar 589061: OUTPUT«0.51/2» | ||
01:53
araujo__ left
|
|||
awwaiid | I didn't know that <1/2> was Rat notation | 01:53 | |
01:54
araujo_ left
|
|||
awwaiid | I like having Rat notation | 01:54 | |
01:54
araujo_ joined
|
|||
AlexDaniel | tbrowder: “escape-glyph” is the face in question | 01:54 | |
01:55
FROGGS left
01:56
araujo_ left
|
|||
AlexDaniel | tbrowder: also see “nobreak-space” face and “nobreak-char-display” variable | 01:56 | |
01:57
araujo_ joined
|
|||
BenGoldberg | m: < 1/2 >.perl.say | 01:59 | |
camelia | rakudo-moar 589061: OUTPUT«RatStr.new(0.5, "1/2")» | ||
BenGoldberg | m: <1/2>.perl.say | ||
camelia | rakudo-moar 589061: OUTPUT«0.5» | ||
awwaiid | hmm. | ||
BenGoldberg | m: <1/2>.WHAT.say | ||
camelia | rakudo-moar 589061: OUTPUT«(Rat)» | ||
AlexDaniel | hmmm | 02:00 | |
BenGoldberg | m: say <245850922/78256779> - pi | 02:01 | |
camelia | rakudo-moar 589061: OUTPUT«0» | ||
AlexDaniel | awwaiid: may I ask why do you need Rat notation? | ||
I mean, 1/2 is already a Rat | |||
BenGoldberg | m: pi.WHAT.say; | ||
camelia | rakudo-moar 589061: OUTPUT«(Num)» | ||
awwaiid reads about docs.perl6.org/language/glossary#Allomorph_ | |||
BenGoldberg | m: say <245850922/78256779>.Num - pi | 02:02 | |
camelia | rakudo-moar 589061: OUTPUT«0» | ||
BenGoldberg | m: say atan2( -1, 0 ); | ||
camelia | rakudo-moar 589061: OUTPUT«-1.5707963267949» | ||
BenGoldberg | m: say atan2( 1, 0 ); | ||
camelia | rakudo-moar 589061: OUTPUT«1.5707963267949» | ||
BenGoldberg | m: say atan2( 1, 0 )*2; | ||
camelia | rakudo-moar 589061: OUTPUT«3.14159265358979» | ||
BenGoldberg | m: say atan2( 1, 0 )*2 - <245850922/78256779>; | 02:03 | |
camelia | rakudo-moar 589061: OUTPUT«0» | ||
BenGoldberg | m: say (atan2( 1, 0 )*2 - <245850922/78256779>) * 1e100; | ||
camelia | rakudo-moar 589061: OUTPUT«0» | ||
AlexDaniel | m: say <42>.WHAT; | ||
camelia | rakudo-moar 589061: OUTPUT«(IntStr)» | 02:04 | |
awwaiid | AlexDaniel: I accidentally ran into it. But you have a good point that 1/2 is just as good. hmm. | ||
I ran into when building a grammar that could parse fractions and was testing things iirc | 02:05 | ||
AlexDaniel | it looks like other languages need Rat notation, perl 6 doesn't :) | ||
awwaiid | AlexDaniel: I don't think I like <1/2> being different than < 1/2 > though. Actually -- I as I think about it I _don't_ like it because it makes < ... > feel overloaded | ||
I was expecting <...> to reliably be quote-word context | 02:06 | ||
02:06
freezerburnv_ joined
|
|||
AlexDaniel | by the way, python 3.6 will support underscores in numeric literals. How cool is that! ;) | 02:06 | |
or at least, that's what I heard | |||
awwaiid | it doesn't already? Ruby does | 02:07 | |
AlexDaniel | almost every language does. | ||
02:07
FROGGS joined
|
|||
awwaiid | I need to get Inline::Python going a bit better. I hooked up travis last weekend at least. All The Libraries!!! | 02:08 | |
(are belong to us) | |||
AlexDaniel | awwaiid: actually, I'm not sure if it is a bug or not | ||
it probably is | |||
awwaiid | that they are different, or that <1/2> _ever_ is automatically a Rat / RatStr? | 02:09 | |
AlexDaniel | that < 25/2 > is RatStr | ||
I don't know, maybe it was done on purpose, but why? | 02:10 | ||
awwaiid | no idea | ||
AlexDaniel | m: say <0.5>.perl | ||
camelia | rakudo-moar 589061: OUTPUT«RatStr.new(0.5, "0.5")» | ||
AlexDaniel | m: say < 1/2 >.perl | 02:11 | |
camelia | rakudo-moar 589061: OUTPUT«RatStr.new(0.5, "1/2")» | ||
AlexDaniel | m: say <1/2>.perl | ||
camelia | rakudo-moar 589061: OUTPUT«0.5» | ||
awwaiid | sick and wrong | ||
ooo! we should deparse it | |||
02:12
pierre_ left
|
|||
AlexDaniel | m: say <42>.perl | 02:13 | |
camelia | rakudo-moar 589061: OUTPUT«IntStr.new(42, "42")» | ||
AlexDaniel | m: say < 42 >.perl | ||
camelia | rakudo-moar 589061: OUTPUT«IntStr.new(42, "42")» | ||
AlexDaniel submits rakudobug | 02:14 | ||
BenGoldberg | m: 3587785776203/44485467702853 | 02:15 | |
camelia | rakudo-moar 589061: OUTPUT«WARNINGS for <tmp>:Useless use of "/" in expression "3587785776203/44485467702853" in sink context (line 1)» | ||
BenGoldberg | m: say 3587785776203/44485467702853 | ||
camelia | rakudo-moar 589061: OUTPUT«0.080650737453591» | ||
BenGoldberg | m: say 3587785776203/1783366216531 | 02:16 | |
camelia | rakudo-moar 589061: OUTPUT«2.01180539529450» | ||
tbrowder | AlexDaniel: thanks! | 02:20 | |
02:20
kid511 left
02:22
sufrostico left
|
|||
TimToady | is not a bug | 02:25 | |
awwaiid | What's the concept? | 02:26 | |
(or link to doc works too of course) | |||
TimToady | we need a literal notation for rats and complex, and <> is it | ||
awwaiid | how about the space vs no-space differene? | 02:27 | |
AlexDaniel | m: say <42e2i>.perl | ||
TimToady | we don't need an extra literal notation for ints or nums, so we don't bother to treat <> special | ||
camelia | rakudo-moar 589061: OUTPUT«ComplexStr.new(<0+4200i>, "42e2i")» | ||
AlexDaniel | m: say < 42e2i >.perl | ||
camelia | rakudo-moar 589061: OUTPUT«ComplexStr.new(<0+4200i>, "42e2i")» | ||
TimToady | m: say <42e2+3i>.perl | ||
camelia | rakudo-moar 589061: OUTPUT«<4200+3i>» | ||
awwaiid | Right -- so 1/2 is an operation that results in a Rat, whereas <1/2> is a Rat literal. | ||
(compiler optimization excepted) | 02:28 | ||
TimToady | yes, and while you can get away with (1/2), it only works by constant folding | ||
awwaiid | cool | ||
TimToady | and bare 1/2 is a problem if you have a surrounding operator that is tighter than / | ||
02:28
noganex joined
|
|||
TimToady | so we just stole <> for those literals, but only when there's no space | 02:29 | |
sure, it's a little inconsistent, but there are reasons | |||
AlexDaniel | m: say <42e2+3i>.perl | ||
camelia | rakudo-moar 589061: OUTPUT«<4200+3i>» | ||
AlexDaniel | m: say < 42e2+3i >.perl | ||
camelia | rakudo-moar 589061: OUTPUT«ComplexStr.new(<4200+3i>, "42e2+3i")» | ||
AlexDaniel | I see | ||
TimToady | generally, you wouldn't write that | 02:30 | |
it's just a degenerate case of qw | |||
AlexDaniel throws away a fully written bug report | |||
TimToady | or more generally, of val() | ||
awwaiid | m: say <1/2>.WHAT ; say < 1/2 >.WHAT ; say "1/2".WHAT ; say qw< 1/2 >.WHAT | ||
camelia | rakudo-moar 589061: OUTPUT«(Rat)(RatStr)(Str)(Str)» | ||
TimToady | anyway, it's working as designed, even if you think the designer is an idiot :) | 02:31 | |
awwaiid | not at all -- just want to understand. In this case :) | ||
02:31
noganex_ left
|
|||
awwaiid | (kidding. TimToady++ # awesomesauce) | 02:32 | |
AlexDaniel | TimToady: it kinda makes sense. “kinda” because it is very confusing at first and now I will be thinking “wait, what am I going to get here?” whenever I use <>, as there's no simple rule. | ||
TimToady | you think <> is inconsistent here, try inside regex :) | 02:33 | |
awwaiid | so the rule is <> bumping right up against a slashy fraction is a Rat. What's with the RatStr? | ||
best of both worlds I guess | |||
TimToady | allomorphism is for when someone is forced to use a textual representation, and needs a bit of dwimmery | ||
awwaiid | interesting | 02:34 | |
TimToady | when someone is asked for a number at a prompt, you'd like to be able to treat it like a number | ||
likewise, your program is forced to be a textual representation | |||
BenGoldberg | m: num $x = 0; ++$x; say $x; | ||
camelia | rakudo-moar 589061: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Two terms in a rowat <tmp>:1------> 3num7⏏5 $x = 0; ++$x; say $x; expecting any of: infix infix stopper statement end statement modifier st…» | ||
BenGoldberg | m: my num $x = 0; ++$x; say $x; | ||
camelia | rakudo-moar 589061: OUTPUT«This type cannot unbox to a native number: P6opaque, Int in block <unit> at <tmp> line 1» | ||
TimToady | so literals are a bit allomorphic, especially inside <> with multiple vlaues | ||
BenGoldberg | m: my num $x = 0e0; ++$x; say $x; | ||
camelia | rakudo-moar 589061: OUTPUT«1» | ||
BenGoldberg | m: my num $x = 0.5e0; ++$x; say $x; | 02:35 | |
camelia | rakudo-moar 589061: OUTPUT«1.5» | ||
AlexDaniel | .tell gfldex see irclog.perlgeek.de/perl6/2016-08-06#i_12976146 and the discussion that follows. Perhaps you'll have an idea on how we can improve the docs to make it less WATy | 02:36 | |
yoleaux | AlexDaniel: I'll pass your message to gfldex. | ||
BenGoldberg wonders what would break if ++ on a num increased by the smallest amount which results a value greater that the initial num. | 02:37 | ||
geekosaur | everyone expecting $x = 0.5; $x++; to do what it does *everywhere* | 02:40 | |
also, I defy you to provide a simple, comprehensible explanation of the resulting behavior on floating point numbers (remember that said increase will scale depending on the magnitude of the original value) | 02:42 | ||
AlexDaniel | m: my $x = 9e16; my $y = $x; $x++; say $x == $y # ;) | 02:43 | |
camelia | rakudo-moar 589061: OUTPUT«True» | ||
geekosaur | yes, but that's at least consistent with floating point everywhere else | ||
BenGoldberg | How about at least provide .smallest-greater and .largest-smaller methods? | 02:44 | |
TimToady | and what would you do with it? | 02:45 | |
BenGoldberg | TBH, I'm not sure ;) | ||
TimToady | adding 1 tends to have more real-world application, I suspect | ||
BenGoldberg | Probably | 02:46 | |
m: say first { !(0+"1e-$_") }, ^Inf; | 02:47 | ||
camelia | rakudo-moar 589061: OUTPUT«324» | ||
02:47
araujo__ joined
|
|||
BenGoldberg | m: my $x = 0; my $y = $x + 1e-323; say $x <=> $y; | 02:47 | |
camelia | rakudo-moar 589061: OUTPUT«Less» | ||
BenGoldberg | m: my $x = 0; my $y = $x + 1e-323; say $x <=> $y but NotByMuch; | 02:48 | |
camelia | rakudo-moar 589061: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Operators '<=>' and 'but' are non-associative and require parenthesesat <tmp>:1------> 3 = 0; my $y = $x + 1e-323; say $x <=> $y7⏏5 but NotByMuch; expecting any of: infix …» | ||
BenGoldberg | m: my $x = 0; my $y = $x + 1e-323; say (($x <=> $y) but (role NotByMuch {})); | ||
camelia | rakudo-moar 589061: OUTPUT«Less» | ||
02:49
araujo__ left,
araujo__ joined
|
|||
TimToady | m: my $x = 10; my $y = $x + 1e-323; say $x <=> $y; | 02:50 | |
camelia | rakudo-moar 589061: OUTPUT«Same» | ||
02:50
araujo_ left
|
|||
BenGoldberg | m: <2646693125139304345/842468587426513207> - <139755218526789/44485467702853> | 02:51 | |
camelia | rakudo-moar 589061: OUTPUT«WARNINGS for <tmp>:Useless use of "-" in expression "<2646693125139304345/842468587426513207> - <139755218526789/44485467702853>" in sink context (line 1)» | ||
BenGoldberg | m: say <2646693125139304345/842468587426513207> - <139755218526789/44485467702853> | ||
camelia | rakudo-moar 589061: OUTPUT«-1.61109530172737e-28» | ||
02:51
araujo__ left
|
|||
BenGoldberg | m: say <2646693125139304345/842468587426513207> - pi.Rat | 02:51 | |
camelia | rakudo-moar 589061: OUTPUT«-2.66764189062422e-07» | ||
02:52
araujo__ joined
02:54
araujo__ left
|
|||
mspo | m: my m: my Numeric $x = 0.5; say ++$x; | 02:54 | |
camelia | rakudo-moar 589061: OUTPUT«5===SORRY!5===Type 'm' is not declaredat <tmp>:1------> 3my m7⏏5: my Numeric $x = 0.5; say ++$x;Malformed myat <tmp>:1------> 3my7⏏5 m: my Numeric $x = 0.5; say ++$x;» | ||
mspo | m: my Numeric $x = 0.5; say ++$x; | ||
camelia | rakudo-moar 589061: OUTPUT«1.5» | ||
BenGoldberg | If I've got a Rat which supposedly approximates pi to 37 decimal digits, and rakudo's builtin pi (converted to a Rat) differs by 2e-7, then does that mean our conversion from Num to Rat is deficient, or does it mean our builtin pi is deficient? | 02:55 | |
TimToady | in that range, Rat has more precision than Num | 02:56 | |
assuming 64-bit Num | 02:57 | ||
02:57
araujo__ joined
|
|||
BenGoldberg | m: say log( 1e-323, 2 ); | 02:58 | |
camelia | rakudo-moar 589061: OUTPUT«-1073» | ||
BenGoldberg | The wikipedia page on 64 bit doubles mentions that subnormals can be as small as 5 x 10 ** -324, so that's about right. | 03:00 | |
m: log( 2**52, 10 ); | 03:02 | ||
camelia | rakudo-moar 589061: OUTPUT«WARNINGS for <tmp>:Useless use of "log( 2**52, 10 )" in expression "log( 2**52, 10 )" in sink context (line 1)» | ||
BenGoldberg | m: log( 2**52, 10 ).say; | ||
camelia | rakudo-moar 589061: OUTPUT«15.653559774527» | ||
BenGoldberg | Would programmers be upset if perl6's builtin pi were a Rat instead of a Num? | 03:04 | |
m: pi.nude.perl.say | |||
camelia | rakudo-moar 589061: OUTPUT«Method 'nude' not found for invocant of class 'Num' in block <unit> at <tmp> line 1» | ||
BenGoldberg | m: pi.Rat.nude.perl.say | ||
camelia | rakudo-moar 589061: OUTPUT«(355, 113)» | ||
geekosaur | practically, it's a rational anyway | ||
TimToady | there's not a lot of point, since almost any calculations involving pi will degrade to Num quickly | 03:05 | |
BenGoldberg | m: say pi.Rat.Num - pi | ||
camelia | rakudo-moar 589061: OUTPUT«2.66764189404967e-07» | ||
TimToady | Rats are really only useful when doing addition/subtraction with limited denominators | ||
which is a lot of calculation, but not typically when you're multiplying by pi | |||
geekosaur | also iirc at one point the Rat implementation of pi was a hairier Rat, but that just made all Rat computations using it painful | 03:07 | |
(hairier but more precise) | |||
although the counterargument there is that if you're doing Rat math involving pi, you're already doing it wrong >.> | 03:09 | ||
or else need something more specific to whatever non-floating approximation you are using anyway | |||
BenGoldberg thinks he's got an idea... | |||
Would a method pi(Rat:U, $precision) make sense? | 03:10 | ||
03:20
khw left
|
|||
TimToady | I don't think we need to build a pi spigot into p6 | 03:20 | |
03:20
freezerburnv_ left
03:24
kaare_ joined
03:38
BrassLantern joined,
BrassLantern left
03:52
CIAvash joined
04:26
pierre_ joined
04:35
Cabanossi left
04:36
Cabanossi joined
04:48
skids left
04:56
holyghostoo joined,
holyghostoo left,
holyghostoo joined
05:16
obfusk_ joined,
holyghostoo left,
obfusk left
05:18
andrzejku joined
05:20
pierre_ left
05:30
pierre_ joined,
k1lldash9 joined
|
|||
k1lldash9 | curious, are there advantages to say vs print "this\n" ? | 05:33 | |
does it implicitly set carriage return and that is essentially it? that's all | |||
thanks! :) | |||
ahh, nevermind, I found the answer, sorry! ha | 05:35 | ||
05:35
pierre_ left
|
|||
andrzejku | hi | 05:35 | |
05:36
Tonik joined
05:37
k1lldash9 left
05:38
pierre_ joined
05:43
hwcomcn joined
05:47
hwcomcn left
05:50
pierre_ left
05:51
hwcomcn joined
05:52
hwcomcn left
05:53
hwcomcn joined,
hwcomcn left
05:54
hwcomcn joined,
hwcomcn left
05:55
hwcomcn joined
05:56
hwcomcn left,
pierre_ joined
05:57
hwcomcn joined,
hwcomcn left
05:58
hwcomcn joined
05:59
hwcomcn left
06:07
smls joined
|
|||
smls | m: say (1.1 .. 10.1).grep(3 < *.Int < 7) | 06:08 | |
camelia | rakudo-moar 589061: OUTPUT«===SORRY!===QAST::Block with cuid 1 has not appeared» | ||
smls | ^^ ? | 06:09 | |
06:12
itaipu joined
|
|||
TimToady | m: say (1.1 ... 10.1).grep(3 < * < 7) | 06:18 | |
camelia | rakudo-moar 589061: OUTPUT«(3.1 4.1 5.1 6.1)» | ||
TimToady | m: say (1.1 ... 10.1).grep(3 < * + 0 < 7) | 06:19 | |
camelia | rakudo-moar 589061: OUTPUT«===SORRY!===QAST::Block with cuid 1 has not appeared» | ||
TimToady | doesn't like WhateverCode there, I guess | ||
smls | So, Whatever can curry with chaining comparison ops but WhateverCode can't? | ||
TimToady | would seem not | ||
smls | will RT | 06:20 | |
TimToady: Btw, the reason I was asking why we don't have a .product to go along with .sum, is that the { [*] |$_ } is the thing that stands out the most as line noise in rosettacode.org/wiki/Sum_and_Produc...zle#Perl_6 | 06:22 | ||
06:24
ufobat joined
|
|||
ufobat | good morning :) | 06:27 | |
06:27
andrzejku left
06:37
itaipu left
06:39
labster left
06:44
mohae joined
06:47
mohae_ left
06:57
labster joined
07:12
holyghostoo joined
07:15
darutoko joined
07:17
andrzejku joined
07:25
pierre_ left
07:26
setty2 joined
07:29
firstdayonthejob joined
07:42
pierre_ joined
07:43
andrzejku left
07:48
wamba joined
|
|||
smls | TimToady: Your grammar-based solution to rosettacode.org/wiki/Amb#Perl_6 doesn't work anymore in the latest Rakudo... :( | 07:54 | |
It simply *stops* after reaching the end of the first branch, and doesn't backtrack, so it prints no solution. | 07:56 | ||
Strangely enough, it works if the <{...}> regex EVAL interpolations are replaced with the regex code they produce. | |||
Did something change about the <{...}> feature that would prevent backtracking over it? | |||
Here's the code with some cleanup and debug statements added, to show the problem: gist.github.com/smls/407f65d275810...2148f2312a | 08:00 | ||
08:14
spider-mario joined
08:35
stmuk joined
08:38
stmuk_ left,
stmuk_ joined
08:41
stmuk left
08:44
pecastro left
08:56
andrzejku joined
09:02
BenGoldberg left
09:06
RabidGravy joined
09:07
AlexDaniel left
09:16
obfusk joined,
obfusk_ left
09:21
TEttinger left
09:33
pmurias joined
09:35
margeas joined
|
|||
tbrowder | ufobat: good morning! | 09:35 | |
09:36
sergot joined
09:37
pecastro joined
09:40
stmuk joined
09:43
stmuk_ left,
margeas left,
margeas joined
09:47
MorayJ joined
09:58
pdcawley joined,
perl666 joined
09:59
pierre_ left
10:00
perl666 left
10:18
firstdayonthejob left
10:23
stmuk_ joined
10:25
pdcawley left
10:26
stmuk left
|
|||
dogbert17 silence reigns | 10:35 | ||
10:41
marcovorg joined,
margeas left
10:42
labster left
|
|||
dalek | c: eb847e3 | (Jan-Olof Hendig)++ | doc/Type/List.pod6: Added docs for List.antipairs |
10:43 | |
smls | Why is .antipairs needed if it does the same thing as .pairs.invert ? | 10:44 | |
timotimo | hoh, it is? | 10:47 | |
10:47
andrzejku left,
wamba left
|
|||
timotimo | m: { :1a, :2b, :3c, :4d }.antipairs.perl.say | 10:47 | |
camelia | rakudo-moar 589061: OUTPUT«(1 => "a", 4 => "d", 3 => "c", 2 => "b").Seq» | ||
timotimo | m: { :1a, :2b, :3c, :4d }.pairs.invert.perl.say | ||
camelia | rakudo-moar 589061: OUTPUT«(1 => "a", 4 => "d", 3 => "c", 2 => "b").Seq» | ||
dogbert17 | timotimo: there's something fishy here, there is an implementation of 'invert' in List.pm, but it soes not seem to work | 10:49 | |
m: say (1,2,3).invert # ?? | 10:50 | ||
camelia | rakudo-moar 589061: OUTPUT«Method 'value' not found for invocant of class 'Int' in block <unit> at <tmp> line 1» | ||
timotimo | um, that's quite weird | ||
to have .invert on list do what antipairs does on a hash, but only if the list is a list of pairs | |||
10:50
wamba joined
|
|||
dogbert17 | the code is a one-liner: self.map({ nqp::decont(.value) »=>» .key }).flat | 10:50 | |
timotimo | right | 10:51 | |
i find that ... weird | |||
also, why would it have »=>» there? unless there's more than one key per thing? | 10:52 | ||
dogbert17 | timotimo: it could be I guess, in other places invert drills down into lists | ||
docs.perl6.org/type/Map#method_invert | 10:53 | ||
I wonder if there is a :kv missing from List.invert | 10:54 | ||
smls | ah. | ||
timotimo | could be, yeah | ||
dogbert17 | where's lizmat when we need her :) | 10:56 | |
lizmat | I'm here | ||
.oO( you rang? ) |
|||
I'm not sure why we have List.invert either.... I don't think I touched it in any opt work | |||
dogbert17 | can you backlog ~15 lines please :) | 10:57 | |
lizmat | Hash.invert is *not* the same as Hash.antipairs | ||
dalek | osystem: 2373470 | RabidGravy++ | META.list: Add Doublephone See github.com/jonathanstowe/Doublephone |
||
dogbert17 | lizmat: agreed | 10:58 | |
RabidGravy | I'm back! | ||
dogbert17 | m: say (1,2,3).invert # ?? | ||
camelia | rakudo-moar 589061: OUTPUT«Method 'value' not found for invocant of class 'Int' in block <unit> at <tmp> line 1» | ||
lizmat | RabidGravy++ | ||
dogbert17: lemme check | |||
dogbert17 | o/ RabidGravy | ||
RabidGravy | (but schwern made me do that one) | ||
dogbert17 | have you managed to stop Brexit ? | ||
RabidGravy | working on it | 10:59 | |
lizmat | dogbert17: all I can say is that TimToady added/changed it early 2015 | ||
RabidGravy | HACKERS FOR EUROPE! | ||
timotimo | HACK THE CONTINENT!! | ||
dogbert17 | lizmat: maybe we'll have to wait for his comments on the matter then | 11:00 | |
lizmat is checking further | |||
11:01
rindolf joined
|
|||
dogbert17 | RabidGravy: have you tried your musicstreaming stuff lately. perhaps it works better/faster now thanks to all recent opts? | 11:01 | |
lizmat | feels to me that .invert on a List *is* the same as antipairs | ||
dogbert17 | lizmat: in which case it would be redundant | 11:02 | |
11:02
pierre_ joined
|
|||
lizmat | well, I guess we want to keep supplying it so you can call .invert on anyhing | 11:03 | |
dogbert17 | lizmat: in which case we have a bug :) | ||
lizmat | yeah | ||
m: dd 42.antipairs | |||
camelia | rakudo-moar 589061: OUTPUT«(42 => 0,).Seq» | ||
lizmat | m: dd 42.invert | ||
camelia | rakudo-moar 589061: OUTPUT«Use of uninitialized value of type Any in string contextAny of .^name, .perl, .gist, or .say can stringify undefined things, if needed. in block <unit> at <tmp> line 1Cannot resolve caller invert(Int); none of these signatures match: in block <u…» | ||
11:06
rpburkholder joined
|
|||
lizmat tries some patches | 11:06 | ||
dogbert17 | * oO | ||
lizmat hopes Apple will come out with a 32core MBP soon | 11:08 | ||
11:09
itaipu joined
|
|||
dogbert17 | guess Apple will have something new besides iPhones in September | 11:12 | |
lizmat | hmmmm I borked 2 spectests | 11:14 | |
dogbert17 | uh oh | 11:15 | |
smls | Having List.invert invert the pairs of a list of pairs, is not that different than other instances where Perl 6 treats lists of pairs specially... | 11:16 | |
lizmat | apparently you can only List.invert if the List contains pairs | ||
dogbert17: so In guess the right course of action would be to rakudobug it as a @LARRY bug | 11:18 | ||
11:19
stmuk joined
|
|||
dogbert17 | lizmat: so the bug is that it only handles list of pairs? | 11:20 | |
lizmat | well, I guess the bug is that the error is really LTA if the list does not consist of pairs *OR* it should call .pairs on itself first before inverting | 11:21 | |
(aka, be the same as .antipairs) | |||
11:21
stmuk_ left
|
|||
dogbert17 | so a mail to [email@hidden.address] with [BUG] and @LARRY then? | 11:22 | |
in the subject that is | 11:23 | ||
11:24
stmuk_ joined
11:26
stmuk left
|
|||
lizmat | dogbert17: yup | 11:33 | |
dogbert17: (sorry, was distracted) | |||
dogbert17 | lizmat: rt.perl.org/Public/Bug/Display.html?id=128860 | 11:36 | |
lizmat | dogbert17++ | 11:37 | |
dogbert17 | hooray, thx for the help | 11:38 | |
btw, what's the fastest way in Perl 6 to split a string into a list of single characters, comb? | 11:39 | ||
lizmat | yup, .comb | 11:40 | |
dogbert17 | lizmat: thx, I was working on a Project Euler problem and got the impression that comb is rather slow. Is it a target for opts in the future? | 11:41 | |
lizmat | I was just looking at it again | ||
dogbert17 | I'm specifically referring to the default case. i.e. "string".comb | 11:42 | |
MasterDuke | bench: releases .comb for ^100000 | 11:44 | |
11:44
pierre_ left
|
|||
benchable | MasterDuke: gist.github.com/ee0173e2863fb8b944...332eaefd62 | 11:45 | |
dogbert17 | MasterDuke: cool | 11:46 | |
MasterDuke | looks like it did get twice as fast between 2016.06 and 2016.07 | ||
dogbert17 | MasterDuke: indeed | ||
lizmat | yeah, but that was not because of changes to .comb itself | 11:47 | |
dogbert17 | I was working on projecteuler.net/problem=112 in case you're interested | ||
MasterDuke | github.com/rakudo/rakudo/commit/efbfdaa | 11:48 | |
that's where benchable found the difference | |||
dogbert17 | those bots are nifty | 11:49 | |
MasterDuke | projecteuler.net/problem=60 is what got me started committing to Rakudo | 11:51 | |
been stuck/working on that one for a long time now | |||
dogbert17 | That one I haven't solved :( | 11:52 | |
MasterDuke | it's why i wrote github.com/MasterDuke17/List-Combinations | 11:53 | |
because the core combinations() was too slow | 11:54 | ||
dogbert17 | nice, I actually managed to solve 112, and comb definitely played a part, but the code took like 6 minutes to run on my machine | 11:56 | |
replacing comb with some % and div trickery reduced the time to approx one minute | 11:57 | ||
MasterDuke | nice. my Perl 5 solution takes 6 seconds | 11:58 | |
using a 'split //' | 11:59 | ||
dogbert17 | yeah, there's still some work to be done although some other problems which I solved earlier in the year have become much faster thx mainly to lizmat++ and jnthn++ | ||
12:02
holyghostoo left
|
|||
MasterDuke | yep, no arguments there | 12:05 | |
moritz | m: say 300 / 6 | ||
camelia | rakudo-moar 589061: OUTPUT«50» | ||
moritz | that's decent. The factor used to be around 100 or 200 for common tasks | 12:06 | |
dogbert17 | moritz: speed is definitely improving | ||
12:06
itaipu left
12:09
kid51 joined
12:13
MorayJ left
12:18
smls_ joined,
smls left,
ufobat left
12:19
smls_ left
12:21
gnull left
12:25
canopus left
12:31
pierre_ joined
12:32
itaipu joined
12:33
aries_liuxueyang left,
canopus joined
12:34
MorayJ joined
12:35
cyphase left
12:39
itaipu left,
aries_liuxueyang joined
12:42
cyphase joined
12:45
MorayJ left,
stmuk joined
12:48
stmuk_ left
12:51
freezerburnv_ joined
13:00
freezerburnv_ left,
hcit joined
13:03
canopus left
13:07
kid51 left
13:10
canopus joined
13:11
kid51 joined
13:12
marcovorg is now known as marcorg
13:14
canopus left
13:21
canopus joined
13:31
freezerburnv_ joined
13:33
stmuk_ joined
13:35
canopus left,
stmuk left
|
|||
RabidGravy | boom! | 13:38 | |
13:41
canopus joined
|
|||
RabidGravy | I was thinking about that metaphone thing and unicode, seeing as metaphone (and soundex) are pretty useless for anything other than ascii words | 13:43 | |
is there a reliable way of knowing for a given character whether it is based on a latin character (in the rakudo implementation)? | 13:45 | ||
13:47
lucar joined
|
|||
lucar | Hi there | 13:47 | |
how does the perl6 repl compare with Common Lisp? | 13:48 | ||
does it support interactive coding ? | |||
DrForr | As far as I know, yeah. It lets you type in code, read it, eval's it and prints it, just like CL. | 13:49 | |
lucar | great | ||
arnsholt | The Perl 6 REPL isn't as functional as you'd get from something like SBCL | ||
lucar |