»ö« 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.
Xliff m: $_ = 1; when 1 | 2 { say 'A'; } 00:06
camelia A
Xliff m: my enum blah <aa bb cc>; $_ = blah(1); when aa | bb { say 'A'; } 00:07
camelia A
Xliff m: my enum blah <aa bb cc>; $_ = blah(3); when aa | bb { say 'A'; }
camelia ( no output )
sena_kun Xliff, ping? 00:10
Xliff Yes?
sena_kun can you please check advent site? is 12th day shows up? 00:11
Xliff Yes.
It's up.
sena_kun \o/ 00:12
Xliff "Day 12 – Building a flexible grammar"
sena_kun now I need to get some sleep...
yes, I guess that's what it should be. the article was posted in drafts, so I was kinda forced to fix markup & publish. I hope I did everything okay. :S 00:13
Xliff One issue. 00:15
Xliff I don't know if it can be solved. 00:15
It's fine as is, but it looks like the intention of the original author was to have some words in BOLD in the code markup.
sena_kun well, you either have syntax highlighting or bold, I think. 00:16
Xliff Yes. 00:17
El Gato Negro 1 Gato Street, South Texas *Bueno*
Victor Mancho 3 Mancho Street, New York City *Malo*
*Bueno* and *Malo* should be bold, IIRC
sena_kun let me check it...
Xliff If it can't be bold, I think it still works, though. 00:18
sena_kun updated to have bold text. 00:19
I wish people would discuss such things beforehand. :S anyway, I'm going to bed already. I hope I won't be fired for this. :) 00:20
Xliff Why was the rotor method named that way? 01:54
My zen question for the day.
uzl .seen jmerelo 03:15
yoleaux I saw jmerelo 11 Dec 2018 19:58Z in #perl6: <jmerelo> lizmat, lucasb please do that.
Xliff What's the best way to see the signatures for a given method? 03:23
uzl .tell jmerelo Hi, JJ! I just saw your note for scheduling. I think my article is ready. However, if someone could look at it before posting it would be great.
yoleaux uzl: I'll pass your message to jmerelo.
uzl .tell jmerelo I already have the wordpress username but I'd appreciate if someone with more experience 03:24
yoleaux uzl: I'll pass your message to jmerelo.
uzl could do the posting. Or at least walk me through it.
.tell jmerelo BTW I was debating on changing the article's title since it might give the wrong impression. I'm fine with it but if you've a better title I'd go with it.
yoleaux uzl: I'll pass your message to jmerelo.
uzl .tell jmerelo Article: gist.github.com/uzluisf/268a95ffec...254a3971d1
yoleaux uzl: I'll pass your message to jmerelo.
uzl Hello, I'm looking for someone to proofread my article( gist.github.com/uzluisf/268a95ffec...254a3971d1 ). Any correction/suggestion is welcome. I'll probably be back tomorrow! 03:28
Xliff .tell uzl In your first example, the second comparison has a comment that should read "True, 220 and 284 are though." -- you had "28" rather than "284". 04:07
yoleaux Xliff: I'll pass your message to uzl.
nelsonhb Hiranyagarbha (the cosmic egg).He is more prominently mentioned in the post-Vedic Hindu epics and the mythologies in the Puranas. In the epics, he is conflated with Purusha. 04:30
Xliff source: NativeCall::Types 04:52
holyghost bron == source :-) 05:02
nelsonhb The succession of these flame emperors, from Shennong, the first Yan Emperor, until the time of the last Yan Emperor's defeat by the Yellow 05:04
Emperor, may have been some 500 years.
jmerelo Today, MorayJ tells us how to build a flexible grammar perl6advent.wordpress.com/2018/12/...e-grammar/ 06:26
yoleaux 03:23Z <uzl> jmerelo: Hi, JJ! I just saw your note for scheduling. I think my article is ready. However, if someone could look at it before posting it would be great.
03:24Z <uzl> jmerelo: I already have the wordpress username but I'd appreciate if someone with more experience
03:24Z <uzl> jmerelo: BTW I was debating on changing the article's title since it might give the wrong impression. I'm fine with it but if you've a better title I'd go with it.
03:24Z <uzl> jmerelo: Article: gist.github.com/uzluisf/268a95ffec...254a3971d1
jmerelo .tell uzluisf It's mostly OK, but did you read the comments by Xliff? The title is OK. I might have used something like "Calling numbers names" "Or numbers by any other name" or something like that, but it's OK. 06:28
yoleaux jmerelo: I'll pass your message to uzluisf.
jmerelo .tell uzl (just in case) It's mostly OK, but did you read the comments by Xliff? The title is OK. I might have used something like "Calling numbers names" "Or numbers by any other name" or something like that, but it's OK.
yoleaux jmerelo: I'll pass your message to uzl.
Geth doc: d49329e9c3 | (JJ Merelo)++ | doc/Type/Signature.pod6
Adjust line length
06:32
Geth doc: b9dce77293 | (JJ Merelo)++ | doc/Type/Signature.pod6
Changes =item to =head4 sections

