🦋 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.
00:00 reportable6 left 00:03 reportable6 joined 00:58 MasterDuke joined 01:35 tbrowder__ left, tbrowder__ joined 01:38 kurahaupo joined
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
04:38 ugexe left, ugexe joined 06:00 reportable6 left 06:02 reportable6 joined 06:08 kurahaupo left, kurahaupo_ joined
timo sounds like "is-dir" doesn't give the expected answer perhaps 06:50
07:33 kurahaupo_ left 07:36 kurahaupo joined 07:43 sena_kun joined 08:10 kurahaupo left
timo or perhaps is-reg returns true for dirs 08:16
08:30 kurahaupo joined 08:35 kurahaupo left 08:38 kurahaupo joined 09:17 kurahaupo left 09:21 sena_kun left 09:22 kurahaupo joined
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
10:32 linkable6 left, evalable6 left 10:34 linkable6 joined 10:35 evalable6 joined 10:41 kurahaupo left, kurahaupo joined 10:46 ab5tract left
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
11:08 kurahaupo left
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
11:18 kurahaupo joined
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"
12:00 reportable6 left 12:02 reportable6 joined 12:41 kurahaupo left 12:46 kurahaupo joined
lizmat another sprintf beauty: 14:21
M: dd sprintf(q/%#05x/,1)
m: dd sprintf(q/%#05x/,1)
camelia "000x1"
14:53 kurahaupo left 14:58 kurahaupo joined 15:10 kurahaupo left 15:20 kurahaupo joined 15:28 kurahaupo_ joined 15:29 kurahaupo left, kurahaupo_ left, kurahaupo joined 16:01 kurahaupo left 16:05 kurahaupo joined 16:14 kurahaupo left 16:18 kurahaupo joined 16:25 kurahaupo left 16:30 kurahaupo joined 16:31 kurahaupo_ joined, kurahaupo left 16:32 kurahaupo_ left, kurahaupo joined, kurahaupo left 16:37 kurahaupo joined 16:41 kurahaupo left 16:43 kurahaupo joined 16:44 squashable6 left 16:46 squashable6 joined 16:47 kurahaupo left 16:53 ab5tract joined 17:11 ab5tract left 17:25 sena_kun joined 18:00 reportable6 left 18:03 reportable6 joined 19:03 evalable6 left, linkable6 left 19:04 linkable6 joined 19:05 evalable6 joined 19:25 ab5tract joined 19:57 guifa left 20:08 sena_kun left 20:09 ab5tract left
MasterDuke isn't (s)printf turing complete? 20:39
21:08 squashable6 left 21:11 squashable6 joined
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
23:11 linkable6 left, evalable6 left 23:12 linkable6 joined, evalable6 joined
Geth rakudo/main: 64c48f6cf3 | (Nick Logan)++ (committed using GitHub Web editor) | README.md
Update badge url to reference the main branch
23:40