7 Dec 2021
evalable6 (exit code 1) 04===SORRY!04===
Skarsnik, Full output: gist.github.com/5750c54867f1e46ba5...b688ef9aea
Skarsnik class A is rw {has uint8 $.a }; my $a = A.new; $a.a = 185;say
sprintf("%02X", $a.a)
m: class A is rw {has uint8 $.a }; my $a = A.new; $a.a = 185;say sprintf("%02X", $a.a) 22:32
camelia -47
Skarsnik I really don't get this one thou
gfldex 185 is bigger then 128 so when treated as a singed int8, it will be negative. 22:35
Int is int64 unless promoted to BigInt.
m: class A is rw {has uint8 $.a }; my $a = A.new; $a.a = 185;say sprintf("%02u", $a.a) 22:37
camelia negative value '-71' for %u in sprintf
Directive %u not applicable for value of type Int (-71) in format
in block <unit> at <tmp> line 1
gfldex m: class A is rw {has uint8 $.a }; my $a = A.new; $a.a = 185;say sprintf("%02d", $a.a)
camelia -71
gfldex There is no signed hex value for sprintf and friends. 22:38
Skarsnik yes, but there is not reason to fallback to signed int x)
gfldex It should complain indeed. 22:39
Skarsnik 185 fit in a uint8
gfldex m: class A is rw {has uint8 $.a }; my $a = A.new; $a.a = 185;say sprintf("%b", $a.a) 22:40
camelia -1000111 22:41
gfldex :D
That is supposed to be an unsigned int in binary.
It might just be that the sprintf-implementation predates unsinged native types. 22:42
Skarsnik m: class A is rw {has uint8 $.a }; my $a = A.new; $a.a = 185;say $a.a;
camelia -71
Skarsnik does not came from sprintf :)
gfldex sprintf should be able to get it right tho. It's sitting right on top of the VM, using plenty of nqp-magic. 22:43
Skarsnik m: class A is rw {has uint8 $.a }; my $a = A.new; $a.a = 185;say $a.a.REPR; 22:46
camelia P6opaque
Skarsnik REPR should not be P6opaque for a native 22:47
MasterDuke Skarsnik: fyi, nine++ is currently working on improving the uint support in moarvm/nqp/rakudo
gfldex m: class A{has uint32 $.a; method dd { dd $!a, $!a.REPR } }; my $a = A.new(:a(185)); $a.dd; 22:49
camelia 185
MasterDuke m: my uint8 $a = 3; say $a.WHAT
camelia (Int)
MasterDuke when you call a method on a native it gets autoboxed
gfldex WHAT is not a method. 22:50
Skarsnik :( the multi line reporting is still not fixed? (a block of instruction on multiple line, like multiple condition of a if). It's annoying to only have the error repport for the first line :( 22:52
japhb Skarsnik, gfldex: ++nine has been working on a thorough rethink of signedness at all levels of the stack. PRs aren't ready yet, but I'd say hold on a few days before overthinking this. (It's all known bugs, and it's being worked on.) 23:14
Skarsnik I probably already repported this like 4-5 years ago anyways ^^
moon-child japhb: a pre-increment well-deserved for some impressive and tedious work 23:19
jgaz Is it just me, or is raku-beginner not on libra chat. Was it not ported from freenode? 23:24
moon-child #raku-beginners (with an s), I think? 23:25
hm, maybe not...
jgaz It's sans 's'. I just tried joining manually and it worked. There are people there. But I don't think it's a discoverable channel. 23:26
If you ask for a list of channels from the IRC server -- unless I just missed it -- you won't find it.
Let me know if I just need to get an eye exam... and another cup of coffee. :) 23:27
moon-child maybe it was not registered, and the list only shows registered channels?
jgaz Maybe? 23:28
I re-ran my search, it showed up the second time. 23:37
8 Dec 2021
gfldex lolibloggedalittle: gfldex.wordpress.com/2021/12/08/lazy-fishy/ 00:53