»ö« 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.
Geth doc: eda446c59b | (JJ Merelo)++ | .gitignore
Adds resource folder :see_no_evil:
07:04
doc: 0038c7f1ae | (JJ Merelo)++ | META6.json
Follows comma's advice
doc: d4be812b7c | (JJ Merelo)++ | Perl 6 docs.iml
Adds support for comma
antoniogamiz o/ 07:34
El_Che antoniogamiz: lo 07:35
Geth doc: antoniogamiz++ created pull request #2908:
Fixexternallinks, close #2836, close #2657
07:42
rfold antoniogamiz: see also bugzilla.mozilla.org/show_bug.cgi?id=668213 07:47
Seems to be due to an eight year old bug in Firefox.
antoniogamiz rfold: oh, I did not know that :oo 07:51
thanks!
rfold So it probably works fine already in Chromium. 07:58
antoniogamiz yep, it does 07:59
rfold If you set autofocus in onload, does it actually set focus though? Because autofocus only sets focus during loading AFAIK. 08:00
antoniogamiz ups, you're right. I should set focus instead
rfold You could set focus only if location.hash is missing or equal to '___top' I suppose. 08:02
er, '#___top'
antoniogamiz done :) 08:06
rfold Cool :)
Can't wait for this fix to be live, it's been bugging me so much.
antoniogamiz how do you manage the messages of your app? do you think make a logger class with different levels of debugging is recommendable? 08:08
I mean, I have different kinds of messages and sometimes some of them needs to be disabled 08:09
so I though that I have a class where several general methods to print those messages, I can disable them there 08:10
s/I have/to have
rfold My approach to logging has always been passing around a function that takes a log message. Then the callsite can wrap this function in another function that does additional processing, e.g. filtering or adding more information. 08:11
antoniogamiz mmm can you show me an example? 08:12
rfold If you don't like passing around arguments then you can use a &* variable.
Yeah sure.
Geth doc/master: 5 commits pushed by Antonio++, (Juan Julián Merelo Guervós)++ 08:16
rfold antoniogamiz: glot.io/snippets/fe8143bqqq this uses Str for messages but you could use something more elaborate like a message type that has a level and timestamp and metadata for example 08:18
If you have two loggers &foo and &bar you can combine them like this: sub foobar($msg) { foo($msg); bar($msg); }
This will log to both loggers, e.g. to stdout and to syslog.
antoniogamiz :oo 08:20
thanks a lot rfold!
rfold If you don't like passing it around you can do this: glot.io/snippets/fe817qemj7 and you could write functions like sub log that set the level for you, e.g. sub info, sub warning 08:21
antoniogamiz mmm I like that :) 08:23
rfold And these are useful: glot.io/snippets/fe819gresx . We use this approach at work and it's nice because the logger isn't global, thus the caller can easily customize the way that the callee logs things. (Although we use Haskell not Perl 6, but it should work just fine.)
antoniogamiz I like that even more :oooo 08:25
rfold Other possible combinators include: catch exceptions that occur during logging, make a logger thread-safe with channel or lock, logger that ignores all but the first message, logger that accepts numbers and adds them to a counter (we use this for progress reporting) 08:26
rfold And log message throttling is very useful for high volumes 08:28
antoniogamiz uoh, good 08:29
thanks a lot for your tips :) 08:30
kshannon Is there a way to re-dispatch to the current proto sub? I can't use nextwith as the arguments match a completely different set of multi candidates. 08:38
And while I'm on the subject of multi-dispatch, was there a rationale for making missing optional named arguments more specific than a candidate without the named argument? 08:40
I'm guessing it's probably just a consequence of the actual dispatch rules but I can't seem to find a good description of what those rules are on docs.perl6.org 08:42
antoniogamiz maybe you should raise an issue to clarify that part 08:44
antoniogamiz m: -> $msg, *%h { logger(func($msg, *%h)) } 08:59
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routines:
func used at line 1
h used at line 1
logger used at line 1
antoniogamiz mmm what's the error there?
m: -> $msg, *%h { logger(func($msg, %h)) } 09:02
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routines:
func used at line 1
logger used at line 1
antoniogamiz it was the * 09:03
rfold p6: my &transform := &infix:<o>; my &log = transform(&say, * + 1); log(4); 09:13
camelia 5
rfold Hmm, weird problem. 09:45
rfold p6: say “/usr/lib/llvm-6.0/bin:{%*ENV<PATH>}” 09:45
camelia /usr/lib/llvm-6.0/bin:/usr/bin:/bin:/usr/sbin:/sbin
rfold When I run this locally, I get: Use of Nil in string context in sub build at 09:46
Without curly braces however, it works fine.
p6: say “/usr/lib/llvm-6.0/bin:%*ENV<PATH>” 09:55
camelia /usr/lib/llvm-6.0/bin:/usr/bin:/bin:/usr/sbin:/sbin
antoniogamiz jnthn: good work with Log::Timeline 11:06
jnthn antoniogamiz: Ah, you're making use of it? :) 11:11
antoniogamiz I was implement a better logger for Perl6::Documentable but JJ told me to use yours instead 11:12
and I liked the idea :)
there's good use examples at Cro::HTTP
rfold p6: run <<echo {4e9}>> 11:19
camelia 4000000000
rfold Hmm, I also get the "Use of Nil in string context" warning here. Maybe I need to update Rakudo.
rfold p6: sub f { run <<echo {4e9}>> }; f 11:24
camelia 4000000000
rfold p6: sub f(--> Nil) { run <<echo {4e9}>> }; f 11:25
camelia Use of Nil in string context

