🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 6 September 2022.
00:15 Manifest0 left 01:11 gabiruh left 01:12 gabiruh joined 01:22 hulk joined 01:23 kylese left 02:08 jpn joined 02:13 jpn left 02:15 hulk left, kylese joined
greenfork gfldex: I understand the intention, thank you 03:05
04:27 lizmat left 04:41 jmcgnh left 04:44 vrurg joined 04:46 vrurg_ left 05:06 jmcgnh joined 05:30 Sgeo left 06:15 abraxxa joined 06:55 Manifest0 joined 07:06 jpn joined 07:11 jpn left 07:20 kotrcka left 07:24 jpn joined, haxxelotto joined 07:29 jpn left 07:46 bdju left 07:48 bdju joined 07:59 chatter63 joined, chatter63 left 08:00 spacekookie left 08:01 spacekookie joined 08:12 sena_kun joined 08:14 dakkar joined 08:40 camelia left, nine left 08:47 camelia joined 08:51 nine joined 09:00 camelia left 09:01 nine left 09:02 nine joined 09:03 camelia joined, jpn joined 09:05 lizmat joined 09:06 sena_kun left, sena_kun joined, nine left, camelia left 09:07 nine joined 09:14 camelia joined 09:49 jpn left 09:50 jpn joined 10:07 hudo left 10:14 jpn_ joined 10:17 jpn left 11:51 jpn joined 11:52 dakkar left 11:53 dakkar joined 11:54 jpn_ left 12:26 jpn left
tbrowder what is advantage of using discord here? 12:45
ugexe many people are already in other discord channels, and possibly not in any other irc channels. so they don't need an irc client and can continue using the chat format (discord) they are used to for everything else 12:59
12:59 jpn joined 13:29 formiko joined, formiko left
librasteve discord is a trendy way for "half-geeks" to chat - but irc needs real geek skills to stop getting ejected every time you restart your machine (screen?), to see the messages you missed and to add images and multiline code snippets (irccloud app?) ... but you need to turn off all Discorrd animations to retain your sanity 14:02
antononcube @tbrowder "what is advantage of using discord here?" -- You can have direct conversations with @librasteve , @antononcube , and @Nemokosch . 14:42
@tbrowder More seriously, Discord is simply a more convenient way to communicate in every way than IRC. 14:46
14:54 haxxelotto left 14:56 swaggboi left 14:59 Guest45 joined 15:08 avuserow left 15:09 avuserow joined
Guest45 Hi all. I have an array of two-element lists. I want to append items from a separate 1-d array to each inner list, giving an array of three-element lists. Here's what I have so far: 15:18
$ raku
Welcome to Rakudo™ v2024.02.
Implementing the Raku® Programming Language v6.d.
Built on MoarVM version 2024.02.
To exit type 'exit' or '^D'
[0] > my @a = ((0,1),(2,3))
[(0 1) (2 3)]
[1] > my @b = (8,9)
[8 9]
[2] > @a Z @b
(((0 1) 8) ((2 3) 9))  ## Not quite. I want flat inner lists. 15:19
[3] > (@a Z @b).map: *.flat
(([0 1] 8) ([2 3] 9))  ## ??
[4] > (@a.List Z @b.List).map: *.flat
((0 1 8) (2 3 9))      ## ok, but whaa?
[5] >
So, a) What are the '.List's doing? And b) surely there's a better way. Any suggestions?
[Coke] For multi line pastes, please use something like gist.github.com instead for future ones.
librasteve or if you move over to Discord (on a non-bridged channel) then you can use triple backticks for code quoting 15:20
(btw I leanred this the hard way)
[Coke] Guest45 - the .List is converting from an Array to a List 15:22
m: my @a = ((0,1),(2,3)); dd @a.^name; dd @a.List.^name;
camelia "Array"
"List"
librasteve m: my @a = ((0,1),(2,3)); my @b = (8,9); say @a Z, @b; 15:29
evalable6 (((0 1) 8) ((2 3) 9))
Raku eval (((0 1) 8) ((2 3) 9))
librasteve this is the best way I know to do the first part - can't avoid doing map flat on the result afaik 15:30
[Coke] the , is implied if left off, I think
librasteve note the comma ',' does all the work 15:31
oh - ok ... I see that Geust45 had that part right in the first place ;-)
[Coke] Right, I think the question is, why does this not work:
m: my @a = ((0,1),(2,3)); my @b = (8,9); dd (@a Z @b).map(*.flat) 15:32
camelia (($(0, 1), 8).Seq, ($(2, 3), 9).Seq).Seq
[Coke] m: my @a = ((0,1),(2,3)); my @b = (8,9); dd (@a.List Z @b.List).map(*.flat) # but this does
camelia ((0, 1, 8).Seq, (2, 3, 9).Seq).Seq
[Coke] m: my @a = ((0,1),(2,3)); dd @a; dd @a.flat; dd @a.List; dd @a.List.flat; 15:33
camelia Mu @a = [(0, 1), (2, 3)]
($(0, 1), $(2, 3)).Seq
((0, 1), (2, 3))
(0, 1, 2, 3).Seq
[Coke] docs.raku.org/language/list#Itemization 15:34
"Second, remember that these invisible dollar signs also protect against flattening, so you cannot really flatten the elements inside of an Array with a normal call to flat or .flat.
Guest45: Hope that helps. 15:37
librasteve Array.raku does not put $ to explicitly show scalars, unlike List.raku:
15:43 jpn left 15:44 jpn joined
I kinda sympathize with the language design decision to preserve nesting structure of arrays and lists, that way I can make more sophisticated repeating patterns (I guess a 3D array would be an example of that), and I can be confident that I can pass it around without having some routine accidentally flatten it - but it sure is hard to get your head around 15:45
[Coke] m: my @a = ((0,1),(2,3)); say @a; say @a.raku; dd @a; 15:47
camelia [(0 1) (2 3)]
Mu @a = [(0, 1), (2, 3)]
[(0, 1), (2, 3)]
[Coke] (just checking that all the diagnostics there "hide" the $() ) 15:48
15:54 abraxxa left
Guest45 No time to read just now--running off to work. TIA! 15:54
15:58 haxxelotto joined 16:00 Guest45 left
nahita3882 alternatives: list comprehension ((|.[0], .[1]) for @a Z @b) or with map @a.map({ |$_, @b[$++] }) 16:06
16:10 haxxelotto left
another because why not sub infix:<AP> { |@^a, $^b }; @a ZAP @b 16:12
ab5tract I like that ZAP solution quite a lot 16:21
nahita3882 (thanks, could have named more descriptively like { |@^sub-list, $^tail }) 16:27
16:39 dakkar left 16:45 haxxelotto joined 17:54 jpn left 18:16 xihitrchdg joined
xihitrchdg hell 18:17
roguerakudev Is there a certain order in which grammars will attempt to match proto candidates? I have some candidates which are basically subsets of others, e.g. an integer with a certain number of digits vs an integer with any number of digits
xihitrchdg o
roguerakudev And obviously I want it to prefer the more specific case
18:18 xihitrchdg left
antononcube @Rog Hmm... I think I asked a similar question here a year ago, while dealing with time interval specs. 19:00
@Rog Not much help, but here is the discussion start: discord.com/channels/5384078799804...4753932288 19:08
Basically, I solve this by having a given operator in order to handle the generic and particular cases in one sub / method. 19:10
@Rog See the method process-time-interval definition and its invokation here: github.com/antononcube/Raku-DSL-Sh...kumod#L171 19:18
librasteve Rog: given this is raku, I would guess that its the same as any other regex 19:23
Util I have been asked to call your IRC attention to www.reddit.com/r/rakulang/comments...onference/ , if there is any chance you might be attending the conference. 20:36
Summary: (1) we want more Raku talks. (2) Rakudo internals qualifies for the Science track (paper or poster). Thanks!
20:42 merp left 20:48 merp joined 20:51 vrurg_ joined, vrurg left
[Coke] Util++ 21:01
I will not be there long enough to present, probably, but hopefully someone dan!
... can
librasteve I just installed and ran this ... crag 'say (1.6km / (60 * 60 * 1s)).in: <mph>' 21:02
and got this... 0.99mph Saw 1 occurrence of deprecated code. ================================================================================ Method Str (from Distribution::Resource) seen at: /home/stephenroe/.rakubrew/versions/moar-2024.03/share/perl6/site/sources/978310083AD9011C8F98B263FB7A6CF0339EAEEC (Chemistry::Stoichiometry::ResourceAccess), lines 54,87 Please use %?RESOURCES<key> directly instead. 21:03
-------------------------------------------------------------------------------- Please contact the author to have these occurrences of deprecated code adapted, so that this message will disappear!
now look - this is really bad - please can we restict the error message to the installation (even that is FAR TOO HEAVY ... one line deprecated is enough 21:04
2024.03 21:05
21:11 jpn joined, haxxelotto left 21:12 haxxelotto joined
[Coke] There should be a raku flag to hide the deprecated warnings. 21:14
librasteve i disagree - the warnings should be default not shown when running a script - only on install 21:15
they are too heavy (imo) for install too - one line total would be sufficient 21:17
this came from an errant module during the install...
===> Testing [OK] for Math::Matrix:ver<0.3.9>:auth<github:pierre-vigier> ===> Testing: Chemistry::Stoichiometry:ver<0.1.6>:auth<zef:antononcube>:api<1> [Chemistry::Stoichiometry] Saw 1 occurrence of deprecated code. [Chemistry::Stoichiometry] ================================================================================ [Chemistry::Stoichiometry] Method St [Chemistry::Stoichiometry] r (from 21:18
Distribution::Resource) seen at: [Chemistry::Stoichiometry] /private/var/folders/w8/sf4t1d6kq6qss6gv1tfzc00000gn/T/.zef/1713301662.18319/2bdb6628b29b1e5f1eec75300fe8fda0e8b5c22e.tar.gz/dist/lib/Chemistry/Stoichiometry/ResourceAccess.rakumod (Chemistry::Stoichiometry::Res [Chemistry::Stoichiometry] ourceAccess), lines 54,87 [Chemistry::Stoichiometry] Please use %?RESOURCES<key> directly instead. [Chemistry::Stoichiometry]
-------------------------------------------------------------------------------- [Chemistry::Stoichiometry] Please contact the author to have these occurrences of deprecated code [Chemistry::Stoichiometry] adapted, so that this message will disappear! [Chemistry::Stoichiometry] Saw 1 occurrence of deprecated code. [Chemistry::Stoichiometry] ================================================================================
[Chemistry::Stoichiometry] Method Str (from Distribution::Resource) seen at: [Chemistry::Stoichiometry] /private/var/folders/w8/sf4t1d6kq6qss6gv1tfzc00000gn/T/.zef/1713301662
[Chemistry::Stoichiometry] .18319/2bdb6628b29b1e5f1eec75300fe8fda0e8b5c22e.tar.gz/dist/lib/Chemistry/Stoichiometry/ResourceAccess.rakumod (Chemistry::Stoichiometry::ResourceAccess), lines 54,87 [Chemistry::Stoichiometry] Please use %?RESOURCES<key> directly instead. [Chemistry::Stoichiometry] -------------------------------------------------------------------------------- [Chemistry::Stoichiometry] Please contact
the author to have these occurrences of deprecated code [Chemistry::Stoichiometry] adapted, so that this message will disappear! [Chemistry::Stoichiometry] Saw 1 occurrence of deprecated code. [Chemistry::Stoichiometry] ================================================================================ [Chemistry::Stoichiometry] Method St [Chemistry::Stoichiometry] r (from Distribution::Resource) seen at:
[Chemistry::Stoichiometry] /private/var/folders/w8/__sf4t1d6kq6qss6gv1tfzc00000gn/T/.zef/1713301662.18319/2bdb6628b29b1e5f1eec75300fe8fda0e8b5c22e.tar.gz/dist/lib/Chemistry/Stoichiometry/ResourceAccess.rakumod (Chemistry::Stoichiometry::Res [Chemistry::Stoichiometry] ourceAccess), lines 54,87 [Chemistry::Stoichiometry] Please use %?RESOURCES<key> directly instead [Chemistry::Stoichiometry]
-------------------------------------------------------------------------------- [Chemistry::Stoichiometry] Please contact the author to have these occurrences of deprecated code [Chemistry::Stoichiometry] adapted, so that this message will disappear! ===> Testing [OK] for Chemistry::Stoichiometry:ver<0.1.6>:auth<zef:antononcube>:api<1>
21:25 itaipu left 21:27 itaipu joined
[Coke] antoncube: github.com/antononcube/Raku-Chemis...try/pull/3 21:28
I like having the deprecation warnings with an option to disable them at runtime (probably from years of java usage) - The PR was an easy way to help fix your short term issue, though. 21:29
I certainly agree that they are verbose and could possibly be shorter. 21:30
afk 21:31
antononcube @Coke and @librasteve I review and merge the fixes tonight. Thank you! 21:39
21:52 sena_kun left 21:53 sena_kun joined
lizmat meh, looks like quoting code on this side of the IRC bridge is just as bad as just pasting code :-( 22:14
23:00 sena_kun left 23:13 jpn left 23:22 Sgeo joined