<FromGitter>
<alexherbo2> is there a way to create fifo in crystal?
<FromGitter>
<alexherbo2> my use case is to get a value from Kakoune, by creating a fifo and make Kakoune write a state to it, and waiting for reading the value.
<FromGitter>
<naqvis> @oprypin:matrix.org true but seems that's intentional, as if you change that to `new`, one would still need to redefine `around_exec` or else macro expansion will yell at you saying `there is no previous definition of 'around_exec'`
<FromGitter>
<oprypin:matrix.org> yea but then i just dont use `def_around_exec`
<FromGitter>
<oprypin:matrix.org> can do `def around_exec(request); yield super; end`
<FromGitter>
<naqvis> seems this decision was intentional or with assumption that `HTTP::Client` won't get extended by 3rd party
<FromGitter>
<naqvis> as stdlib `Log` module is utilizing this macro by just reopening the class
<FromGitter>
<alexherbo2> I explicitely check the type in `cli.cr` before passing, so it should know I'm passing a string no?
deavmi has quit [Ping timeout: 272 seconds]
<FromGitter>
<alexherbo2> I would like to avoid flow control and the `argv.shift` to separate the `command` from the `arguments` to pass to my method
<FromGitter>
<alexherbo2> I tried splat, but it is not allowed
deavmi has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 264 seconds]
<FromGitter>
<asterite> oprypin because of around? Yeah, when it was introduced I mentioned that this should be done with actual callbacks, not macro code. But I think they were in a hurry to add logging to http
alexherbo2 has joined #crystal-lang
<FromGitter>
<asterite> Taupiquer session and the other one are closured by the option parser callbacks so they cant be type filteted
<FromGitter>
<asterite> Ideally the compiler should tell you that
<FromGitter>
<alexherbo2> oh :o
<FromGitter>
<asterite> Assign them first to another variable after the option parser finiishes
<FromGitter>
<asterite> Or finishes, depending on how bad an autocorrector you are using
<FromGitter>
<alexherbo2> is there a way to forward a hash as the named parameters of the method?
<FromGitter>
<alexherbo2> something like `my_method(**named_params)`
<postmodern>
how do you handle compiler errors for C bindings when a function is missing from the library? or should you guard that code with flags?
deavmi has joined #crystal-lang
<FromGitter>
<asterite> Good question. How do you do it in C or Ruby?
<FromGitter>
<oprypin:matrix.org> postmodern (https://matrix.to/#/@postmodern:matrix.org): i think you mean linker errors?
<postmodern>
oprypin, ah correct. wasn't sure if the crystal compiler did some extra checks before linking
<FromGitter>
<oprypin:matrix.org> C handles it with ./configure, Crystal just doesnt
<postmodern>
asterite, in Ruby I'd use FFI which is 100% runtime (uses dlopen and dlsym under the hood).
<FromGitter>
<oprypin:matrix.org> openssl bindings is a decent example, it just checks the version before assuming a fucntion is available (I *think*, not sure)
<FromGitter>
<asterite> I think in Ruby without ffi there's extrb which lets you check if a function exists
<FromGitter>
<asterite> They do it by compiling a small program and see if it's successful or not
<FromGitter>
<asterite> I think we should do the same, eventually
<FromGitter>
<oprypin:matrix.org> > They do it by compiling a small program and see if it's successful or not ⏎ ⏎ that's what ./configure does typically too
<FromGitter>
<oprypin:matrix.org> thats why is so slow lol
<FromGitter>
<asterite> extconf rb
<postmodern>
asterite, correct you'd use extconf and mkmf to generate C test programs to figure out things
<FromGitter>
<asterite> But with an install hook you could do it then?
<postmodern>
yeah i could probably roll my own configure script or add some auto-generated config.cr file that a Makefile generates
<postmodern>
maybe in the future we could port over mkmf (it's code may be ugly, but it provides the necessary logic)