in sub f at <tmp> line 1
rfold Ah, it goes wrong when used inside a routine that specifies Nil as return value.
p6: sub f(--> Nil:U) { run <<echo {4e9}>> }; f 11:29
camelia 4000000000
Type check failed for return value; expected Nil:U but got Proc (Proc.new(in => IO::Pipe, ...)
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1
rfold p6: sub f(--> Nil:U) { run <<echo {4e9}>>; Nil }; f
camelia 4000000000
rfold p6: sub f(--> 42) { run <<echo {4e9}>>; 42 }; f
camelia WARNINGS for <tmp>:
42
Useless use of constant integer 42 in sink context (line 1)
rfold p6: sub f(--> 42) { run <<echo {4e9}>> }; f 11:30
camelia 42
rfold So interpolated blocks always evaluate to the return value if the return value is specified in the signature of the enclosing routine.
antoniogamiz mm I have a file called use Perl6::Documentable::LogTimelineSchema;inside the dir Perl6/Documentable/ 11:36
s/use/''
I should a gist one moment
antoniogamiz gist.github.com/antoniogamiz/cbb93...871434e4e2 11:41
antoniogamiz jnthn: can you take a look into that? I have tried to do the same as in Cro::HTTP but there's something wrong :( 11:42
aahh if it's a task I must pass a function or a pointy block 11:45
jnthn antoniogamiz: Yes, for a task you should either pass a block of code to execute, which determines the duration of the task, *or* you can use `.start` and then call `.end` on the object you get back if you have a more complex situation (for example, the start and end are in completely different bits of the code) 12:27
I hope the Log::Timeline README covers this reasonably well, but if not, please feel free to PR what you wish it had said :) 12:28
antoniogamiz ok, thanks for the help :) 12:29
rfold p6: sub postfix:<!> { [*] 2 .. $^a }; sub postfix:<$> { [**] $^a! xx $^a }; say 3$ 12:31
camelia 26591197721532267796824894043879185949053422002699243006604327894970735598738829091213422929061755830324406828265067234256016357755902793896426126110930203989303477744606138944253796008746621478842290221338538191929054279157507592749529351093190203622…
rfold p6: sub postfix:<!> { [*] 2 .. $^a }; sub postfix:<$> { [**] $^a! xx $^a }; say 3$.chars 12:35
camelia 36306
rfold Wowie that's a big number. 1$ = 1, 2$ = 4 and 4$ overflows. :D
tyil . 14:22
timotimo: I see messages arriving at the Discord side 14:23
timotimo those two you just wrote arrived there
the one before that was from 2019-07-07
tyil ah
timotimo oh, you did kick it, very good
tyil now that I have moved to my desktop, I can check your user out while I'm at it :D 14:24
Geth doc: 3ee315710d | Coke++ | template/footer.html
whitespace
14:38
antoniogamiz do you use write the documentation just above the method or in the README.md for instance? 15:12
s/use/usually
sena_kun writes markdown docs, but will be happy to do inline documenting if there'd be a simple to follow manual on how to 15:15
antoniogamiz using #| maybe? 15:16
sena_kun well, technically yes, but... 15:16
antoniogamiz in what way do you write the docs in markdown? do you mind to send a link? :)
sena_kun e.g. github.com/croservices/cro/blob/ma...-zeromq.md 15:18
antoniogamiz oh, ty :) 15:19
sena_kun the best thing is when there is at least some docs available. if they describe actual state of thing this is awesome. if they more or less describe what the code does (not how, but what the API is and how to use it), it is joy.
antoniogamiz I will try to do that! I want everyone understand how perl6 doc is generated 15:20
sena_kun antoniogamiz++ # if there will be an understanding of how docs are generated, woo-hoo, one can start to write something dynamic 15:21
antoniogamiz JJ and I want to make a dynamic site using cro instead of mojo 15:22
and I think we will use punycode to solve all the problems with urls
Geth doc: 02267c21ca | (JJ Merelo)++ | .travis.yml
Disables binary environment from matrix, refs #2859
16:05
vrurg Isn't 'use Module:ver<0.2>' supposed to load v0.2 and higher only even if v0.1 is available too? 16:59
ugexe no, only 0.2 17:01
vrurg It loads 0.1 for me.
ugexe then its in a repository before the repository containing 0.2
vrurg use lib <v0.2 v0.1 lib>; 17:02
ugexe then again it still shouldnt load 0.1
it would just choose 0.1 if you did `use Module` rather
vrurg And still, if its use Module:v<0.2+> it should fail even if it finds 0.1
ugexe m: use Test:ver<6.e> 17:03
camelia ===SORRY!===
Could not find Test:ver<6.e> at line 1 in:
inst#/home/camelia/.perl6
inst#/home/camelia/rakudo-m-inst-1/share/perl6/site
inst#/home/camelia/rakudo-m-inst-1/share/perl6/vendor
inst#/home/camelia/rakudo-m-inst-1/sh…
ugexe m: use Test:ver<6.d>
camelia ( no output )
ugexe i can only guess you have something setup incorrectly
vrurg Perhaps, but... I can upload a .tgz somewhere. 17:04
ugexe: Could you, please, try it: nextcloud.lflat.org/index.php/s/bZsPBdtzsyK5ejz 17:06
ugexe none of those have a meta6.json script. they arent versioned at all
s/script// 17:07
vrurg Aha... I thought it'd fetch it from unit. 17:07
ugexe nope. that itself would require running code 17:08
Foo:ver(for 1..Inf { say 42 })
so we wouldnt be able to create a dependency graph without running code
vrurg ugexe: Ok, thanks. 17:09
ugexe instead if you want to write the version in the unit you do `unit module Foo:ver($*DISTRIBUTION.meta<version>)`
cpan-p6 New module released to CPAN! App::MoarVM::ConfprogCompiler (0.0.7) by 03TIMOTIMO 17:10
vrurg ugexe: Dynamic variable $*DISTRIBUTION not found 17:12
But, anyway, it doesn't matter.
ugexe it was added in one of the last few releases 17:13
i guess it'll also say that if you didn't load the code as a module 17:14
antoniogamiz34 any idea to solve this? => expected Positional[Array] but got Array ($[]) 17:27
ugexe m: sub foo(Str @arr) { }; my @a; foo(@a) 17:28
camelia Type check failed in binding to parameter '@arr'; expected Positional[Str] but got Array ($[])
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
ugexe m: sub foo(Str @arr) { }; my Str @a; foo(@a)
camelia ( no output ) 17:28
ugexe use the correct type
antoniogamiz34 oh thanks :D 17:29
vrurg ugexe: Here is what I needed the versioning for: github.com/perl6/problem-solving/issues/71 17:35
ugexe i'm not sure you can avoid those problems of multiple versions without having a good understanding of your dependencies (something a developer *should* have anyway if you ask me) 17:36
another thing users have to understand is how multiple versions are going to work when *something* does e.g. `sub foo(MultiVerClass $foo) { $foo.blorg }` 17:38
vrurg ugexe: Put yourself in a situation when your project needs two external modules, both using different versions of another common module. You can do nothing about it. The only option is to rewrite one of those on your own.... 17:40
ugexe a perfect reason for providing the auth mechanism even 17:41
vrurg How is it supposed to work? Any link for a paper/discussion? 17:41
ugexe but to rebuttal -- someone made poor choses for the project
just because a module exists and does something you want is not a valid reason to use it 17:42
it must also be e.g. secure
in other words: im of the opinion the user is the only one who can get themselves out of that problem period 17:43
timotimo i wonder if we'll ever have something comparable to html's Subresource Integrity, or how you used to import stuff from .net in niecza, with a hash in the identity; i think that was perhaps for a pubkey? or maybe a hash of the code or something?
vrurg ugexe: I can think of a couple of possible scenarios ending up with this very problem. And, yet, do you see a solution for CORE?
ugexe nope. i don't really view core the same way I do modules though 17:43
i admit for CORE it might be solvable. i dont think that is the general case for modules though. 17:44
vrurg ugexe: I consider the problem in its complexity. I tried to make QuantHash iterable and ended up with complete hell of different class implementations.
ugexe: I think it makes sense to express your thoughts in the ticket. Any thoughts are gonna be useful. 17:45
ugexe maybe when i get off work, if im feeling frisky. then again my a/c is broke and its 95 degrees at home so... 17:46
timotimo oh lord 17:48
that's terrible
vrurg ugexe: oh my... We've spent 3 weeks with a broken AC last May, it was just 85.
ugexe its 130 degrees in my attic where some component of the a/c is so they have to wait for a morning time slot to fix it :( 17:49
vrurg And wish you not to get an AC technician which would come Friday eventing saying "oh, I forgot I ran out of acetylen"... 17:50
ugexe no they just came out tuesday to fix it, only to tell me oh i cant do it till later cause its too hot 17:50
El_Che you guys have AC :) 17:52
a heatwave is expected next week here
ugexe You probably have a heater 17:53
It doesn't get cold enough for a heater here. but a/c is basically required 17:54
vrurg ugexe: don't know where you located, but even in South Florida we switch AC to heating for 2-3 months a year. Anything below 72 home is too cold for me. :) 17:57
ugexe i used to live in south florida -- WPB 17:58
and yeah i'd occasionally turn the heater on
now i'm in texas
vrurg So, you say it is warmer over there? BTW, I'm in WPB currently. ;) 18:01
ugexe Yeah its hotter here. Where you working at in WPB? 18:03
ugexe I used to live by the lamborgini dealership on Okeechobee 18:04
vrurg Boca Raton. Actually, I'm telecommuting, almost never leave home.
ugexe Ah, boca was too rich for my blood back then 18:05
and too old
vrurg West Boca isn't that expensive. In either case, for less rent we've got 2 times better house than we had in Miami. 18:06
vrurg hates Miami.
ugexe go as far east as possible in the U.S. and you're bound to find... West Palm Beach 18:07
JappleAck hi. how do i disable buffering of $*IN ? 18:09
ugexe m: say $*IN.^methods.map(*.Str).contains("buffer") 18:10
camelia Submethod object coerced to string (please use .gist or .perl to do that)
True
in block <unit> at <tmp> line 1
Method object coerced to string (please use .gist or .perl to do that)
in block <unit> at <tmp> line 1
Method object coerced t…
ugexe bah
m: say $*IN.^methods.map(*.^name).contains("buffer")
camelia False
ugexe damnit
ugexe m: say $*IN.^methods.map(*.^name).grep(*.contains("buffer")) 18:10
camelia ()
ugexe m: $*IN.out-buffer(1); # I would guess this
camelia Too many positionals passed; expected 1 argument but got 2
in block <unit> at <tmp> line 1
ugexe obviously im wrong
JappleAck yeah, that's only i found by "buffer" word 18:11
ugexe well, maybe its $*IN.out-buffer = 1
m: $*IN.out-buffer = 1
camelia ( no output )
JappleAck it's a "method" as i see in the docs, not "property", but i'll try it 18:12
doesn't help
ugexe its an rw method that returns a proxy 18:13
vrurg m: say $*IN.^methods.map(*.name).contains("buffer") 18:14
camelia True
vrurg m: say $*IN.^methods.map(*.^name).grep: *.contains("buffer")
camelia ()
vrurg m: say $*IN.^methods.map(*.name).grep: *.contains("buffer")
camelia (out-buffer)
ugexe .open(:out-buffer(1)) works for filehandles at least 18:15
vrurg ugexe: over-use of .^name always plays this trick with a Method object. ;)
ugexe are you sure you don't want $*OUT.out-buffer = 1 ? 18:16
$*IN.open(:out-buffer(1)) might be worth trying 18:17
Xliff vrurg: What constitutes overuse of .^name? 18:19
vrurg Xliff: In my case it's a lot of introspection while debugging. 18:20
JappleAck i tried this: `my \IN = $*IN.open: :1out-buffer;` but when i do `IN.readchars(1).say` it reads only when i press enter 18:21
ugexe wouldn't it have to wait to press enter so it knows it can try to encode the string? 18:22
vrurg JappleAck: you probably need getc method 18:27
ugexe still requires an Enter press 18:28
Geth doc: e93988ac2b | Antonio++ (committed using GitHub Web editor) | template/header.html
Update header.html
JappleAck is there any equivalent of $| from perl5? 18:30
vrurg JappleAck: Term::termios is what you need. 18:31
JappleAck: waiting for enter is not about Perl6 buffering, it's how terminal works.
In perl5 read STDIN, $c, 1 would do the same for you: wait for enter, then get 1 char. 18:33
JappleAck i found a way to run `/bin/stty raw` first 18:41
but i don't know how to change it back to default value 18:43
vrurg termios is better because it doesn't use external processes.
stty sane must work.
Raylier Hello people haven't checked here in a while 19:46
timotimo ohai 19:47
do you happen to be raydiak? 19:49
Raylier Rayler, Ray, euler are some of the names I've used. Not RAydiak though 19:55
timotimo oh, ok 19:59
welcome back in any case :) 20:00
noisegul Welcome back
MasterDuke thundergnat: there was a recent example where 90% of the time was spent in stringifying a big Int. since you did so much with stringifying (Fat)Rats, you might be able to evaluate this and see if it could help code.activestate.com/lists/tcl-core/13692/ 20:14
discord6 <Tyler (Aearnus)> dumb question, but I can't for the life of me figure out what : does when you're calling a subroutine 20:17
MasterDuke a : where? 20:18
TreyHarris Tyler (Aernus): I'm pretty sure you mean cases like `say (1,[1,2],"foo",Mu).map: so *.say ;` in Mu's docs? 20:23
That means you're calling a method like it was a subroutine
It's often used for its precedence more than for its actual functionality; in the case of map, for instance, using a colon lets you skip the parentheses, which would be annoying otherwise), so for instance, the above could be written `say (1,[1,2],"foo",Mu).map(so *.say,)` 20:29
m: say (1,[1,2],"foo",Mu).map: so *.say ; 20:30
camelia 1
[1 2]
foo
(Mu)
(True True True True)
TreyHarris m: say (1,[1,2],"foo",Mu).map(so *.say,)
camelia 1
[1 2]
foo
(Mu)
(True True True True)
masak timotimo: two reactions: "ugh, I should totally be blogging more", and "wow, webrings are still a thing?" :) 20:31
timotimo we're making them a thing again! 20:32
TreyHarris @Tyler (Aearnus): The precedence thing, if it wasn't clear, is a bit like Haskell's $, if you're familiar with it. Or "and" and "or" vs "&&" and "||" -- you can say "complex stuff or die sprintf(...)" where "complex stuff || die sprintf(...)" would do something strange 20:34
noisegul Can somebody help me determine a return type? A method is supposed to return an Array of objects, calling `.^name` and `.first.^name` print what's expected, but looping over the result and accessing objects won't work, neither does appending to an Array of the same type the result is supposed to be. Commented example here: gist.github.com/noisegul/b049fd382...55b104f99d 20:45
timotimo noisegul: looks like the array returned by registry.lookup is in a container 20:46
and that makes the for loop only do a single iteration, which passes the whole thing into $r
noisegul I see, that's why the second for loop example works, but not the first 20:48
TreyHarris noisegul: It's almost the definition of the difference between the $ and @ sigils 20:49
timotimo either put a .list at the end before the -> $r or make lookup return something non-containerized
noisegul I see, what would the return type annotation for .lookup be in that case? Or does that still fall under `Array[TYPE]`? 20:51
timotimo it does
noisegul Alright, makes sense, thanks for the clarification! :) 20:52
TreyHarris Where is .lookup defined, anyway?
noisegul It's from a different module 20:53
TreyHarris noisegul: which, though? I'm having trouble finding it working from github.com/antoniogamiz/Perl6-Documentable 20:54
noisegul TreyHarris: Hmm should be here I suppose: github.com/antoniogamiz/Perl6-Docu...y.pm6#L101 20:56
discord6 <Tyler (Aearnus)> thanks TreyHarris!!! makes a lot of sense now 21:06