This refs #2483
I leave the issue open just in case some other similar pages are found
06:35
jmerelo From StackOverflow: stackoverflow.com/questions/537361...ationstore Can anyone help? 06:38
tyil I'm sure perl 6 has an operator to compare 2 arrays for being equal 07:00
(ie, both contain the same values)
holyghost if there's not maybe @l.eq(@l2) should be made 07:02
holyghost without regarding pointers to lists 07:04
jmerelo tyil: ===, I think. That's object equality. Or >=<
Geth doc: 5063159650 | (JJ Merelo)++ | 2 files
Quirks of do when added.

Closes #2506
07:05
doc: c8066ff988 | (JJ Merelo)++ | doc/Language/pod.pod6
Checking changes, closes #2507
07:07
moritz if you want to compare arrays by their contents, use eqv 07:41
Xliff \o 08:23
Anyone awake? I am having some weird issues with CArrays 08:24
Xliff (Yes. AGAIN) 08:24
Long story short, what would cause this error message: Unknown element type in CArray 08:25
lizmat m: my @a = 1,2,3; my @b = 3,2,1; dd @a eqv @b # tyil 08:26
camelia Bool::False
lizmat m: my @a = 1,2,3; my @b = 1,2,3; dd @a eqv @b # tyil
camelia Bool::True
Xliff \o lizmat
Is this early or late for you? :)
lizmat early actually, 9:30 am 08:27
Xliff: and I'm afraid I don't have an answer for your questionn
Xliff lizmat: That's OK. I'm afraid this might be another jnthn or timotimo question. 08:28
(am I missing someone?) 08:29
At any rate: Good morning!
It's 3:30am here.
m: my @a = <a b c d e f>; say $a.iterator.pull-one;
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$a' is not declared. Did you mean '@a'?
at <tmp>:1
------> 3my @a = <a b c d e f>; say 7⏏5$a.iterator.pull-one;
Xliff m: my @a = <a b c d e f>; say @a.iterator.pull-one;
camelia a
Xliff m: use v6.c; class A { has @!a = <1 2 3>; method iterator { say 'Iterator'; my @a := @!a; class :: does Iterator { has $.index is rw = 0; method pull-one { @a.elems > $.index ?? @a[$.index++] !! IterationEnd; } }.new; }; }; .say for A.new; 08:30
camelia Iterator
1
2
3
Xliff m: use v6.c; class A { has @!a = <1 2 3>; method iterator { say 'Iterator'; my @a := @!a; class :: does Iterator { has $.index is rw = 0; method pull-one { @a.elems > $.index ?? @a[$.index++] !! IterationEnd; } }.new; }; }; A.new.iterator.pull-one.say 08:31
camelia Iterator
1
Xliff goes for a cig
Xliff OK. Write up here: gist.github.com/Xliff/cba831252504...205437bd0b -- I will ping back later to see if an issue should be created. 08:46
G'night!
tyil lizmat: interesting 09:22
lizmat tyil: it's what is-deeply uses under the hood 09:23
tyil if I sort the lists, and then use eqv, it should work for my usecase
tyil I dont care about the order, just whether they have the same entries 09:23
lizmat and the same number of entries ? 09:24
I mean <a a> eqv <a> or not ?
tyil yes, but that's a check I can do before even considering eqv
tyil if the number of elements differ, they're clearly not the same 09:24
lizmat right 09:25
tyil if the number of elements is equal, I want to know whether they have the same entries, in no particular order
lizmat hmmm... wonder if there is some set op that you could use...
tyil that's what I was wondering too :) 09:26
but I can do with @a.sort eqv @b.sort
lizmat are the lists big ? 09:28
moritz or possibly set(@a) eqv set(@b) 09:32
lizmat m: my @a = 1,2,3; my @b = 3,2,1; dd @a == @b && @a (<=) @b 09:34
camelia Bool::True
lizmat that probably uses set semantics, which is ok if you're sure each value only occurs once in every list
m: my @a = 1,2,3; my @b = 3,2,1; dd @a == @b && @a (<=) @b.Bag # force Bag semantics otherwise 09:35
camelia Bool::True
lizmat I wonder if a (==) op would make sense
tyil lizmat: they may become big I guess 10:04
tyil for now I'm not expecting lists larger than 50 entries 10:04
lizmat then sorting should be quick an dirty 10:08
tobs There's also symmetric difference (^) which is empty precisely when the sets/bags are the same 10:29
lizmat tobs++ 10:30
m: my @a = 1,2,3; my @b = 3,2,1; dd @a == @b && @a (^) @b
camelia Set.new()
lizmat m: my @a = 1,2,3; my @b = 3,2,1; dd @a == @b && @a (^) @b.Bag 10:31
camelia ().Bag
lizmat slight problem with that is that it doesn't shortcut as soon as it sees a difference 10:31
which (==) could 10:32
tyil tobs: unrelated to my earlier question, but can I use symmetric difference to show me all the entries that appear in the RHS that *dont* appear in the LHS? 10:39
and vice-versa, give me all entries that appear in the LHS but not in the RHS
lizmat m: my @a = 1,2,3,5; my @b = 1,2,3,4; dd @a (-) @b # ones on the left not on the right 10:44
camelia Set.new(5)
lizmat m: my @a = 1,2,3,5; my @b = 1,2,3,4; dd @a R(-) @b # ones on the right not on the left
camelia Set.new(4)
lucasb tyil: are you doing AoC? :)
tyil AoC? 10:45
(that's probably a no)
I'm making a program in Perl 6 to configure nginx and request new certs through certbot anytime I add a new host 10:46
lucasb ah, sorry. I thought perhaps was practicing Advent of Code :)
tyil it is to be the frontend service for my kubernetes cluster
once this is done I have two other (fun) projects to do in Perl 6 :>
apart from rewriting all sorts of stuff at work into perl 6, that is
if I can get stackoverflow.com/questions/536925...-ircclient answered with a "yes", I'll have three other projects :D 10:48
lizmat tyil: that's above my paygrade :-(
tyil w-what is? :o
lizmat using certfp 10:49
tyil ah
lizmat well, I would have to spend a relative large amount of time on that, that hopefully someone else has already done
tyil I'm willing to offer you one of my cherished cans of cider at the next amsterdam.pm :>
lizmat ok :-) it's not 8 Jan yet :-) 10:50
tyil I'm not in a hurry
the other projects will take me quite some time
and at the end of the month I wont have much time 10:51
and then next month I wont have much time either, as I may or may not be moving to amsterdam :p
lizmat ah.. the joys of living together :-) 10:54
mornfall is there a (simple-ish) way to inject a method into an existing class instance?
i'm using .&foo but it's a bit hacking for the downstream
hackish*
lizmat m: 'my $a = 42 but role { method foo { "foo" } }; say $a.foo 10:55
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in single quotes; couldn't find final "'" (corresponding starter was at line 1)
at <tmp>:1
------> 3ole { method foo { "foo" } }; say $a.foo7⏏5<EOL>
expecting …
lizmat m: my $a = 42 but role { method foo { "foo" } }; say $a.foo 10:55
camelia foo
lizmat mornfall ^^ 10:55
mornfall lizmat: thanks, cool 10:58
mornfall is there a case-insensitive version of eq? 11:08
lucasb maybe $foo.fc eq $bar.fc
mornfall oh okay, .fc works (i tried .to-lower without much success :p) 11:09
tyil .lc is for lowercasing 11:12
yoleaux CalculatorParseError: Unknown syntax at position 0
tyil docs.perl6.org/routine/lc
but I'd suggest using fc as lucasb recommended 11:13
lizmat m: sub infix:<fceq>($a,$b) { $a.fc eq $b.fc }; dd "foo" fceq "fOo" 11:18
camelia Bool::True
Ulti jnthn: whatever happened to github.com/jnthn/grammar-generative ? >:3 feels like a super nice idea in general, is it essentially impossible in reality? 11:50
mornfall WARNING: unhandled Failure detected in DESTROY. If you meant to ignore it, you can mark it as handled by calling .Bool, .so, .not, or .defined methods. The Failure was: [snip]
how would this happen? it's like a regular throw in a with block in a sub?
(the backtrace it gives, that is) 11:51
lucasb do you see the place the failure was created? 12:00
mornfall reviews exception docs 12:04
turns out i should not be using 'fail' at all, i want a die/.throw 12:07
lizmat m: for ^280 { my $a := Failure.new }
camelia ( no output )
lizmat m: for ^280 { my $a := Failure.new }
camelia WARNING: unhandled Failure detected in DESTROY. If you meant to ignore it, you can mark it as handled by calling .Bool, .so, .not, or .defined methods. The Failure was:
Failed

