lizmat yes, that's a unixism, so not supported out of the box in Raku 00:03
habere-et-disper =b 00:10
m: say ( shell 'echo -n ~', :out ).out.slurp( :close ) 00:14
camelia /home/camelia
00:25 arkiuat left 00:33 arkiuat joined 00:47 habere-et-disper left 01:32 arkiuat left 01:37 arkiuat joined 03:07 apogee_ntv left, swaggboi left, apogee_ntv joined, swaggboi joined
jubilatious1_98524 m: say "~", $*CWD.absolute; 03:19
Raku eval ~/home/glot
jubilatious1_98524 m: say $*CWD.absolute; 03:20
Raku eval /home/glot
03:32 librasteve_ left 04:35 arkiuat left 04:48 arkiuat joined 04:53 arkiuat left 05:14 arkiuat joined 05:19 arkiuat left 05:36 lizmat left 05:48 arkiuat joined 05:55 arkiuat left 06:32 arkiuat joined 06:37 arkiuat left 07:07 arkiuat joined
ab5tract m: dd %*ENV<HHOME> 07:07
camelia element{'HHOME'} = Any
ab5tract m: dd %*ENV<HOME>
camelia "/home/camelia"
ab5tract this would be the usual way to do it 07:08
07:12 arkiuat left 07:34 arkiuat joined 07:39 arkiuat left 08:07 arkiuat joined 08:12 arkiuat left 08:34 arkiuat joined 08:39 arkiuat left 09:02 arkiuat joined 09:07 arkiuat left, dakkar joined 09:35 arkiuat joined 09:40 arkiuat left 10:07 arkiuat joined 10:12 arkiuat left 10:33 lizmat joined 10:34 arkiuat joined 10:38 arkiuat left 10:55 arkiuat joined 11:06 arkiuat left 11:36 arkiuat joined 11:42 arkiuat left 12:01 arkiuat joined 12:06 arkiuat left 12:20 arkiuat joined 12:29 arkiuat left 12:41 arkiuat joined 12:46 arkiuat left 13:13 arkiuat joined 13:18 arkiuat left 13:32 arkiuat joined 13:36 arkiuat left 13:48 arkiuat joined 13:53 arkiuat left 14:19 arkiuat joined 14:27 arkiuat left
jubilatious1_98524 m: say "~", %*ENV<HOME>; 14:34
Raku eval ~/home/glot
jubilatious1_98524 m: put "~", %*ENV<HOME>; 14:35
Raku eval ~/home/glot
14:58 arkiuat joined 15:08 arkiuat left 15:24 Guest5968 joined, Guest5968 left, Guest5968 joined 15:56 arkiuat joined 15:59 librasteve_ joined 16:01 arkiuat left 16:20 arkiuat joined 16:25 arkiuat left 16:39 Guest5968 left 16:44 Guest4085 joined 16:52 arkiuat joined 16:57 arkiuat left
sailkite i don't have a strong reason for asking this, but is there a way to use the reduction metaoperator with infix feed operators? i've tried naïve variations and i'm clearly not groking something 17:08
17:09 Guest4085 left 17:21 arkiuat joined 17:27 arkiuat left
ab5tract sailkite: one way to get things working with feeds is to wrap them in a block that calls itself 17:35
m: dd do 1..10 ==> { [+] @_ }() 17:36
camelia 55
ab5tract But also in RakuAST you could use a helper class to make it read a bit more nicely 17:37
m: Q| my $r = class :: { method reduce(*@a) { [+] @a } }.new; dd do 1..10 ==> reduce($r:) 17:38
camelia ===SORRY!=== Error while compiling <tmp>
Couldn't find terminator | (corresponding | was at line 1)
at <tmp>:1
------> @a } }.new; dd do 1..10 ==> reduce($r:)<HERE><EOL>
expecting any of:
|
ab5tract m: Q| my $r = class :: { method reduce(*@a) { [+] @a } }.new; dd do 1..10 ==> reduce($r:) |.AST.EVAL
camelia 55
ab5tract or less cryptically: 17:40
m: Q| class Assist { method reduce(*@a) { [+] @a } }; dd do 1..10 ==> reduce(Assist:) |.AST.EVAL
camelia 55
17:40 dakkar left 17:56 arkiuat joined 17:59 Guest4085 joined 18:01 arkiuat left
sailkite i guess in an extremely arcane and purely didactic sense, i was wondering about a hypothetical case where there's some concept like this raku my @things = 2, 1, 2; @things ==> unique() ==> sort() ==> say(); and i wanted to somehow manipulate that into a means of using [==>]. i know that it's possible to just simply method chain it @things.unique.sort.say, but i couldn't help but feel curious. 18:05
ab5tract Ah, so that's what you meant :) 18:22
18:23 arkiuat joined
ab5tract I don't think that's possible because there's no way to pass the call in a list (as far as I know, anyway!) 18:24
so even if you could do: [==>] @a, unique(), sort(), say() -- it would fail because you would have the result of those calls in the list instead
but as you've noticed, [==>] and other attempts won't work either because the feed operator is not a higher level Raku infix routine, even though it dresses like one for the party 18:26
18:28 arkiuat left
nahita3882 with explicit .reduce there is something, but not that dramatic: 18:30
m: my @a = 12, 3, 4, 3; [@a, &unique, &sort, &say].reduce: { &^fun(@^arg) } 18:31
Raku eval (3 4 12)
nahita3882 order-preservingness of .unique is appreciated; in CPython, e.g., one does [*dict.fromkeys(arr)] to that effect (PyPy guarantees [*set(arr)] is ok) 18:36
18:49 librasteve_ left 18:56 arkiuat joined
sailkite much appreciated, thanks for indulging me 😅 18:58
19:01 arkiuat left 19:23 arkiuat joined 19:28 arkiuat left 19:36 arkiuat joined 19:41 arkiuat left
jubilatious1_98524 m: List.new(12, 3, 4, 3) ==> unique() ==> sort() ==> say(); 19:44
Raku eval (3 4 12)
ab5tract nahita3882++ 19:57
always enjoy reading your code snippets
19:59 habere-et-disper joined
habere-et-disper Is there a simple/portable way to test from raku if the terminal supports non-ASCII? I'm writing to STDOUT and I want to know if it can handle UTF8. 19:59
20:02 Guest4085 left 20:08 arkiuat joined
lizmat habere-et-disper: japhb might know, but they're not on this channel 20:18
or patrickb
they are on #raku
jubilatious1_98524 habere-et-disper: Dunno if this is helpful: unix.stackexchange.com/a/800915/227738 20:19
20:34 arkiuat left 20:54 arkiuat joined 20:59 arkiuat left 21:03 habere-et-disper left 21:23 habere-et-disper joined 21:26 arkiuat joined 21:30 arkiuat left 21:45 habere-et-disper left, habere-et-disper joined 21:59 arkiuat joined 22:04 arkiuat left 22:17 habere-et-disper left 22:25 arkiuat joined 22:30 arkiuat left 22:47 arkiuat joined 22:52 habere-et-disper joined 22:54 arkiuat left 22:59 habere-et-disper left 23:07 arkiuat joined 23:15 arkiuat left 23:28 arkiuat joined 23:49 Guest4085 joined 23:50 Guest4085 left, Guest4085 joined, Guest4085 is now known as ds7832