🦋 Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku Set by ChanServ on 14 October 2019. |
|||
00:00
guifa2 left
00:02
dogbert11 left,
pecastro left
00:04
eax left
00:05
wingfold left,
dogbert11 joined,
wingfold joined
00:09
monkey__ left
00:10
wingfold left
00:17
xinming left,
wingfold joined,
wingfold left
00:18
wingfold joined,
xinming joined
00:19
monkey__ joined
00:22
wingfold left
00:33
mowcat left
00:34
xinming left
00:35
xinming joined
00:49
wingfold joined
00:50
wingfold_ joined,
wingfold left
00:51
wingfold joined,
wingfold_ left
00:55
wingfold_ joined,
wingfold left
00:56
metagib joined
|
|||
metagib | Hi, i forget how to know if a number is an integer, my approach was this | 00:58 | |
"100.sqrt ~~ Int" #It's false, i but need to know if the result is an integer | |||
01:00
wingfold_ left
01:02
_________ left
01:04
_________ joined
|
|||
metagib | Also the bridge in the discord bot doesn´t work since more of three weeks | 01:05 | |
01:06
wingfold joined
|
|||
moon-child | m: sub integral($x) { $x == $x.Int }; print integral 100.sqrt | 01:10 | |
camelia | True | ||
moon-child | actually it should be sub integral($x) { ?try { $x == $x.Int } } | 01:11 | |
01:24
wingfold_ joined,
wingfold left
|
|||
metagib | Nice, i remember a specific method inside the lenguaje but maybe never existed lol | 01:25 | |
m: sub isint(Numeric $number) {$number == $number.Int}; say isint 100.sqrt | 01:26 | ||
camelia | True | ||
metagib | why the second option with try ? how is different to the first one ? | 01:27 | |
moon-child | m: sub integral($x) { $x == $x.int }; print integral 2i | 01:28 | |
camelia | No such method 'int' for invocant of type 'Complex'. Did you mean any of these: 'Int', 'UInt'? in sub integral at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
moon-child | m: sub integral($x) { $x == $x.Int }; print integral 2i | ||
camelia | Cannot convert 0+2i to Int: imaginary part not zero in sub integral at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
moon-child | m: sub integral($x) { ?try { $x == $x.Int }}; print integral 2i | ||
camelia | False | ||
moon-child | (you need the ? to coerce to a boolean, otherwise it returns Nil} | 01:29 | |
01:29
wingfold_ left
|
|||
metagib | Ohh nice, i dont consider the imaginary roots | 01:34 | |
thanks !!! | 01:35 | ||
01:35
metagib left
01:37
dataangel left
01:47
DiffieHellman left,
wingfold joined,
DiffieHellman joined
01:51
wingfold left
02:03
xinming left
02:04
xinming joined,
wingfold joined
02:06
wingfold left
02:07
wingfold joined
02:11
wingfold left
02:14
orinthe7 joined
02:15
orinthe left,
orinthe7 is now known as orinthe
02:16
kvw_5 joined
02:19
kvw_5_ left
02:24
Sgeo__ joined
02:27
Sgeo_ left
02:32
monkey__ left
02:33
wingfold joined
02:36
monkey__ joined
02:38
guifa2 joined
02:41
xinming left
02:43
xinming joined
03:01
aindilis` left
03:08
xinming left,
xinming joined
03:20
Doc_Holliwood joined,
wingfold left
03:28
xinming left
03:29
xinming joined
03:32
wingfold joined
03:36
wingfold left
03:41
kaiwulf left
03:43
tejr left
03:44
tejr joined
03:45
xinming left
03:46
xinming joined
03:50
wingfold joined
04:00
asymptotically left,
asymptotically joined
04:02
monkey__ left
04:08
asymptotically left
04:09
asymptotically joined
04:10
asymptotically left
04:11
asymptotically joined,
Doc_Holliwood left
04:21
[Sno] joined
04:24
sno left
04:35
Doc_Holliwood joined
04:38
wamba joined
04:46
wingfold_ joined,
wingfold left,
parabolize left,
maggotbrain joined
04:50
wingfold_ left
04:54
Geth left
04:57
wingfold joined
04:58
wingfold_ joined,
wingfold left
04:59
wingfold joined,
wingfold_ left
05:04
wingfold left
05:10
wingfold joined
05:15
wingfold left
05:16
japhb left
05:18
japhb joined,
xinming left
05:19
xinming joined
05:30
wingfold joined
05:33
xinming left,
xinming joined
05:44
guifa2 left
05:47
frost-lab joined
05:49
silug left
05:55
silug joined
06:02
epony left
06:16
wingfold left
06:24
xelxebar left
06:26
xelxebar joined
06:29
elcaro left,
elcaro joined
06:30
wingfold joined
06:55
ufobat joined
06:58
andinus joined
07:06
jmcgnh left
07:13
jmcgnh joined
07:23
wamba left
07:24
notagoodidea joined,
wingfold left
07:29
Sgeo__ left
|
|||
japhb | 🎉🎉🎉 MUGS 0.0.6 is now released and uploaded. :-D | 07:39 | |
07:41
wingfold joined
07:46
wingfold left
07:47
wingfold joined
07:48
wamba joined,
wingfold left,
wingfold joined
07:50
wamba left,
wamba joined,
wamba left
07:51
domidumont joined
07:53
wingfold left
07:54
wamba joined
08:02
wamba left
08:05
wingfold joined
08:13
wingfold left
08:16
Manifest0 left,
wamba joined
|
|||
notagoodidea | I am gonna pull a PR for the countdown stuff from Ben Hoyt somewhere today (simple and optimized) any modification to enhance it is welcome (in particular the optimized version) | 08:17 | |
08:20
Manifest0 joined
08:25
wingfold joined
08:37
aborazmeh left
08:42
wingfold left
08:49
dakkar joined
08:55
sena_kun left
08:56
wingfold joined
08:58
notagoodidea left,
sena_kun joined
09:03
xinming left,
xinming joined
09:05
El_Che_ is now known as El_Che
09:18
kensanata joined,
asymptotically left
09:23
asymptotically joined
09:27
pecastro joined
09:30
xinming left
09:31
xinming joined
09:35
kensanata left
09:40
jmerelo joined
09:46
ufobat_ joined
09:47
asymptotically left,
wingfold left,
asymptotically joined
09:51
a3r0_ joined
09:55
jmcgnh left,
andinus left,
ufobat left,
a3r0 left
09:56
jmcgnh_ joined
09:58
jmcgnh_ is now known as jmcgnh,
jmcgnh is now known as jmcgnh_
09:59
jmcgnh_ is now known as jmcgnh
10:01
wingfold_ joined
10:09
rindolf joined
10:14
[Sno] left
10:28
Doc_Holliwood left
10:32
Doc_Holliwood joined
10:38
wingfold_ left
10:50
wingfold joined
11:03
plvicente joined
11:07
xelxebar left
11:09
xelxebar joined
11:11
Geth joined,
benkolera left
11:20
squashable6 left,
Kaiepi left
11:21
squashable6 joined,
squashable6 left
11:23
squashable6 joined
11:28
Black_Ribbon left
11:29
xinming left,
xinming joined
11:37
wingfold left
11:50
wingfold joined
11:51
frost-lab left
11:57
xinming left
11:58
plvicente left,
xinming joined
12:07
wingfold left,
wingfold joined
12:11
xinming left,
wamba left
12:13
xinming joined
12:25
wamba joined
12:26
plvicente joined
|
|||
CIAvash | weekly: www.raku-lang.ir/en | 12:30 | |
notable6 | CIAvash, Noted! (weekly) | ||
12:36
Geth left
|
|||
lizmat | CIAvash: looks nice, but how is it intended? as a proposal? a demo ? | 12:41 | |
12:42
Doc_Holliwood left
|
|||
CIAvash | lizmat: It was a proposal a year ago when I opened an issue for it on problem-solving, but now it's an alternative website. But the community still can use the source code for creating a new site if they want to. | 12:46 | |
12:46
plvicente left
|
|||
lizmat | weekly: lizmat: It was a proposal a year ago when I opened an issue for it on problem-solving, but now it's an alternative website. But the community still can use the source code for creating a new site if they want to. | 12:47 | |
notable6 | lizmat, Noted! (weekly) | ||
lizmat | so I won't forget :-) | ||
afk& | |||
12:48
notagoodidea joined
|
|||
notagoodidea | github.com/benhoyt/countwords/pull/74 here it is. | 12:48 | |
it's nothing special but hey why not. | |||
12:49
__jrjsmrtn__ left
12:50
__jrjsmrtn__ joined
12:52
epony joined
12:56
xinming left
12:57
monkey__ joined,
xinming joined
|
|||
codesections | m: (^9).classify({$_ %% 2 ?? :{:first<hash>:2k} !! :{:second<hash>:2k}}, :into(my %h{Hash})) | 13:00 | |
camelia | Type check failed in binding to parameter 'key'; expected Hash but got Pair (:k(2)) in block <unit> at <tmp> line 1 |
||
codesections | what am doing wrong ^^^^ ? | 13:01 | |
This looks like it should construct a %h Hash with Hash keys. But the keys are turned into Pairs somehow? | 13:02 | ||
13:04
plvicente joined
|
|||
codesections | m: say :{:first<hash>:2k}.WHAT | 13:04 | |
camelia | (Hash[Mu,Any]) | ||
codesections | it _should_ be a Hash... | ||
oh, I guess the fact that a Hash is an Iterable is confusing things? | 13:12 | ||
13:20
monkey__ left
13:25
plvicente left
13:39
jmerelo left
13:43
QhpAptyj9hj0RQwM joined
13:45
wingfold left,
wingfold joined
13:46
Gruber is now known as Grrrr
13:47
wingfold left,
wingfold joined
13:48
wingfold_ joined,
wingfold left
13:50
wingfold_ left
|
|||
codesections | actually, I'm just having difficulty with _any_ way of using Hashes as Hash keys | 13:50 | |
13:50
wingfold joined
|
|||
codesections | m: my %h{Hash}; %h{ %(:k1<v1>:k2<v2>) } = 42 | 13:51 | |
camelia | Type check failed in binding to parameter 'key'; expected Hash but got Pair (:k1("v1")) in block <unit> at <tmp> line 1 |
||
moritz | camelia: that's because hashes are not a value type | ||
erm, meant codesections | |||
13:52
wingfold left
|
|||
codesections | reading the docs on that now. | 13:52 | |
ty | |||
13:52
wingfold joined
|
|||
codesections | moritz: does that mean that only value types can be used as Hash keys? | 13:53 | |
13:54
plvicente joined
|
|||
moritz | yes | 13:57 | |
codesections | But I can use a List of Pairs as a key. Lists aren't value types either, are they? | 13:58 | |
Or does immutability mean they are? | |||
13:58
Doc_Holliwood joined
13:59
Sgeo joined
|
|||
moritz | m: say (1, 2, 3).WHICH | 14:00 | |
camelia | List|73990384 | ||
moritz | hm, looks more like a ref type to me | ||
but I think lizmat did some of work on that some time ago, maybe she knows? | 14:01 | ||
14:04
wingfold left,
wingfold joined
|
|||
codesections | m: my %h; %h{ (:k1<v1>:k2<v2>).Map } = 42; | 14:05 | |
camelia | ( no output ) | ||
codesections | m: my %h; %h{ (:k1<v1>:k2<v2>).Map } = 42; %h.keys.map: {.WHAT.say} | ||
camelia | (Str) (Str) |
||
14:06
plvicente left,
wingfold_ joined
|
|||
codesections | m: my %h := :{ (:k1<v1>:k2<v2>).Map = 42}; %h.keys.map: {.WHAT.say} | 14:06 | |
camelia | Type check failed in binding; expected Associative but got Block (-> ;; $_? is raw = O...) in block <unit> at <tmp> line 1 |
||
14:06
wingfold left
|
|||
codesections | m: my %h := :{ (:k1<v1>:k2<v2>).Map => 42}; %h.keys.map: {.WHAT.say} | 14:07 | |
camelia | (Map) | ||
14:07
wingfold_ left
|
|||
codesections | there we go... | 14:07 | |
14:07
wingfold joined
|
|||
codesections | m: my %h := :{ (:k1<v1>:k2<v2>).Hash => 42}; %h.keys.map: {.WHAT.say} | 14:07 | |
camelia | (Hash) | ||
14:09
xinming left
|
|||
codesections | moritz: ^^^ it looks like I can use Hashes/other ref types as keys just fine -- just not as a constraint? | 14:09 | |
14:10
QhpAptyj9hj0RQwM left,
xinming joined
|
|||
codesections | m: my Hash $h = :{ (:k1<v1>:k2<v2>).Hash => 42}; $h.keys.map: {.WHAT.say} | 14:11 | |
camelia | (Hash) | ||
14:11
QhpAptyj9hj0RQwM joined
14:12
wingfold left
|
|||
codesections | (also seems to work with assignment, not just binding) | 14:12 | |
14:12
wingfold joined
14:14
wingfold_ joined,
wingfold left
14:15
wingfold joined,
wingfold_ left
14:17
wingfold left
14:18
wingfold joined
14:19
astik_ joined
14:22
wingfold left
14:23
astik__ left
14:24
notagoodidea left
14:31
notagoodidea joined
14:37
wingfold joined
14:42
daimon is now known as daemon
14:46
plvicente joined
14:47
plvicente left
14:53
parabolize joined
14:58
Doc_Holliwood left
15:10
Doc_Holliwood joined
15:16
plvicente joined
15:18
codesect` joined
15:19
codesections left
15:21
QhpAptyj9hj0RQwM left
15:22
QhpAptyj9hj0RQwM joined
15:24
codesections joined
|
|||
xinming | SmokeMachine: I think I just now found a bug, where when we try to save the Blob col type, Red will try to concat the Blob to Str with ~ operator. | 15:30 | |
15:34
xinming left
15:35
xinming joined
|
|||
SmokeMachine | xinming: would you mind to open an issue with an example of code for that, please? | 15:39 | |
15:39
notagoodidea left
15:40
literal joined,
plvicente left
15:41
wingfold left
|
|||
xinming | SmokeMachine: Ok, creation worked, while calling .^save will raise exception. | 15:41 | |
15:41
wingfold joined
15:45
wingfold left
15:52
wingfold joined
15:53
xinming left,
xinming joined
|
|||
xinming | hmm, ignore me, It seems, It's because of wrong type of column, after I changed column to other type, I can't seem to reproduce the bug | 15:56 | |
15:57
Kaiepi joined,
wingfold left
|
|||
codesect` | xinming: That sounds a lot like this issue: docs.raku.org/language/traps#Using...t_of_blobs | 15:58 | |
15:59
codesect` left,
codesections left
16:00
codesections joined,
wingfold joined
16:01
wingfold_ joined,
wingfold left
16:05
wingfold_ left,
wingfold joined,
plvicente joined
16:09
Doc_Holliwood left
16:10
wingfold left
16:16
b2gills left
16:18
jmerelo joined
16:23
wingfold joined
16:32
notagoodidea joined
16:37
plvicente left
16:38
QhpAptyj9hj0RQwM left
16:46
wingfold left,
wingfold joined
16:49
wingfold_ joined,
wingfold left
16:50
QhpAptyj9hj0RQwM joined
16:53
wingfold_ left,
plvicente joined
17:01
wingfold joined
17:06
wingfold left,
wingfold joined
|
|||
[Coke] wonders how having a hash as a key is helpful. | 17:07 | ||
That is, what's the use case? | |||
17:11
xinming left
17:12
xinming joined
17:17
QhpAptyj9hj0RQwM left
17:18
QhpAptyj9hj0RQwM joined,
aluaces left
17:31
plvicente left
17:38
dakkar left
17:47
aborazmeh joined
17:49
samcv_ is now known as samcv,
samcv left,
samcv joined
17:54
tison joined
18:09
ufobat_ left,
tison left
18:11
wingfold_ joined,
wingfold left
18:16
wingfold_ left
|
|||
[Coke] | if I run 'zef install MUGS' I get as far as "===> Searching for missing dependencies: RPG::Base, Cro::WebApp, Term::termios, Text::MiscUtils::Layout, Pluggable" and then it hangs. | 18:19 | |
(trying again with --verbose) | |||
18:20
wingfold joined
18:21
wingfold left,
lynx__ joined,
wingfold joined
|
|||
[Coke] | ... maybe the new 0.0.6 release just now fixed it? install proceeding | 18:24 | |
18:25
Geth joined
|
|||
[Coke] | (can't easily see the old version I tried to install, it scrolled off) | 18:25 | |
18:26
wingfold left
18:35
wingfold joined
18:36
aluaces joined
18:39
wingfold left
18:42
xinming_ joined
18:46
xinming left,
jmerelo left,
wamba left
|
|||
QhpAptyj9hj0RQwM | [Coke]: Did the install complete? | 18:49 | |
[Coke] | no. ended up getting a segfault instead | 18:51 | |
QhpAptyj9hj0RQwM | [Coke]: Hmm. What OS are you running, and how did you install zef? | ||
18:53
wingfold joined,
wamba joined
18:54
jmerelo joined
18:58
wingfold left
18:59
eseyman left
19:00
notagoodidea left
|
|||
QhpAptyj9hj0RQwM | That way I might be able to recreate the issue on my end :) | 19:03 | |
19:05
eseyman joined
|
|||
moon-child | curious, why is there no builtin infix operator for appending lists? | 19:09 | |
e.g. infix:<..>(@a, @b) { |@a, |@b } | |||
19:09
mowcat joined
19:10
wingfold joined
|
|||
codesections | m: my @a = <0 2 6>; my @b = <7 8 9>; @a ,= @b; say @a | 19:10 | |
camelia | (\Array_58686824 = [Array_58686824 [7 8 9]]) | ||
codesections | er, | 19:11 | |
19:11
domidumont left
|
|||
moon-child | ooh, I didn't know there was prettyprinting for circular data structures | 19:12 | |
that's neat | |||
19:20
QhpAptyj9hj0RQwM left
19:24
QhpAptyj9hj0RQwM joined
19:28
lynx__ left
19:30
drakonis left
19:31
wingfold left
19:32
xelxebar left,
xelxebar joined
19:34
drakonis joined,
wingfold joined
19:37
Doc_Holliwood joined
19:39
wingfold left
19:43
wingfold joined
19:48
wingfold left,
brtastic joined
19:53
wingfold joined
19:55
jmerelo left,
benkolera joined
20:01
wamba left
20:18
QhpAptyj9hj0RQw joined
20:22
QhpAptyj9hj0RQwM left
20:30
aindilis joined
20:39
wingfold left
20:45
wingfold joined
20:46
wingfold left,
wingfold joined
20:49
wingfold left,
wingfold joined
20:54
wingfold left
20:59
wingfold joined
|
|||
codesections | the below behavior is a bug, right? | 21:00 | |
m: sub f(:$named) {dd $named}; f(:named('k1' => (:pair<list>:done<right>), 'k2' => :pair<list>:done<wrong>)) | 21:01 | ||
camelia | $(:k1((:pair("list"), :done("right"))), :k2(:pair("list"))) | ||
codesections | I know there's a syntax error -- the second pair list should be inside parens. But that should result in the Signature not matching, right? Not just silently disappear... | 21:02 | |
moritz | I think it's applied as an adverb somewhere... but TBH this is something I never managed to wrap my head around | 21:04 | |
21:04
drakonis left
|
|||
moritz | adverb like in the %hash<key>:delete access | 21:04 | |
codesections | hmm, I thought that implemented through named parameters. Hold on, I just read something about that | 21:06 | |
perl6advent.wordpress.com/2013/12/...y-adverbs/ | 21:07 | ||
m: sub f(:$named, *%h) {dd $named; dd %h}; f(:named('k1' => (:pair<list>:done<right>), 'k2' => :pair<list>:done<wrong>)) | 21:12 | ||
camelia | $(:k1((:pair("list"), :done("right"))), :k2(:pair("list"))) Hash element = {} |
||
codesections | if it's turning into an adverb, then in theory it should show up in the slurpy, right? | ||
21:15
QhpAptyj9hj0RQw left
|
|||
moon-child | is there a way to do ioctls in raku (without nativecall)? docs.raku.org/language/5to6-perlfunc#ioctl indicates no dice, but maybe that's out of date? | 21:21 | |
moritz | codesections: it might be an adverb to the pair constructor, which ignores it? | 21:22 | |
codesections | moritz: Oh, good thought. | 21:23 | |
moritz | perlpunks.de/paste/show/60527389.2f5c.1fc | 21:24 | |
the QAST::WVal+{QAST::SpecialArg}(Str :named<c>) <wanted> d in the argument list of the .new call seems to support this hypothesis | 21:25 | ||
codesections | so does | 21:26 | |
m: say Pair.^lookup('new').signature | |||
camelia | (Pair: |) | ||
codesections | m: say Pair.^lookup('new').candidates.map: *.signature | 21:27 | |
camelia | ((Pair: Cool:D \key, Mu \value, *%_) (Pair: Mu \key, Mu \value, *%_) (Pair: Mu :$key!, Mu :$value!, *%_)) | ||
codesections | m: say &infix:«=>».candidates.map: *.signature | 21:28 | |
camelia | ((Mu $key, Mu \value)) | ||
codesections | yep, moritz, you were right. So that just leaves the question of whether it's a bug or not | 21:29 | |
21:32
brtastic left
21:33
kaiwulf joined
21:40
wingfold left,
wingfold joined
21:44
wingfold_ joined,
wingfold left
21:48
wingfold_ left
22:02
wingfold joined
22:03
daxim left
22:26
aindilis` joined,
aindilis left
22:34
xinming_ left
22:35
xinming_ joined
|
|||
moon-child | m: my uint8 $x = 0; print +^ $x; | 22:37 | |
camelia | -1 | ||
moon-child | hmmm... | ||
on my system, that prints 'Cannot invoke this object (REPR: P6opaque; NQPMu)'. Either way, I want it to return 255 instead of coercing to a regular Int. Is there a way to do that? | |||
22:39
aindilis` left
22:40
aindilis joined
|
|||
codesections | moon-child: I'm pretty sure there are some bugs in our uint code atm: github.com/rakudo/rakudo/issues/3936 | 22:42 | |
m: my uint8 $x = 0; print (my $ = +^ $x) | 22:44 | ||
camelia | -1 | ||
codesections | m: my uint8 $x = 0; print (my $ = +^$x) | ||
camelia | -1 | ||
codesections | m: my uint8 $x = 0; print (my $ = +^ $x<>) | ||
camelia | -1 | ||
moon-child | m: my uint8 $x = 0; print (my $ := +^$x) | ||
camelia | -1 | ||
22:44
wingfold left
|
|||
codesections | m: my uint8 $x = 0; print (my $ = +^ 0) | 22:45 | |
camelia | -1 | ||
codesections | m: my uint8 $x = 0; print (my uint8 $ = +^ $) | ||
camelia | Use of uninitialized value of type Any in numeric context 255 in block <unit> at <tmp> line 1 |
||
moon-child | :/ | 22:46 | |
codesections | m: my uint8 $x = 0; print (my uint8 $ = +^ $x) | ||
camelia | 255 | ||
codesections | ...which is actually what I *meant* to type the first time... | ||
22:49
mowcat left
22:51
oneeggeach joined,
wingfold joined
22:52
wingfold left,
wingfold joined
|
|||
moon-child | hmmm, I still get this error 'Cannot invoke this object (REPR: P6opaque; NQPMu)' | 22:55 | |
with the latest git | |||
(aside: anyone know why the makefile opts to install into a local dir instead of system-wide?) | |||
22:57
wingfold left
|
|||
codesections | Odd, I don't get that error on release or git (though I haven't built it in a few days) | 22:58 | |
I don't know the reasoning for the Makefile, but I like to keep the dev version in its own folder and run release for other work, so I'm fine with it. | 22:59 | ||
But you can set a different one with an argument to the ./configure script | 23:00 | ||
23:00
xelxebar left,
xelxebar joined
23:05
Black_Ribbon joined
|
|||
moon-child | reverted to the same commit hash as the bot; same result | 23:07 | |
weird | |||
guess I'll have to make my utf8 decoder less clever then | |||
japhb | Why do a utf8 decoder? It's built in ... | 23:08 | |
moon-child | I'm making a repl, so it needs to read a character at a time. And builtin getc has one character of buffering, for combining characters, which I can't find out how to disable | 23:09 | |
so, I don't actually need to do the decoding myself, but I need to know how many continuation bytes to fetch | |||
23:15
xinming_ left
23:16
xinming_ joined
|
|||
japhb | moon-child: Oh, I have a solution to that. | 23:17 | |
github.com/ab5tract/Terminal-Print...wInput.pm6 or github.com/ab5tract/Terminal-Print...dInput.pm6 or github.com/Raku-MUGS/MUGS-UI-CLI/b...ut.rakumod (all of which I wrote at various times and for various needs) | 23:18 | ||
The first one just allows you to get raw input that hands you data as soon as there are enough utf8 bytes to decode, and importantly *WITHOUT* waiting for combining characters. | 23:20 | ||
The second one decodes escape sequences and special keys streaming from the RawInput supply. | |||
The third one is a start on a Linenoise/ReadLine replacement that isn't as broken as Linenoise is, nor nearly as large/complex as Readline. | 23:21 | ||
moon-child | hmmm, I already wrote the function and basic escape decoding, but might steal some of your code there | 23:22 | |
japhb | It's worth knowing BTW, that it's safe to concatenate strings ending with base characters with strings starting with combining characters -- MoarVM automatically does NFG fixups to make the string normalized afterwards. | ||
23:23
wingfold joined
|
|||
moon-child | ahh, that's good to know | 23:23 | |
23:25
berber44 joined
|
|||
japhb | moon-child: One useful bit is that the third one (the Linenoise replacement) is the first one with code to multiplex querying the terminal and reading input. | 23:25 | |
Which is useful for determining where the cursor actually is, how big the terminal is, etc. | 23:26 | ||
23:29
rindolf left
|
|||
japhb | The biggest limitation of the Linenoise replacement is that I hadn't added escape sequence decoding yet (nor history search, tab completion, or hints, but those aren't fundamental to the input question you seemed to have) | 23:32 | |
moon-child | tab completion will be a pain. I want to do what zle does and show the completions below the prompt (without making a new one, like bash does), but that seems somewhat involved | 23:33 | |
japhb | ... which is pretty much why I hadn't yet split it out of the MUGS codebase and released it separately, though that's likely at some point; Linenoise is just too broken around ANSI and non-latin alphabets. | ||
moon-child | I think someone did a linenoise that handled utf8 | ||
japhb | As far as I could tell, that project got abandoned ... and I doubt it was ever as Unicode-smart as Raku is out of the box. | 23:34 | |
moon-child | few things are as unicode-smart as raku is out of the box :P | 23:35 | |
japhb | The tab completions on a different line thing are why being able to query the terminal while accepting input is very useful. ;-) | ||
But the other problem is that Linenoise is utterly unaware of ANSI sequences in the prompt (despite using them for terminal control). Which means if you like to highlight your prompts ... Linenoise will happily screw things up as soon as you backspace at start of input. | 23:36 | ||
moon-child | it also doesn't support multiline editing or input | ||
japhb | Also Linenoise can't understand not havin the full display width to work with. So if you want to keep your input line inside a frame, well ... SOL. | 23:37 | |
Yeah, it does long line input. Sorta. But not multiline. | |||
23:45
wingfold left
23:50
wingfold joined
23:51
wingfold_ joined,
wingfold left
23:55
wingfold_ left
|