<FromGitter>
<didactic-drunk> Is there an dynamic `StaticArray` type similar to `alloca` for stack allocation?
<FromGitter>
<Daniel-Worrall> should I be moving `libruby.so` to `/usr/local/lib` or specifying the path on compile (somehow, not sure how yet)
<FromGitter>
<watzon> Does anyone else think it would be handy to be able to descructure an array into another array in a similar way to how you can do it in JS? Something like: ⏎ ⏎ ```arr = [2, 3, 4] ⏎ merged = [1, *arr, 5] ⏎ pp merged ⏎ # => [1, 2, 3, 4, 5]``` [https://gitter.im/crystal-lang/crystal?at=5dc37b23e1c5e91508488797]
<FromGitter>
<watzon> There isn't a way to do this currently right?
<FromGitter>
<watzon> This is possible in Ruby as well, but in Crystal you get the error `Unterminated Array literal`
<FromGitter>
<christopherzimmerman> I doubt splatting arrays will ever be supported
<FromGitter>
<christopherzimmerman> Because IIUC that would require the compiler to know the size of the array at compile time for an array to be splatted as function arguments for example.
<woodruffw>
hmm, it probably wouldn't be too hard to introduce constrained splatting -- it's semantically the same as `lhs + thing + rhs` in a method body
<FromGitter>
<watzon> Basically yeah
<woodruffw>
splatting into a method call would be tough though -- i guess the closest thing could be sugar for array-to-tuple, then splat the tuple
<woodruffw>
with a runtime exception if the tuple isn't the right size
<FromGitter>
<Daniel-Worrall> Is it intended that `crystal docs` expands `#{__DIR__}` for macros definining constants? ⏎ My Constants are getting generated with travis filepaths which might confuse people `CSS_BEAUTIFY_JS = {{ read_file("/home/travis/build/Daniel-Worrall/beautify/src/../js-beautify/beautify-css.js") }}`
DTZUZO has quit [Ping timeout: 240 seconds]
alexherbo2 has joined #crystal-lang
DTZUZO has joined #crystal-lang
<FromGitter>
<Daniel-Worrall> I don't claim to know much about shell scripting but I put together a pre-commit githook file to check `crystal tool format`, `ameba` (and shards dependencies for ameba), `crystal spec` ⏎ It only runs on files that are to be commited and the specs run with --fail-fast to speed execution. ⏎ ⏎ Note: --fail-fast doesn't give a correct error code on return, but should be fixed for next release so I'm
<FromGitter>
<Daniel-Worrall> and ofc, forgot to include the link in the message :^)
<FromGitter>
<tenebrousedge> I would just use the `shards check` and other return value directly. And why not run the appropriate fix command?
<FromGitter>
<Daniel-Worrall> People may want to run them themselves, or be aware that it was run
<FromGitter>
<Daniel-Worrall> I'm unsure how to do taht kai. As I said, I don't really know much about shell scripting
<FromGitter>
<j8r> in you script, you can directly do `if mycommand ; then`
<FromGitter>
<j8r> or, `if !mycommand; then echo "Ooops"; fi`
<FromGitter>
<Daniel-Worrall> gotcha
<FromGitter>
<tenebrousedge> being aware that they are run is fine, but unless there are potential side effects (which for some of these seems unlikely) then personally I would assume that the person wanting to automate their workflow would want to automate as much as was practical
<FromGitter>
<tenebrousedge> you can also do `command || exit`
<FromGitter>
<j8r> Yep, I don't think having an error message is necessary
<FromGitter>
<j8r> > Error handling in Swift resembles exception handling in other languages, with the use of the try, catch and throw keywords. Unlike exception handling in many languages—including Objective-C—error handling in Swift does not involve unwinding the call stack, a process that can be computationally expensive. As such, the performance characteristics of a throw statement are comparable to those of a return
<FromGitter>
... statement.
<repo>
hm ok now i don't get a segfault but a cryptic message! :)
<hightower4>
Hey do SDL apps require X to run, or they can run on the console too?
<hightower4>
ah seems obvious it requires X
sorcus has joined #crystal-lang
<hightower4>
Is there a way in crystal to get symbolic names of keys, like 'enter', 'kp_up' and similar? I've tried grepping for KEY, KP, and ENTER but didn't find anything. Does it link with some C lib which exposes this, or it's simply not there?
<oprypin>
hightower4, u talking abot the terminal? it's linux specific probably
<oprypin>
i think you're much better off not looking for such constants then
<hightower4>
yeah was looking in the direction of SDL. Now just trying to see whether SDL is usable in the linux console, like if I avoid initializing video, would just the event loop with kb/mouse events work or not.
<hightower4>
(for sfml I assume it doesn't)
<hightower4>
ehm, doesn't. needs a (GUI) window before it'll process any events
<hightower4>
ok then I'm left with your pointers to the files containing those symbols, thanks!
<oprypin>
> SDL is usable in the linux console - well of course not!
<oprypin>
these key codes have nothing in common with terminal codes
<oprypin>
hightower4, then these files are worse than useless
<hightower4>
yes, I was just playing around seeing what's possible.
<hightower4>
Hey how would I convert bytes to string, honoring certain encoding? I am looking at #to_s and don't see encoding-related options
<hightower4>
where do I find the definition of that to_s which prints classes like #<Class::Ptr properties...> ?
<hightower4>
ah solved it
<FromGitter>
<bew> Reading the pr about :ditto:, I see that the warning are donce with `@program.warning_failures << "some text"` does it mean that there is no location with the warning?
<FromGitter>
<bew> (can't test right now)
FromGitter has quit [Remote host closed the connection]
<repo>
can you get any kind of xpath work with pipes?
<FromGitter>
<wontruefree> @here if anyone is interested in hearing talk on datastream from @bcardiff we will be staring in 10 min https://zoom.us/j/3541015445