<FromGitter>
<Blacksmoke16> im pretty sure using a method like `serialized_name: get_key` would work too
<FromGitter>
<dscottboggs_gitlab> ooh boy. no that's getting too obscure. Don't try to be fancy, just be straightforward, I always say. I'll just do a builder method. thanks for the suggestion though.
<FromGitter>
<Blacksmoke16> as you wish :p
<FromGitter>
<Blacksmoke16> would be easier to understand than a custom to_json method imo, esp if you have a lot of fields, keeping that up to date/editing it was a pita for me
<FromGitter>
<Blacksmoke16> is what inspired this :p
<FromGitter>
<bajro17> @rishavs maybe you will be interested its router with parameters I want make work
<FromGitter>
<Blacksmoke16> hmm specs are failing on travis but pass on local computer
<FromGitter>
<Blacksmoke16> wait what, if i run the one spec on its own it fails, but passes when doing `crystal spec`
zorp_ has quit [Ping timeout: 245 seconds]
<FromGitter>
<Blacksmoke16> ill see if i can reproduce in a smaller project tomorrow, night
<FromGitter>
<proyb6> @bajro17 which are the two in the playground? One thing for sure about the performance with H2load (Http1.1), Iβm baffled that Rust and Go fasthttp routers are 2 times faster in throughput
<FromGitter>
<zoorod> how do I get the output in terminal ?
<FromGitter>
<zoorod> then i try I brake the code
<FromGitter>
<zoorod> 1) when
<jhass>
what do you try, what error do you get?
<FromGitter>
<Blacksmoke16> if you're using that shard in a project you could go into your `lib/slang` folder and add like `pp my_var` and it should get printed when using it in your app
<FromGitter>
<Blacksmoke16> ofc would only be temp as changes would be reverted if you updated the shard or changed computers etc
<FromGitter>
<melonlub> Hi, I am using https://github.com/meew0/discordcr (a library for connecting to discord api). It works fine on linux but when I am trying it on WSL, it doesn't work and raise a 400 exception. Any idea what might be the cause?
<jhass>
what's the full error message?
<FromGitter>
<zoorod> If I use "puts or print"
<FromGitter>
<zoorod> undefined local variable or method 'hi
<FromGitter>
<zoorod> sorry, have some difficulties to understand , lets say I want to get the "str" value on line 14 in the file . How should I do that ?
<jhass>
"puts str" on line 15
<jhass>
but it's just an IO::Memory, so pretty boring
<FromGitter>
<zoorod> I have no experience using macros , I will play around a bit and be back later
<FromGitter>
<zoorod> thanks
<jhass>
@Blacksmoke16 I guess your specs or project depend on filesystem order to load dependencies before dependents, so make sure you require dependencies explicitly before you need them
<FromGitter>
<Blacksmoke16> pretty sure i am?
<FromGitter>
<Blacksmoke16> only happens when the `@assertions` array in that example is empty
<FromGitter>
<Blacksmoke16> so is like using the base type of the class, which is abstract
<FromGitter>
<Blacksmoke16> ill see if i can replicate it
<FromGitter>
<Blacksmoke16> https://play.crystal-lang.org/#/r/5cuo but this one (where im pre filling the `assertions` array in the `Validator` class runs fine
<FromGitter>
<Blacksmoke16> updated links, bit easier to understand
return0e has quit [Ping timeout: 252 seconds]
return0e_ has joined #crystal-lang
_whitelogger has joined #crystal-lang
<FromGitter>
<Blacksmoke16> https://play.crystal-lang.org/#/r/5cvp simplest i could get it, if you remove the `(ActualValueType)` generic on `MyAssertion` class it works
sevensidedmarble has quit [Remote host closed the connection]
<FromGitter>
<vlazar> never mind S-YOU just found your new PR with a fix
RX14 has joined #crystal-lang
dabedoc has quit [Ping timeout: 256 seconds]
<FromGitter>
<ljuti> Thought I found a bug/new corner case in hash implementation, but I was just using it wrong :)
<FromGitter>
<ljuti> Error messages couldβve been a bit more helpful, though. Iβm sure I wonβt be the only one to try to use it the wrong way and not realize it right away.
JuanMiguel has joined #crystal-lang
JuanMiguel has quit [Client Quit]
rohitpaulk has joined #crystal-lang
<FromGitter>
<jwoertink> @ljuti How were you using it?
<FromGitter>
<Blacksmoke16> that would work, issue is its coming from an http request
<FromGitter>
<Blacksmoke16> which is erroring on reading the body for some reason in his case
<FromGitter>
<dscottboggs_gitlab> > the future of named tuples as we know them is uncertain... β β why's that? I saw some discussion on an old PR about possibly removing symbols. Is that something that's being worked on?
<FromGitter>
<jwoertink> There's always talk of removing something. Until the language is 1.0 just assume that could be the case with anything
<FromGitter>
<dscottboggs_gitlab> I don't have a problem with it, symbols seem like a great way to introduce bugs
<FromGitter>
<dscottboggs_gitlab> even a global enum for your project would be better than a global enum for the whole language
<FromGitter>
<Blacksmoke16> hm?
<FromGitter>
<dscottboggs_gitlab> although I couldn't think of a concrete example where an enum collsion would create a bug so maybe I'm just being cautious for nothing, but my instincts say it's a little fishy
<FromGitter>
<Blacksmoke16> symbols are not enums
<FromGitter>
<dscottboggs_gitlab> idk I'm just rambling, hoping someone has any clue how to iterate over the same tuple in two separate macros
<FromGitter>
<dscottboggs_gitlab> I mean it's basically a single global enum - readable names for efficient integer values
<FromGitter>
<Blacksmoke16> make it a constance and reference that?
<FromGitter>
<dscottboggs_gitlab> oh! really??
<FromGitter>
<Blacksmoke16> maybe?
<FromGitter>
<Blacksmoke16> would have to give some example for what you're trying to do
<oprypin>
yeah, macros can work with constants
<FromGitter>
<dscottboggs_gitlab> that definitely did it, thanks @Blacksmoke16
<FromGitter>
<rishavs> thanks for the help guys. i will sleep over this issue. hopefully tomorrow will be easier :)
<FromGitter>
<Blacksmoke16> couldnt you just do like ` (keys : Array(String))`
<FromGitter>
<dscottboggs_gitlab> I guess so... I usually use splats. wouldn't that mean you'd have to put like `val[["key1", "key2"]]` and still have the problem of checking for empty at runtime?