<FromGitter>
<Blacksmoke16> would help (i think it was @DanilaFe) who's data has multiple keys for the same thing
<FromGitter>
<watzon> You know what else would be kind of nice? The ability to use a Regex as a key. Sometimes APIs are shitty and do stuff like `"page1": {...}, "page2": {...}"` and it becomes difficult to deserialize.
<FromGitter>
<Blacksmoke16> Hmm
<FromGitter>
<Blacksmoke16> That would probably be a good situation for a converter
<FromGitter>
<watzon> Yeah possibly
<FromGitter>
<Blacksmoke16> I'll keep you posted, probably a little ways out on this side of things
<FromGitter>
<Daniel-Worrall> Weird, in crystal play I can use `URI.parse`, but if I add `HTTP::Params.parse` below it, it says URI is an undefined constant.
<FromGitter>
<watzon> That is weird. Be sure to always `require "uri"` if you're planning on using it though. Just a good practice.
<FromGitter>
<Daniel-Worrall> Yup
<FromGitter>
<bew> Hey guys, I think I've found a weird bug, I need confirmation: https://carc.in/#/r/7jaq the two typeof should give the same things, no? Might be related to the auto deconstruction of block args in some cases? (might only be too tired to process the output.....)
<FromGitter>
<bew> no nevermind
<FromGitter>
<bew> will need to find a better example... I have a nasty bug somewhere in these lines but I can't get a smaller exemple yet..
<FromGitter>
<Blacksmoke16> π¬
<FromGitter>
<bew> my symptom is that I have a `some_call do |*args| ... end` and `args` ends up with a `String` type instead of a `Tuple(String, String)`
<FromGitter>
<Blacksmoke16> hmm
<FromGitter>
<Blacksmoke16> wouldnt the `*` splat the tuple and since there is only one block arg make that the value?
<FromGitter>
<Blacksmoke16> just a guess
<FromGitter>
<bew> I thought about that, but I hope not... it would be pretty counter intuitive imo
<FromGitter>
<Daniel-Worrall> the twitch lib is coming along nicely
jokke has joined #crystal-lang
<FromGitter>
<Qard> Is there a way to make something generic over a not only a *type* but also a *count* when trying to create a class that wraps a set-size array from `Pointer(T).malloc(count)`? I want to be able to *inherit* from this generic type, specifying the size it should be.
<FromGitter>
<Blacksmoke16> you can pass a number as a generic
<FromGitter>
<Blacksmoke16> `MyType(MyClas, 5)`
<FromGitter>
<Qard> Oh, that works? I thought it could only be classes.
<FromGitter>
<Blacksmoke16> it does indeed
<FromGitter>
<Blacksmoke16> (only for numbers tho)
<FromGitter>
<Blacksmoke16> you cant pass strings or bools etc
<FromGitter>
<Qard> Ah, well numbers are the only thing I need, so works for me. :)
<FromGitter>
<Daniel-Worrall> I'm surprised I can't just expand the file
<FromGitter>
<Blacksmoke16> like if you have all your macro code in a `{% begin %} {% end %}` can add that before the last end
rohitpaulk has quit [Remote host closed the connection]
<FromGitter>
<zbaylin> Is there a way to have a non-fixed length array as an argument in C function bindings? For example, I'm trying to write bindings for libxlsxwriter's `worksheet_write_rich_string`, but I can't find a way to say the length can vary in the `fun` declaration
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
dannyAAM has joined #crystal-lang
<FromGitter>
<j8r> Pretty sure you can't
<FromGitter>
<j8r> That's the purpose of StaticArray
<companion_cube>
if it's C bindings, you probably have to pass pointer + length anyway, right?
return0e has quit [Read error: Connection reset by peer]
<FromGitter>
<kingsleyh> evening - if anyone would like to help out on my blockchain project: https://sushichain.io please message me. Looking for all and any help. In particular I have a few small programming tasks which could be quite fun which I need doing but don't have any time or money. So it would be for the π
<FromGitter>
<Blacksmoke16> is there a way to override an alias within your specs?
<companion_cube>
aren't blockchains on the decline these days?
<FromGitter>
<wontruefree> what is the new tech hotness?
<FromGitter>
<kingsleyh> depends where you look :)
<companion_cube>
crystal, hopefully?
<FromGitter>
<kingsleyh> blockchains are still around
<FromGitter>
<Blacksmoke16> nvm, took a diff approach
<FromGitter>
<watzon> @kingsleyh any progress on the Crystal plugin for Idea?
<FromGitter>
<wontruefree> what is the crystal plugin idea?
<FromGitter>
<absolutejam_gitlab> I just want something that'll work with my editor haha
<FromGitter>
<Blacksmoke16> anyone use it with sublime?
<FromGitter>
<wontruefree> I used it with VSCode and now I use it with Vim
<FromGitter>
<watzon> They fix some bugs every now and then, but the things marked WIP have been like that for as long as I've been watching the project
<FromGitter>
<wontruefree> I prefer VSCode and recommend that to people
<FromGitter>
<watzon> I do too
<FromGitter>
<watzon> Especially now that I'm back on Windows for now. WSL integration is actually great now.
<FromGitter>
<Blacksmoke16> boo windows
<companion_cube>
typescript has a very good LSP plugin
<companion_cube>
hopefully crystal can get that too
<FromGitter>
<watzon> Yeah I hope
<FromGitter>
<watzon> We're missing out on a lot right now
<FromGitter>
<wontruefree> I did a migration to windows last year and thought it was way better then it was
<FromGitter>
<wontruefree> but I am on OSX now
<FromGitter>
<absolutejam_gitlab> I was big on VSCode but now I'm too deep using Kakoune and the keyboard-centric workflow
<FromGitter>
<absolutejam_gitlab> I just need to train myself to rely on stuff like fzf more
<FromGitter>
<absolutejam_gitlab> I like the LSP route because it's editor agnostic
<FromGitter>
<absolutejam_gitlab> they all have an LSP client now
<FromGitter>
<absolutejam_gitlab> and the protocol handles some good stuff, it just has to be implemented π
<FromGitter>
<watzon> Yeah it's nice
<FromGitter>
<absolutejam_gitlab> what's everyone using as web language/framework these days?
<FromGitter>
<absolutejam_gitlab> not asking for advice, just curious what you're using and why
<FromGitter>
<watzon> I like to try out new things. I think my favorite right now is still Vue, but I like Svelte a lot.
<FromGitter>
<absolutejam_gitlab> not heard of svelte
<FromGitter>
<Blacksmoke16> angular, but only if you're building a bigger app
<FromGitter>
<Blacksmoke16> would be overkill for a like one page or so type thing
<FromGitter>
<watzon> Svelte is super lightweight and pretty vue-like
<FromGitter>
<watzon> It's missing some things though
<FromGitter>
<wontruefree> I liked vue but I am at a job right now where we have a mix of react and pure javascript
<FromGitter>
<watzon> Eww react
<FromGitter>
<watzon> Never been a fan
<FromGitter>
<rmarronnier> Any reason why NamedTuple has such a small size limit : `Error: named tuple size cannot be greater than 300 (size is 412)` ?
<FromGitter>
<watzon> That is a good question. I've never hit that before.
<FromGitter>
<Blacksmoke16> any reason why you need to have a named tuple that big?
<FromGitter>
<rmarronnier> I its keys are Symbols (Int32), there should be no problem
<FromGitter>
<Blacksmoke16> using a struct would prob be better no?
<FromGitter>
<rmarronnier> Its a conversion table for language iso codes
<FromGitter>
<watzon> Hash shouldn't have that limit
<FromGitter>
<rmarronnier> Yeah, I always thought I shouldn't have to care about these kind of things because the compiler would optimize everything. I am so naive :-p
<FromGitter>
<wontruefree> as Mike Acton would say a compiler is a tool not a magic wand
<FromGitter>
<wontruefree> basically a compiler can only work in the spaces it was designed for
<FromGitter>
<wontruefree> he is a little harsh but right
<companion_cube>
there's lots of stuff for reusing buffers and arrays in the stdlib, once you want to optimize
<FromGitter>
<bew> @zbaylin still need help with your lib binding?
absolutejam4 has joined #crystal-lang
absolutejam4 has quit [Ping timeout: 246 seconds]
coderobe has quit [Read error: Connection reset by peer]
ukd1 has joined #crystal-lang
<ukd1>
does anyone know how to detect if a client has disconnected from a server mid-request? I'm doing a long-lived request, and wanna abort if they do.