WARNING: unhandled Failure detected in DESTROY. If you meant to igno…
lizmat this code created a lot of unhandled Failure objects, as soon as the GC kicks in, the warnings appear 12:08
jnthn Ulti: Never really found time to continue working on it. I don't think it's impossible, but I only got it working for one sort-of-interesting example case. 12:09
yoleaux 11 Dec 2018 11:04Z <lizmat> jnthn: are dynamic variable lookups cached and if so, OOC how?
jnthn Ulti: And that's before we even begin to consider performance :) 12:09
But as an idea, yeah, it's quite neat :) 12:10
I guess you already found the slides of the talk I gave about it too?
lizmat: MoarVM caches successful dynvar lookups that are resolved on the call stack. We currently don't cache failure to find one, nor any that are resolved in, say, PROCESS
lizmat I was thinking that looking for uninitialized dynvars may be a source of slowdown 12:12
jnthn Yeah, that will try all the places
Well, non-existing anyway
lizmat so I was thinking, what if a *mentioning* a dynvar in a scope would automatically create a slot in its MY::
jnthn lunch &
lizmat: Rebinding 12:13
lizmat ? 12:14
pmurias what should $*DISTRO.name return when running in a browser (say Chrome) 12:16
?
lizmat depends on the OS it's running on ?
m: $*DISTRO.name 12:18
camelia ( no output )
lizmat m: say $*DISTRO.name
camelia opensuse
pmurias lizmat: hmm, I don't have access to the precise distro information 12:28
lizmat: also I'm not sure if returning say linux when running in Chrome on linux wouldn't be misleading 12:29
lizmat: as it's not quite a different thing then running in linux natively
lizmat can you access the browser ID string? maybe that's a good replacement, and may contain the OS it runs on anyway 12:30
pmurias lizmat: yes I can 12:33
lizmat hmmm.... thinking about that more 12:41
maybe we should introduce a $*BROWSER ?
so that a. you could check *if* you're running in a browser 12:42
and b. provide all sorts of introspectoin
on the jvm / moarvm / js bare backend, that would be Nil 12:43
and have $*DISTRO remain the same
pmurias we do have a bunch of data available from window.navigator (developer.mozilla.org/en-US/docs/W...Navigator) so adding a $*BROWSER to access it would make sense 12:46
lizmat sounds like a plan to me 12:49
pmurias lizmat: I used grep.cpanauthors.org (btw. which I found in the weekly) and it seems $*DISTRO.name is mostly used for detecting os to special case their differences 13:17
especially we don't want to use the .is-win special handling
lizmat so $*BROWSER seems like a good idea ? 13:18
pmurias lizmat: $*BROWSER definitely seems like a good idea 13:19
lucasb well, it opens precedent for $*FUTURISTIC-DEVICE :)
$*ANDROID ? 13:20
lizmat I think *$BROWSER atm for this is better
but perhaps a more genenic $*EMBEDDED 13:21
?
in any case, the term "browser" becomes more and more general, so I think we're going to be safe in that respect for a while
pmurias lizmat: just that setting $*DISTRO.name to 'browser' might be better than returning the host os and confusing 13:22
os checks
tbrowder o/
lucasb yeah, $*BROWSER is much more convenient to type :)
tbrowder: o/ 13:23
lizmat pmurias: not sure... feels to me $*DISTRO should stay doing what it does even in a browser
even if it may be confusing in a browser setting 13:24
tbrowder question: can a cro service be deployed on apache2 or nginx in the same manner as Bailador (using a reverse proxy)?
lizmat tbrowder: at that level, it's just HTTP going back and forth, so there should be no difference 13:25
If I understand the question correctly
ufobat tbrowder, i think yeah
tbrowder i want to deploy a new site using cro, but i want to make sure it's secure as my current apache2 sites are. 13:26
ufobat i think it might be not working if you want to do http/2 to your reverse proxy 13:27
tbrowder no, not using http2 yet 13:28
ufobat but internet -> https -> ngnix/apache -> http -> cro/bailador works, i think
tbrowder but https
jnthn tbrowder: Yes, I've got most of my my production Cro apps deployed with an Apache reverse proxy; works fine. 13:28
ufobat tbrowder, maybe that helps you a bit gitlab.com/ufobat/voteimproved 13:29
tbrowder jnthn: do you use sytemd for starts and shutdowns?
jnthn tbrowder: No
tbrowder if so, mind sharing the config files?
jnthn tbrowder: Deployed in containers in a kubernetes cluster 13:30
tbrowder ah!
jnthn (Apache in its own container)
nelsonhb The succession of these flame emperors, from Shennong, the first Yan Emperor, until the time of the last Yan Emperor's defeat by the Yellow
Emperor, may have been some 500 years.
tbrowder jnthn: thanks 13:31
ufobat: thanks 13:32
tbrowder funny, just saw new email announcement from digitalocean about their new kubernetes DOK8s 13:34
Ulti jnthn: no not seen the slides, is it on your homepage under talks/papers I can go find it 13:36
jnthn Ulti: yeah, I think it had some title like "What if Perl 6 grammers could generate?" or something 13:37
I think it went down as the most headache-inducing talk I ever gave
Ulti Im just thinking for my bioinformatics stuff where I have some grammars it would be really quite nice to easily de/serialize using the same thing
jnthn: sounds good :) I will make sure to do some blood letting before I read it
oh you've updated your site! swanky 13:38
incase anyone else is interested jnthn.net/papers/2013-yapcna-gramma...nerate.pdf
especially as formats like Newick for representing phylogenetic trees are litterally just a parse tree and back again really 13:40
c1nil can i use mutable sub parameters? 13:45
pmurias jnthn: you might want to have a look at the boomerang language if you are interested in bidirectional parsing (and well everything)
lucasb c1nil: sub foo($x is copy) # if that's what you mean 13:46
pmurias lizmat: it seems like a tradeoff between being more truthfull (in a way) and pragmatism, I'll think that over 13:52
nelsonhb Netaji Subhas Chandra Bose International Airport
Bir Tikendrajit International Airport
Guwahati International Airport
Mandalay International Airport
Chiang Mai International Airport
Noi Bai International Airport
Siem Reap-Angkor International Airport
Mactan–Cebu International Airport
rindolf jnthn: thanks 13:56
pmurias lizmat: linux-browser is also something I'm considering (so that it both doesn't hide info and doesn't accidently get matched by some platform check) 13:59
pmurias in roast we have a test like this: ok +%*ENV.keys, '%*ENV has keys'; 14:11
do we want to *require* that the env variables aren't empty no matter where we are running?
timotimo ha 14:12
pmurias not a big problem to add some fake variables there for rakudo.js but getting rid of the test seems cleanr 14:16
* cleaner
vrurg pmurias: maybe skipping on certain platforms would be more appropriate? 14:19
lucasb Interesting, even with a empty environment "env -i /path/to/perl6 -e 'say %*ENV'", env still has PWD and SHLVL set 14:20
ah, perl6 is a shell script :) 14:21
invoking moar directly starts with a completely empty env 14:22
pmurias well according to our specification it's not a Perl 6 if you start with a empty env ;) 14:24
timotimo no, our specification just says it has to make up a key, any key
lucasb well, someone should try if "env -i /path/to/moar [ --libpath=LIBPATH ] /path/to/perl6.moarvm -e 'say %*ENV'" fails that roast test :) 14:26
timotimo tbrowder: would you be interested in a perl 6 game of life that uses SDL2 instead of running inside of 6pad? 14:33
tbrowder yep (but don't know what SDL is for sure, SimpleDirectMedia?) 14:35
pmurias tbrowder: yes 14:36
tbrowder timitimo: that would be great (i think, still reading about SDL) 14:37
pmurias timotimo: looking through the irc logs it seems like 6pad has hang taking your code hostage :/ 14:41
pmurias timotimo: how do you think making it preserve code on page reload would be good? 14:43
timotimo perhaps put everything in LocalStorage and offer a "history" kind of like an undo history? 14:51
timotimo also, is there a way to not have the page unresponsive while 1) loading the perl6 javascript file and 2) compiling some perl6 code to js? 15:06
pmurias timotimo: I think there might be a way (by putting the actuall js compiler in an iframe) 15:11
pmurias timotimo: I have to think about (and experiment with that a bit) 15:11
timotimo: got to run& 15:12
Xliff Anyone seen this before? -- gist.github.com/Xliff/cba831252504...205437bd0b 15:12
timotimo i wonder if it'd work better to put the compiler part into a web worker; functions are passed around "as strings" anyway in js, right? :P 15:14
uzl Hello, #perl6! 15:26
yoleaux 04:07Z <Xliff> uzl: In your first example, the second comparison has a comment that should read "True, 220 and 284 are though." -- you had "28" rather than "284".
06:28Z <jmerelo> uzl: (just in case) It's mostly OK, but did you read the comments by Xliff? The title is OK. I might have used something like "Calling numbers names" "Or numbers by any other name" or something like that, but it's OK.
uzl Xliff: Thanks. I've fixed it! 15:27
.tell jmerelo I've gone with one of your titles. It's more subtle and sounds less pretentious ;-)! Feel free to put the article in reserve! 15:28
yoleaux uzl: I'll pass your message to jmerelo.
Xliff Can someone tell me what it means when you get the following error: "Unknown element type in CArray" -- Is that a mismatched memory issue? 15:37
timotimo can you run the script under gdb? 15:38
Xliff Sure.
timotimo and "break CArray.c:331"
and then print repr_data[0]
Xliff Crap. I have to re-brew. Didn't remember debug 15:42
timotimo ah dang
i think it'd literally be no problem at all to have the default be --debug=3 or at the very least --debug=1 15:43
Xliff I know.
I keep forgetting I have an alias for that. So used to typing it out.
Doesn't take long, though.
Compile times are creeping up, again. 15:46
lizmat yeah, probably the new read-intX / write-intX methods 15:47
Xliff timotimo: Were you talking perl6-gdb-m? 15:49
timotimo yes 15:53
Xliff Every time I use 'perl6-gdb-m script args' I don't get the gdb prompt. Is there a way to pass commands to GDB? 15:54
Nevermind. Got it. 15:55
Xliff $1 = {elem_size = 8, elem_type = 0x555556d77588, elem_kind = 6} 15:55
timotimo that's a CUnion 16:00
Xliff Yep!
And I've had trouble with CUnions and CArray's before. You'd think I'd learn. 16:01
timotimo maybe it's enough to put a case for that where there's already cases for pointer, string, array etc such
Xliff CUnions are supported by NativeCall, so I would think they'd be good for CArray, yes? 16:02
timotimo well, yeah. just turns out somebody forgot to take care of them in CArray 16:04
Xliff D'oh 16:05
timotimo make_wrapper will also need a bit of code
Xliff Oh...wow. 16:06
timotimo but there's also a MVM_nativecall_make_cunion
Xliff OK, want me to make an issue? 16:07
timotimo i thought maybe you could make a patch :D 16:08
Xliff LOL!
While I am looking at the relevant parts of the code, I'd have no idea what to do.
This for make_wrapper: 16:10
case MVM_CARRAY_ELEM_KIND_CUNION:
return MVM_nativecall_make_cunion(tc, repr_data->elem_type, data);
?
timotimo i think so 16:12
Xliff paste.ee/p/XgQOK 16:16
timotimo looks good; does it seem to work? 16:19
AlexDaniel nnnnnnooooooooooooooooo github
my vertical space :(
:O and now it's gone 16:20
Kaiepi what happened to github?
scimon So 6.d lets me throw promises at it like crazy.
AlexDaniel they added an extra bar to the top of the screen with the issue title 16:21
but after refreshing the page it seems to be gone… weird
scimon Making 4000 promises to read data files, throwing them into an array and then awaiting the lot. Just. Works :) 16:21
Kaiepi in a chat bot i'm writing there's a timeout on sending messages
AlexDaniel scimon: I know! That's how Blin works actually
Kaiepi so i have a send-bulk method that uses a lazy for to do Promise.in(atomic-inc-fetch $i).then({ self.send: $data }) and awaits it 16:22
lazy for is crazy useful 16:23
AlexDaniel scimon: basically I create a Promise for each module, and then there's a react block with as many `whenever`s as there are modules :)
AlexDaniel scimon: github.com/perl6/Blin/blob/master/...in.p6#L285 :) 16:23
Xliff timotimo: Let me see. 16:26
How can I force rebuild all of rakudo? 16:37
lizmat touch any of the files in src/core 16:38
scimon Neat.
Geth doc: 44ba9e8347 | (Elizabeth Mattijsen)++ | doc/Type/Endian.pod6
Introducing the Endian enum
16:42
doc: acbc324427 | (Elizabeth Mattijsen)++ | doc/Type/Blob.pod6
First stab at documenting new blob8.read- methods
doc: cd33e48117 | (JJ Merelo)++ | doc/Language/variables.pod6
Improves and debugs description, refs #2510
16:47
jmerelo lizmat++ ^^^
yoleaux 15:28Z <uzl> jmerelo: I've gone with one of your titles. It's more subtle and sounds less pretentious ;-)! Feel free to put the article in reserve!
jmerelo .tell uzl thanks! 16:48
yoleaux jmerelo: I'll pass your message to uzl.
tobs` I'm doing something like this: » S:g['1'] = @patch[$i++] with $data « where I replace all 1's in $data with the elements of @patch in order. That works with a "my $i = 0" in the function but obviously won't when I use the anonymous state variable instead of $i. 16:56
I wonder if I can somehow have $ reset each time the function is entered but not reset while that particular line is executed. 16:57
AlexDaniel tobs`: so what's wrong with `my $i = 0`? :) 16:58
tobs` n-nothing
I thought "now is the perfect chance to use $++" but once again it wasn't 17:00
Xliff timotimo: OK. Segfaulting when I try to access the CUnion.
So there may still be something missing.
tobs` m: sub f { say $++ }; f; f; f; sub g { say do { $++ } }; g; g; g 17:02
camelia 0
1
2
0
0
0
tobs` hehe
AlexDaniel that looks correct
tobs` oh, but it resets on every evaluation of the do block, so I can't use that as an index. $i it is then. 17:04
jmerelo tobs`: blocks don't have state. Routines do, I guess. 17:05
m: sub f { say $++ }; f; f; f; sub g { say do -> { $++ } }; g; g; g
camelia 0
1
2
-> { #`(Block|58873200) ... }
-> { #`(Block|58873416) ... }
-> { #`(Block|58873488) ... }
jmerelo m: sub f { say $++ }; f; f; f; sub g { say -> { $++ } }; g; g; g 17:06
camelia 0
1
2
-> { #`(Block|61371048) ... }
-> { #`(Block|61371264) ... }
-> { #`(Block|61371336) ... }
jmerelo m: sub f { say $++ }; f; f; f; sub g { say { -> { $++ } }}; g; g; g
camelia 0
1
2
-> ;; $_? is raw { #`(Block|74260232) ... }
-> ;; $_? is raw { #`(Block|74522624) ... }
-> ;; $_? is raw { #`(Block|74522696) ... }
jmerelo aw, never mind.
Did you know you can try StackOverflow? Please do. :-)
m: sub f { say $++ }; f; f; f; sub g { -> { $++ } }; say g; say g; say g 17:07
camelia 0
1
2
-> { #`(Block|73077112) ... }
-> { #`(Block|73077328) ... }
-> { #`(Block|73077400) ... }
tobs` m: sub f { say $++ }; f; f; f; sub g { say { -> { $++ }() }}; g; g; g
camelia 0
1
2
-> ;; $_? is raw { #`(Block|79938208) ... }
-> ;; $_? is raw { #`(Block|79938424) ... }
-> ;; $_? is raw { #`(Block|79938496) ... }
tobs` m: sub f { say $++ }; f; f; f; sub g { say -> { $++ }() }; g; g; g 17:08
camelia 0
1
2
0
0
0
jmerelo tobs`: so Callables don't keep state either. It needs to be a routine.
tobs`: hum, but in that case the block is created in every call... 17:09
lizmat m: my $a = { say $++ }; $a() for ^10 # jmerelo: I don't think so ?
camelia 0
1
2
3
4
5
6
7
8
9
jmerelo lizmat: right. 17:10
lizmat++
tobs`: the problem is that you're creating the do block every time you call g, and $ is always lexically scoped. 17:11
tobs` What I was trying to do is get a new block in each invocation of the function, which then keeps the same state during my S:g
jmerelo tobs`: no can do. New block initializes state, unless you use caller state, which is probably not what you're looking for. 17:12
xlat m: (my $b=buf8.allocate(10)).contents = "foo!".encode.list; say $b;
camelia Cannot unbox a type object (Nil) to int.
in block <unit> at <tmp> line 1
xlat m: try (my $b=buf8.allocate(10)).contents = "foo!".encode.list; say $b; 17:13
camelia Buf[uint8]:0x<66 6F 6F 21 00 00 00 00 00 00>
xlat m: (my $b=buf8.allocate(4)).contents = "foo!".encode.list; say $b; 17:14
camelia Buf[uint8]:0x<66 6F 6F 21>
jmerelo tobs`: anyway. Try StackOverflow, really. We're reaching 900 questions... stackoverflow.com/questions/tagged/perl6 And someone who's not right here right now might see it and solve it.
There are a bunch of unanswered questions there, also. For instance, this one on using certfp for authenticating IRC bots by tyil stackoverflow.com/questions/536925...-ircclient 17:15
pmurias timotimo: functions are not passed around as strings in js 19:20
timotimo: the CORE setting is super heavy to load so the compiler and "executor" need to loaded once and together 19:21
El_Che It looks like Go is getting a CPAN like infra: www.prnewswire.com/news-releases/j...64117.html 19:23
xinming When I use something like perl6 -Ilib test.p6 the test.p6 only contains the simple use Module::Name:from<Perl5> Why rakudo can't find the perl5 module? 19:27
pmurias xinming: I don't understand the question 19:28
xinming: do you have a problem with rakudo not finding your perl 5 module? 19:29
xinming yes 19:30
hmm, seems the @INC is not changed
use lib doesn't change the @INC
pmurias xinming: maybe the Perl 6 and Perl 5 INC paths are not shared (I didn't check)?
xinming pmurias: I think I know the reason, the Inline::Perl5 doesn't use the value in perl6. so use lib 'lib'; in test.p6 doesn't work as expected. 19:33
but something like PERL5LIB="lib" perl6 test.p6 worked.
I think use lib 'lib'; won't affect Inline::Perl5 module. 19:34
lizmat Inline::Perl5 is usually installed: "use lib" is intended to be used for not installed modules only 19:37
b2gills xinming: Perhaps `use lib:from<Perl5> 'lib'; useModule::Name:from<Perl5>` ? 19:48
lizmat use Inline::Perl5; %*ENV<PERL5LIB> = "."; use Foo:from<Perl5> # to load a ./Foo.pm works for me 19:51
hmmm... without it as well... :-(
please disregard ^^^ 19:53
sena_kun m: class Wrap { has $.a; }; class A is Set {}; say A.new(Wrap.new(a => 1)) eqv A.new(Wrap.new(a => 1)); 19:56
camelia False
sena_kun how do I fix this? I see docs mention WHICH overloading, but it isn't even called when defined in `Wrap`. 19:57
hmmm, in my tiny example WHICH is called... 19:58
sena_kun tries again
masak question: can someone define "closure" in a simple way?
(I know what it is, I'm just looking for simple ways to describe it) 19:59
sena_kun masak, piece of code + data necessary to execute it?
that's probably the simplest I can get, but it is a description of a lot of different things.
El_Che a function that may references variables in the surrounding scope? 20:00
sena_kun "a code block" will be a bit more precise(while being more general, yes), won't it? 20:01
El_Che throw anonymous somewhere 20:02
in
masak "a closure is a function that uses variables/names defined outside of it"
...maybe 20:03
lizmat s/function/Callable/ ?
sena_kun if you don't want to introduce "lexical" word, I think.
El_Che anonymous = can be defined as a variable on a scope
Geth doc: 98f3faa6dd | (Elizabeth Mattijsen)++ | doc/Type/Kernel.pod6
Document Kernel.Endian
masak lizmat: I think "function" is more precise than "Callable", actually. a Callable doesn't need to be a block of code, even. just something that can be called. 20:04
lizmat m: dd WhateverCode ~~ Callable # I guess that's true, as WhateverCode is guaranteed to not be a closure 20:05
camelia Bool::True
masak right, good example
lizmat hmmm... or is it ? hmmm
masak not in my book, no :)
El_Che are loop constructions a kind of closures in p6? or not related at all?
masak could you be more specific about what you're asking? 20:06
lizmat m: my $a = 666; sub a() { * - $a }; dd a.(42) # WhateverCode with closure ? 20:07
camelia -624
masak it's a WhateverCode _in_ a closure :)
El_Che for @foo -> $foo { say "block $foo" }
lizmat the $a is used inside the code
El_Che block accesses outside variable
masak El_Che: it's only an "outside variable" visually. it's actually just a parameter to the block. 20:08
El_Che masak: ah, yes, I remember now.
thx
masak or, perhaps better said, the block begins already at the `->` :)
(well, there's the _block_, and then there's the _block_ block) :P 20:09
El_Che func() { ... }("parameter") in other langs :)
block block - who is it? - not a closure
masak :P 20:10
actually, your string "parameter" is an argument :)
El_Che that's a good argument, there
masak well, not to argue, but... 20:11
masak .oO( ...I arguee ) 20:12
TreyHarris Oops, I idiotically did a git pull before saving changes to a file--and that file's been edited by someone else since my last pull. Nowhere conflicting, though. I can copy the entire section I modified, revert, and paste it back in... but I feel like my mind's blanking on a better way to handle this
(Er, sections; one above and one below the part the other commit changed. Otherwise this would be easy-peasy.) 20:13
masak TreyHarris: "Save As", check out your pre-pull commit, commit, go back to tip, cherry-pick?
TreyHarris masak: yep, exactly. thanks. (I'm using Magit, so that's very easy.) 20:14
masak \o/
TreyHarris Just had a brain-block
masak I was wondering what IDE that'd be that didn't refresh the files from disk automatically when they changed :)
still waiting for the editor that makes Git the inherent saving metaphor and abstracts away the disk itself 20:15
TreyHarris masak: no, it was my own idiocy--it was my first pull since I'd created this feature branch and I'd forgotten to set the upstream--something that I know I can do with Magit but is faster on the command line, so I did it in othe command line. So Magit didn't say "whoah, there, buddy" 20:21
lichtkind p6: say <a b c> ~~ "a" 20:41
camelia False 20:42
lichtkind why?
p6: say [<a b c>] ~~ "a"
camelia False
lichtkind p6: say <a b c>.Set ~~ "a"
camelia False
gfldex a list of Str is not a Str
lichtkind p6: say (1 2 3) ~~ 3
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3say (17⏏5 2 3) ~~ 3
expecting any of:
infix
infix stopper
statement end
statement modifier
statem…
lichtkind p6: say (1..3) ~~ 3 20:43
camelia True
lichtkind list on int is not an int
p6: say (1,2,3) ~~ 3
camelia True
lucasb you want (elem) 20:44
lichtkind lucasb, yes and i got it , but this seems to be inconsitant
pmurias masak: re git editor wouldn't that create horrible commit histories?
gfldex ~~ is not the most consistant operator we got indeed 20:45
lucasb lichtkind: ah, sorry. I didn't realize you're showing an problem in P6
lichtkind lucasb, you just rying to be helpful - all good 20:46
TreyHarris I thought there was a way to stick ":skip" or suchlike into "subtest" to get the entire subtest skipped, rather than having to count the plan of the subtest and skip that number? But I can't find it. 20:47
tobs lichtkind: the reason is (1..3).Int is 3 (the length of the list) whereas <a b c>.Str is not "a" 20:52
lichtkind p6: say (1,2,3) ~~ 2
camelia False 20:53
tobs m: say <a b c> ~~ "a b c"
camelia True
lichtkind indeed
thank you tobs
this not an smart match i imagined anymore
but at least consistant :) 20:54
TreyHarris m: say so <a b c>.contains('a b') 20:58
camelia True
TreyHarris m: say so <a b c> (cont) 'a'; say so <a b c> (cont) 'a b' 20:59
camelia True
False
TreyHarris I forgot until this moment that `contains` is a Str operation, not a container one
Kaiepi wait it's a Str and not a List/Array one? 21:07
fuck
gfldex m: say <a b c> eq "a"; # <-- thats what happens inside Str.ACCEPTS 21:12
camelia False
Kaiepi what's the List/Array method for checking if something exists inside an array? 21:16
(cont)?
gfldex m: say so <a b>».contains('a b'); # that's a nice riddle :) 21:17
camelia True
gfldex Kaiepi: You use a set operator. They coerce to Set and do what you expect. see: docs.perl6.org/language/setbagmix 21:18
tobs Kaiepi: (cont) will turn the array into a set. You can also use .first
Kaiepi ah perfect
thanks
sena_kun new advent post is here. \o/ 22:11
Geth doc: 47847ccd0c | (Elizabeth Mattijsen)++ | doc/Type/Kernel.pod6
Kernel.Endian to be called .endian
22:27
buggable New CPAN upload: Chart-Gnuplot-0.0.9.tar.gz by TITSUKI modules.perl6.org/dist/Chart::Gnupl...an:TITSUKI 23:13
buggable New CPAN upload: Chart-Gnuplot-0.0.10.tar.gz by TITSUKI modules.perl6.org/dist/Chart::Gnupl...an:TITSUKI 23:33
Xliff Is there a way to tell a CArray that it has a certain number of elements (since it was returned with a C-Struct?) 23:57
I am trying to resolve this error: "Don't know how many elements a C array returned from a library"