🦋 Welcome to the IRC channel of the core developers of the Raku Programming Language (raku.org #rakulang). This channel is logged for the purpose of history keeping about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Logs available at irclogs.raku.org/raku-dev/live.html | For MoarVM see #moarvm
Set by lizmat on 8 June 2022.
MasterDuke well. i wonder if this is correct. patching DirRecurse.pull-one to use my new stat syscalls (i.e., only call stat once in the method, and use the saved object for subsequent calls), the time reported by `time raku -I . -e 'use Test'` in a directory with 113k files dropped from ~3.2s to ~0.19s 03:07
i'm not sure i trust that 03:10
huh. `Argument 0 to MoarVM syscall 'file-stat' had kind obj, but should be str` when i pass a `str`-typed variable instead of a literal 03:24
hm. i realized the other syscalls have an expected kind of `0` when the arg is a str, but changing that and i still get the same error 03:31
*expected repr
oh, i need to call nqp::decont_s on the arg 03:32
hm. so the file-stat sycall is being called for all the first-level entries in this directory, but nothing deeper... 03:50
anyway, time for bed, will pick this up tomorrow
timo sounds like "is-dir" doesn't give the expected answer perhaps 06:50
timo or perhaps is-reg returns true for dirs 08:16
Geth rakudo/main: 3cf10fdcc7 | (Elizabeth Mattijsen)++ | src/core.e/Format.pm6
Reorganize Format a bit

While documenting the Format class, it occurred to me that the "code" method was pretty ambiguous in its naming. Replaced that by the
  "Callable" method. Also removed the .signature method, as that now
more logically falls out of Callable.signature. Kept the "arity" and "count" methods as these are deemed to be more necessary for properly feeding the Callable from different sources (e.g. the .fmt method).
10:18
roast: 5241a0188c | (Elizabeth Mattijsen)++ | S32-str/format.t
Adapt Format test following changes in Format class
10:20
lizmat m: sprintf(q/% #x/,-42) 11:03
camelia ( no output )
lizmat m: say sprintf(q/% #x/,-42)
camelia 0x-2a
lizmat m: say sprintf(q/% #x/,-42).EVAL
camelia ===SORRY!=== Error while compiling /home/camelia/EVAL_0
Confused
at /home/camelia/EVAL_0:1
------> 30⏏x-2a
expecting any of:
whitespace
lizmat I think it's wrong that this doesn't roundtrip
sprintf should have rendered it as "-0x2a" 11:04
m: dd "-0x2a".EVAL # which *does* roundtrip 11:05
camelia -42
timo sounds reasonable
m: say sprintf(q/% #o/, -42) 11:06
camelia 0-52
lizmat that would EVAL but not roundtrip :-)_
timo that looks just totally wrong :D
lizmat m: dd '052'.EVAL 11:07
camelia Potential difficulties:
Leading 0 has no meaning. If you meant to create an octal number, use '0o' prefix; like, '0o52'. If you meant to create a string, please add quotation marks.
at /home/camelia/EVAL_0:1
------> 3052⏏<EOL…
timo that as well yeah
i hadn't even seen the # directive before 11:08
lizmat there's probably a lot you don't know about sprintf formats :-) 11:08
timo i wonder if we want something that's a bit less "magic syntax" for creating formatters
like in C there's a whole bunch of constants you can use to "get the right thing" like PRIi64 11:09
Formatter.integer(:base(16), :zero-pad, :min-length(5), :max-length(10)) or whatever 11:11
do we want to support ~ with Format so that it can 1) combine multiple formats and 2) not lose too much of its compiled efficiency when we just concat a string to it 11:12
i guess concating two format strings that refer to their arguments by index could be weird to define 11:13
lizmat you can already concatenate 2 Format strings, as they act as normal strings in every other way 11:14
timo of course you can 11:20
i just mean if we should handle it in some special way
lizmat I've thought about it, but format strings allow: * and $ 11:21
* means: fetch the value for width or precision as an argument
m: dd sprintf("%*s,-10,"foo")
camelia ===SORRY!=== Error while compiling <tmp>
Unable to parse expression in argument list; couldn't find final ')' (corresponding starter was at line 1)
at <tmp>:1
------> dd sprintf("%*s,-10,"⏏foo")
expecting any of:
i…
lizmat m: dd sprintf("%*s",-10,"foo") 11:22
camelia "foo "
lizmat and then there's $ 11:26
m: dd sprintf(q/%2$s/,"foo","bar")
camelia "bar"
lizmat another sprintf beauty: 14:21
M: dd sprintf(q/%#05x/,1)
m: dd sprintf(q/%#05x/,1)
camelia "000x1"
MasterDuke isn't (s)printf turing complete? 20:39
lizmat haven't found a way to have a sprintf change something, or be able to call an altered version of itself 22:44
but maybe I didn't try hard enough?
japhb lizmat: classic C sprintf has the ability to write data into an arg. 22:56
I doubt we would have replicated that
lizmat TIL
japhb I mean, it might as well have a sign on it saying "security hole *here*", so I wouldn't be surprised if its not even supported anymore. 22:58
lizmat pretty sure we don't want that in Raku :-) 22:59
sleep&
japhb Ah yeah, here it is: n The number of characters written so far is stored into the integer pointed to by the corresponding argument. 23:01
Geth rakudo/main: 64c48f6cf3 | (Nick Logan)++ (committed using GitHub Web editor) | README.md
Update badge url to reference the main branch
23:40