<daurnimator>
nycex: note that in unicode you need to toUpper a whole string; not just a single codepoint
<daurnimator>
s/need to/should/
<andrewrk>
these Q&A's of zig showtime are really helpful to me from a language design perspective
<nycex>
yeah I wanted to do that anyway
<nycex>
just gonna post this is a second time since I think this may not have been read due to the other conversation:
<nycex>
is it possible to get a function pointer to a function that takes a comptime known type for it's arguments
layneson has joined #zig
r4pr0n has quit [Quit: r4pr0n]
<andrewrk>
nycex, if you only need the function pointer to be comptime-known, then you can just use the generic function as the function pointer, no problem
<andrewrk>
if you need it to be runtime known, then you would have to declare a function without any generic args that calls the generic one, and then take a pointer to that
<nycex>
hm yeah I figured that might be needed, thanks
frmdstryr has quit [Ping timeout: 264 seconds]
<daurnimator>
andrewrk: idea: @as to do that
<daurnimator>
`@as(fn (i32) void, somegenericfn)`
knebulae has quit [Read error: Connection reset by peer]
knebulae has joined #zig
<leeward>
Ok, somewhere between 0.6 and now, translate-c has broken for SDL. Time to bisect.
<leeward>
Oof, long stretch where mainline wasn't building is making this less fun than it ought t obe.
<leeward>
ought to be, even.
layneson has quit [Ping timeout: 272 seconds]
<leeward>
Well, it's not terribly useful, but #5560 at least points to the range of changesets where it could have been broken. Given the last one in the range's comment, I'm guessing it's either that one or the first one. Might dig into it when the sun is up.
benjif has quit [Ping timeout: 240 seconds]
<andrewrk>
leeward, you should be able to bisect with only direct children of master branch
<daurnimator>
btw, please excuse my terseness for a while: I only have one working hand
<andrewrk>
you ok there?
<daurnimator>
had hand surgery
frett27 has joined #zig
satchmo has quit [Ping timeout: 256 seconds]
B4s1l3 has joined #zig
B4s1l3 is now known as opDispatch
aerona has quit [Quit: Leaving]
opDispatch has quit [Quit: Konversation terminated!]
ur5us has quit [Ping timeout: 256 seconds]
waleee-cl has quit [Quit: Connection closed for inactivity]
ur5us has joined #zig
drp has joined #zig
craigo has quit [Ping timeout: 246 seconds]
ur5us has quit [Ping timeout: 256 seconds]
dddddd has quit [Ping timeout: 260 seconds]
cole-h has quit [Quit: Goodbye]
B4s1l3 has joined #zig
B4s1l3 is now known as opDispatch
alexnask_ has joined #zig
alexnask has quit [Ping timeout: 272 seconds]
hermier has quit [Remote host closed the connection]
s-ol has joined #zig
<s-ol>
whats the quickest way I can turn a pointer to a value into a size-1-slice?
dermetfan has joined #zig
<s-ol>
i guess i have to go from single-item to multi-item pointer somehow, but im not sur ehow
<alexnask_>
@as([*]T, ptr)[0..1] I think
<alexnask_>
Nvm this @as doesnt work, I though any pointer could coerce to [*]T
<alexnask_>
I guess you need to ptrCast
<s-ol>
yeah, that does it, ptrCast then slice
wootehfoot has joined #zig
<andrewrk>
you can do a double coercion: @as([]T, @as(*[1]T, ptr))
<s-ol>
daurnimator: how are you? (lets take this part to DM ;)
<daurnimator>
14:30:20 <daurnimator>had hand surgery
<daurnimator>
:P
<s-ol>
next question: zig-fmt always un-wraps function signatures, there's no way around that? I've got some real long signatures for C library callbacks
<daurnimator>
"un-wrap"?
<s-ol>
daurnimator: oof, strain related?
<s-ol>
daurnimator: eh, un-line-wraps, i mean puts the whole signature onto one line
<daurnimator>
cut tendon(s) doing housework
<daurnimator>
s-ol: add a trailing comma
<s-ol>
ahah! thats better ;)
<s-ol>
sounds sucky :/ they got it all back together?
<daurnimator>
supposedly; 6 weeks one handed now...
<s-ol>
guess you're going half speed for a while
<daurnimator>
certain keyboard shortcuts are.... difficult
ur5us has joined #zig
<s-ol>
well now's the time to learn to type with your toes
<daurnimator>
will probably take 4 weeks for a footboard to arrive :P
<s-ol>
is there any way to shorten this? ?*c_void -> *ControlServer
<daurnimator>
no that looks about right
<daurnimator>
each piece of that statement is making a separate promise
<s-ol>
yeah, i see
<s-ol>
guess 80w is not a very attainable goal in zig sometimes
<daurnimator>
made for reading/debugging not writing/codegolf :P
<s-ol>
yeah, working on a 1366x760 laptop though I am starting to appreciate horizontal-brevity ;)
<s-ol>
maybe i should turn line wrapping on in my editor
<s-ol>
thats so ugly though >.<
<daurnimator>
120 cols should be fine though...
<s-ol>
yeah, might just need to lower my font size a bit
alexnask_ is now known as alexnask
ur5us has quit [Ping timeout: 256 seconds]
DrDeano has joined #zig
<DrDeano>
I am having some problems with ChildProcess where after I call `wait()`, I get a `OutOfMemory` but the error return trace says `PathAlreadyExists`. I am calling this with the build file.
<ifreund>
hmm, does Builder.exec() not work for your use case?
<ifreund>
DrDeano: Builder.exec() returns the stdout as a []u8, if that's what you need
neceve_ has joined #zig
ask6155 has joined #zig
<DrDeano>
The process i am running doesn't return
<ask6155>
Hey I'm back (If anyone remebers). I decided to try out zls so I built zig master and then zls master and configured it to work with Coc (Vim) and then copied all the keybinds. gd is supposed to jump to definition but it says "Definition provider not found for current document"
<alexnask>
ask6155, Hmm, this is weird. Let me download vim and give it a shot, I know a few people are using zls with coc and no one has reported this
<alexnask>
(are you using vim or neovim btw? Should matter just want to make sure I get as close an environment as possible)
<ask6155>
neovim
<ask6155>
I installed Coc via vim-plug
<DrDeano>
ifreund, but why should I be getting a OOM though as I do the same as the Builder.exec()
<ifreund>
DrDeano: hmm, I don't know.
<euantor>
Is there an easy way using `build.zig` to set a compile-time option that can be checked in code? Something like D's `-version=XYZ` or Nim's `-d:abc=xyz`? I want to implement a compile time feature flag to enable/disable specific functionality.
<ifreund>
euantor: yes, you can use addBuildOption() and then @import("build_options")
<euantor>
I thought I'd seen something like it, but the stdlib documentation is a little lacking for the build system right now
<daurnimator>
euantor: indeed; please do help out where you can!
<euantor>
Yeah, I'll try get time to submit a PR to document this at least tonight
<ask6155>
Yeah I tried my zls with emacs (Found a PR on github with instructions) and it works but neovim doesn't
<gonz_>
CoC AFAIK is about as faithful an implementation of LSP as you get outside of VSCode
<gonz_>
It's unlikely that CoC is the issue and by extension neovim
frmdstryr has joined #zig
ask6155 has left #zig ["byeeee"]
andrii has joined #zig
andrii has quit [Client Quit]
andrii has joined #zig
andrii has quit [Client Quit]
andrii has joined #zig
andrii has quit [Client Quit]
andrii has joined #zig
<alexnask>
I just installed coc through plug.vim, added zls to the config (also needed zig.vim) and added the 'gd' nmap and it just works
<alexnask>
(completions seem to work as well). Are you sure all goto definitions were broken? Perhaps it was a specific symbol (like something imported by usingnamespace perhaps?)
craigo has joined #zig
andrii has quit [Quit: Leaving]
andrii has joined #zig
andrii has quit [Client Quit]
andrii has joined #zig
babina has joined #zig
babina has left #zig [#zig]
andrii has quit [Client Quit]
andrii has joined #zig
Snetry has quit [Quit: left Freenode]
Snetry has joined #zig
dddddd has joined #zig
layneson has joined #zig
<s-ol>
in std.fs.File, is there a way to check how much data an fd has buffered? I'm trying to manually line-buffer input pipes
drewr has quit [Quit: brb]
<s-ol>
if i could get the number of bytes in the fd, then I can pull them out and do my splitting. I need to line-buffer multiple streams at the same time, so I can't just read(1)
dingenskirchen has quit [Ping timeout: 272 seconds]
dingenskirchen has joined #zig
andrii has quit [Quit: Leaving]
slowtyper has quit [Ping timeout: 264 seconds]
dongcarl has joined #zig
FireFox317 has quit [Ping timeout: 264 seconds]
<gonz_>
Do you have to sign in to add to the zeemap?
<ikskuh>
no, it's not necessary
<gonz_>
I guess I should've asked if there was an upside.
<gonz_>
I accidentally added an anonymous one, feel free to remove it
<gonz_>
Sofia, Bulgaria
<tgschultz>
andrewrk: OutStream.write seems underspecified regarding the return value. My instinct is that it should return '0' if there is a temporary situation (buffer full, requires flushing) that causes there to be no bytes written.
<tgschultz>
However, if one calls writeAll in this situation, its a softlock.
<tgschultz>
On the other hand, returning an error complicates calling code.