🦋 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:23
gdown joined
00:53
MasterDuke joined
01:08
hulk joined
01:09
kylese left
01:26
Xliff_ joined
|
|||
Xliff_ | \o | 01:26 | |
How can I run an external command in raku and have the commands output still pass through to STDOUT without buffering or capturing? | 01:27 | ||
antononcube | @Xliff If I understand correctly the question, you have to call shell. | 01:30 | |
Xliff_ | Thanks! | 01:34 | |
02:15
hulk left,
kylese joined
|
|||
ugexe | That is not correct | 02:17 | |
Well maybe it is actually im | 02:18 | ||
not sure | |||
I’m not sure how using shell would rather | 02:20 | ||
would help rather ^ | |||
antononcube | @ugexe Right, I was not sure about the question and hence proposed solution. I go often through the following "bargain" : 1) first I try to use shell , 2) then I try to use run, 3) finally, I end up using Proc::Async. | 02:30 | |
03:23
Maylay left
03:33
Maylay joined
04:32
Maylay left
04:49
guifa left
05:19
gdown left
05:30
Sgeo left
07:10
sena_kun joined
07:28
sena_kun left
07:36
dawids joined
07:39
dawids left
08:00
melezhik joined
|
|||
melezhik | Xliff: does not actually matter which method you use to execute command, the issue relates to STDOUT buffering flushing | 08:01 | |
$*ERR.out-buffer = False; | 08:02 | ||
$*STD.out-buffer = False; | |||
the way you go | |||
actually $*OUT.out-buffer = False; | 08:04 | ||
08:06
wayland joined
08:07
melezhik left
08:11
thaewrapt left
08:16
thaewrapt joined
08:21
thaewrapt left
08:27
dakkar joined
08:32
thaewrapt joined
08:44
thaewrapt left
08:57
thaewrapt joined
09:03
thaewrapt left
09:12
MasterDuke left
09:15
thaewrapt joined,
skyesoss left
09:20
thaewrapt left
09:30
thaewrapt joined
09:50
thaewrapt left
10:02
thaewrapt joined
10:07
thaewrapt left
10:11
skyesoss joined
10:17
skyesoss left
10:18
thaewrapt joined
10:25
thaewrapt left
10:36
thaewrapt joined
10:43
thaewrapt left
10:45
Xliff_ left
10:54
thaewrapt joined
11:00
guifa joined,
thaewrapt left
11:11
thaewrapt joined
11:13
hudo left
|
|||
greenfork | How can I forward-declare a role to be used for an enum? I'd like this example to work paste.sr.ht/~greenfork/99c817d403e...9b5830d2a6 | 11:14 | |
11:18
thaewrapt left
|
|||
lizmat | you can't | 11:20 | |
11:21
guifa left
|
|||
lizmat | enums are compile time constructs, so all logic to create the enum *must* exist when the enum is declared | 11:21 | |
perhaps there's another way to do what you want to do? feels like your question was an X-Y problem question | 11:22 | ||
greenfork | Basically I want to do something like this Surface::Fire.draw | 11:24 | |
I think this is the closest code paste.sr.ht/~greenfork/f10f0f0670f...cf3b6b3e76 | 11:25 | ||
I also posted on stackoverflow this question, will answer it myself after figuring out the optimal solution I think stackoverflow.com/questions/787930...or-an-enum | |||
lizmat | that works, so what's wrong with it? | 11:26 | |
greenfork | Nothing wrong, I just don't like the way it is written | 11:27 | |
My other classes are like class A { method draw { ... } }, so they are all called like $a.draw, I wanted to have a similar interface for the enum | 11:28 | ||
But I think that it requires wrapping it in a class | |||
11:29
thaewrapt joined
11:35
thaewrapt left
12:04
thaewrapt joined
12:10
thaewrapt left
12:19
thaewrapt joined
12:26
thaewrapt left
12:37
thaewrapt joined
12:49
thaewrapt left
|
|||
[Coke] | you can pun a class into that role. | 12:57 | |
m: role DrawSurface { method draw($a) { say $a } }; my $b = DrawSurface.new; $b.a("hi") | 12:58 | ||
camelia | No such method 'a' for invocant of type 'DrawSurface' in block <unit> at <tmp> line 1 |
||
[Coke] | m: role DrawSurface { method draw($a) { say $a } }; my $b = DrawSurface.new; $b.draw("hi") | 12:59 | |
camelia | hi | ||
[Coke] | so if you want an instance var, you can still make one, even if it's a role not a class. | ||
13:00
thaewrapt joined
|
|||
antononcube | I think we can also make a class that does the role Enumeration? (I am not in front a computer, I am just reading the enum documentation on my iPad.) | 13:05 | |
13:07
thaewrapt left
13:18
thaewrapt joined
13:26
thaewrapt left
13:28
thaewrapt joined
|
|||
[Coke] | Yes, you can do it manually too of course. | 13:41 | |
m: role DrawSurface { method draw($a) { say $a } }; class C does DrawSurface {}; my $b = C.new; $b.draw("hi") | 13:42 | ||
camelia | hi | ||
[Coke] | you basically get an anonymous C in the first example. | ||
13:45
Sgeo joined
|
|||
[Coke] | greenfork: hope that helps. | 13:54 | |
greenfork | [Coke]: this is interesting, thank you for tagggin me! | 13:56 | |
14:19
skyesoss joined
14:23
skyesoss left
14:47
skyesoss joined
14:59
jgaz joined
16:01
nuno left
16:31
dakkar left
17:52
xinming left
17:54
xinming joined
18:49
skyesoss left,
Sgeo left,
patrickb left,
lizmat left,
dustinm` left,
quotable6 left,
bisectable6 left,
bloatable6 left,
skyesoss joined,
Sgeo joined,
patrickb joined,
lizmat joined,
dustinm` joined,
quotable6 joined,
bisectable6 joined,
bloatable6 joined
18:55
sena_kun joined
|
|||
xinming | Hi, Is it possible that we use PSGI in Cro? | 18:57 | |
jdv | why? | 19:00 | |
it was talked about a bunch years ago, psgi and raku that is. | 19:01 | ||
what is justification? | |||
antononcube | Is "PSGI" in Raku going to be called "RSGI"? | 19:02 | |
jdv | afaik, the general psgi/raku thing went nowhere | 19:03 | |
xinming | Ok, I just check my old test utility written in perl, I have TODO to say upgrade to PSGI, which reminds me about PSGI thing in raku support. :-) | 19:40 | |
antononcube | @ximming Do it, ximming! Do it! | 20:08 | |
20:31
sena_kun left
21:03
wayland76 joined,
wayland left
21:47
vrurg joined,
vrurg_ left
22:43
skyesoss left
23:02
guifa joined
|