[00:03] *** Celelibi left [00:03] Or for a really simple one (a binding for POSIX crypt(3)) see https://github.com/jonathanstowe/Crypt-Libcrypt/blob/master/lib/Crypt/Libcrypt.pm [00:24] *** pecastro left [00:27] *** guifa2 joined [00:30] What are some built-in routines that use +@foo slurpies in their signatures [00:30] sortiz: thanks! [00:39] guifa2: +@foo is like **@foo, to avoid flattening iterables. [00:39] m: sub foo(*@a) { dd @a }, foo 1..3, 4..8; [00:39] rakudo-moar f623f1b6e: OUTPUT: «Array element = [1, 2, 3, 4, 5, 6, 7, 8]␤» [00:39] m: sub bar(+@a) { dd @a }, bar 1..3, 4..8; [00:39] rakudo-moar f623f1b6e: OUTPUT: «Array element = [1..3, 4..8]␤» [00:42] Used by built-ins when we want to preserve the structure of its inputs [00:49] *** notagoodidea left [01:06] sortiz: I know what +@foo does, but I was trying to come up with some examples of builtins in that use it [01:06] all I can think of is for, but that's technically a control structure, not a routine [01:17] *** Celelibi joined [01:21] *** xinming_ joined [01:23] guifa2. Sorry, misunderstood your question. In core, I found the built-ins 'cache' and 'reverse' as examples. [01:24] *** xinming left [01:29] *** Celelibi left [01:30] *** simcop2387 left [01:30] *** no-n left [01:31] sortiz++ the first couple ones that I looked up were all **@foo, so didn't have any good examples for the talk I'm finishing up [01:31] *** Celelibi joined [01:34] Glad to be of help [01:41] *** Celelibi left [01:43] *** lizmat joined [01:54] *** brtastic left [01:55] *** Kaeipi left [01:57] *** Kaeipi joined [01:57] *** Kaeipi left [01:59] *** simcop2387 joined [02:01] *** Kaeipi joined [02:04] *** gnufr33dom joined [02:09] *** Kaeipi left [02:10] *** Kaeipi joined [02:11] *** Kaeipi left [02:18] *** Celelibi joined [02:30] *** rindolf joined [02:32] *** kvw_5_ joined [02:35] *** kvw_5 left [02:38] guifa2: I was looking for an old blog post the other day, as just happened to skim past an old p6weekly post mentioning the `+` sig with regards to the one-arg rule [02:38] https://p6weekly.wordpress.com/2015/09/28/2015-34-40-birthday/ [02:38] maybe it's interesting for you [02:40] elcaro: yeah, I knew the history and all, just looking for some nice examples in the wild — the talk I'm doing starts with surprisingly intuitive stuff, and then transitions to how module devs can leverage them to make things Just Work™ for users [02:40] I could think of pretty good examples for everything else [02:41] I still prefer my alcoholic description of the slurpies [02:42] *** JRaspass left [02:43] *@pour-first, **@chug-now, +@read-the-label [02:43] (see: https://tenesianu.blogspot.com/2019/06/perl-6-summer-slurpies-three-for-dollar.html ) [02:47] *** lucasb left [02:48] Nice... I'm in a conference call right now (supposed to be working, i guess) so i'll have a better read later [02:51] probably outside of the scope of your blog post, but regarding the first/rest thing, there's also unpacking sigs [02:51] ie. `foo(*@all ($first, *@rest))`, or just `foo(*@ ($first, *@rest))` if you don't care about all [03:02] Yeah, blog post is a year+ old now (it still calls it Perl 6 ha) [03:03] Do you know any modules offhand other than Cro that take advantage of foo { … } , where foo is actually a sub that functionally appears to be a control structure? [03:05] lizmat's `silently` comes to mind [03:07] oh perfect! [03:09] That's actually a brilliant example. it's almost the same as quietly (which is a control structure) [03:15] yeh, that's why I thought of it. [03:15] (that, and I used it recently, so it was fresh in my brain) [03:15] *** brtastic joined [03:19] I'm trying to avoid slang-y stuff, and show just how much vanilla Raku can do [03:20] But I think I feel comfortable enough with slangs I can write an article on creating one's own quoting structure, which I think would be super useful for some modules [03:29] slangs are rad [03:30] haskell slang brings all of hackage to raku [03:41] *** sortiz left [03:44] tony-o I was a bit overjoyed once I got a term slang working. Even with just using the basic QAST op 'call', you can do so much. Once RakuAST is around … mmmm [03:47] is rakuast going to speed things up or is it just going to make doing something like code coverage easier/nicer? [03:48] i think two PTSes ago i did some hacky nqp thing where i was able to insert `got here` messages to figure out code coverage [03:49] It's main purpose isn't speed, but my impression is that it can help workout certain optimizations better and result in it eventually. [03:50] IIRC from what lizmat was saying, one of the major reasons we ended up with it is jnhtn didn't like the idea of using EVAL for constructing code blocks ha [03:50] But the long-running desire for macros no doubt helped out too [04:09] macro yo macros [04:11] sounds like it's going to be nice [04:13] In my case, it's going to be awesome, because I've struggled to be able to adequately mimick regexen. I can do everything *but* interact with the other languages (Q, Regex, and, I dunno, what do we call Raku that's neither Q nor Regex?) [04:41] *** evalable6 left [04:41] *** linkable6 left [04:41] *** linkable6 joined [04:41] *** evalable6 joined [05:02] *** colemanx joined [05:03] *** colemanx left [05:04] *** brtastic left [05:25] *** brtastic joined [05:34] *** guifa2 left [05:35] *** rindolf left [05:37] i have a list like this: , [05:38] ^ i want to remove * from h and note down it's co-ordinates [05:38] removing * is easy with deepmap, how can i note down it's co ordinates? [05:39] m: (, ).deepmap(*.comb[0]) [05:39] rakudo-moar f623f1b6e: ( no output ) [05:39] m: say (, ).deepmap(*.comb[0]) [05:39] rakudo-moar f623f1b6e: OUTPUT: «((a h) (b c))␤» [05:46] *** rindolf joined [05:50] notandinus: do you just need it to work on a list-of-lists? or does it need to work with arbitrary nesting of lists [05:53] it's just list of lists, and 4x4 to be exact [05:53] i could do a nested for loop but i was wondering if there is a general solution [05:53] elcaro: ^ [05:57] hmm, I have an apl solution but it doesn't translate to raku. (Missed opportunity, maybe :) [05:58] (there's a builtin that tells you the coordinates of 'true's in a multidim array) [06:00] nothing comes to mind. i would probably do a nested map with indices [06:00] m: my @a = , ; say (^4 X ^2).grep(-> ($y, $x) { @a[$x;$y].contains('*') }) [06:00] rakudo-moar f623f1b6e: OUTPUT: «((3 1))␤» [06:01] need a `deepgrep` that you can use the `:k` adverb with :D [06:02] i see [06:02] moon-child: i've been dipping my toes into APL recently. makes me wish for an `Inline::APL` [06:03] or a slang (similar to Slang::SQL) that you can just evaluate APL expressions in Raku code [06:04] that would be cool [06:04] a good start would just be implementing all the primitives as raku functions. Hyperoperators are neat, but nothing like a real rank operator [06:10] I have a been mucking around with doing basic APL stuff with Raku [06:10] just converting exampls from the learn dyalog book [06:10] https://gist.github.com/0racle/b2b2514f8b9ff056263385fe1b333b17 [06:10] very basic [06:11] but would be interesting to implement APL in Raku... although I suspect it could benefit from more speed/development on Native Array [06:13] that gist is just a few sample pieces of code from the start of the Mastering Dyalog APL pdf [06:21] *** jmerelo joined [06:29] i have this array @visited and @puzzle [06:30] @puzzle = , ; @visited = (True, False), ((Any), False) [06:31] i want to print @puzzle but replace characters that have already been visited with * [06:32] i could just use nested for, is there another way of doing this? [06:32] i guess not because we need the indexes, right? [06:35] *** wamba joined [06:40] yeah, you need to do like a deep zip. maybe you need to create a helper function that returns nested indices and implement functions you need around that [06:41] tbh, I haven't put a lot of thought into a better solution, so maybe someone else might come up with a more concise way. [06:45] *** jmcgnh left [06:51] *** jmcgnh joined [07:04] notandinus: not the most elegant solution, but probably how I would handle it in a pinch: https://gist.github.com/0racle/72afb15114b08f035962cde8a7b8e121 [07:13] *** sjm_uk joined [07:17] *** ufobat joined [07:27] *** aluaces joined [07:29] *** ufobat_ joined [07:30] *** Sgeo left [07:31] *** Celelibi left [07:31] *** kvw_5_ left [07:31] *** xinming_ left [07:31] *** kvw_5 joined [07:32] *** ufobat left [07:33] *** xinming_ joined [07:40] *** Celelibi joined [07:41] *** rindolf left [07:50] *** cxreg left [07:52] *** cxreg joined [08:02] *** Garbanzo_ left [08:05] *** domidumont joined [08:28] *** parabolize left [08:29] *** sena_kun joined [08:38] *** MasterDuke joined [08:47] *** dakkar joined [08:54] *** pecastro joined [09:01] *** JRaspass joined [09:07] *** tejr left [09:09] *** tejr joined [09:24] *** sena_kun left [09:26] *** aborazmeh joined [09:26] *** aborazmeh left [09:26] *** aborazmeh joined [09:26] *** sena_kun joined [09:34] *** Scimon joined [09:34] Morning. [09:35] *** daxim left [09:37] *** Scimon left [09:38] *** Scimon joined [09:42] oh hej scimon [09:46] I got a new laptop and it took me a while to get IRC setup. [09:47] irc drivers notoriously difficult to get working right, especially on new hardware [09:47] *** codesections left [09:47] Mostly I just didn't think about it. 2020 you know, hard to get the brain in gear. [09:48] timotimo: I hear the windows builtin ones work pretty well ootb [09:48] I'm trying to get myself in a better place this year. [09:49] As such I'm picking up a half finished module I was working on which led me to think of a question. I see there's work being done on fez do we have a preference for module upload location? [09:49] there's this incredible hack called "IRCDISWrapper" that runs ms comic chat in wine and autmates the UI to expose a line-based API [09:50] I'd need to run windows first ;) [09:50] Oh wait. Wine... Mmmmm [09:55] But yeah. Are we moving away from CPAN? [10:03] Nothing has changed yet [10:03] see: https://twitter.com/jmaslak/status/1348741527363747840 [10:04] Coolio. [10:04] Thanks [10:14] *** gnufr33dom left [10:27] *** aborazmeh left [10:41] *** MasterDuke left [10:48] *** aborazmeh joined [10:48] *** aborazmeh left [10:48] *** aborazmeh joined [11:00] *** notagoodidea joined [11:08] *** Black_Ribbon left [11:20] *** rindolf joined [11:26] *** stoned75 left [11:31] *** Altai-man joined [11:32] *** aborazmeh left [11:33] *** sena_kun left [11:40] *** PimDaniel joined [11:40] hi, c'est encore moi. [11:40] \o [11:41] Is there a solution do declare an array of Int tuples? [11:41] Or should we control it aftewards? [11:43] my Int @a ? [11:43] are the tuples of the same number of elements ? [11:44] Hi lizmat: i just need ((Int,Int),(Int,Int),(Int,Int),(Int,Int),...) [11:44] Each tuple is a coord (x,y) point. [11:45] And they should be minimum 4. [11:45] but can be more. [11:46] But from the start, we do not know the coords so this is probably not possible. [11:46] When not make a Point class? [11:46] hum [11:47] class Point { has Int $.x, has Int $.y } [11:47] why not : yes! [11:47] That should have been a why not when [11:47] use complex numbers and make a mathematician angry [11:48] Suis Null en math :(! [11:49] yes with a Class we can make any control we want!, i'll try this. [11:49] Thank's for the idea. [11:49] m: class Point { has Int $.x, has Int $.y }; dd Point.new(x => 42, y => 666) [11:49] rakudo-moar e7a46bc09: OUTPUT: «Point.new(x => 42, y => 666)␤» [11:50] Yes : we can see this in any school case curses or example. [11:50] note that classes with accessors optimize better than arrays and indices [11:51] Heu not shure to understand : there's allready a Point class? [11:52] no no no. [11:52] no, but it is frequently used in examples :-) [11:52] Yes : easy to make it. [11:53] thank's a lot : i must go now, back later... [11:53] *** PimDaniel left [11:57] *** MilkmanDan left [11:57] *** Manifest0 left [11:57] *** agentzh left [11:58] *** spacebat2 left [11:58] *** MilkmanDan joined [11:58] *** Manifest0 joined [11:58] *** agentzh joined [11:58] *** klapperl joined [11:58] *** jdv79 joined [11:58] *** spacebat2 joined [12:01] ahh, I missed that convo. I have a Point module on the ecosystem. it's a Value Type and uses native nums internally, so fairly performant [12:01] *** JRaspass left [12:01] m: class Point { has Int $.x, has Int $.y; multi method COERCE( @l ) { return Point.new(x=>@l[0],y=>@l[1]) } };my Point() $p = (3,4);say $p [12:01] rakudo-moar e7a46bc09: OUTPUT: «Point.new(x => 3, y => 4)␤» [12:02] *** nicholatian joined [12:02] :D I love the new Coercion stuff. [12:02] *** aborazmeh joined [12:02] *** aborazmeh left [12:02] *** aborazmeh joined [12:03] Scimon++ [12:04] I'd also love to be able to write (3,4).Point() but I guess that's a way off. [12:04] I think you can? but vrurg_ would be able to quicly say how [12:05] Not directly you get a "No such method Point" error ATM. [12:05] wouldn't that have to try calling .Point() on a list first before realising it's an unknown method, then check if a Point.COERCE is available in the callers namespace [12:06] *** MasterDuke joined [12:06] I would guess so yes. [12:07] *** aborazmeh left [12:08] seems it would be _possible_ but maybe not worth the added ambiguity [12:33] * [Coke] guesses he should not be surprised at all the APL love that pops up in here from time to time [12:33] * [Coke] did a POC for APL on parrot years like 12 years ago. [12:34] * [Coke] tries to figure out what https://github.com/coke/paraplegic/blob/master/t/jaah.t is doing. [12:35] feels like a rot13 ? [12:35] * MasterDuke just heard [Coke] announce Slang::APL, wonder what the release date is... [12:36] is there something like fatpack for raku? [12:36] not to my knowledge [12:36] <[Coke]> lizmat: ah, it's removing all the FX characters, reversing, and also splitting the string in the middle and putting it back together. [12:37] *** stoned75 joined [12:38] <[Coke]> ... wow. so old I apparently wasn't doing a LICENSE every time. [12:39] <[Coke]> MasterDuke: :P [12:45] * [Coke] briefly looks at the source, and wonders how this worked. I see ⌽ in the grammar, but not how it's actually doing anything in the actions. [12:47] https://github.com/coke/paraplegic/blob/master/src/parser/actions.pm#L57-L67 ? [12:48] [Coke]: seems the love flows both ways. came across an article on the aplwiki that has a Raku script for maintaining xkb settings [12:48] https://aplwiki.com/wiki/Typing_glyphs_on_Linux [12:48] (or was it you that wrote it? :D) [12:56] ok so i wrote a script with some modules, how do i turn it into zef installable thing that can also be uploaded to cpan or fez (later) ? [12:56] https://github.com/andinus/octans [12:56] ^ it's this, do i just have to add META6.json thing? [12:57] also, any comments on the structure or anything related to the project? [12:57] wait, does github not syntax highlight .rakumod ? [12:58] notandinus: not really. It's probably not caught up with those extensions yet. We did the PR IIRC, but it's not been deployed. [12:59] syntax highlighted code: https://git.tilde.institute/andinus/octans [12:59] jmerelo: ah i see [12:59] notandinus: normally with the raku shebang, github will highlight the code. [12:59] oh do you also put shebang on modules? [13:01] not sure if it changes anything? But if it is just to provide hl on github, it may not be worth it knowing that hl will arrive one day or the other? [13:01] notandinus: not really. github uses several heuristics to know how to highlight and find out which language it is. One of them is the shebang line. [13:01] <[Coke]> jmerelo: hello [13:03] i see, thanks. i guess i'll wait for hl, i don't use it for viewing anyways [13:03] any comment on the module thing? [13:04] i've read this https://docs.raku.org/language/modules#Distributing_modules [13:05] i was wondering if i should place my modules under Octans:: directory (?) [13:08] I am still looking to the same thing but most the modules I see organize themself around bin/ lib/ where bin/ hold the cli part and lib/ have the lib/Foo/Bar.rakumod for Foo::Bar name. Not sure if it is the favored methods. like App::Octans => lib/App/Octans.rakumod. [13:08] But it is mainly from observation on how package are structured in the raku module space and it depends on the authors but the main ones seems to go around a similar structure (due to the Foo::Bar naming scheme?) [13:09] *** JRaspass joined [13:10] i see, so i'll place octans.raku -> bin/octans and all other moduels in lib/Octans/ [13:10] it seems like the most common structure I have seen but newbie and so. [13:11] i see, it's fine the structure can be changed anytime [13:12] *** aborazmeh joined [13:12] *** aborazmeh left [13:12] *** aborazmeh joined [13:15] hmm https://docs.raku.org/language/modules#Upload_your_module_to_zef_ecosystem [13:15] ^ has instructions to upload to fez, can i already upload there? [13:16] <[Coke]> (APL) ah, all the magic is in tools/, weird. :) [13:17] Well it's been over a year but I've picked up my Pure Raku Markdown module again and done some tidying up. Got over 50% spec tests passing now. [13:18] *** finsternis left [13:27] hmm fez install fails with: (tried git and tar), please ensure one is in your path [13:27] i have both git and tar in $PATH [13:56] notandinus: I discovered App::Mi6 (https://modules.raku.org/dist/App::Mi6) [13:57] It's v. good. [13:58] notagoodidea: i see, i'm looking at that and another authoring tool [13:58] i'm still finalising the repository before uploading [14:01] not sure how to play with fez as it seems to release to CPAN. [14:02] notandinus: Your feedback about those interests me! [14:06] Mi6 release to Cpan. fez releases to the new under development Raku ecosystem. As I understand it. [14:07] *** aborazmeh left [14:10] notagoodidea: i think fez is not ready yet, it'll be the new raku ecosystem [14:11] after fez is done, p6c will be phased out [14:11] i'm going to upload my project to cpan for now [14:13] *** aborazmeh joined [14:13] *** aborazmeh left [14:13] *** aborazmeh joined [14:14] btw https://en.wikipedia.org/wiki/Moby_Project 's dictionary is in public domain, it has lots of words (~0.35 mil) [14:21] *** vrurg_ is now known as vrurg [14:29] *** Kaeipi joined [14:32] ok, my C game is quite low but `typedef struct Foobar *Barfoo;` is a way to make the pointer opaque. using NativeCall, `class Barfoo is repr("Cpointer") {}` is the goodway to create the binding? [14:38] *** lucasb joined [14:44] m: say (0x1 | 0x2); say (0x1 +| 0x2); [14:44] rakudo-moar aa9e849ab: OUTPUT: «any(1, 2)␤3␤» [14:49] hmm very weird, %?RESOURCES is set to Nil even when i include the files in META6.json [14:51] notandinus: running locally (i.e., from the top-level module directory)? might need a `-I .` [14:51] MasterDuke: i installed it with zef [14:51] i'm trying to access it from bin/octans [14:52] hmm it does print something when i try to acess it from a module inlib/ [14:52] am i not supposed to access it from bin/ ? [14:54] hmm, it's working correctly when i acess it from lib/ [14:54] but i need to use it in bin/, the main program [14:55] not sure then, i've never created a module with a bin/ [14:55] zef seems to install the bin/ in $HOME/.raku/bin [14:56] it's a program, am i doing it wrong? i've put the modules in lib/Octans/* and the program octans in bin/octans [14:57] in my case zef put it here: /home/andinus/star/share/perl6/site/bin/octans [15:00] looking at https://github.com/tony-o/raku-fez [15:01] is that your program, or a launcher script? (a call to `CompUnit::RepositoryRegistry.run-script`)? [15:01] *** MasterDuke left [15:01] they've put everything in Fez::CLI and just write `use Fez::CLI' in bin/fez [15:01] dakkar: it's my program [15:01] i've put the sub MAIN in bin/octans [15:01] and i need %?RESOURCES in sub MAIN [15:02] ok, if you run it directly, rakudo can't know what distribution it belongs to, so $?RESOURCES can't work [15:02] zef should have written another `octans` script, probably in star/bin/ [15:02] *** Sgeo joined [15:02] (it'd be in ~/.raku/bin/ for me, but I'm not using star) [15:04] *** daxim joined [15:04] actually… I have ~/.raku/bin/zef, and the program itself is in ~/.raku/resources/D5A6DAB7FF5EFBDDBE82A4D69694601F07F66C52 [15:04] Actually, I might be mistaken, but a script can't know where to take resources from. It's a privilege of a module. [15:04] dakkar: i ran find .| ag octans in ~/star and it only has it in ./share/perl6/site/bin/octans [15:04] vrurg: that's also possible, but if so, the documentation needs patching [15:04] hmm, I could test it [15:05] i see, so should i turn it in a module and call `use Octans::CLI' like fez is doing? [15:05] notagoodidea: It's always a good idea [15:05] * vrurg minimizes script size whenever possible. [15:06] It's also a matter of well-organized code. [15:10] ok i just had to move the whole script to Octans::CLI and add `use Octans::CLI' in bin/octans, it works fine now [15:10] thanks [15:12] yep, just confirmed [15:13] so either https://docs.raku.org/language/variables#%?RESOURCES or the implementation, is wrong [15:13] *** MasterDuke joined [15:14] i see, are you filing a report? [15:15] yeah [15:15] against rakudo, because I'd like it to work as the documentation says ☺ [15:15] it does say "Distribution of the current compilation unit", only modules are part of the compunit right? [15:15] no [15:15] programs are compiled [15:15] oh i see, [15:16] `CompUnit::RepositoryRegistry.run-script` exists, so scripts are in the repository of compilation units… [15:16] which strongly implies they are compilation units [15:16] i see [15:16] so after this is fixed there would be no need to put programs in lib/X/CLI right? [15:16] the fact they're not (currently) getting *pre* compiled shouldn't matter [15:17] it would still be a good idea (for testability, at least) [15:17] i see, will bin/ things also get precompiled later on? [15:17] that's my understanding [15:17] oh i see, to test the output of the CLI.rakumod thing? [15:17] makes sense [15:21] *** wamba left [15:26] *** Altai-man left [15:26] *** gnufr33dom joined [15:31] https://github.com/rakudo/rakudo/issues/4173 [15:35] https://github.com/tony-o/raku-fez/blob/master/bin/fez is not calling MAIN on Fez::CLI, how does it work then? [15:36] Fez::CLI is defining the MAIN sub but theres nothing that is calling it [15:36] i moved my things in sub MAIN but it doesn't work [15:38] the MAINs are exported, so `use`ing it should make them available (and then called) when run from the command line. did you export your sub MAIN? [15:39] i see, no mine wasn't exported [15:39] thanks, works after exporting [15:40] *** wamba joined [15:46] <[Coke]> MasterDuke: I figure you were probably kidding... but do we need a slang? or just all the APL operators? [15:47] <[Coke]> (I see no modules in the ecosystem for APL yet) [15:47] With NativeCall, is it possible to assign size to Carray as in `struct { int data[3] }` -> `class foo ... { has CArray[int32] $.data }`. Not sure how to give the size of the created array. [15:49] *** jess left [15:50] [Coke]: that was just kidding, i've never used APL so don't really know. but what about Inline::APL? (or all three: Slang::APL, Inline::APL, and all the operators! the more the merrier) [15:50] *** clarkema joined [15:51] <[Coke]> inline would be calling out to existing apl; slang would be if there's extra syntax... I think APL::Operators would be fine to start. [15:51] <[Coke]> ... should be trivial to create an APL::Operators based on the test suite from the old parrot project. [15:51] <[Coke]> I'll start there. [15:53] *** [Sno] joined [15:55] *** sno left [16:01] *** [Sno] left [16:04] *** parabolize joined [16:08] notagoodidea: https://docs.raku.org/language/nativecall#Structs [16:08] doesn't appear you'd need to [16:10] unless you're initializing it, then you need to use the CArray[int32].allocate(3) [16:12] tony-o: No I don't initialize it, but I would have to be sure that only 3 elements are provided/initialized on the Raku side of the call before giving it to C. or at least that is how I understand it. [16:13] ah, try it with that class+TWEAK example in the link ^ [16:14] Yep, seen that, thanks! [16:14] ooh, wait, an int[3] inside a struct is not a carray, is it? [16:15] a carray is a pointer [16:15] that struct contains the three ints, not a pointer to ints [16:15] *** dataangel left [16:16] dakkar: hu? [16:16] *** dataangel joined [16:16] AIUI, a CArray is passed to C as a pointer [16:18] So you do : `class .. { has int32 $.data1, etc. }` or `class ... { has Pointer $.data1, etc.}`. [16:18] but your `struct { int data[3] }` contains the integers directly (you wouldn't malloc that data, would you?) [16:18] definitely not pointer [16:19] As said early my C game is meh to low, so still learning my pain point when I meet them :) I am all ear. [16:19] I'm really not the best person for this, as my C is pretty rusty and my understanding of NativeCall is limited [16:21] I'd start with `has int32 $.data0; has int32 $.data1; has int32 $.data2` [16:21] at least that should match the memory layout [16:21] then you may want to remove the public accessors for those, and provide more sensible ones (and a TWEAK) [16:27] in c that can work both ways [16:27] in this case - int x[3] ==> x[2] is the same as (x+2) [16:28] yes, because foo.data has nominally type int* [16:28] for NC more just a question of you want to access it [16:28] but that pointer is not stored in memory, it's the compiler cheating [16:28] and for NC it matters very much what is actually in memory [16:29] if you try to interpret a random int as a pointer, you're going to have a bad day [16:31] *** Celelibi left [16:32] yes that's true [16:32] i uploaded my module to pause under Perl6, how much time does it take to reflect in modules.raku.org ? [16:34] <[Coke]> (APL) so, one operator that won't work: prefix:<|>, which conflicts with flattening. [16:41] *** PimDaniel joined [16:42] I think the documentation is too tricky for newbies. [16:43] *** mowcat joined [16:43] [Coke]: use ❘ instead 😁 [16:43] PimDaniel: learning from a reference is, indeed, difficult [16:44] If i want to put a sub into a say Misc module out of class : i cannot see a simple example nor explanation to do it a simple way. [16:44] A simple example with an export would help. [16:45] `package Misc { sub foo() is export { return 3 } }`? [16:45] `module Misc { sub foo() is export { return 3 } }`? [16:45] sorry [16:45] https://docs.raku.org/type/Routine#trait_is_export [16:46] *** mowotter joined [16:46] PimDaniel: was that what you were after? [16:47] Yes thanks : but easy because you know where to search! When i search i found a lot of complicated things that lost me. [16:47] Thank's a lot : but i pass hours searching and finaly forget what i searched! [16:48] yep, docs.raku.org is a reference, meaning it's for people who already know *some* of what they're looking for [16:48] it's not a good resource to learn from scratch [16:48] *** JRaspass left [16:48] *** stoned75 left [16:48] so, is ther a good ressource to learn from scratch? [16:49] i come from Perl5 but not sure it helps. [16:49] *** mowcat left [16:49] it helps quite a bit ☺ [16:49] https://raku.org/resources/ this links to books and things "for newcomers" [16:50] <[Coke]> dakkar: my goal is to use whatever the original APL operators are. [16:50] <[Coke]> MasterDuke: https://gist.github.com/coke/94d976b93b5bd41ea5c52f295654bc86 [16:50] <[Coke]> (those all pass with a verrrrry small module) [16:51] [Coke]: ⌶ U+2336 APL FUNCTIONAL SYMBOL I-BEAM maybe? /me is guessing [16:52] I already red a curse for newbie level in French but it's quickly insufisant when you pass the school cases examples. [16:52] (U+2336 to U+2395 are all APL operators) [16:52] *** [Sno] joined [16:52] PimDaniel: ah yes, that's the common issue with programming: the tutorials are too simple, the reference is too advanced [16:53] dakkar: thank's for your link! [16:53] And to learn how to read reference manuals you need to read reference manuals :P [16:53] [Coke]: cool [16:53] in ~60 years, I feel the only solution we've come up with is "keep writing documentation, tutorials, &c &c, eventually something useful will come out" [16:55] I need to precise that i'm french too. I can read english and spanish. I understand German a few and no more. But my be a good curse exists in Spanish. [16:55] PimDaniel: Andrew Shitov have a few books on Raku/Perl6 that are nice and a new course coming up at https://course.raku.org/essentials/ [16:56] notagoodidea: Thank's! [16:56] but the Part2/3 are not yet published. [16:57] *** gnufr33dom left [16:57] aren't there translations of the docs available somewhere? [16:57] The French one i have IS a translation. [16:58] It was very helpfull for starting and i still look at it sometimes. [16:59] my first raku module: https://modules.raku.org/dist/octans:cpan:ANDINUS [17:01] notandinus: congrats! [17:03] thanks :) i had this pause account for so long, i made it while learning perl but never got around uploading any of my perl stuff. [17:07] I used unit module Misc; instead of a block, I tried a multi but it complains about Missing block [17:07] The multis where tested appart and work! [17:12] *** notagoodidea left [17:19] *** Scimon left [17:26] *** guifa2 joined [17:28] Is there any way to specify endianness when working with >8bit blobs? (the read/write functions on 8bit blobs let you specify it, but >8bits don't have it for, e.g., writing out a file) [17:30] https://docs.raku.org/routine/encoding#utf16,_utf16le_and_utf16be [17:30] *** Celelibi joined [17:31] what's UTF got to do with blobs? [17:31] that seems to indicate there's a BOM specifier somewhere [17:32] a BOM is a thing in a file [17:32] blobs are in-memory things [17:32] guifa2: I get the feeling that blob16 &c are not designed to be serialised [17:33] Dakkar: yeah, which is kind of a shame, because they do make working with some things easier [17:33] oop, misread that as buf [17:33] buf are also in-memory things [17:34] i didn't say they weren't [17:34] guifa2: I think you'll have to write your own read/write subs [17:34] tony-o: UTF is for text, blob/buf are a bit more general ☺ [17:35] I think a quick wrapper class will be best [17:35] i'm aware [17:37] * dakkar disconnects, end of the workday [17:38] *** thdrmz left [17:42] *** dakkar left [17:43] *** Garbanzo_ joined [17:50] *** natrys joined [17:50] *** stoned75 joined [18:04] * [Coke] was looking at some APL, saw ⎕ and was thinking he was missing a character in his font. [18:05] <[Coke]> (APL) so the operators are really trivial but I think anything interesting would have to be an APL slang. [18:07] <[Coke]> (once you start getting into variable assignment, etc.) Anyone have a pointer to an APL test suite? [18:14] *** Garbanzo_ left [18:17] *** monkey_ joined [18:31] *** Garbanzo_ joined [18:50] *** jmerelo left [18:54] *** aborazmeh left [18:55] *** aborazmeh joined [18:55] *** aborazmeh left [18:55] *** aborazmeh joined [19:03] *** Kaeipi left [19:05] *** Kaeipi joined [19:06] *** xelxebar left [19:09] *** Garbanzo_ left [19:09] *** xelxebar joined [19:21] back again! [19:21] after a walk throught the woods with friends! [19:26] I could do my Misc module! It was just that i'v put "is export" between the name of the sub the 1st ( : thought it was like for Classes but no. [19:28] *** sortiz joined [19:29] *** MasterDuke left [19:35] <[Coke]> sub x() is export { ...} [19:42] *** sjm_uk left [19:47] *** berber44 joined [19:48] Coke: Yess! Thanks! [19:48] *** Kaeipi left [19:49] unit module Coke; sub flour is export { ... } [19:49] :) [19:50] *** Kaeipi joined [19:50] no sub flour() is export { ... } [19:50] ping guifa2 [19:50] *** Kaeipi left [19:51] *** Kaeipi joined [19:52] is new a particular method? [19:52] or does it behave like any other? [19:52] sortiz o/ [19:52] classes inherit from Any, and "new" is a method provided to each class that way [19:53] so it is just like any other method, just provided to you by default [19:53] and like any method, can be overridden if you should decide to want to do that [19:54] the best is to tell what i wanna do: [19:54] guifa2, All Blobs supports reads with the selected endiannes. [19:54] Just use one of the Endian enum [19:55] The default is NativeEndian [19:55] What does really do bless? [19:55] PimDaniel, bless "creates" the object. [19:55] PimDaniel: bless actually instantiates the object [19:56] and when a class has no new? [19:56] no new method and no bless too? [19:56] it inherits them [19:56] m: class Foo { }; dd Foo.new [19:56] rakudo-moar 39d3f1368: OUTPUT: «Foo.new␤» [19:57] *** Kaeipi left [19:57] https://docs.raku.org/language/objects#index-entry-new_(method) [19:58] how can i call new called with named and positional parameters? Should i make a multi? [19:59] *** Kaiepi joined [20:00] my $pt = Point.new(x => 39,y => 68); and my $pt = Point.new(39,68); [20:00] yeah, just make it a multi [20:00] at the URL previously mentioned you could read 'If you want a constructor that accepts positional arguments, you must write your own new method' [20:01] class Point { multi method new ($x, $y) { self.bless: :$x, :$y }; multi method new (:$x is required, :$y is required) { self.bless: :$x, :$y } }; say Point.new(x => 39,y => 68); say Point.new(39,68) [20:01] guifa2, rakudo-moar 39d3f1368: OUTPUT: «Point.new␤Point.new␤» [20:03] guifa2: i think it's quite what i was about to write, thank's! [20:04] self.bless(:$x,:$y) instead. [20:04] according to other examples i saw. [20:06] *** berber44 left [20:07] IT WORKS!!!! [20:07] is fact i added multi but i forgotted method multi method , pfff! [20:08] it's a sub or a method or something else... [20:11] Is Comma ide efficient? [20:11] efficient enough that the developers work with it themselves when working for clients ? [20:11] *developers of Comma [20:13] I just discover that it exists. [20:14] is it written in raku? [20:15] no [20:15] it's written in uncommon lisp [20:15] it's part of the JetBrains IDE framework, which is java, iirc [20:16] *** domidumont left [20:16] but some parts of it are definitely Raku.... it uses all of the introspection features of Raku, e.g. and you can't do that from Java afaik [20:16] Well, bon i would not mind pay 12 Euros but i'm affraid they ask me more later. [20:17] The commynity edition to try may be. [20:17] well, they is Edument CZ, of which the CEO is Jonathan Worthington :-) [20:20] Ok i understand! No problem! [20:21] I suppose all this is a lot of work, of course! [20:27] *** b2gills1 left [20:27] *** Kaiepi left [20:31] *** Kaiepi joined [20:31] *** Kaiepi left [20:32] back later , need to rest... bye! [20:32] *** PimDaniel left [20:36] *** ufobat_ left [20:39] <[Coke]> lizmat: I think not quite CEO, but he's on the website, anyway. :) [20:39] <[Coke]> (top row! :) [20:39] of the Edument CZ branch, I'm pretty sure he is [20:44] *** brtastic left [20:44] m: my @b32 is Blob[int32] = 1,2,3,4; dd @b32; @b32.read-int32(0, BigEndian).say; [20:44] rakudo-moar 39d3f1368: OUTPUT: «Blob[int32].new(1,2,3,4)␤16777216␤» [20:45] m: my @b32 is Blob[int32] = 1,2,3,4; @b32.read-int32(1) # Bug? [20:45] rakudo-moar 39d3f1368: OUTPUT: «MVMArray: read_buf out of bounds offset 1 start 0 elems 4 count 4␤ in block at line 1␤␤» [20:47] that feels like a bug at first sight [20:48] afk& [20:48] *** monkey_ left [20:49] *** lichtkind joined [20:50] m: my @b32 is Blob[int32] = 1,2,3,4; @b32.read-int16(1).say # Works [20:50] rakudo-moar 39d3f1368: OUTPUT: «2␤» [20:50] m: my @b32 is Blob[int32] = 1,2,3,4; @b32.read-int16(1, BigEndian).say # Works [20:50] rakudo-moar 39d3f1368: OUTPUT: «512␤» [20:52] m: my @b32 is Blob[int32] = 1,2,3,4; @b32.read-int16(3).say [20:52] rakudo-moar 39d3f1368: OUTPUT: «MVMArray: read_buf out of bounds offset 3 start 0 elems 4 count 2␤ in block at line 1␤␤» [20:52] m: my @b32 is Blob[int32] = 1,2,3,4; @b32.read-int16(2).say [20:52] rakudo-moar 39d3f1368: OUTPUT: «3␤» [20:53] Indeed a bug. [20:56] *** aborazmeh left [21:17] <[Coke]> lizmat: ah, website sez: COUNTRY MANAGER CZ, so there we go! [21:26] *** wamba left [21:32] *** Garbanzo_ joined [21:38] *** b2gills joined [21:56] <[Coke]> https://gist.github.com/coke/7a01ffb4085c08e4bc677bceea4158d9 - when I use zef to install App::Uni, I get this wrapper script - when I run the script, it gives me the full path in $*PROGRAM-NAME - but if I have a simple script, it does not. [21:56] <[Coke]> I want the usage message to be "as invoked", not the full path (that I did not use) [21:57] What do *@ and *% denote in sub signatures? Just 'some array' and 'some hash'? [21:58] <[Coke]> "slurpy array" (all the remaining positional, all the remaining hash) [21:58] <[Coke]> s/hash/named/ [21:59] Ah so they're both anonymous _and_ slurpy [22:10] *** natrys left [22:15] *** rindolf left [22:17] *** kaiwulf joined [22:18] I'm new to raku. I like perl so I figure I should get in to raku too. [22:21] kaiwulf: welcome! [22:23] Thanks! [22:26] *** Black_Ribbon joined [22:55] *** notagoodidea joined [22:55] [22:58] *** lucasb left [23:19] *** telex left [23:20] *** telex joined [23:27] *** epony left [23:28] *** lichtkind left [23:28] *** notagoodidea left [23:43] *** JRaspass joined [23:47] *** clarkema left [23:55] *** moon-child left