»ö« 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.
k-man when typing things into the perl6 REPL, is the terminating ; just implied? 00:34
lookatme_q k-man, I think it is 00:43
parsonsNose_ m: my @a = <1 2 3 4>; { say @a.index($_) } for @a; 01:38
camelia 0
2
4
6
parsonsNose_ Oh wait 01:39
I just read the docs
it does string search
what's the one to get the index in a list by an element?
lookatme_q parsonsNose_, index is the method of Str 01:42
parsonsNose_ yeah... so now I have: 01:44
m: my @a = <1 2 3 4>; { say ab.pairs.grep(*.value == $_)[0].key } for @a
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
ab used at line 1
geekosaur docs.perl6.org/type/List#routine_grep if you just want the index, use :k
parsonsNose_ m: my @a = <1 2 3 4>; { say @a.pairs.grep(*.value == $_)[0].key } for @a
camelia 0
1
2
3
parsonsNose_ but that seems a bit cumbersome
geekosaur if you're working with pairs, you may want a Hash instead of a List 01:45
parsonsNose_ I'm not really... 01:45
I just want the list index
but IDK how to get that 'properly'
geekosaur m: my @a = <a b c d>; say @a.grep(/c/, :k)
camelia (2)
Zoffix ParsonsNose: .grep has `:k` adverb so you don't need to do the .pairs stuff
parsonsNose_ :k!
Zoffix m: my @a = <1 2 3 4>; { say @a.first: $_, :k } for @a # also this, if you want just the first thing 01:46
camelia 0
1
2
3
parsonsNose_ hurrah
Zoffix m: my @a = <1 2 3 4>; say @a.first: $_, :k for @a # also, no need for braces there
camelia 0
1
2
3
parsonsNose_ tnx 01:47
[Coke] trips over github.com/sergot/openssl/issues/63 again 01:57
CarlNomus hello? 02:01
p6: say 3;
camelia 3
ryn1x timotimo: No prob. I use openSUSE so it was easy to double check. 02:11
Geth doc: 7f58ce280d | Coke++ | README.md
We switched to .pod6 a long time ago
03:15
buggable New CPAN upload: App-Tasks-0.0.7.tar.gz by JMASLAK modules.perl6.org/dist/App::Tasks:cpan:JMASLAK 03:43
lookatme_q :) 03:56
holyghost I started the Bayes::Learn package for Bayesian Learning 05:58
It can use several hypotheses now to learn with a set of experiments 05:59
It's all built for speed in games, so no great OOP because of overloading and disptaching 06:01
s/disptaching/dispatching
light speed :-) 06:02
lookatme_q what's that ? 06:08
holyghost Bayesian learning ? 06:10
lookatme_q hmm, the package
holyghost See en.wikipedia.org
It uses Bayes' rule to compute several hypotheses 06:11
You can enter data and calculate the conditional probability of the hypothesis 06:12
for example, in Age of Empires you move and attack by using chances e.g. of proxmimity 06:13
lookatme_q oh, I see
holyghost the proximity learn is a hypothesis where you calculate an integral to sum up 06:13
then you find a prob
you throw away the hypothesis or narrow your probs 06:14
lookatme_q oh 06:14
holyghost by keeping or adding hypotheses e.g. I want to attack because I'm close of an enemy
the "want to attack" is a probability
holyghost Bayes just caluclate P(A|B) 06:15
condition B with Prob on A
then you go multi-variate
Quite an simple concept but very much used in games e.g. RTS because it's fast 06:16
RTS == real-time strategy
lookatme_q cool
It's in Perl 6 ?
I mean you can using it in Perl 6 ?
holyghost yes
holyghost it'll go to CPAN 06:17
It's not yet online
lookatme_q good job
holyghost thx
lookatme_q I assume Perl 6 will able to make game in future, just like Java 06:18
holyghost There's SDL2::Raw for SDL2 (libsdl.org) bindings for graphics 06:20
holyghost I will make an example game with that later on 06:20
Java uses AWT
SDL2 is full-featured for making a game 06:22
lookatme_q oh, not know that, I just know Minecraft is written in Java
holyghost so is the perl5 package
s/perl5/perl6
I don't play games, I just make them :-)
Civilization IV used python and Java 06:23
Perl6 games are not far away
lookatme_q I play game, sometimes
holyghost The math basically stays the same again because you need to gain speed
lookatme_q oh 06:24
holyghost I play Darkside Chronciles sometimes
I like the Final Fantasy system
s/Chronciles/Chronicles 06:25
El_Che awt? is that still a thing? I thought Oracle killed ir 06:26
holyghost I think it's still a package with the import syntax
lookatme_q not familiar with console game
holyghost There's also Java3D 06:27
an override on a window with simple 3D programming features
kudzo Hello, perl6!!! 08:41
kudzo Do perl6 have any documentation on repr<CPPStruct> ? 08:41
I need to know if it supports multy on overloaded method inside C++ class
and is there any way to typecast int32 into some IDTypeInt to send as an argument to the overloaded method
buggable New CPAN upload: POFile-0.7.tar.gz by JNTHN cpan.metacpan.org/authors/id/J/JN/...0.7.tar.gz 09:03
lookatme_q kudzo, maybe you can refer this docs.perl6.org/language/traits#ind...-CPPStruct 09:07
kudzo thanks 09:36
kudzo I have a C++ class method IDClient<Table>::get( int ) is it possible to call it from p6? 11:30
timotimo templates are tricky; if there's a usage of the template with your exact parameters in the .so file already, then maybe - just don't know how to reach it 11:39
but if the template hasn't yet been "instantiated", you would need to generate & compile new C++ code to use it 11:40
masak moritz: dunno if I mentioned, but I think I've found a way for Qtrees not to have to be closures. 11:47
masak well, at least they wouldn't carry their environment around in the traditional sense of the word ;) 11:51
leont Should it matter if you use a module before or after a «unit class X»? 11:52
masak leont: no, don't think so 11:53
leont Hmmmm 11:55
I have a module (TAP) with a class named Version in it. It seems that loading it before a versioned unit declaration confuses it ("An exception occurred while parsing package version", "Default constructor for 'TAP::Version' only takes named arguments") 11:56
The class isn't exported BTW
moritz there's a built-in class Version 11:58
which might be used to version modules
which you might be inadvertently overriding
m: say Version
camelia (Version)
moritz m: say v5.^name
camelia Version
leont But I shouldn'tbe overriding it, as I'm not exporting that class. It's properly namespaced inside TAP:: 11:59
moritz if you declare a class, it's also a lexical symbol 12:02
moritz m: class TAP { class Version { }; say Version === CORE::Version } 12:02
camelia False
leont Yes, and inside TAP everything is fine and dandy. The error is in another class that uses TAP. 12:04
moritz does the error go away if you rename Version to something else? 12:08
holyghost I've uploaded Bayes::Learn to CPAN 12:12
If you want to start a RTS with probabilities go ahead :-)
buggable New CPAN upload: Perl6-Bayes-Learn-0.1.tar.gz by HOLYGHOST cpan.metacpan.org/authors/id/H/HO/...0.1.tar.gz 12:13
holyghost s/RTS/RTS games 12:14
leont Now the error gets more interesting: "A unit-scoped class definition is not allowed in a subscope;"
It seems modules are leaking out somehow :-/
leont (after that rename) 12:15
holyghost BTW, in Bayes::Learn you can use messages as hypotheses 12:19
"attack", "move in" and so on in a Message, Mailbox class, a trick I learned at uni 12:20
Now I have to read my book for more decision theory and chaos statistics as I said before 12:23
moritz sounds fun, in a nerdy sort of way :) 12:39
holyghost lol 12:41
I'm not a nerd, just a gnoll :-) 12:44
moritz what's a gnoll? 12:45
holyghost www.catb.org/esr/jargon/html/T/troglodyte.html 12:46
the first sense, AD&D gnoll 12:47
Try to search forgottenrealms.wikia.com for the term 12:51
huf a grassy gnoll?
hmm hmm
holyghost I do leave my appartment in the weekend 12:54
pmurias holyghost: on the internet nobody know's you're a gnoll ;) 12:55
holyghost No they don't :-)
leont I'm not entirely sure what to do with "STable conflict detected during deserialization." 13:09
masak :) 13:10
holyghost ? 13:15
?x 13:16
masak holyghost: ¿
holyghost: x¿
holyghost lol
masak 101
holyghost |o|
holyghost *lol* 13:17
masak |<>|
holyghost m: *lol*
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3*7⏏5lol*
expecting any of:
infix
infix stopper
statement end
statement modifier
statement modifie…
Ven` leont: file a bug report? :P 13:17
leont I'm not even sure how to start reducing the size. 13:19
masak Ven`: I don't know why I misread that as "file a hug report? :P" 13:21
Ven` we definitely should do that, however. 13:21
masak leont: fwiw, before I start reducing the size, I'm also almost never sure how to start ;) 13:22
I usually do it in a branch, with frequent trial and error accompanied by lots of small 'git commit'
dangit, I have a blog post draft about that sort of golfing that I never quite finished... 13:24
Ven`
.oO( I golfed down my blog post, now there's nothing left anymore )
leont Thing is, this seems to involve stuff like module loading 13:25
masak indeed
but you can end up with, say, two one-line modules or something
and a two-line main program
leont Ah, I think I found it 13:35
I can eliminate the error by removing two lines: «$?CLASS.^add_method($name, $method);» and «$?CLASS.^compose» 13:36
Interestingly, it only fails when loaded from another module. If loaded at a "root" namespace (e.g. a script) the error doesn't seem to happen 13:37
Filed as github.com/rakudo/rakudo/issues/2378 13:51
jnthn I hpoe you're doing those at BEGIN time... 13:55
leont No one ever told me I should, but that does sound like something I should be doing 13:58
timotimo m: class test { say "hi" }; test.new; test.new;
camelia hi
timotimo it could very well be that that runs once per importation or something dangerous like that 13:59
leont Moving the code to begin blocks leaves me with a "Cannot invoke this object (REPR: Null; VMNull)", even in cases that previously worked 14:03
timotimo you have a .^compose inside the class body?
leont It appears $?CLASS isn't defined yet during BEGIN time 14:04
leont Or actually, it appears existent but not very useful yet 14:05
leont I'm not quite sure yet how to solve this. 14:08
Possibly I should compose everything in a role and then compose that into the class, but I may end up with the same problem. 14:09
Or invent my own ClassHow, but that seems rather like an overkill 14:10
timotimo perhaps try a trait 14:11
leont I'm not sure how a trait would turn one sub into two methods 14:15
buggable New CPAN upload: POFile-0.7.1.tar.gz by JNTHN modules.perl6.org/dist/POFile:cpan:JNTHN 14:23
leont Is there any other precedent for adding methods to classes? 14:24
moritz typically you do that with roles, or with .^add_method 14:30
moritz sorry, missing a lot of context here 14:30
leont I am using .^add_method 14:31
Code is github.com/Leont/path-iterator/ BTW
leont moritz: do you have a working example of using add_method? 14:33
jnthn leont: Where did you put the BEGIN? 14:36
leont Around both blocks of add-matchable and add-boolean
azawawi hi 14:36
jnthn OK, that's where i'd epxect them to go 14:37
azawawi leont: an example is found here github.com/azawawi/perl6-odoo-clie...t.pm6#L128
leedo: and here docs.perl6.org/type/Metamodel::MethodContainer
oops :)
leont: and here docs.perl6.org/type/Metamodel::MethodContainer :)
jnthn: hi :) 14:38
jnthn: next steps github.com/azawawi/ide-perl6#plan--todo
going also to deprecate farabi6 and atom-perl6-editor-tools in favor of this one 14:39
also padre::plugin::perl6 is going to be deprecated since it is ancient 14:40
std.pm6, viv stuff
leont Just pushed a branch called begin for replication github.com/Leont/path-iterator/tree/begin 14:41
azawawi timotimo: ping
timotimo: what do you think of www.sfml-dev.org/download/csfml/ ?
leont I keep getting this error: «Cannot invoke this object (REPR: Null; VMNull)»
azawawi leont: on what part? 14:42
leont When actually calling a (dynamic) method on the object. 14:44
(via perl6 -Ilib t/basic.t)
azawawi clones it and starts debugging it 14:46
azawawi leont: ping 14:58
leont: funny bug to be honest
leont: when you add 'use Test' inside Path::Iterator, it is a different set of exceptions 14:59
leont: gist.github.com/azawawi/9f2b0efbf8...23afff8489 15:01
leont I've run into that sort of issue a number of times before. 15:15
jobs 15:17
(wrong screen)
timotimo .tell azawawi looks like a good target for a binding, though i think there's already the start of an sfml binding somewhere? not sure.
yoleaux timotimo: I'll pass your message to azawawi.
sena_kun Is there a production rule that might be named "expression" in Perl 6 grammar? If yes, can I find it somewhere? Looking at Grammar.nqp didn't help much. 15:24
timotimo it could be in NQP 15:25
since P6::Grammar derives from HLL::Grammar
sena_kun thanks, will look in that direction. though something tells me it won't be so simple as I think of it. 15:27
timotimo m: use Perl6::Grammar; say Perl6::Grammar.^find_method("expression") 15:28
camelia ===SORRY!===
Could not find Perl6::Grammar at line 1 in:
/home/camelia/.perl6
/home/camelia/rakudo-m-inst-2/share/perl6/site
/home/camelia/rakudo-m-inst-2/share/perl6/vendor
/home/camelia/rakudo-m-inst-2/share/perl6
Com…
timotimo m: use Perl6::Grammar:from<nqp>; say Perl6::Grammar.^find_method("expression")
camelia ===SORRY!===
Could not find Perl6::Grammar at line 1 in:
/home/camelia/.perl6
/home/camelia/rakudo-m-inst-2/share/perl6/site
/home/camelia/rakudo-m-inst-2/share/perl6/vendor
/home/camelia/rakudo-m-inst-2/share/perl6
Com…
timotimo m: use Perl6::Grammar:from<NQP>; say Perl6::Grammar.^find_method("expression")
camelia (Mu)
timotimo m: use Perl6::Grammar:from<NQP>; say Perl6::Grammar.^find_method("expr")
camelia (Mu)
timotimo m: use Perl6::Grammar:from<NQP>; say Perl6::Grammar.^find_method("TOP")
camelia TOP
timotimo hm.
jnthn It's called EXPR
timotimo m: use Perl6::Grammar:from<NQP>; say Perl6::Grammar.^find_method("EXPR") 15:30
camelia EXPR
timotimo m: use Perl6::Grammar:from<NQP>; say Perl6::Grammar.^find_method("EXPR").file
camelia Died with X::Method::NotFound
in block <unit> at <tmp> line 1
timotimo what was it called again ...
an nqp op perhaps
ah, yes 15:31
m: use nqp; use Perl6::Grammar:from<NQP>; say nqp::getcodelocation(Perl6::Grammar.^find_method("EXPR")) 15:32
camelia getcodelocation needs an object of MVMCode REPR, got P6opaque instead
in block <unit> at <tmp> line 1
timotimo m: use nqp; use Perl6::Grammar:from<NQP>; say nqp::getcodelocation(nqp::getattr(Perl6::Grammar.^find_method("EXPR"), Code, '$!do'))
camelia {file => gen/moar/Perl6-Grammar.nqp, line => 4159}
timotimo sena_kun: ^
sena_kun timotimo, thanks, will look into it.
rouking Wow, very nice
What is `Code` there? 15:33
timotimo attributes are per class in the class hierarchy, and private attributes can appear multiple times with the same name
so you give it the type to look the attribute up in
rouking Oh, it's simply the Code type. Thanks 15:34
timotimo right
rouking What a useful routine, getcodelocation. I'll have to use that if I ever decide to start digging deeper into the internals 15:35
timotimo there's a module and a bot for that purpose, too
s: Str, "comb", \(1) 15:36
SourceBaby timotimo, Sauce is at github.com/rakudo/rakudo/blob/31b1...l.pm6#L197
leont is wondering if macros are the solution to his problem, but doesn't quite feel like the right fit
timotimo buggable: eco Sourcery 15:37
buggable timotimo, CoreHackers::Sourcery 'Helper for showing actual source code locations of core subs and methods': modules.perl6.org/dist/CoreHackers:...fix%20Znet
rouking \(1) is... telling it to find only definition or?
only one definition*
timotimo it's because of multi methods and such
so you give it a capture of arguments to look for 15:38
rouking Ah, nice 15:39
leont It seems that my level of closures inside a BEGIN block is the problem :-/ 16:03
Geth doc: cbeddcd3e0 | (Zoffix Znet)++ | doc/Type/Cool.pod6
[v6.d REVIEW] Remove EVAL --encoding respectation

