Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-07-25

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:08 Cabanossi joined #perl6
00:12 jeromelanteri unless $!directory.IO.d [ mkdir $!directory or die "blabla"; }
00:12 jeromelanteri what's wrong ?
00:13 jeromelanteri error said: cannot look up attributes in a datas type object. ok... i not understand.
00:14 geekosaur sounds like you have an undefined instead of an object with a $!directory
00:14 geekosaur ("type object" is a typed "undef")
00:16 jeromelanteri strange, because i do class datas { has Str $.directory = %*ENC<HOME> ~ "/.vim/installer";
00:16 timotimo do you also .new?
00:16 jeromelanteri so $.directory is declared has string
00:16 jeromelanteri method.new(Str $filename) [... } yes
00:17 timotimo do you also call method new and use the result of that to call the method that has the $!directory in it?
00:17 jeromelanteri i'm going for paste my dirty code
00:17 jeromelanteri timotimo, no, it is inside the class... a method call an other one
00:18 jeromelanteri in the constructir, i use method (then i want to make private) for initialize things)
00:18 jeromelanteri constructor
00:18 timotimo if by constructor you mean method new, then there's your problem
00:18 timotimo inside method new there is not yet a "self"
00:18 jeromelanteri yes, method new
00:18 timotimo that gets made with self.bless
00:18 jeromelanteri i do
00:21 timotimo as in, self.bless returns an instance of the class
00:21 jeromelanteri timotimo, so i need to bless ALL the class variables ?
00:21 timotimo er, huh?
00:23 timotimo can you show your code?
00:23 jeromelanteri i do it now, then message change... id o declare @.datas; then bless :@datas  but he is not happy... he said that @datas is not declared, he ask if i want to said datas or @!datas
00:23 geekosaur jeromelanteri, actually one normally uses the default "new" and defines BUILDALL and/or TWEAK as needed. https://docs.perl6.org/language/classtut
00:23 geekosaur and it sounds like you never create an *object*, you just work within the class definition
00:24 geekosaur and think that is somehow an object of the class
00:24 geekosaur er right, BUILD not BUILDALL
00:24 jeromelanteri geekosaur, i created one, but actually the class doesn't compil.
00:25 jeromelanteri i'm not working on instance, but on method
00:25 timotimo in perl6, you can call methods on instances as well as the type itself
00:26 jeromelanteri https://gist.github.com/jerome-diver/a00c842062ce374a5ac965636d79dc37
00:26 timotimo well, yeah, you're passing $filename, @datas, $directory, $repo_dir, and $full_filename to bless
00:26 timotimo but out of those only $filename is defined
00:26 jeromelanteri timotimo, yes i understand, but is not what i mean... my nglish is poor.
00:27 timotimo when you don't assign the result of bless to a value or return it directly, the object gets lost & destroyed
00:27 jeromelanteri timotimo, ???
00:27 timotimo self.bless returns the instance
00:28 timotimo you're not doing anything with the instance in your method new
00:28 jeromelanteri yes
00:28 jeromelanteri timotimo, it is an obligation to do thngs with them  in new ?
00:29 jeromelanteri timotimo, ok, i think i missunderstood this part. How to create a private instance variable ?
00:30 geekosaur the problem is that you assume that on entry to method new, "self" is a thing already
00:30 geekosaur and you just invoke the bless method on it "for some reason"
00:31 jeromelanteri geekosaur, timotimo actually, when you read my little code, do you understand what 'im trying to do ?
00:31 geekosaur self .= bless( ... )
00:31 jeromelanteri i missunderstand the logic.
00:32 geekosaur self is *undefined* on entry
00:32 geekosaur but the bless method is valid on that undefined, and produces an actual instance
00:32 jeromelanteri geekosaur, ho well. i just understand now what you tell me.
00:32 timotimo i don't think self can be written to by default
00:32 geekosaur hm, possible, then you'd need an undef var for that
00:33 geekosaur my datas $inst .= bless( ... ); ...; return $inst;
00:33 geekosaur doing things by defining "new" is doing them the hard way
00:33 geekosaur take a look at the page I linked earlier
00:34 geekosaur https://docs.perl6.org/language/classtut
00:35 jeromelanteri geekosaur, i don't know, i used to do things like that with C++: declare a structure of class, etc.. define my constructor(s), then inside my constructor, do initialize things... then create my other methods, privates or public as i need.
00:35 timotimo right, it works differently in c++
00:35 timotimo you must know that "method new" isn't special at all
00:35 jeromelanteri geekosaur,  i looked that, but i need to initialmize things when new instance is created.
00:35 geekosaur C++ is not perl 6. most systems based around a meta-object protocol let you define a method new and do things all yourself, which means you also have to deal with any superclasses etc.
00:35 timotimo the only thing that makes methods a constructor is because you use "self.bless" inside
00:36 geekosaur but also provide convenience methods from the MOP that let you ignore the grotty details
00:36 timotimo anyway, i'm going to bed
00:36 geekosaur and it's preferred to use those and not have to worry what's going on underneath
00:36 geekosaur C++ doesn't have a way to avoid the internals, you're forced to deal directly
00:37 geekosaur (except... it also does a number of things for you --- and you lose if you need them to be done differently)
00:37 jeromelanteri then imagine my class datas is a container of repos list with a title and sorted by group, then saved inside a yaml file. Now when i create a new data, i need to check that directory contain file yaml exist (and create it if not), then creat ethe yaml file with gorup "default" inside, ...
00:38 jeromelanteri timotimo, good night
00:38 Cabanossi joined #perl6
00:39 timotimo huh wtf the classtut doesn't mention TWEAK at all
00:39 geekosaur right, the point is you don't normally do that in new, that;s where the MOP machinery lives. most of what you would do in new() in C++, you'd do in submethod BUILD instead; the MOP's new will invoke that at the right point
00:39 jeromelanteri geekosaur, yes but how to just call actions for do initialize things when an instance is created then ?
00:39 timotimo https://github.com/perl6/doc/issues/1393
00:39 timotimo implement the TWEAK submethod
00:39 jeromelanteri submethod BUILD
00:39 timotimo BUILD will disable any defaults you have written next to your attributes
00:40 timotimo i.e. "has $.foo = 1234" will not assign 1234 any more
00:40 geekosaur but since TWEAK isn't there... :/
00:40 timotimo use TWEAK instead, it will let you keep the default values
00:40 jeromelanteri geekosaur, and declare in the same time i define my instance variable is maybe something wrong to ?
00:40 jeromelanteri timotimo, ok
00:41 geekosaur jeromelanteri, the main difference from your point of view is that if you use new, you have to create the instance /ex nihilo/ including any superclasses, etc.
00:41 jeromelanteri i understand it should be easier to not define method new and use BUILD for call functions initializers
00:42 geekosaur if you use BUILD or TWEAK then you get a properly built but uninitialized object, and you do whatever. this is what C++ calls "new"
00:42 jeromelanteri ok
00:42 geekosaur (with some caveats because C++ rubs your nose in some internal details if you have superclasses...)
00:42 jeromelanteri yes
00:42 jeromelanteri in fact i like perl6 when he has some similarity with C++
00:44 jeromelanteri geekosaur, and also here (who is an official page for learn perl6) they directly teach to create constructor (what ever name new or other, this i understand well) https://docs.perl6.org/language/classtut
00:44 geekosaur there's lots of different ways one can do objects. C++ is kinda different from pretty much every other OOP setup, mostly because it's (a) ancient (b) didn't use the main existing OOP setup from that time, which is Smalltalk's OO. perl 6 is based around newer meta-object protocol setups, so it's a bit different also
00:45 jeromelanteri geekosaur, yes, it also totaly new for me.
00:45 geekosaur java does still different things. perl 5 and python native objects are both rather ad hoc and in many ways resemble C++ more than anything else
00:45 geekosaur (although much modern perl 5 OO is based on the same MOP design that perl 6 is, via Moose)
00:46 jeromelanteri yes, in much more simple and far to be so precise than C++. But i see with perl6 we can be precise.
00:47 jeromelanteri this new concept of contruction make me confuse, i need to let place for new concept in my little head...
00:48 zengargoyle heh, YAML.load is not yet implemented
00:48 geekosaur https://docs.perl6.org/language/objects#Object_Construction is a bit more detail about what is going on and how it fits together
00:48 jeromelanteri actually, on this point of curve learning, i feel this more complicate to undersatnd the logic than for learn haskell (just because of this constructor things mecanism). I really need to understand the constuctor mecanism for do precisely what i want to do.
00:49 jeromelanteri zengargoyle, no, but i will use other module than this one (no have time do do... i'm stick on learn how to make a nice class object)
00:50 BenGoldberg If you wanted to write C++ code which behaved a little bit more like the majority of other OOP languages, you'd have to add "virtual" practically everywhere :)
00:50 jeromelanteri geekosaur, ha yes, i didn't read this part... i think it need to be on first of this tuto.
00:50 zengargoyle jeromelanteri: https://gist.github.com/20e1bcf9e8cb41a56e2334b462701ca9
00:50 jeromelanteri ok, i think i should read this doc totaly first to do any thing more.
00:51 zengargoyle datas.new('myfile') -- datas.new(filename => "myfile", datas => Array[Array].new(), directory => "/home/zen/.vim/installer", repo_dir => "/home/zen/.vim/bundle", full_filename => "/home/zen/.vim/installermyfile")
00:51 jeromelanteri zengargoyle, ho thank you. i have to read the doc better. i absolutly want to understand this constructor and TWEK and BUILD story time...
00:52 jeromelanteri thank you
00:54 zengargoyle jeromelanteri: i think... new is for when you don't want named parameters, BUILD is when you want to use different names when calling .new than you want to use inside of class, TWEAK is for when you need to do work after creation but before returning the object.
00:55 geekosaur the default BUILD is what handles setting default values, so if you have them you want to use TWEAK instead.
00:56 zengargoyle good to know.
00:57 jeromelanteri zengargoyle, ok, i keep it in mind. But my way to thinking is that if you really well understand what's happen, then you can act in full power and really do what you thinking (keep control). But if you do things because this one works one time you do it all the time... then sometimes, you go near something who should be better an other way.
00:57 * zengargoyle is still mostly guessing from using Moo.
00:58 jeromelanteri geekosaur, ok, then new for bless variable and use them directly without invocation of hash key
00:58 jeromelanteri BUILD for define default instance variable
00:58 jeromelanteri and TWEK for send initializers things.
00:58 jeromelanteri TWEAK
01:00 jeromelanteri then in my code, it should also be better to put self.directory= $*ENV<HOM>
01:00 jeromelanteri inside BUILD
01:01 geekosaur except you usually take the default one insted of defining yourself. if you really need to modify things at a low level, you can replace new, BUILDALL, BUILD, TWEAK --- from lowest level "do it all yourself by hand" to highest level "just make these changes to the default behavior"
01:01 zengargoyle jeromelanteri: the benefit of doing it the common way is that other things keep working.  like inheritance and subclasses.  so certain things happen in certain places and other people can subclass your class without fear.
01:03 jeromelanteri ok
01:05 jeromelanteri i also miss the point on something: when i define class variables, i do has Type @.name is readonly; but when i call it i do @!name  why "!" ?
01:05 geekosaur you _can_ change hpw they work. generally you shouldn't; it makes life harder for anyone else using your class. but sometimes it is justified, therefore it is possible
01:06 geekosaur you should probably read https://docs.perl6.org/language/classtut as it goes through this
01:06 Actualeyes joined #perl6
01:06 jeromelanteri geekosaur, ok, but what is the signification of "!" in this particular situation ?
01:06 geekosaur when you define an attribute "has $.foo", it defines the actual attribute $!foo and an accessor method foo
01:07 geekosaur the ! is a warning that the thing in question is private/internal
01:07 jeromelanteri ok, understand
01:07 geekosaur the accessor is by default read-write, so self.foo = whatever; works.
01:08 jeromelanteri geekosaur, but this ! private is for define time: has Str $!string;
01:08 geekosaur you can also have private methods as well as private attributes; you again use ! instead of . to invoke them (so, sometimes you will see e.g. self!foo)
01:08 zengargoyle $.foo creates ro access ($obj.foo()) $.foo is rw creates rw access ($obj.foo(), $obj.foo($newval)), $!foo makes no outside access.
01:08 jeromelanteri yes i read that to. then there is no way on my !method blah() {
01:09 jeromelanteri my method !blah() {
01:09 jeromelanteri method !blah {
01:09 jeromelanteri "my" serve something ?
01:10 zengargoyle hrm... can you even have a my method?
01:10 geekosaur method !foo
01:11 jeromelanteri what the difference with my method foo and my method !foo ?
01:11 geekosaur I don't think so, that's in effect 'submethod'
01:11 zengargoyle *nods*
01:12 lookatme joined #perl6
01:12 geekosaur jeromelanteri, that makes a private method which you invoke with self!foo instead of self.foo; it can only be called within the class, or in classes that are marked as trusted
01:12 jeromelanteri maybe there is a clear way for just have a "private" and "protected" container for methods ?
01:12 lookatme morning
01:12 jeromelanteri and what do  "my" ? lookatme, hello
01:13 jeromelanteri the idea to be private... is to not be call by outside.
01:13 geekosaur class A { trusts B; method !priv { ... } }; class B { method pub { self!B::priv(); } }
01:13 geekosaur er
01:13 geekosaur class A { trusts B; method !priv { ... } }; class B { method pub { self!A::priv(); } }
01:13 lookatme my is lexical scope
01:13 geekosaur yes, but perl has always treated "private" as meaning "you need to try a bit harder"
01:14 jeromelanteri and the idea to be protected, is to be able to be call by an herited function in level 1 and stay private from outside.
01:14 geekosaur if you've ever read the Taltos books by Steve Brust, it's like locks in a Jhereg building :)
01:14 jeromelanteri so, what is protected for perl6 ?
01:15 jeromelanteri lookatme, ok, and what lexical scope add more for a private method ?
01:15 zengargoyle my does not exist outside of containing { } (or file if not inside a { }) and only from the line it is defined onward (not before).
01:16 zengargoyle geekosaur: i'm like 3 books behind... :)
01:16 jeromelanteri geekosaur, ok. I'm sorry to push questions so far, it should be stupid for you to read kind of newbie perl6 user questions tag, but i really want to well understand precisely all what i can do or not.
01:16 geekosaur zengargoyle, the locks thing is from the first book
01:16 zengargoyle which was like 80's when i was in high school....
01:16 geekosaur something like "locks are meaningless in here as a way to keep people out, but an effective way to say "private""
01:16 jeromelanteri is there any ebooks from him ?
01:17 * colomon probably hasn’t read Jhereg in a decade or two.
01:17 jeromelanteri and is there any books for design pattern on perl6 ?
01:17 geekosaur still a bit too new for there to be books available although several are in the process of being written as I understand it
01:18 jeromelanteri ok
01:18 jeromelanteri well.. i'm going to learn from your two first links, thank you again.
01:19 geekosaur you really do want to sit down and study the OO tutorial and the object creation detail, it'll make things a lot clearer once you've had time to understand them
01:21 mingdao joined #perl6
01:22 zengargoyle jeromelanteri: reat the docs class tutorial page..... and then read http://design.perl6.org/S12.html
01:24 zengargoyle the design documents are way out of date, and may be wrong with what actually works.  but they give a better view of what is intended to work.  (this is probably bad advice, but i think you might pick up more details).
01:25 geekosaur they're missing things like TWEAK though. which is why I went with the object creation page, which is reasonably up to date
01:26 zengargoyle yeah, i just find the synopses to be more actually wordy with better descriptions than most of the docs pages.
01:26 zengargoyle and slightly better writing on the whole.
01:28 zengargoyle oh, jeromelanteri: the Taltos thing is a set of fantasy novels that have no relation to perl (but are pretty good :) ).
01:30 jeromelanteri oh... an other one thing... is there any kind of event listner in perl6 ? or a way to use instance variable that do things when change they change state (for exemple, if i change the filename of this instance, then the class of this instance should be able to automatically react and change the full filename, then maybe import/export things...
01:30 jeromelanteri zengargoyle, ok
01:30 * zengargoyle Brust and Banks are pretty much my goto enjoyable reading material.. :P
01:32 geekosaur I think we prefer Supplies for event based stuff, but if you need to do the low level watch-a-variable there are Proxies
01:32 jeromelanteri never mind, i have to read doc first.
01:32 zengargoyle jeromelanteri: lots of event stuff.  jnth gave a talk recently (it is in the perl6 weekly post a few weeks ago). and things like Gtk::Simple for UI eventy like example.
01:33 jeromelanteri geekosaur, yes. I thank also something like Qt-5 does.
01:33 jeromelanteri it is very powerfull
01:33 zengargoyle and file notification eventy things...
01:34 zengargoyle it's there, but i don't know it that well yet either... :)
01:34 jeromelanteri events should be able to handle all
01:38 zengargoyle jeromelanteri: https://www.youtube.com/watch?v=VqhLWgvIbz0
01:39 zengargoyle http://jnthn.net/papers/2017-perl6-concurrency-pcp.pdf -- slides
01:40 lookatme I think that video is private? (or something, I forgot it), maybe can not direct access ?
01:40 lookatme s/direct/directly/
01:51 ilbot3 joined #perl6
01:51 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
01:54 lookatme_ joined #perl6
01:54 Cabanossi joined #perl6
02:02 skids joined #perl6
02:04 noganex_ joined #perl6
02:14 cdg joined #perl6
02:34 jdv79 m: react whenever (^10).kv.Supply -> $i, $v { }
02:34 camelia rakudo-moar 2fb8c7: OUTPUT: «Tried to get the result of a broken Promise?  in block <unit> at <tmp> line 1??Original exception:?    Too few positionals passed; expected 2 arguments but got 1?      in block <unit> at <tmp> line 1??»
02:34 jdv79 i don't get the error there
02:38 Cabanossi joined #perl6
02:47 jeromelanteri https://gist.github.com/jerome-diver/56971332d53f93d63dcc1ba1ea8a86dc
02:48 jeromelanteri then how to call function "group" from a module ? i do add::group($yaml)
02:48 jeromelanteri it failed
02:48 jeromelanteri i also add use add;
02:48 lookatme_ jdv79, right side, the parameters may be not correct
02:48 jeromelanteri i read this doc: https://docs.perl6.org/language/modules
02:48 jeromelanteri but stay confuse
02:48 lookatme_ m: react whenever (^10).kv.Supply -> $i { say $i; }
02:48 camelia rakudo-moar 2fb8c7: OUTPUT: «0?0?1?1?2?2?3?3?4?4?5?5?6?6?7?7?8?8?9?9?»
02:50 Sgeo joined #perl6
02:52 alpha6 joined #perl6
02:52 lookatme_ m: react whenever (^10).kv.Supply -> $i { say $i.WHAT; }
02:52 camelia rakudo-moar 2fb8c7: OUTPUT: «(Int)?(Int)?(Int)?(Int)?(Int)?(Int)?(Int)?(Int)?(Int)?(Int)?(Int)?(Int)?(Int)?(Int)?(Int)?(Int)?(Int)?(Int)?(Int)?(Int)?»
02:52 mr-foobar joined #perl6
02:57 lookatme_ m: react whenever (^10).pair.Supply -> $i { say $i.WHAT; }
02:57 camelia rakudo-moar 2fb8c7: OUTPUT: «Tried to get the result of a broken Promise?  in block <unit> at <tmp> line 1??Original exception:?    No such method 'pair' for invocant of type 'Range'. Did you mean any of these??        pairs?        pairup?        path?        tail…»
02:57 lookatme_ m: react whenever (^10).pairs.Supply -> $i { say $i.WHAT; }
02:57 camelia rakudo-moar 2fb8c7: OUTPUT: «(Pair)?(Pair)?(Pair)?(Pair)?(Pair)?(Pair)?(Pair)?(Pair)?(Pair)?(Pair)?»
02:57 lookatme_ jdv79, I think you mean this ? ^^
02:58 jeromelanteri if i construct a sub EXPORT { '&group' => group(); } it failed because of signature for $yaml... and if i add $yaml inside group($yaml) then sure... perl6 is not happy because it said $yaml is not declared... but it is not something to declare... it is an argument to pass to sub group($yaml)...
02:58 jeromelanteri i not understand and i nt see ant example for show this surrent situation.
02:58 jeromelanteri curent
03:01 lookatme_ How do you use that module ?
03:02 lookatme_ It should be `use MyModule :MANDATORY;`
03:04 dugword joined #perl6
03:06 jeromelanteri lookatme_, i tryed this... same result.
03:06 jeromelanteri and i read that :MANDATORY if for default, it should be load all the time.
03:08 lookatme_ m: module A { sub s() is export(:ax) { } }; import A :ax; say &s
03:08 camelia rakudo-moar 2fb8c7: OUTPUT: «sub s () { #`(Sub|54552064) ... }?»
03:08 lookatme_ m: module A { sub s() is export(:ax) { } }; import A; say &s
03:08 camelia rakudo-moar 2fb8c7: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?Undeclared routine:?    s used at line 1??»
03:08 lookatme_ seems like no problem
03:08 lookatme_ jeromelanteri, ^^
03:09 jeromelanteri lookatme_, https://gist.github.com/jerome-diver/56971332d53f93d63dcc1ba1ea8a86dc
03:09 jeromelanteri same... error, same error.
03:10 jeromelanteri sub pants      is export(:MANDATORY) { ... } # objects with tag ':MANDATORY' are always exported
03:10 jeromelanteri copied from there: https://docs.perl6.org/language/modules
03:13 jeromelanteri m: unit module a { sub said($x) is export(:MANDATORY) { say 'hello $x';} use a;  a::said("try");
03:13 camelia rakudo-moar 2fb8c7: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?Cannot use 'unit' with block form of module declaration?at <tmp>:1?------> 3unit module a7?5 { sub said($x) is export(:MANDATORY) { ?    expecting any of:?        generic role?»
03:14 jeromelanteri m: unit module a { sub said($x) is export(:MANDATORY) { say 'hello $x';} import a;  a::said("try");
03:14 camelia rakudo-moar 2fb8c7: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?Cannot use 'unit' with block form of module declaration?at <tmp>:1?------> 3unit module a7?5 { sub said($x) is export(:MANDATORY) { ?    expecting any of:?        generic role?»
03:14 gdonald joined #perl6
03:15 jeromelanteri m: unit module a { sub said($x) is export(:MANDATORY) { say 'hello $x';} import a;  a::&said("try");
03:15 camelia rakudo-moar 2fb8c7: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?Cannot use 'unit' with block form of module declaration?at <tmp>:1?------> 3unit module a7?5 { sub said($x) is export(:MANDATORY) { ?    expecting any of:?        generic role?»
03:15 jeromelanteri m: unit module a { sub said($x) is export { say 'hello $x';} import a;  a::&said("try");
03:15 camelia rakudo-moar 2fb8c7: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?Cannot use 'unit' with block form of module declaration?at <tmp>:1?------> 3unit module a7?5 { sub said($x) is export { say 'hello $?    expecting any of:?        generic role?»
03:15 jeromelanteri m: module a { sub said($x) is export { say 'hello $x';} import a;  a::&said("try");
03:15 camelia rakudo-moar 2fb8c7: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?Strange text after block (missing semicolon or comma?)?at <tmp>:1?------> 3ub said($x) is export { say 'hello $x';}7?5 import a;  a::&said("try");?    expecting any of:?        infix?      …»
03:16 lookatme_ m: module a { sub said($x) is export { say 'hello $x';} }; import a;  a::&said("try");
03:16 camelia rakudo-moar 2fb8c7: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?Malformed lookup of ::&said; please use ::('&said'), ::{'&said'}, or ::<&said>?at <tmp>:1?------> 3xport { say 'hello $x';} }; import a;  a7?5::&said("try");?»
03:16 lookatme_ m: module a { sub said($x) is export { say 'hello $x';} }; import a;  &said("try");
03:16 camelia rakudo-moar 2fb8c7: OUTPUT: «hello $x?»
03:16 lookatme_ m: module a { sub said($x) is export(:MANDATORY) { say 'hello $x';} }; import a;  &said("try");
03:16 camelia rakudo-moar 2fb8c7: OUTPUT: «hello $x?»
03:17 jeromelanteri lookatme_, ho... my module declaratiion should be inside {} ?
03:18 jeromelanteri i not see what's wrong in my code...
03:18 lookatme_ I will try later
03:18 lookatme_ your code
03:18 jeromelanteri examples from doc doesn't put module declaration inside {}
03:18 jeromelanteri lookatme_, ok, thank you
03:23 lookatme_ jeromelanteri, What is that `datas` ?
03:25 jeromelanteri lookatme_, datas.pm6 is a file container for class "datas".
03:25 jeromelanteri also, if i call &group($yaml), it works
03:25 jeromelanteri but add::group($yaml) not
03:25 jeromelanteri if i want to keep first name module at call time, how can i do ?
03:25 lookatme_ Oh, I know what you mean
03:26 lookatme_ m: module a { sub said($x) is export(:MANDATORY) { say 'hello $x';} }; import a;  say &a::("said");
03:26 camelia rakudo-moar 2fb8c7: OUTPUT: «No such symbol '&said'?  in block <unit> at <tmp> line 1??»
03:26 lookatme_ m: module a { sub said($x) is export(:MANDATORY) { say 'hello $x';} }; import a;  say a::("&said");
03:26 camelia rakudo-moar 2fb8c7: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?Combination of indirect name lookup and call not supported?at <tmp>:1?------> 3llo $x';} }; import a;  say a::("&said")7?5;?    expecting any of:?        argument list?»
03:26 jeromelanteri it doesn't want i use syntax: add::group($x)
03:26 lookatme_ m: module a { sub said($x) is export(:MANDATORY) { say 'hello $x';} }; import a;  say a::.keys;
03:26 camelia rakudo-moar 2fb8c7: OUTPUT: «(EXPORT)?»
03:27 lookatme_ m: module a { sub said($x) is export(:MANDATORY) { say 'hello $x';} }; import a;  say a::.keys.<EXPORT>;
03:27 camelia rakudo-moar 2fb8c7: OUTPUT: «Type Seq does not support associative indexing.?  in block <unit> at <tmp> line 1??»
03:27 lookatme_ m: module a { sub said($x) is export(:MANDATORY) { say 'hello $x';} }; import a;  say a::.keys[0];
03:27 camelia rakudo-moar 2fb8c7: OUTPUT: «EXPORT?»
03:27 jeromelanteri let me read and try to understand...
03:27 lookatme_ IDK
03:29 jeromelanteri what is IDK ?
03:29 jeromelanteri m: IDK
03:29 camelia rakudo-moar 2fb8c7: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?Undeclared name:?    IDK used at line 1??»
03:30 lookatme_ I think that `import` import the symbol to current scope
03:31 lookatme_ m: module a { sub a::said($x) is export(:MANDATORY) { say 'hello $x';} }; import a;  say &a::said;
03:31 camelia rakudo-moar 2fb8c7: OUTPUT: «(Any)?»
03:31 jeromelanteri and then i need to use import ? in my main .pl6 code i have to import <group repos>; ?
03:31 lookatme_ IDK = I don't know
03:31 jeromelanteri :)
03:32 jeromelanteri i really would like to use the name of the module for the clearance of my code... (IDK if word "clearance" is english and has sens)
03:32 lookatme_ m: module a { sub a::said($x) is export(:MANDATORY) { say 'hello $x';} }; import a;  say &("a::said");
03:32 camelia rakudo-moar 2fb8c7: OUTPUT: «a::said?»
03:32 lookatme_ This way works
03:32 lookatme_ fine
03:35 jeromelanteri lookatme_, yes, but in the syntax, it is very dirty.
03:35 jeromelanteri there is no other way ?
03:35 lookatme_ m: module a { sub said($x) is export(:MANDATORY) { say 'hello $x';} }; import a;  say a.say;
03:35 camelia rakudo-moar 2fb8c7: OUTPUT: «(a)?True?»
03:36 lookatme_ m: module a { sub said($x) is export(:MANDATORY) { say 'hello $x';} }; import a;  say a.said;
03:36 camelia rakudo-moar 2fb8c7: OUTPUT: «No such method 'said' for invocant of type 'a'?  in block <unit> at <tmp> line 1??»
03:36 jeromelanteri and also, there is two times add... the module name, and the named function...
03:36 lookatme_ yeah
03:37 jeromelanteri it can not be possible that we can not call the module name first then the function next...
03:37 Cabanossi joined #perl6
03:37 jeromelanteri imagine you hav many modules with same fucntion names ? it should have cross things problems...
03:38 lookatme_ I don't know one can do that
03:38 lookatme_ yeah
03:41 jeromelanteri ok, thank you anyway for tryed to help me.
03:41 zoll left #perl6
03:43 lookatme_ m: class a  { method said($x) { say "hello"; }; }; import a; say a.said("uuu");
03:43 camelia rakudo-moar 2fb8c7: OUTPUT: «hello?True?»
03:43 lookatme_ jeromelanteri,
03:44 lookatme_ I think this is another way to do that
03:44 lookatme_ you can replace `unit module` with `unit class`
03:44 lookatme_ and use a method instead of sub
03:44 jeromelanteri lookatme_, yes, but a class is not a module...
03:45 lookatme_ Not found other way. Maybe others know
03:45 jeromelanteri and a method is not a function.
03:45 jeromelanteri lookatme_, yes, i go ahead for search
03:45 lookatme_ jeromelanteri, it's no difference, I think..
03:46 jeromelanteri lookatme_, there is, a class make more things and you can nherit an instance.
03:46 jeromelanteri a class create an object in memory too...
03:47 jeromelanteri and then a unik object is (i think) a wrong design pattern.
03:47 lookatme_ maybe perl5 also does this wat
03:47 lookatme_ y
03:48 jeromelanteri yes, perl5 do that well, i think perl6 know also to do things simple like that to.
03:48 jeromelanteri i read the doc 5 times now... can not see any relevant things about that.
03:48 ugexe m: module Foo { our sub foo { 42 } }; say Foo::foo()
03:48 camelia rakudo-moar 2fb8c7: OUTPUT: «42?»
03:49 jeromelanteri ugexe, OMG !! thank you
03:50 jeromelanteri ugexe,  it works fine...
03:55 cpage_ joined #perl6
04:11 pharv joined #perl6
04:26 pharv are there any web app frameworks that are gaining momentum besides Bailador?
04:27 pharv i'd like to start using one that is far enough along that i can create some basic apps, but also one that is well-designed that i can start contributing to
04:38 cuonglm joined #perl6
04:41 cuonglm Hi, is there any way to know which candidate is exported in multi sub?
04:41 cuonglm https://pikab.in/1b5d51ff5a
04:41 cuonglm If I marked one of multi subs is export, then the other is shown up when I call .candidates
04:42 khw joined #perl6
04:42 cuonglm as I understand now, is export causing the name installed in symbol table, without its signature
04:43 cuonglm https://pikab.in/1b5d51ff5a
04:43 cuonglm Sorry, here's the link: https://pikab.in/1a456b2231
04:47 lookatme_ jeromelanteri, declare with our works fine. But I found it can do export stuff like my does
04:47 lookatme_ s/can/can not/
04:52 Cabanossi joined #perl6
05:11 Aaronepower joined #perl6
05:24 frylock joined #perl6
05:36 AlexDaniel joined #perl6
05:39 coetry joined #perl6
05:40 coetry p6: 'hello friends'.say
05:40 camelia rakudo-moar dc4ed7: OUTPUT: «hello friends?»
05:47 wamba joined #perl6
05:51 coetry has anyone else had issues with p6doc on mac os?
05:51 coetry I can't seem to find documentation for anything. I installed rakudo-star via brew
06:07 Cabanossi joined #perl6
06:16 nine Could someone please add an answer to https://stackoverflow.com/questions/45199334/custom-precompilation-location that removing ~/.perl6 is absolutely not necessary when having different rakudo versions in use and that any issues should be reported?
06:16 nine Well I guess, I can do that as a guest
06:17 domidumont joined #perl6
06:22 coetry_ joined #perl6
06:24 nine .tell raiph Please never ever suggest rakudobrew as a "fix" to users. It will harm more than help. When users talk about precomp issues, we need those reported and then fix them.
06:25 yoleaux nine: I'll pass your message to raiph.
06:26 nine pharv: none that I'm aware of. And no framework at all really takes advantage of Perl 6' features like concurrency or multiple dispatch :/
06:32 lowbro joined #perl6
06:32 lowbro joined #perl6
06:42 skf joined #perl6
06:43 stmuk_ coetry_: There was an issue with p6doc in Star 2017.04 fixed in yesterday's release
06:44 stmuk_ coetry_: you can also fix it by upgrading doc with zef
06:45 skf Hi! When I update to Rakudo Star 2017.07 (Win64, binaries), do I first have to uninstall the old version?
06:46 moritz that would be more robust, yes
06:46 skf Thanks!
06:47 domidumont joined #perl6
06:47 ufobat joined #perl6
06:47 skf Do I have to reinstall all modules again with zef after upgrading?
06:48 nadim joined #perl6
06:49 lookatme_ skf, no need
06:50 domidumont joined #perl6
06:56 darutoko joined #perl6
06:58 pharv nine: ok, thanks... guess i'll just play around with the individual HTTP::Server components for now then
07:02 skf Thanks again :-)
07:03 nine pharv: I'd love to see something that really fits with Perl 6 :) Something that would allow for easy parallelization within a request for example. And something that makes use of Perl 6' features like traits for easy dispatch.
07:04 nine pharv: so far https://github.com/zostay/P6W has come closest to really try something 6y, but seems to still fall short. Why e.g. return 200, [ Content-Type => 'text/plain' ], [ $lucas-number[$n] ]; when we have OO baked so deeply into the language?
07:07 Cabanossi joined #perl6
07:13 parv joined #perl6
07:15 jeromelanteri https://gist.github.com/jerome-diver/56971332d53f93d63dcc1ba1ea8a86dc
07:15 dugword joined #perl6
07:17 jeromelanteri i'm trying to create a yaml file who contains an array of Hashes. Each hash should by { group => 'name_of_group', repos => [ {title => 'my first title', url 'my first url'}, {title => 'other title', url => 'other url'}]}
07:18 nine jeromelanteri: repos => [ ${ url => "", title => "" } ]
07:19 jeromelanteri in datas.pm6 file, the datas class at construction time start initializations, and from initialize_filename_data(), it creat the file and put inside default value. But this value created at line 28 doesn't give an array of hashes
07:19 jeromelanteri nine, look at line 28 of datas.pm6
07:19 stmuk_
07:20 nine jeromelanteri: that should be my @default = [ ${ group => "default", repos => [ ${ url => "", title => "" } ] } ];
07:25 jeromelanteri yes
07:28 cgfbee joined #perl6
07:29 coetry joined #perl6
07:29 jeromelanteri nine, that is correct, and how to make this file a yaml file ?
07:30 jeromelanteri method dump should make it yaml compatible, yes ?
07:30 jeromelanteri from perl5, the yaml file content is not the same.
07:32 dakkar joined #perl6
07:33 xtreak joined #perl6
07:33 abraxxa joined #perl6
07:34 * lizmat clickbaits https://p6weekly.wordpress.com/2017/07/24/2017-30-starring-fresh-produce/
07:37 holyghost joined #perl6
07:39 lookatme_ lizmat, ++
07:40 zakharyas joined #perl6
07:43 wamba joined #perl6
07:44 faraco_ joined #perl6
07:44 faraco_ hi guys, what is Inf?
07:45 nine faraco_: infinity
07:45 faraco_ camelia: say Inf;
07:45 nine m: say Inf
07:45 camelia rakudo-moar dc4ed7: OUTPUT: «Inf?»
07:45 faraco_ oh...why that is not documented?
07:46 nine faraco_: because no one wrote documentation for it so far :)
07:46 eater m: say 0..* == 0..Inf
07:46 camelia rakudo-moar dc4ed7: OUTPUT: «True?»
07:46 eater nice
07:47 gdonald joined #perl6
07:47 nine faraco_: for writing documentation one needs to actually know everything and at the same time recognize what others won't know. So maybe it just never occured to the doc writers that there are people who need docs for Inf
07:48 faraco_ I see. I'm just walking the doc issues, and stumbled upon zoffix's Inf documentation lacking.
07:53 FROGGS joined #perl6
07:56 rindolf joined #perl6
07:56 melezhik joined #perl6
07:57 melezhik Hi Perl6 gurus!
07:57 melezhik How can I pass array of array as function arguments ?
08:00 faraco_ m: say WHAT $*DISTRO;
08:00 camelia rakudo-moar dc4ed7: OUTPUT: «(Distro)?»
08:01 faraco_ m: say WHAT $*KERNEL; say WHAT $*VM;
08:01 camelia rakudo-moar dc4ed7: OUTPUT: «(Kernel)?(VM)?»
08:01 faraco_ what those even do?
08:01 emeric joined #perl6
08:02 faraco_ nevermind
08:04 jonas1 joined #perl6
08:12 lookatme_ m: sub aa(@aa) { .perl.say for @aa; }; aa([ [1, 2,], [3, 4]]);
08:12 camelia rakudo-moar dc4ed7: OUTPUT: «$[1, 2]?$[3, 4]?»
08:13 lookatme_ m: sub aa(@aa) { say " => ", .perl for @aa; }; aa([ [1, 2,], [3, 4]]);
08:13 camelia rakudo-moar dc4ed7: OUTPUT: « => $[1, 2]? => $[3, 4]?»
08:13 lookatme_ melezhik, ^^^
08:15 melezhik thanks lookatme:, I thought it should be (,) :))
08:19 lookatme_ m: say [].WHAT; say ().WHAT;
08:19 camelia rakudo-moar dc4ed7: OUTPUT: «(Array)?(List)?»
08:19 lookatme_ melezhik, ^^
08:20 melezhik yeah, I see
08:20 melezhik thanks
08:22 wamba joined #perl6
08:25 faraco_ any idea how this method operates? multi method tree(Any:D:nqp::istype(self, Iterable)?? self.map({ .tree }).item!! self}
08:32 faraco_ m: say WHAT $*PERL;
08:32 camelia rakudo-moar dc4ed7: OUTPUT: «(Perl)?»
08:38 robertle joined #perl6
08:41 protium joined #perl6
08:51 cadz joined #perl6
08:51 faraco_ hmm, just want to ask, why slurp is in this example ? https://docs.perl6.org/routine/spurt#Examples
08:52 cadz Hi perl6 im new
08:52 faraco_ cadz: welcome! :)
08:52 cadz @faraco_ are you a bot?
08:52 faraco_ cadz: nope, a human.
08:59 El_Che ^---- that's what it wants you to believe since it passed his turing test...
08:59 lookatme_ faraco_, what's your mean?
08:59 lookatme_ cadz, welcome o/
09:00 faraco_ lookatme_: I'm not sure why slurp routine is in spurt example. I don't think it is related to each other.
09:01 lookatme_ faraco_, It's common that show what the file contain after you write something to a file.
09:01 lookatme_ I think
09:02 faraco_ I see, then I'll add a comment on what it does there too.
09:03 lookatme_ For me, comment after that slurp is clear enough
09:04 faraco_ okay nevermind then.
09:06 lookatme_ Hmm, YW
09:08 faraco_ lookatme_++
09:09 samcv so i have a bunch of objects in an array. and i want to pass the values through several functions, but have the changes to the objects i'm passing also take effect in the original array
09:10 samcv https://gist.github.com/samcv/2b89269935ff70f4e197f0dedb407ac0#file-generate-collation-data-p6-L127-L155 so see here how i iterate @main-node -> $sub_node and pass $sub_node to another funcion
09:11 samcv i make changes to $sub_node and need it to also take effect in the original array. is there any way for me to achieve this that doesn't include passing the array element through the functions (would not be as nice as i expand things)
09:11 lookatme_ It's like a `Perl6 on the rail`.
09:14 jnthn samcv: <-> instead of ->
09:14 jnthn samcv: And if you pass it to other subs just declare those parameters as "is rw" and you'll be able to write to the passed thing
09:15 lookatme_ my @a = " a", "b "; sub atrim(@a) { @a>>.trim }; sub aup(@a) { @a>>.uc; }; @a ==> atrim() ==> aup() ==> my @ups; say @ups;
09:15 lookatme_ m: my @a = " a", "b "; sub atrim(@a) { @a>>.trim }; sub aup(@a) { @a>>.uc; }; @a ==> atrim() ==> aup() ==> my @ups; say @ups;
09:15 camelia rakudo-moar acf9f9: OUTPUT: «[A B]?»
09:15 lookatme_ m: my @a = " a", "b "; sub atrim(@a) { @a>>.trim }; sub aup(@a) { @a>>.uc; }; @a ==> atrim() ==> aup() ==> my @ups; dd @ups;
09:15 camelia rakudo-moar acf9f9: OUTPUT: «Array @ups = ["A", "B"]?»
09:17 dugword joined #perl6
09:17 faraco_ I found the slurp example is not properly formatted - https://docs.perl6.org/routine/slurp
09:19 El_Che faraco_: I saw your PR for rakudo-pkg, will have a look later
09:19 El_Che thx
09:20 faraco_ El_Che: it is just a misc :P. but if you want to accept it, your welcome. :)
09:21 faraco_ also in the slurp doc, how to fix that? https://github.com/perl6/doc/blob/master/doc/Type/IO.pod6#L279
09:22 faraco_ the code block begins with `for code :skip-test`.
09:23 wamba joined #perl6
09:26 mr_ron joined #perl6
09:26 El_Che faraco_: send a PR
09:26 cadz Can perl5 and perl6 run side by side?
09:27 faraco_ El_Che: Alright, I'll PR since I don't know what it will do if I direct push.
09:27 ilmari cadz: yes, they are completely independet
09:28 ilmari cadz: but they can also interoperate, via Inline::Perl5 in perl6 and Inline::Perl6 in perl5
09:28 cadz what do you mean interoperate?
09:28 cadz Like i can use perl6 in my perl 5 code?
09:28 ilmari and vice versa
09:29 lookatme_ yeah
09:29 ilmari https://metacpan.org/pod/Inline::Perl6 https://github.com/niner/Inline-Perl5
09:30 cadz This is good, cause I already have a web application running in perl5, and i want to try perl6, for up coming projects, is this advisable?
09:35 Geth ¦ doc: faraco++ created pull request #1423: possible fix on reformatting the slurp example
09:35 Geth ¦ doc: review: https://github.com/perl6/doc/pull/1423
09:37 xtreak joined #perl6
09:43 pmurias joined #perl6
09:43 samcv jnthn, i'm getting Parameter '$p6node' expected a writable container, but got p6node value now
09:44 wamba joined #perl6
09:44 pmurias does preprocessing the nqp.js/rakudo.js runtime to generate both an async/await and node.js specific variants seem sane?
09:45 samcv class p6node { has %.next is rw }; and it calls sub p6node-find-node to supply it with $p6node. so basically function(p6node-find-node); and sub p6node-find-node ($node) { $node.next{$cp} }
09:45 samcv hmm i guess maybe i need to is rw that one too maybe :)
09:45 pmurias I plan to replace RETURN, AWAIT, ASYNC with either 'return', 'await', 'async' or ''
09:45 jnthn samcv: Yeah, you'll need `is rw` on the code paths where you're returning/passing things
09:46 samcv cool just gotta keep following the paths
10:00 faraco_ quick question, what does concurrency in Perl 6 and Go's goroutines differs?
10:01 nadim m: "123".lines.map: { comb(8) }
10:01 camelia rakudo-moar acf9f9: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?Calling comb(Int) will never work with proto signature ($, $, $?)?at <tmp>:1?------> 3"123".lines.map: { 7?5comb(8) }?»
10:01 samcv jnthn, https://gist.github.com/samcv/ef80ff58b8fce911a6ceb9c9a70640b9#file-generate-collation-data-p6-L69-L71 this function. for some reason it's not returning a writable container but if i replace the function call with the same code, it works fine
10:01 samcv any clue?
10:01 nadim m: "123".lines.map: { .comb(8) }
10:01 camelia rakudo-moar acf9f9: ( no output )
10:01 nadim m: "123".lines.map: { .comb(8) }.say
10:01 camelia rakudo-moar acf9f9: OUTPUT: «-> ;; $_? is raw { #`(Block|58367432) ... }?Cannot resolve caller map(Seq: Bool); none of these signatures match:?    ($: Hash \h, *%_)?    (\SELF: &block;; :$label, :$item, *%_)?    (HyperIterable:D $: &block;; :$label, *%_)?  in block <unit> …»
10:02 nadim m: ("123".lines.map: { .comb(8) }).say
10:02 camelia rakudo-moar acf9f9: OUTPUT: «((123))?»
10:02 nadim m: ("123456".lines.map: { .comb(3) }).say
10:02 camelia rakudo-moar acf9f9: OUTPUT: «((123 456))?»
10:02 nadim m: ("123\n456".lines.map: { .comb(3) }).say
10:02 camelia rakudo-moar acf9f9: OUTPUT: «((123) (456))?»
10:02 xinming joined #perl6
10:02 nadim m: ("123\n\n456".lines.map: { .comb(3) }).say
10:02 camelia rakudo-moar acf9f9: OUTPUT: «((123) () (456))?»
10:03 nadim m: ("123\n\n456".lines.map: { .comb(4) }).say
10:03 camelia rakudo-moar acf9f9: OUTPUT: «((123) () (456))?»
10:03 samcv faraco_, i don't know go
10:03 samcv faraco_, but you might find a short blog post i wrote interesting https://cry.nu/perl6/multithreading-in-perl6/
10:04 samcv and at the end there's a link to part 2 as well. gives you an intro to some of the perl 6 concepts
10:04 jnthn samcv: return-rw (or just implicit return)
10:04 samcv ah thanks!
10:04 nadim m: ("123\n\n456".lines.flatmap: { .comb(4) }).say
10:04 camelia rakudo-moar acf9f9: OUTPUT: «(123 456)?»
10:05 xtreak joined #perl6
10:06 faraco_ samcv++
10:08 nadim lizmat: thanks for the perl6 weekly again, looking forward to it every week.
10:09 samcv faraco_, let me know what you think
10:09 timotimo also might need to declare the sub itself "is rw"?
10:11 samcv timotimo, how do i do that?
10:11 samcv i'm still having issues even after making everything returns-rw and such
10:13 timotimo sub foo (bar baz) is rw { ... }
10:14 timotimo and then either return-rw or last-statement-of-sub-returns-automatically
10:17 samcv argh still not working
10:18 timotimo it's possible that the .next{$cp} just isn't writable for some reason, like you bound a value in there rather than having a scalar container
10:18 timotimo you could try "note $p6node.next{$cp}.VAR.^name" and see if it says Scalar or not
10:19 samcv it's weird. one of the values in the object get written but the other doesn't
10:19 samcv but i write them in the same function
10:20 samcv and both are is rw in the object. both are Int's
10:20 samcv but one gets altered the other not
10:21 samcv yep it says Scalar
10:21 wamba joined #perl6
10:22 samcv ok and only one of them has collation_key_link set. the other only have collation_key_elems set
10:34 jeromelanteri i use term::choose and Prompt:Gruss, Term:: Choose is very nice (it clear the terminal by add a layout, very clean...), but Prompt::Gruff go back on console terminal emultaor line (who is not so nice than Term::Choose, but also make a big contrast of final render). So, do you know an other one (who works) module who ask for entry strin or yes/no question tag in the same presentation than Term::Choose does ?
10:49 AlexDaniel camelia: help
10:49 camelia AlexDaniel: Usage: <(rakudo-moar|p5-to-p6|prof-m|star-m|debug-cat|nqp-js|rakudo-jvm|nqp-moarvm|nqp-jvm|nqp-q|r-j|sm|star|nom|nqp-m|p6|m|p56|rakudo|nqp-mvm|r-m|r-jvm|j|rj|perl6|rm|r|nqp)(?^::\s(?!OUTPUT)) $perl6_program>
10:51 akagi201__ joined #perl6
11:00 mr-fooba_ joined #perl6
11:03 araujo joined #perl6
11:03 araujo joined #perl6
11:05 Geth ¦ doc: 54cb7608b0 | faraco++ (committed by Aleks-Daniel Jakimenko-Aleksejev) | doc/Type/IO.pod6
11:05 Geth ¦ doc: possible fix on reformatting the slurp example (#1423)
11:05 Geth ¦ doc:
11:05 Geth ¦ doc: * possible fix on reformatting the slurp example
11:05 Geth ¦ doc:
11:05 Geth ¦ doc: * add :skip-test for slurp example
11:05 Geth ¦ doc: review: https://github.com/perl6/doc/commit/54cb7608b0
11:08 jeromelanteri what should be an equivalent for: my success = IPC::Run::run \@cmd, '>', \$stdout, '2>pty', \$stderr; ?
11:08 jeromelanteri in perl6
11:08 timotimo what are $stdout and $stderr here?
11:09 jeromelanteri standard output and standard error
11:10 jeromelanteri default variables for terminal output
11:11 jeromelanteri never mind if i not have them... i just need to catch success output true or false
11:11 timotimo why do you even pass stdout and stderr if you just want to keep the default ones?
11:11 timotimo https://docs.perl6.org/language/ipc#index-entry-running_programs-running
11:12 jeromelanteri in perl5 you define these $stdout and $stderr empty, then it will put answer inside.
11:12 timotimo so you want to keep the output?
11:13 jeromelanteri timotimo, this IPC::Run:run method can do that, then i profit to try and see if an other one perl6 module does it same or at least... the minimum i need.
11:13 jeromelanteri timotimo, if possible is better, but if just success connection it should be fine for me.
11:13 jeromelanteri it is for check presence of a remote repo
11:13 timotimo the page i linked does what you need
11:14 jeromelanteri cmd would be git ls-remote https://my/remote/repo
11:14 jeromelanteri oh fine, i dodn't see... thank you.
11:14 jeromelanteri didn't (tired)
11:18 dugword joined #perl6
11:22 Cabanossi joined #perl6
11:23 abraxxa1 joined #perl6
11:23 abraxxa joined #perl6
11:29 JimmyZ joined #perl6
11:33 xtreak_ joined #perl6
11:34 xtreak joined #perl6
11:39 bjz joined #perl6
11:54 unop joined #perl6
12:00 stmuk joined #perl6
12:12 raschipi joined #perl6
12:20 dugword joined #perl6
12:28 domidumont joined #perl6
12:28 itaipu joined #perl6
12:30 domidumont1 joined #perl6
12:32 pmurias joined #perl6
12:37 Cabanossi joined #perl6
12:43 coetry joined #perl6
12:51 araraloren joined #perl6
12:57 mcmillhj joined #perl6
13:01 donaldh joined #perl6
13:04 cosimo joined #perl6
13:05 zostay Feel free to raise the irc in an issue. The doc is not finished.
13:05 zostay Stupid autocorrect, rfc, not irc
13:07 zostay The was re @nine from earlier
13:08 zostay There is a really good set of reasons for preferring tuples to an object though for the return values in P6WAPI
13:10 zostay Simplicity, easy to coerce into it, there are lots of listy things you can use, etc. It does not require an Array, but anything that coerces to List
13:11 zostay So return an object in the current spec if you like, just make sure it has a list method
13:20 dugword joined #perl6
13:25 xtreak joined #perl6
13:27 nine zostay: the list however is not self documenting, won't warn you if you're holding it wrong and is harder to extend in a backwards compatible way
13:28 zostay Make that argument in an issue and we can figure it out. So far I have had some interest, some complaining, but not much cooperation.
13:28 zostay Those are all good points.
13:29 xtreak joined #perl6
13:32 cog_ joined #perl6
13:34 kst` joined #perl6
13:39 mr-foobar joined #perl6
13:40 nine zostay: I have a hard time coming up with a good subject for the issue. My beef is that P6W in general seems to ignore OO. For example: "&wrappee = wrappee(%config) if &wrappee.returns ~~ Callable;" looks quite magical to the uninitiated. $wrappee.config(%config); however looks very mundane (a default method config that does nothing can be provided by the P6W::App role)
13:41 nine zostay: die "WTF" if $p.result[0] != 200; is magic number soup while die "WTF" if $p.result.http-code != 200; points the casual reader at what's going on
13:42 mcmillhj joined #perl6
13:42 nine zostay: I love however that you use promises :) This has potential
13:47 stux|RC-only joined #perl6
13:51 zengargoyle .ask jnthn is that concurrency talk/slides supposed to be not shared around?
13:51 yoleaux zengargoyle: I'll pass your message to jnthn.
13:51 wamba joined #perl6
13:53 zakharyas joined #perl6
13:57 skids joined #perl6
13:59 zakharyas joined #perl6
14:04 zengargoyle gah, StackOverflow.  i'm so not into playing reputation game again.
14:06 zengargoyle .ask raiph can you maybe augment the bib parser with like: my $kv-index = .<kv-pairs><kv-pair>.first({$_.<key> ~~ "title"}, :k); # so it doesn't just use .<kv-pairs><kv-pair>[0]<value>
14:06 yoleaux zengargoyle: I'll pass your message to raiph.
14:07 Cabanossi joined #perl6
14:08 wamba joined #perl6
14:10 espadrine joined #perl6
14:14 wamba joined #perl6
14:14 tinita zengargoyle: load is actually implemented in https://github.com/yaml/yaml-perl6
14:15 tinita feedback welcome
14:15 tinita it just needs libyaml-perl6 at the moment
14:15 zengargoyle tinita: cool, that was just the one error i didn't feel like messing with. :)
14:16 rindolf joined #perl6
14:16 colomon Does anyone know the state of the various Git modules for p6?  I was just thinking it would be nice to have a script to delete merged branches, and wondered if we had a module interface to git or if I should just call git commands directly myself.
14:17 tinita zengargoyle: just be aware that it's different from https://github.com/perl6-community-modules/yaml-pm6
14:17 perlpilot joined #perl6
14:18 Khisanth joined #perl6
14:18 zengargoyle tinita: i'll try and remember if/when i need to use a YAML module myself.
14:28 alimon joined #perl6
14:37 Cabanossi joined #perl6
14:38 FROGGS joined #perl6
14:39 cosimo joined #perl6
14:52 zakharyas joined #perl6
14:53 jnthn zengargoyle: Which talk? :)
14:54 jnthn The most recent one I did has already been posted publicly on YouTube and I tweeted about it :)
15:02 zengargoyle oh, maybe i have the link given from the p6weekly a few weeks ago and that video still says private...
15:03 zengargoyle ah, i was going on lookatme's comment: 18:40 < lookatme> I think that video is private? (or something, I forgot it), maybe can not direct access ?
15:04 zengargoyle cool, guess it's actually been made public.
15:05 AlexDani` joined #perl6
15:06 zengargoyle it had that big red warning about being a private video when it was first in p6weekly.
15:06 jnthn Ah, OK
15:08 zengargoyle .tell lookatme that video has been make public now, so it's all good.
15:08 yoleaux zengargoyle: I'll pass your message to lookatme.
15:13 perlpilot jnthn: Will there be some future syntax to encapsulate that compose routine from that video?  It kind of made me want some syntax resembling ==> to join together the processing bits without the supply "boilerplate"
15:14 zakharyas joined #perl6
15:18 someuser joined #perl6
15:22 dugword joined #perl6
15:25 dugword joined #perl6
15:32 perlpilot joined #perl6
15:39 ChoHag joined #perl6
15:43 nhywyll joined #perl6
15:46 cdg joined #perl6
15:47 Skarsnik joined #perl6
15:48 cdg_ joined #perl6
15:48 Skarsnik Hello
15:48 Skarsnik Was there a Qt app to see profile log from rakudo/moar?
15:49 [Coke] there was a builtin --profile that generated an html page.
15:49 ugexe or sql i think
15:50 ugexe there is some Qt profiler thing though
15:50 timotimo right in tadzik's github, Skarsnik
15:50 Skarsnik well all I remember from the html generated, it was like easily over 100MB and most brownser did not like that x)
15:51 timotimo also, the profiler can now spit out a .sql file that is compatible with sqlite
15:51 Skarsnik ah, that interesting
15:51 Skarsnik probably lighter than json to use them?
15:51 ugexe yeah tadzik told me the .sql output was to address that very problem
15:52 timotimo https://github.com/perl6/nqp/pull/354 - has a few sql queries to start you off with
15:52 ugexe which reminds me i should actually try profiling zef again since it might be loadable now :)
15:52 timotimo the thing about json is that the qt json library we used would arbitrarily not support files above a certain size
15:53 timotimo we didn't have to try very hard to reach taht size
15:54 ugexe no other json library could be swapped in that *can* handle that size?
15:54 timotimo could be. is work, though
15:55 wamba joined #perl6
16:00 perlpilot joined #perl6
16:07 awwaiid joined #perl6
16:07 perlpilot joined #perl6
16:07 |oLa|1 joined #perl6
16:08 Cabanossi joined #perl6
16:12 TeamBlast joined #perl6
16:15 perlpilot_ joined #perl6
16:16 cpage__ joined #perl6
16:16 |oLa| joined #perl6
16:16 Skarsnik_ joined #perl6
16:16 AlexDani` joined #perl6
16:19 notbenh joined #perl6
16:24 someuser joined #perl6
16:27 mcmillhj joined #perl6
16:38 TeamBlast joined #perl6
16:51 Bucciarati joined #perl6
16:51 Juerd Is there a way to introspect which library (version) an "is native" function resolved to?
16:52 itaipu joined #perl6
16:55 timotimo the native role applied to the thing has the original thing passed to the trait in it
16:56 timotimo m: use NativeCall; sub fprintf(Str, int32, int32) is native("that_library.so"); say &fprintf.^roles[0].perl
16:56 camelia rakudo-moar 5a5849: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?A unit-scoped sub definition is not allowed except on a MAIN sub;?Please use the block form.?at <tmp>:1?------> 32, int32) is native("that_library.so");7?5 say &fprintf.^roles[0].perl?»
16:56 timotimo m: use NativeCall; sub fprintf(Str, int32, int32) is native("that_library.so") { }; say &fprintf.^roles[0].perl
16:56 camelia rakudo-moar 5a5849: OUTPUT: «NativeCall::Native[Sub,Str]?»
16:56 timotimo it doesn't output that, eh?
16:57 Skarsnik why should it give you that? it's just the argument to the trait
16:58 Skarsnik Ho the role... hm
16:58 timotimo because the argument is put into the role directly
16:58 Skarsnik not sure you can access the data?
16:59 Zoffix m: use NativeCall; sub fprintf(Str, int32, int32) is native("that_library.so") { }; say &fprintf.^roles[0].^role_arguments
16:59 camelia rakudo-moar 5a5849: OUTPUT: «(sub fprintf (Str $, int32 $, int32 $) { #`(Sub+{NativeCall::Native[Sub,Str]}|70456672) ... } that_library.so)?»
17:00 Zoffix m: use NativeCall; sub fprintf(Str, int32, int32) is native("that_library.so") { }; say &fprintf.^roles[0].^role_arguments.tail
17:00 camelia rakudo-moar 5a5849: OUTPUT: «that_library.so?»
17:00 timotimo ah, nice.
17:00 timotimo my local rakudo seems broken at the moment, so couldn't try around manually
17:01 Skarsnik m: use NativeCall; sub fprintf(Str, int32, int32) is native("that_library.so", v0.1) { }; say &fprintf.^roles[0].^role_arguments
17:01 camelia rakudo-moar 5a5849: OUTPUT: «(sub fprintf (Str $, int32 $, int32 $) { #`(Sub+{NativeCall::Native[Sub,List]}|70812272) ... } (that_library.so v0.1))?»
17:01 Skarsnik m: use NativeCall; sub fprintf(Str, int32, int32) is native(sub {"foo"}) { }; say &fprintf.^roles[0].^role_arguments
17:01 camelia rakudo-moar 5a5849: OUTPUT: «(sub fprintf (Str $, int32 $, int32 $) { #`(Sub+{NativeCall::Native[Sub,Sub]}|80132592) ... } sub () { #`(Sub|80132744) ... })?»
17:01 zengargoyle i was thinking if is native("libfoo.so") works can one tell that it's really libfoo.so :ver("0.1.0") that got loaded.
17:02 Skarsnik it's lost
17:02 Skarsnik because it's converted to a path to the lib
17:02 Skarsnik well you can get the argument like show previously
17:03 zengargoyle and maybe at compile time, a is native("libfoo.so") could be compiled with the actual version that was found so upgraging (changing libfoo.so link in the future) does not break ABI.
17:03 timotimo the lookup of the actual library only happens when you run it the first time
17:03 aindilis joined #perl6
17:03 zengargoyle so compile time phaser to do the lookup?
17:03 Skarsnik no
17:04 Skarsnik a method of the role is executed and do it at runtime
17:05 zengargoyle ah, ok, i've just been pondering ways to avoid libfoo.so changing between when it's built/tested and when it's run.
17:05 zengargoyle w/o specifing a specific version.
17:05 Skarsnik https://github.com/rakudo/rakudo/blob/nom/lib/NativeCall.pm6#L308
17:05 Skarsnik don't
17:05 Skarsnik I mean
17:05 Skarsnik libfoo.so should not be used
17:06 Skarsnik execpt for some shitty lib
17:06 zengargoyle libfoo.so often just links to the latest libfoo.1.0, libfoo.2.0, libfoo.2.1.0 that have been installed on the system.
17:06 Skarsnik if you look at bsd/linux doc about dynamic lib .so is a developper thing, that why debian provide them only in the -dev package
17:07 nadim joined #perl6
17:08 zengargoyle right, and ld when given libfoo.so actually embeds the libfoo.so.1.0.0 that it found when compiling so the prog doesn't fail if libfoo.so is changed.
17:08 Skarsnik That why I put a warning when no version was given to the native trait (but I think it was removed)
17:08 zengargoyle ah,,,, gotcha.
17:08 geekosaur :(
17:09 Skarsnik Idealy, a libit should be libnameoflib.ABIVERSION.so libnameoflibe.so is a developper thing
17:09 Skarsnik damn
17:09 geekosaur everyone wants to think that's the right thing and will always "just work"... have seen it cause a fair number of bugs (not just in perl 6; once had to diagnose a weird bug in (then Platform Computing) LSF that boiled down to it attaching a libfoo.so unversioned and the ABI had changed)
17:09 mst trade-offs, as usual
17:10 zengargoyle i guess maybe it can be left up to Build.pm script to sort things out at install time or something.
17:10 Skarsnik by like mysql does a mysql.version.so
17:10 Skarsnik even if there is no ABI change
17:10 timotimo the trade-off with not passing a version is that your program won't work on many user's systems unless they create that symlink as root or install some extra dev package
17:11 Skarsnik There more info on the ticket associed to the PR that add the version in the native trait
17:12 geekosaur and just to make things more annoying, the ELF shared object spec has one versioning mechanism, Mach-O has another, and Windows DLLs have none at all
17:13 Skarsnik it's still standardized for os X
17:13 zengargoyle i also wonder how to go about guessing library location/name at build time.  i.e.  find libfoo.so.1 given libfoo.so or libfoo or just foo.
17:13 zengargoyle like trying to get a list of searched paths out fo ld.so somehow and looking for candidates.
17:13 Juerd timotimo: Unfortunately, I don't need what was passed, but what was loaded. Specifically, 'readline' was passed, but it doesn't work if I pass that to cglobal. 'readline.so.6' works with cglobal, but on another box it uses 'readline.so.7'
17:14 Juerd I found a work-around: I use Readline.pm6 to set a value in readline, then brute force the values until I get the right value back. Then I know which version of readline.so was used by Readline.pm6
17:14 Skarsnik what? readline.so.6 work?
17:14 Juerd https://github.com/Juerd/shalog/commit/656c45e836427f3786d7c90a5792da47dc820036
17:15 Juerd Er, libreadline.so.6
17:15 Skarsnik you probably to use an ENV variable if you want to be able to change it
17:15 Skarsnik and I can't type properly today
17:15 Juerd Well, I have something that works now, need it in production tomorrow :)
17:16 Juerd But was wondering if there's a supported way of doing this
17:16 Juerd Something less hacky :)
17:16 Skarsnik look like a special case like mysql, the .6 .7 is a version not an ABI version?
17:17 Juerd I have no idea. I never use C stuff normally :)
17:17 Juerd This entire thing with libreadline is a hack because I can't assign to rl_completion_entry_func to get tab completion :)
17:18 Juerd And I really need tab completion :)
17:18 zengargoyle i would think that there's a call somewhere in whatever clib/dynlib/ld.so loader thing that could resolve a libfoo.so and tell the actual version/filename/path of the resolved lib.
17:18 zakharyas joined #perl6
17:18 Skarsnik My though on this whole miss is https://github.com/rakudo/rakudo/pull/716
17:19 geekosaur not publicly, sadly
17:19 Skarsnik *mess
17:19 ChoHag joined #perl6
17:19 geekosaur there's a debug envar for linux's ld.so, a different one for solaris's, a different one for freebsd...
17:19 zengargoyle darn.
17:19 Skarsnik m: use NativeCall :ALL; guess_library_name("foo", v6.1).say;
17:19 camelia rakudo-moar 5a5849: OUTPUT: «Too many positionals passed; expected 1 argument but got 2?  in sub guess_library_name at /home/camelia/rakudo-m-inst-2/share/perl6/sources/24DD121B5B4774C04A7084827BFAD92199756E03 (NativeCall) line 205?  in block <unit> at <tmp> line 1??»
17:20 geekosaur this stuff was designed for C, not for perl 6
17:20 Skarsnik m: use NativeCall :ALL; guess_library_name(("foo", v6.1)).say;
17:20 camelia rakudo-moar 5a5849: OUTPUT: «libfoo.so.6.1?»
17:20 zengargoyle is there a standard symbol in the loaded lib that has the version so one could then try libfoo.so:ver<whatever> and see if it works?
17:20 geekosaur no
17:21 zengargoyle ah, i guess that's why it's hard. :)
17:21 Skarsnik The best solution is to cover the normal/general case in NC and have people build their own find lib stuff for specific case
17:23 zengargoyle yeah, i guess there's always just set an environment variable before building.
17:23 Skarsnik but the solution for that sucks (IMO) you need to give a sub to the trait and it will be executed for each routine marked with the is native trait
17:25 khw joined #perl6
17:26 zengargoyle maybe a Build.pm could find and make a Foo::NC::Library module with a constant in it.
17:26 Skarsnik constant is compile time
17:26 geekosaur actually this impinges on a different issue that has been brought up, which is that instead of making these things per-routine there should be a "global" (module level) operation to get a "handle" for a shared object and then the routines should reference that in "is native"
17:27 Skarsnik geekosaur, that what my pr is about actually, you give the is native trait a lib handle instead
17:28 Skarsnik so you are like my $handle = native-library-register-thing(blalblab); sub foo is native($handle) {};
17:29 geekosaur that said, I continue to think NC is doomed in the long run because there isn't enough information in a shared object to do it right, you need source information as well (and even then C has that annoying ambiguity with respect to pointer vs. array)
17:29 zengargoyle Skarsnik: i think compile time is fine for me.  if you remove the libfoo.so.1.0 that it actually found and compiled it then it should no longer work.
17:30 Skarsnik It does not work well with precomp for module. Like if you base on a env variable, it will be only at compile time (or the first time the module is compiled) then you find yourself unable to change this value at runtime later
17:32 Skarsnik like you do MYVAR=piko; perl6 -I foomodule/lib piko.p6; MYVAR=bar (first run);  perl6 -I foomodule/lib piko.p6 it will keep the first MYVAR value
17:32 zengargoyle why would you everl load a different version at runtime and expect it to work?  given libfoo.so, at compile find libfoo.so.1.0 and libfoo.so.1 and compile in libfoo.so:ver<1>
17:32 Skarsnik damn I missplaced the (first run)
17:33 mr-fooba_ joined #perl6
17:35 Skarsnik well if you want to try another version of lib. Think of a module (binding a lib) installed by an admin on a debian stable and an user want to try with a more recent version of the lib. He can't since it will be tied to the lib found at install time
17:37 zengargoyle right, but AFAIK..... libfoo.so.1 is a link to libfoo.so.1.latest and libfoo.so is a link to libfoo.so.latest.  if you compile in libfoo.so.1 you will get libfoo.so.1.latest  if you want libfoo.so.2 you need to recompile.
17:38 geekosaur keep in mind that, when doing this in C, you use a SONAME
17:38 geekosaur which is embedded in the shared object as read at link time
17:38 Skarsnik hm
17:38 Skarsnik libfoo.so.1 can be whatever the admin want x)
17:38 geekosaur so libfoo.so.1.2.127 will have in it an SONAME of "libfoo.so.1" typically
17:39 zengargoyle true... :)
17:40 Skarsnik also thing of a module like DBIish
17:41 Skarsnik the test does not assume you have every SGDB installed so you can install DBIish without having mysql/sqlite/postgres/whatever
17:41 Skarsnik it can be installed without a lib
17:45 zengargoyle so at build, find the ones you can and make DBIish::NC::Library::Pq with a constant with the version.  then try to require that at runtime, if it fails fallback to libpq.so
17:46 zakharyas joined #perl6
17:49 zengargoyle i guess i'm thinking along the lines of .PL files in p5.  code that generates the .pm file at build.  can suss out the actual library or just put in the generic case.
17:49 Skarsnik DBIish do weird stuff https://github.com/perl6/DBIish/blob/master/lib/NativeLibs.pm6
17:51 nhywyll joined #perl6
17:55 setty1 joined #perl6
18:00 Skarsnik unrelated, let see if rakudo/moar build on my chromebook x)
18:01 cdg__ joined #perl6
18:08 xinming joined #perl6
18:14 mspo with cruton?
18:15 Skarsnik hm 2 tests does not pass for NC, the one with the callbacks and another one with simple args
18:15 Skarsnik yes
18:19 zengargoyle unrelated, does anybody know of a good HOWTO for doing CI on Windows from GitHub (ala travis.ci) for somebody who knows almost nothing about Windows?
18:21 El_Che zengargoyle: install ubuntu on windows :)
18:21 El_Che jk
18:22 Cabanossi joined #perl6
18:23 Zoffix zengargoyle: I think "AppVeyor" is what the kids use for that purpose. We got one in rakudo, tho I've no idea about its setup or requirements
18:23 timotimo zengargoyle do you perhaps mean appveyor?
18:23 timotimo heh.
18:23 Zoffix zengargoyle: https://github.com/rakudo/rakudo/blob/nom/appveyor.yml
18:24 timotimo sign up on appveyor using your guthub user, create a "new repo" and select your project, then select branches and stuff
18:24 Skarsnik interesting
18:25 timotimo guthub? lol
18:25 Skarsnik gitgood
18:30 pharv joined #perl6
18:31 zengargoyle Zoffix: cool, i'll check it out.
18:33 geekosaur better than gitflub
18:34 ugexe timotimo: https://github.com/rakudo/rakudo/commit/02667bd#diff-b230ad5a251e63db259b97ac944ca507R98 `-e '...'` this isn't windows friendly
18:36 geekosaur yeh, you should swap the 's and "s (thankfully nothing in there looks like a shell variable)
18:37 ugexe yep, and im not sure `rm -f` if a windows command
18:37 ugexe well i guess its just using that as output
18:37 ugexe but i am getting failures on the quotes
18:37 geekosaur it's "not" but I think the build system may assume mingw / msys2 currently? if it needs to work with msvc then no
18:38 domidumont joined #perl6
18:38 geekosaur probably the right answer there is you're already using perl 6, use IO::Path methods instead of shelling out to rm
18:38 ugexe it is, i misparsed it since it does "say 'rm -f'"
18:39 geekosaur ah
18:39 ugexe https://ci.appveyor.com/project/ugexe/perl6-text-table-simple/build/1.0.10#L1025 here is the test failure for brevity
18:44 ugexe im really more confused at why i get that failure but rakudo org does not
18:46 ugexe ah i see, because appveyor for rakudo org does not do nmake install, just nmake test
18:47 Exodist joined #perl6
18:50 perlpilot joined #perl6
18:53 El_Che The .so discussion was interesting. Thx
18:57 Exodist joined #perl6
19:07 Exodist joined #perl6
19:07 Cabanossi joined #perl6
19:10 awwaiid joined #perl6
19:20 mcmillhj_ joined #perl6
19:21 AlexDaniel m: use Test; my @expected = ‘hello’, /or/; my @got = ‘hello’, ‘lord’; cmp-ok @got, ‘~~’, @expected, ‘Lorem ipsum.’
19:21 camelia rakudo-moar 90a0f2: OUTPUT: «ok 1 - Lorem ipsum.?»
19:21 AlexDaniel m: use Test; my @expected = ‘hello’, /or/; my @got = ‘hello’, ‘worm’; cmp-ok @got, ‘~~’, @expected, ‘Lorem ipsum.’
19:21 camelia rakudo-moar 90a0f2: OUTPUT: «ok 1 - Lorem ipsum.?»
19:21 AlexDaniel m: use Test; my @expected = ‘hello’, /or/; my @got = ‘hello’, ‘wrom’; cmp-ok @got, ‘~~’, @expected, ‘Lorem ipsum.’
19:21 camelia rakudo-moar 90a0f2: OUTPUT: «not ok 1 - Lorem ipsum.??# Failed test 'Lorem ipsum.'?# at <tmp> line 1?Regex object coerced to string (please use .gist or .perl to do that)?  in sub cmp-ok at /home/camelia/rakudo-m-inst-2/share/perl6/sources/C712FE6969F786C9380D643DF17E85D06…»
19:22 AlexDaniel this “Regex object coerced to string” warning… :|
19:23 AlexDaniel and wrong ‘expected’ part also
19:23 Exodist joined #perl6
19:23 AlexDaniel is there any better way to do what I'm trying to do? Or am I seeing a bug?
19:25 nadim joined #perl6
19:25 Skarsnik weird
19:26 tony-o m: use Test; my @expected = ‘hello’, q/or/; my @got = ‘hello’, ‘wrom’; cmp-ok @got, ‘~~’, @expected, ‘Lorem ipsum.’
19:26 yoleaux 24 Jul 2017 14:29Z <Zoffix> tony-o: any idea why modules.zef.pm is puking a rainbow? http://modules.zef.pm/search?terms=HTTP%3A%3AUserAgent
19:26 camelia rakudo-moar 90a0f2: OUTPUT: «not ok 1 - Lorem ipsum.??# Failed test 'Lorem ipsum.'?# at <tmp> line 1?# expected: 'hello or'?#  matcher: 'infix:<~~>'?#      got: 'hello wrom'?»
19:26 Zoffix m: use Test; my @expected = ‘hello’, q/or/; my @got = ‘hello’, ‘wrom’; say @got ~~ @expected
19:26 camelia rakudo-moar 90a0f2: OUTPUT: «False?»
19:27 Skarsnik I don't get the '~~' part ^^
19:27 tony-o Zoffix: i'm in the process of fixing it - the eco system finally exceeded the amount of space available on that machine
19:27 Zoffix Skarsnik: it's the op you give to cmp-ok routine
19:27 tony-o now i need to figure out a different way to version/browse file repository
19:28 AlexDaniel tony-o: not quite sure what are you trying to say by this
19:28 AlexDaniel tony-o: I want it to match a regex
19:28 AlexDaniel so yeah, if I'm not using a regex, then it works
19:29 Skarsnik m: my @expected = 'hello', /or/; say @expected.perl;
19:29 Zoffix m: my @expected = ‘hello’, q/or/; my @got = ‘hello’, ‘wrom’; say &infix:<~~>(@got, @expected)
19:29 Skarsnik rip camelia x)
19:29 Zoffix y u do that?
19:29 camelia rakudo-moar 90a0f2: OUTPUT: «Resource temporarily unavailable»
19:29 camelia rakudo-moar 90a0f2: OUTPUT: «False?»
19:30 Exodist joined #perl6
19:30 Skarsnik m: my @expected = 'hello', /or/; say @expected.perl;
19:30 camelia rakudo-moar 90a0f2: OUTPUT: «["hello", /or/]?»
19:30 Skarsnik hm, no output that tell the type of something?
19:30 Zoffix AlexDaniel: yeah a bug. It's using $expected as .Str
19:31 Zoffix in here: https://github.com/rakudo/rakudo/blob/nom/lib/Test.pm6#L245
19:32 AlexDaniel I wonder if .gist is going to work significantly better…
19:33 Zoffix and $got too
19:33 AlexDaniel right
19:34 Zoffix .oO( (try .perl)//.gist )
19:35 Skarsnik I wonder if a dies-with in Test could be useful
19:35 Skarsnik dies-with sub {stuff}, X::FileNotFound;
19:36 AlexDaniel Zoffix: this will produce something like '"foo"' for strings… should we just omit outer quotes then? *shrug*
19:37 Zoffix Yeah, probably. Just noticing a bunch of other tests use .perl as output
19:37 Zoffix Skarsnik: we already have it. It's called throws-like
19:38 Skarsnik Oooh
19:39 Zoffix It's a bit off, since it's Failure-blind and will report it as a throw. roast/packages/Test/Util (and Testo.pm6's future version) have fails-like to compensate
19:39 tony-o m: use Test; my @expected = ‘hello’, m/or/; my @got = ‘hello’, ‘wrom’; cmp-ok @got, ‘~~’, @expected, ‘Lorem ipsum.’
19:39 camelia rakudo-moar 90a0f2: OUTPUT: «Use of uninitialized value of type Any in string context.?Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.?  in block <unit> at <tmp> line 1?ok 1 - Lorem ipsum.?»
19:39 tony-o AlexDaniel: ah
19:41 Skarsnik Zoffix, hm, I don't get the diff x)
19:41 Zoffix m: my $x = +'a'; say "Look ma, no throwage!"
19:41 camelia rakudo-moar 90a0f2: OUTPUT: «Look ma, no throwage!?»
19:42 Zoffix m: use Test; throws-like { my $x = +'a'; say "Look ma, no throwage!" }, Exception, 'yeah, it totally throws'
19:42 camelia rakudo-moar 90a0f2: OUTPUT: «    1..2?Look ma, no throwage!?    not ok 1 - code dies??    # Failed test 'code dies'?    # at <tmp> line 1?    ok 2 -  \# SKIP Code did not die, can not check exception?    # Looks like you failed 1 test of 2?not ok 1 - yeah, it totally…»
19:42 Zoffix Oh
19:42 Zoffix nevermind, I guess I'm misremembering :)
19:42 Zoffix m: use Test; throws-like { use fatal; my $x = +'a'; say "Look ma, no throwage!" }, Exception, 'yeah, it totally throws'
19:42 camelia rakudo-moar 90a0f2: OUTPUT: «    1..2?    ok 1 - code dies?    ok 2 - right exception type (Exception)?ok 1 - yeah, it totally throws?»
19:43 Zoffix Ah, right: throws-like can't detect whether a throw—as opposed to a Failure—happened, and that's what the fails-like solves.
19:49 ChoHag joined #perl6
19:52 AlexDaniel ok, RT #131797
19:52 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=131797
19:54 cdg joined #perl6
20:01 cdg_ joined #perl6
20:04 AlexDaniel m: my @got = ‘one’, ‘two three’; say @got
20:04 camelia rakudo-moar 9c0d40: OUTPUT: «[one two three]?»
20:04 AlexDaniel does not look like a useful gist, to be honest
20:05 AlexDaniel well, .perl then
20:06 timotimo how do i figure out what files a deb package with a given version and apt archive will give me? (i don't have a debian installation)
20:06 Zoffix heh. my phone also now shows n/l in logs as a question mark now
20:06 El_Che timotimo: https://packages.ubuntu.com/
20:07 Zoffix m: say "\n?\n?"
20:07 camelia rakudo-moar 9c0d40: OUTPUT: «?????»
20:07 El_Che or you have deb file?
20:07 Cabanossi joined #perl6
20:08 AlexDaniel ?×?…«??? RT…
20:08 AlexDaniel Zoffix: yep, new messages are broken
20:08 AlexDaniel but old ones work fine: https://irclog.perlgeek.de/perl6/2017-07-22#i_14907056
20:09 AlexDaniel and here's the same message: https://irclog.perlgeek.de/perl6/2017-07-25#i_14921142
20:09 timotimo huh.
20:09 geekosaur timotimo, a .deb is just an "ar" archive
20:09 geekosaur ar t foo.deb
20:09 AlexDaniel moritz: ? do you know about this already? I think I mentioned it previously, but I'm not sure
20:10 timotimo our ZMQ binding asks for a libzmq.so.5, but ubuntu only has .1 or .3
20:10 El_Che data.tar.gz should have the files
20:10 geekosaur ("tv" if you want details)
20:10 timotimo oh, wait, trusty is comparatively old, isn't it?
20:10 geekosaur and depending on the version you will need data.tar.gz or data.tar.xz from it for the file content
20:10 El_Che 14.04
20:11 timotimo xenial has the version we're asking for
20:11 El_Che timotimo: it's still supported through: https://packages.ubuntu.com/
20:11 timotimo yes
20:11 timotimo how do i figure out if i can get this for trusty from backports?
20:11 timotimo does ubuntu even have the concept of backports?
20:12 geekosaur not really
20:12 El_Che e.g., it is what previous windows release provide as their linux subsystem (the latest moved to 16.04)
20:12 timotimo wait, there's updates and backports links on the ubuntu package search page
20:12 El_Che they do
20:13 El_Che https://help.ubuntu.com/community/UbuntuBackports
20:13 moritz AlexDaniel: lalala I can't hear you... :(
20:13 timotimo crap, trusty-backports doesn't have libzmq.so.5 anywhere
20:13 El_Che https://packages.ubuntu.com/trusty-backports/
20:13 geekosaur that's what I mean by "not really". some things may get backported. not everything, not reliably
20:14 El_Che geekosaur: yeah, it's handpicked
20:14 El_Che does debian backport everything?
20:14 timotimo ubuntu precise pangolin should be even older than trusty, right?
20:15 El_Che that's 12.04
20:15 timotimo dangit, that's the two things travis-ci apparently offers
20:16 El_Che can you wget the package and install in your test line?
20:18 Exodist joined #perl6
20:19 timotimo it looks like to build zmq you really only need build-essential
20:24 zakharyas joined #perl6
20:27 El_Che timotimo: what about running docker?
20:27 El_Che https://docs.travis-ci.com/user/docker/
20:27 El_Che see the sinatra example: docker pull carlad/sinatra
20:27 El_Che do a docker pull ubuntu/debian/whatever
20:28 El_Che then docker run [...] <cmd to trigger the tests>
20:28 Exodist joined #perl6
20:28 timotimo if we already grab docker for this we might as well use one of the rakudo-containing images
20:29 timotimo btw, maybe if we had appveyor for many more of our modules we could have an easier time making a 32bit rakudo star release that works
20:29 El_Che sure
20:29 timotimo they do offer 32bit VMs to build stuff on
20:30 timotimo does anybody know what modules fail for rakudo star on a 32bit windows machine?
20:30 El_Che I am working on alpine rakudo pkgs (to create very small dockers images), but I am stuck on a ruby problem (I use fpm)
20:31 timotimo darn you, ruby :<
20:32 camelia joined #perl6
20:32 eater joined #perl6
20:35 El_Che more musl than ruby I suspect
20:36 timotimo okay, i don't know what that is :)
20:38 geekosaur a different libc than the gnu libc normally used by linuxes
20:39 geekosaur it's smaller and missing some things that all-the-world-is-x86ish-linux-gnu-gnome-* know are "always there"
20:40 timotimo oh, ok. the only one i know in that vein was dietlibc
20:42 robertle joined #perl6
20:47 bjz joined #perl6
20:56 TEttinger joined #perl6
21:07 Cabanossi joined #perl6
21:09 pharv joined #perl6
21:15 stmuk timotimo: I think it was linenoise (which also doesn't or didn't work under MSVC)
21:17 sufrostico joined #perl6
21:20 stmuk oh and Inline is broken on all Windows (at least with mingw/gcc)
21:21 stmuk and there is quite a lot of io breakage
21:22 stmuk https://github.com/FROGGS/p6-Inline-C/issues/12
21:23 timotimo i wonder what uses Inline::C?
21:23 timotimo maybe it can be left out?
21:23 stmuk Inline itself isn't in R*
21:24 timotimo oh, OK
21:25 stmuk https://github.com/stmuk/Task-Star should have all the R* modules (unlike its upstream)
21:25 timotimo its upstream which doesn't exist any more? :)
21:26 timotimo can you set up appveyor for your fork of Task-Star?
21:26 stmuk its upstream which exists again :)
21:26 timotimo it does!
21:26 timotimo not on appveyor though :(
21:27 stmuk is there a appveyor example handy?
21:28 stmuk like https://github.com/tadzik/Task-Star/blob/master/appveyor.yml
21:28 stmuk :)
21:30 dugword joined #perl6
21:30 tadzik ...exists again? :o
21:30 gdonald joined #perl6
21:30 tadzik that's an apocryphe :o
21:31 stmuk ah you deleted from ecosystem only I guess
21:31 tadzik ah, all good then :)
21:35 * stmuk signs up for appveyor in an unsuccessful attempt to reduce his windows involvement :(
21:39 pierrot joined #perl6
21:44 mcmillhj joined #perl6
21:45 pierrot joined #perl6
21:46 timotimo don't we all wish to have less involvement with windows ...
21:52 nadim hi, I change subs and methods to accep a variable number of positional by using a *@list construct. I must have done something wrong since my test do not pass anymore and it even loops infinitely on a test. Could someone please have a look at the short diff and tell me what  I did wrong? https://nopaste.linux-dev.org/?1160030
21:56 timotimo if you're taking an *@ and a *%, you might as well just have |foo and pass it on with |foo
21:56 timotimo that will give both positionals and nameds
21:56 nadim ok
21:58 nadim but the subs need them separately as they create an object with |% and then calls a methos with |@s
21:59 nadim at line 48 one can see what I do to handle the arguments, right now I know that only  one is passed as I have not changed the calls in the tests
22:00 nadim but something gets seriously messed up, I get test errors and then it used 140% cpu for ever
22:00 mcmillhj joined #perl6
22:03 timotimo if you've used to pass a lazy list before as one single thing
22:03 timotimo that'll now be flattened
22:03 timotimo which will take forever
22:04 timotimo in general, *@ slurpies might behave unexpectedly when things that get passed are lists themselves
22:04 timotimo m: sub test(*@a) { .perl.say for @a }; test(<a b c>, 9, 9, 9)
22:04 camelia rakudo-moar 9c0d40: OUTPUT: «"a"?"b"?"c"?9?9?9?»
22:04 timotimo see how it flattens that into six arguments?
22:04 nadim yes, the for ever test is probably one of the infinite sequences
22:04 timotimo m: sub test(**@a) { .perl.say for @a }; test(<a b c>, 9, 9, 9)
22:04 camelia rakudo-moar 9c0d40: OUTPUT: «$("a", "b", "c")?9?9?9?»
22:05 timotimo this is probably what you want
22:05 nadim I will try
22:06 nadim I have modified all those I could to use |foo too
22:07 cpage_ joined #perl6
22:07 timotimo when you have |foo you can get at the nameds and the positionals individually through its .list and .hash methods
22:07 nadim ah!
22:08 timotimo m: sub test(|foo) { foo.list.perl.say; foo.hash.perl.say }; test(1, 2, 3, <a b c>, [9, 9], :foo, :!bar)
22:08 camelia rakudo-moar 9c0d40: OUTPUT: «(1, 2, 3, ("a", "b", "c"), [9, 9])?Map.new((:!bar,:foo))?»
22:08 nadim that may be a better way than **@a
22:08 timotimo yup
22:10 nadim all the methods and subs eventually get to one single method, I guess that one can also use the |foo style, it's a bit weird i must admt but let's try this
22:11 Skarsnik I wonder if you can found arm travis like stuff
22:12 Skarsnik *find
22:12 bwisti joined #perl6
22:14 pompomcrab joined #perl6
22:20 mcmillhj joined #perl6
22:25 nadim timotimo: surprisingly, sub xxx(|args) { class.new(args.hash).method(args.list) }  method new(*%hash) { ... } says: Too many positionals passed; expected 1 argument but got 2
22:28 timotimo you will still want to |args.list
22:28 timotimo and |args.hash, too
22:29 nadim ah!
22:30 timotimo what you get is still just a regular list and a regular map (aka the immutable version of a hash)
22:30 timotimo so that'll want to be flattened again
22:33 stmuk hmm the problem with testing something like Task::Star is the CI doesn't get run if an included module is updated
22:33 nadim all the test pass but I wonder about two things: the method new(*%options), still has the *
22:34 nadim timotimo:  and the final get_dump_lines(**@list, *%options) had to have **@list
22:36 nadim timotimo: maybe I should replace that with get_dump_lines(|args) and use args.hash<key> instead
22:37 TimToady joined #perl6
22:37 timotimo stmuk: at least travis allows you to run your tests weekly even if nothing has changed in your repo
22:40 mcmillhj joined #perl6
22:43 bwisti joined #perl6
22:50 Geth ¦ ecosystem: 174dd1232a | (Tony O'Dell)++ (committed using GitHub Web editor) | META.list
22:50 Geth ¦ ecosystem: JSON Parsing middleware for HTTP::Server-s
22:50 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/174dd1232a
22:53 mcmillhj joined #perl6
23:00 adu joined #perl6
23:09 mcmillhj joined #perl6
23:20 cpage_ joined #perl6
23:21 afdafsdaf joined #perl6
23:23 Cabanossi joined #perl6
23:25 mcmillhj joined #perl6
23:25 Geth_ ¦ perl6.org: 8e18188ab0 | (Steve Mynott)++ | source/downloads/index.html
23:25 Geth_ ¦ perl6.org: rakudo doesnt build on cygwin
23:25 Geth_ ¦ perl6.org: review: https://github.com/perl6/perl6.org/commit/8e18188ab0
23:29 deep-book-gk_ joined #perl6
23:31 afdafsdaf left #perl6
23:32 deep-book-gk_ left #perl6
23:37 zoll joined #perl6
23:41 mcmillhj joined #perl6
23:52 adu joined #perl6
23:53 Cabanossi joined #perl6
23:57 Actualeyes left #perl6

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo