»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋
Set by Zoffix on 25 July 2018.
ingy timotimo: now p5 tests run in 0.8s instead of 4s 00:56
I just replaced Test::Builder. No idea what the heck it was doing... 00:57
but it didn't work right on super old perls so I just wrote the tap stuff by hand
dduncan I’m starting to get into Perl 6 again after several years’ away from paying much close attention. I’m trying to understand the Mix type. While I know its a generalization of Bag to support real-number weights, I’m unclear on some other things. I found docs.perl6.org to not answer my questions. The primary question is whether it supports negative weights (which Set and Bag do not). If it does, then I assume Mix supports 03:48
generalizations of all the operators applicable to Bag, but in that case I wonder how some of them apply to negative weights. For example, what is the generalized definition of Mix union and intersection? With Bag it is the max/min of the 2 weights, but with Mix does that generalize to the most positive/negative of the 2 weights or the furthest/nearest to zero of the two or something else? While intersection of negatives producing a
number with the greater absolute value may seem non-intuitive, maybe it is the most correct and consistent. Also I would wonder the semantics of membership when negative weights are supported. Thank you.
dduncan The Mix definition I saw said the weight is “a non-zero real number” but the various operators didn’t really explain the consequences of this for negative weights. 03:52
dduncan On the other hand, while having documentation is nice, since Rakudo is relatively mature now, I will simply see what its actual behavior is and go by that for my answers. 03:57
Maybe its just me, but there doesn’t seem to be any clear way to find the public version control for Rakudo et al by way of perl6.org. When I go to perl6.org/downloads/ the section on installing from source points to rakudo.org/how-to-get-rakudo/ and that points to tarballs with the source, but no repositories. I know its on Github for example but there’s no mention of these on either site that I could easily find. 04:17
is in contrast to many open source projects where a Github-or-other-repo url is easy to find.
[Coke] dduncan: can you add an issue to github.com/perl6/user-experience/issues ? 04:21
dduncan ok, I’ll look into that
dduncan Okay I turned that into this: github.com/perl6/user-experience/issues/30 04:45
[Coke] Thanks! 04:50
lookatme_q o/ 05:01
quester releaseable6: status 06:30
releasable6 quester, Next release will happen when it's ready. 0 blockers. 480 out of 489 commits logged
quester, Details: gist.github.com/fb1d60461fe48aa631...c4775c1f5d
El_Che moning p6 06:43
lookatme_q El_Che, morning 06:49
pmurias m: say 1e+34.Int 10:34
camelia 9999999999999999455752309870428160
pmurias ^^ this doesn't seem a very desirable result
hmm, or is it? because that number is actually shorter then a pretty one with a lot of 0's 10:36
jnthn It's becasue a literal with e in it is a Num, and so its precision is constrained to that of a floating point number 10:41
So I suspect that's the closest representable number
m: say 10 ** 34 10:42
camelia 10000000000000000000000000000000000
pmurias jnthn: it's the same Num 10:47
jnthn: the question is that there are multiple possible results that nqp::fromnum_I could give for a given number
s/question/problem/ 10:48
jnthn: and which one should we choose
m: say 1e+34.Str 10:49
camelia 1e+34
AlexDaniel What's the choice?
pmurias AlexDaniel: all the values that are represented by 1e+34 10:50
JavaScript throws an exception and refuses to do the conversion
The number 1e+34 is not a safe integer and thus cannot be converted to a BigInt 10:51
AlexDaniel if someone is using Nums then the Num itself is likely not accurate anyway, throwing an exception sounds a bit annoying 10:52
pmurias in js people use doubles as integers a lot 10:58
pmurias AlexDaniel: when stringifying numbers we use the shortest representation 11:09
buggable New CPAN upload: Trait-Env-0.3.0.tar.gz by SCIMON modules.perl6.org/dist/Trait::Env:cpan:SCIMON 11:52
New CPAN upload: Trait-Env-0.3.1.tar.gz by SCIMON modules.perl6.org/dist/Trait::Env:cpan:SCIMON
Mochi101 I have a bit of a problem. 12:37
Maybe someone can help me with it. 12:38
MasterDuke Mochi101: perl 6 related? 12:43
jast Mochi101 left five minutes ago 12:44
not very patient ;)
MasterDuke oh ha, time flies...
jast that it does 12:45
Mochi101 good day all 13:57
sena_kun o/ 14:01
MasterDuke .ask Mochi101 do you have a perl 6 question?
yoleaux MasterDuke: I'll pass your message to Mochi101.
Ven` m: grammar A { rule TOP { <section> }; proto regex section { <sym> \= * }; } 14:35
camelia 5===SORRY!5=== Error while compiling <tmp>
Can only use <sym> token in a proto regex
at <tmp>:1
------> 3 <section> }; proto regex section { <sym7⏏5> \= * }; }
Ven` I'd argue the error message is a bit LTA :P
Ven` I, for sure, am inside of a proto regex..:) 14:35
uzl Hello all! 15:24
So I've been working in my first module ever and I'm not sure if I'm using Perl 6's best practices. Hopefully, somebody can take a look at it and provide me with suggestions/advice. 15:26
P6 module: gitlab.com/uzluisf/enigma
The module is somewhat of a P6 port of this Python library: bitbucket.org/bgneal/enigma/
I'm also writing this post (uzluisf.gitlab.io/posts/perl6-oop-...oduction/) and would like some proofreading. 15:29
I'll be back later.
Geth doc: 5984a29832 | (JJ Merelo)++ | doc/Type/IO/Spec/Win32.pod6
Some reflow and rephrasing related to #2277
16:24
doc: 38fcd6c52f | (JJ Merelo)++ | doc/Type/IO/Spec/Unix.pod6
Revises and clarifies examples refs #2277
synopsebot Link: doc.perl6.org/type/IO::Spec::Win32
Link: doc.perl6.org/type/IO::Spec::Unix
doc: e0917e83ec | (JJ Merelo)++ | 2 files
Eliminates comments and adds an example

The behavior of join and catpath is very similar, but it's described in the same way it's implemented, so this is more a comment on the implementation than on the documentation itself. Refs #2277
MasterDuke .tell uzl "We’ll build from the most simple category, the assignment category to the most general one, the course category.", there should probably be some sort of punctuation after "assignment category" 16:28
yoleaux MasterDuke: I'll pass your message to uzl.
MasterDuke .tell uzl "not zeroth" should be "no zeroth" 16:30
yoleaux MasterDuke: I'll pass your message to uzl.
MasterDuke .tell uzl your `class Assignment {` code example has some weird indentation for the comments 16:31
yoleaux MasterDuke: I'll pass your message to uzl.
MasterDuke .tell uzl the bullets have a different font size in the Assignment Class paragraph vs the Student Class paragraph 16:35
yoleaux MasterDuke: I'll pass your message to uzl.
MasterDuke .tell uzl "a add-assignment method" should be "an add-assignment method" 16:36
yoleaux MasterDuke: I'll pass your message to uzl.
MasterDuke .tell uzl "but can we can" has an extra 'can', should be "but we can" 16:37
yoleaux ...
MasterDuke huh, haven't seen yoleaux do that before 16:38
yoleaux: help
El_Che .tell MasterDuke did you break yoleaux? 16:39
yoleaux El_Che: I'll pass your message to MasterDuke.
El_Che seems to be working
MasterDuke yeah, not sure what happened
yoleaux 16:39Z <El_Che> MasterDuke: did you break yoleaux?
El_Che buffer overflow :)
robertle perhaps the quotes?
El_Che .tell MasterDuke "but can we can" has an extra 'can', should be "but we can" 16:40
yoleaux El_Che: I'll pass your message to MasterDuke.
El_Che nope
MasterDuke . 16:41
yoleaux 16:40Z <El_Che> MasterDuke: "but can we can" has an extra 'can', should be "but we can"
MasterDuke dpk: is there a limit to the number of messages one can .tell yoleaux? 16:51
dpk well, the server it’s running on has 24 GB of memory ... ;-) 17:18
Ven` is class :: { has Typed @.array; } supposed to work? 17:20
my very small tests seem to indicate that yes, but my program doesn't accept it. 17:21
Type check failed in assignment to @!function; expected AST::Fn but got List ($(AST::Fn.new(name =>...) 17:23
Not sure what goes wrong and getting a smaller version of the program hides the bug :\
tyil Ven`: you can use `has Str @.array` for instance, which requires all elements in the array to be Str 17:26
Ven` yeah, that's what I'm doing (`has AST::Fn @.function`)
MasterDuke Ven`: that looks sort of like what you 17:27
MasterDuke 're assigning to it is a List that happens to contain AST::Fns 17:28
Ven` well, even Array[AST::Fn].new(...) fails.
MasterDuke dpk: it doesn't seem to be accepting new .tells from me 17:28
Ven` oh, I think I figured it out.
m: class A { has Int @.xs; }; my %vals = xs => (1, 2, 3); A.new(xs => (1, 2, 3)); say "I survived!"; A.new(|%vals); 17:29
camelia I survived!
Type check failed in assignment to @!xs; expected Int but got List ($(1, 2, 3))
in block <unit> at <tmp> line 1
Ven` sounds like a Rakudo bug 17:30
*or* I don't get how | works :)
tyil m: class A { has Int @.xs; }; my %vals = xs => (1, 2, 3); A.new(xs => (1, 2, 3)); say "I survived!"; A.new(:%vals); 17:33
camelia I survived!
Ven` tyil: you're just passing ignored arguments 17:34
tyil but it doesnt fail :D 17:35
Ven` fair enough
dpk MasterDuke: try sending one to me now? 17:35
.to MasterDuke test
yoleaux dpk: I'll pass your message to MasterDuke.
tyil I think youre looking forthis
m: class A { has Int @.xs; }; my %vals = xs => (1, 2, 3); A.new(xs => (1, 2, 3)); say "I survived!"; A.new(xs => |%vals<xs>)
camelia I survived!
Ven` no, I'm not 17:37
tyil m: class A { has Int @.xs; }; my %vals = xs => (1, 2, 3); A.new(xs => (1, 2, 3)); say "I survived!"; my $a = A.new(xs => |%vals<xs>); dd $a.xs;
camelia I survived!
Array[Int] @!xs = Array[Int].new(1, 2, 3)
Ven` at this point the | is not useful. I want something that has dynamic keys
tyil hmm
Ven` yeah it just adds a level of wrapping [] on top, it's completly broken. I have to list the keys 17:50
MasterDuke dpk: i got that message, but yoleaux isn't replying saying "i'll pass your message..." when i try to .tell someone else (in a priv message to yoleax)
Ven` m: class A { has Int @.xs; }; my %vals = xs => (1, 2, 3); say A.new(|%vals).perl;
camelia Type check failed in assignment to @!xs; expected Int but got List ($(1, 2, 3))
in block <unit> at <tmp> line 1
Ven` m: class A { has @.xs; }; my %vals = xs => (1, 2, 3); say A.new(|%vals).perl;
camelia A.new(xs => [(1, 2, 3),])
Ven` note the double wrapping...
MasterDuke m: class A { has Int @.xs; }; my %vals = xs => 1, 2, 3; dd A.new(xs => (1, 2, 3)).xs; dd A.new(|%vals).xs; 17:52
camelia Array[Int] @!xs = Array[Int].new(1, 2, 3)
Array[Int] @!xs = Array[Int].new(1)
Ven` ah, it's probably because in my grammar I have <foo>+ and so $<foo>>>.made is actually itemized for some reason 17:53
MasterDuke m: class A { has Int @.xs; }; my %vals := xs => (1, 2, 3); dd A.new(xs => (1, 2, 3)).xs; dd A.new(|%vals).xs;
camelia Array[Int] @!xs = Array[Int].new(1, 2, 3)
Array[Int] @!xs = Array[Int].new(1, 2, 3)
Ven` jjkkjkjkjkjkjkjkkjkjkjkjkkj;set ft=perl 17:57
wooooops
>>
well, I added a `%foo{$_} := %foo{$_} for <key1 key2 xs>` to fix that bug. Thanks MasterDuke 18:06
masak Ven`: you use the hjlk keys too much in vim. ;) 20:08
tejr masak: and have a lot of trouble picking a line 20:40
lichtkind is there a way to breakup class into several files? 21:19
timotimo you can use roles for that purpose 21:24
jnthn Short answer: no. Long answer: if the class can be decomposed into various roles, put those in files and compose them into the class. Technically you could have a chain of files using each other and doing `augment`...but don't.
jnthn If a class is so incohesive that there's not value in having it all in the same place, it may also be a sign of poor design. 21:25
lichtkind jnthn thanks and extra thanks for looking into my ticked 21:27
jnthn, normally i would be of same opinion but its purpose of this module to give you all the base you need to deal with matrices so its gets very big, any attemt to outsoure some functionality so far failed due lack of acess to private attributes 21:29
timotimo, yes i have to look more into roles 21:30
timotimo, roles have access to private attributes of the class they mixed in?
timotimo that is correct
lichtkind thanks that would work than 21:31
great
buggable New CPAN upload: Sparrowdo-VSTS-YAML-Cordova-0.0.9.tar.gz by MELEZHIK modules.perl6.org/dist/Sparrowdo::V...n:MELEZHIK 22:12
Herby_ \o 23:01
benjikun o/ 23:04
lizmat And another Perl 6 Weekly hits the Net: p6weekly.wordpress.com/2018/08/27/...kilfenora/ 23:21