This feature didn't make it into the language and was removed from Rakudo in
  github.com/rakudo/rakudo/commit/31...4ed6cdab98
synopsebot Link: doc.perl6.org/type/Cool
leont I'm wondering if this is a VM issue or some such. 16:09
leont Values that previously worked suddenly do so no longer 16:09
scimon leont: I'm not sure of your issue but I've seen that error before and I found that no precompilation "fixed" the issue. (In that the code started working but you know.... it's not precompiled). 16:15
In may case it's in Trait::Env where the Attribute Traits fail if you precompile the code for them. Again it's in a closure.
leont «no precompilation» does indeed work around the issue 16:16
leont Anonymous methods appear to be the problem :-/ 16:23
Or actually, only ones that capture 16:24
The captured value appears to disappear in smoke 16:25
scimon I'm hoping at some point it'll be tracked down. But I've got no idea what's causing it. 16:30
Zoffix lizmat: yeah, the archive just contains 2 source files and two backup files for them. Not even a META6.json file 16:56
wc
holyghost: yo, your CPAN archives are invalid and your modules aren't being indexed
holyghost: you need at least META6.json, but it wouldn't hurt to have a README and tests: docs.perl6.org/language/modules#Pr...the_module 16:57
holyghost: also, you're leaving behind backup files (the one that end with ~) in your CPAN uploads 16:58
Zoffix .tell holyghost you have a problem with your modules: colabti.org/irclogger/irclogger_log...10-15#l556 16:59
yoleaux Zoffix: I'll pass your message to holyghost.
perl5to6justforf Hey i just started "using" perl6...I just created my first class. I put it in a seperate file from my main program. How can i "use" that Class? is there an @INC like in perl5 or a 'use lib' ? 18:36
The Problem is that perl6 doesnt look in the cwd 18:37
so in perl 5 i would have said "use lib '.'" or BEGIN { push @INC, '.'}
robertle the environment variable PERL6LIB can be used to do this, be aware that the separator for multiple entries is not a colon but a semicolon 18:41
and you can still do "use lib 'lib';"
but after that the module lookup is a bit more complex than in perl5, at least to my ignorant eye 18:42
robertle so I guess both methods above work ok for local tests, but once you build something that is meant to be deployed by zef you can't really do that anymore. good news, you also don't really need to anymore 18:43
also note that perl5 also does not look in cwd, at least not on all OSes
to the great frustration of users, but for good (security) reasons 18:44
perl5to6justforf yeah i know they removed '.' in perl 5.26 i think!? well yeah i know but its just to try the language not for anything serious ;) 18:45
thanks for the help!
robertle have fun! 18:47
Xliff perl5to6justforf: "use lib '.'" 18:54
timotimo i usually just -Ilib
Xliff Anyone around familiar with the current macro implementation?
paste.fedoraproject.org/paste/CyVc...kOBRCH8JxA
timotimo what keeps you from just turning it into a simple sub that takes the code object that goes from line 12 to 19? 18:55
Xliff timotimo: ¯\_(ツ)_/¯ 18:56
I could do that, however I am not so sure how the code object would port in that case. 18:58
timotimo not sure how you mean "would port" 19:09
[Coke] do we have a mime type for pod6? 19:19
Xliff timotimo: Yeah, I can do a sub. Will start testing options. Thanks. 20:18
lizmat And another Perl 6 Weekly hits the Net: p6weekly.wordpress.com/2018/10/15/...tom-for-6/ 21:17
El_Che lizmat: you kind of missed azawawi's Appserver importance. It's not for Atom but can be used by all the editors and ides that support Microsoft's AppServer arch, including vim and emacs 21:57
it's pretty huge (once finished)
lizmat well, I did mention it in the new modules section... but i guess I did miss that part :-) 21:58
El_Che you can hype it an other time :) 21:59
lizmat post adapted 22:01
El_Che :)
lizmat El_Che++
xinming_ When I use rakudo source code on tag 2018.09 And I do ./Configure.pl then make, I got error which is 23:12
src/vm/moar/ops/perl6_ops.c:80:76: error: ‘MVM_SPESH_FACT_DECONTED’ undeclared (first use in this function); did you mean ‘MVM_SPESH_FACT_RW_CONT’?
tfacts->flags |= MVM_SPESH_FACT_CONCRETE | MVM_SPESH_FACT_KNOWN_TYPE | MVM_SPESH_FACT_DECONTED;
^~~~~~~~~~~~~~~~~~~~~~~
MVM_SPESH_FACT_RW_CONT
Oops
sorry, I thought it's just 3 lines of erorr. :-)
What do I need to do to compile it? 23:13
jnthn Use the 2018.09 tag of MoarVM too, not HEAD
xinming_ Got it, thanks 23:14
jnthn (That symbol was removed)
Eventually we'll get rid of the extops (C code) in the Rakudo repo, so we won't have issues like this :)