<FromGitter>
<Blacksmoke16> is your object coming from a json string?
<FromGitter>
<Blacksmoke16> er the data
<FromGitter>
<dscottboggs_gitlab> yup `record` works
<FromGitter>
<dscottboggs_gitlab> I was just going to suggest defining a struct but record does that so ¯\_(ツ)_/¯
<FromGitter>
<Blacksmoke16> :P
<FromGitter>
<Blacksmoke16> if his data is coming from json it would be even easier for him
<FromGitter>
<dscottboggs_gitlab> why's that?
<FromGitter>
<Blacksmoke16> `.from_json` vs having to call `.new xxx`
<FromGitter>
<dscottboggs_gitlab> hm?
<FromGitter>
<Blacksmoke16> would be able to call `from_json` on his string which would set the values automatically vs having to do like `obj = Obj.new "blah", "test", "test.host"` etc
<FromGitter>
<dscottboggs_gitlab> Oh I see
<FromGitter>
<Blacksmoke16> but sounds like its not so oh well
<FromGitter>
<Blacksmoke16> found a work around for that module validation bug i found
<FromGitter>
<Blacksmoke16> bit less clean but it works so meh
<FromGitter>
<dscottboggs_gitlab> talkin to me?
<FromGitter>
<Blacksmoke16> yea :P
<FromGitter>
<dscottboggs_gitlab> I haven't been around too much...busy.... ⏎ ⏎ mind referencing the bug? :p
<FromGitter>
<Blacksmoke16> i noticed, i miss you :P
<FromGitter>
<dscottboggs_gitlab> sorry, got a job haha
<FromGitter>
<Blacksmoke16> writing crystal at least?
<FromGitter>
<dscottboggs_gitlab> well...one of them... but that's not the one that pays the bills. Things have been going well, I just wish the safety Crystal offered was more common haha. People at my new job write mainly python and I've already found at least one bug caused by null references...
<FromGitter>
<Blacksmoke16> 😬
<FromGitter>
<Blacksmoke16> gotta show them the light
<FromGitter>
<dscottboggs_gitlab> yeah...I'm just glad to not be working retail anymore haha
<FromGitter>
<Blacksmoke16> we recently upgraded to PHP 7.1 at work, gives *some* type safety as you can specify return/argument types now, but still only happens at runtime afaik
<FromGitter>
<Blacksmoke16> or at build time, since there isnt really compile time
<FromGitter>
<Blacksmoke16> ah jezz, anythings better than that ha
<FromGitter>
<dscottboggs_gitlab> "ha"?
<FromGitter>
<Blacksmoke16> ha?
<FromGitter>
<dscottboggs_gitlab> oh I see
<FromGitter>
<Blacksmoke16> mhm
<FromGitter>
<dscottboggs_gitlab> but @j8r hired me to build the API for his (really cool) DPPM (https://github.com/dfabric/dppm) project, so I've been doing that every free minute I have basically haha
<FromGitter>
<Blacksmoke16> ah nice, hows that going?
<FromGitter>
<Blacksmoke16> hehe should have used athena 😏
<FromGitter>
<dscottboggs_gitlab> flix is working as long as you *preformat* the video, so to really be useful it will need to be integrated with `libav.cr` with a standard, well-tested format sent from the server to the client
<FromGitter>
<Blacksmoke16> wait what, whats his thing have to do with videos?
<FromGitter>
<dscottboggs_gitlab> nothign I just was talking about another thing before you replied to my first message
<FromGitter>
<Blacksmoke16> ohh right
<FromGitter>
<Blacksmoke16> gotcha
<FromGitter>
<dscottboggs_gitlab> I actually thought about it because we're using RBAC which seemed like it would integrate well with Athena's routing system, but I was more familiar with Kemal and you were refactoring Athena at the time. So maybe next time :p
<FromGitter>
<dscottboggs_gitlab> RBAC is not easy lol
<FromGitter>
<Blacksmoke16> all good
<FromGitter>
<Blacksmoke16> you see the changes i did to it?
<FromGitter>
<Blacksmoke16> for CORS/custom handlers?
<FromGitter>
<dscottboggs_gitlab> not yet, how's it going?
<FromGitter>
<Blacksmoke16> turned out pretty good id say, super flexible
<FromGitter>
<Blacksmoke16> easy to setup for global cors, or can define groups to use on a per controller/action basis
<FromGitter>
<Blacksmoke16> then i overloaded the HTTP::Handler to give middleware access to like matched route and the config obj
<FromGitter>
<Blacksmoke16> pretty slick
<FromGitter>
<Blacksmoke16> next thing id like to do is try and auto generate swagger docs from the route defs. should be able to do most of it automatically. Also could like annotate your models and generate schemas for those too. See how it goes
<FromGitter>
<dscottboggs_gitlab> wow that looks really solid
<FromGitter>
<dscottboggs_gitlab> swagger docs?
* FromGitter
* dscottboggs_gitlab must hit the hay ✌️
<FromGitter>
<Blacksmoke16> o/
lucasb has quit [Quit: Connection closed for inactivity]
boughtly has joined #crystal-lang
<boughtly>
i have a piece of code that throws an exception, except I can't seem to catch it with begin/rescue/end
<boughtly>
I get an unhandled exception stacktrace
<boughtly>
what could I be doing wrong
<boughtly>
(I tried both rescue with the exception type exactly and with Exception)
DmitryBochkarev has joined #crystal-lang
DmitryBochkarev has quit [Max SendQ exceeded]
DmitryBochkarev has joined #crystal-lang
<boughtly>
Ha. I found the issue. I am trying to throw an exception when divising a float64 by 0, so naturally I've opened the struct and overrode the division operator. However, this causes the program to fail to load because Float64::NAN tries to divide by zero for initialization
DmitryBochkarev has quit [Ping timeout: 246 seconds]
rohitpaulk has joined #crystal-lang
boughtly has quit [Ping timeout: 256 seconds]
rohitpaulk has quit [Remote host closed the connection]
<FromGitter>
<j8r> not really a fan of using structs in place of a module, with `self.` for every method, though
<FromGitter>
<j8r> I remember you said to me you use structs and inheritance due to a limitation
fanta7531 has quit [Quit: fanta7531]
Raimondi has joined #crystal-lang
<FromGitter>
<Blacksmoke16> @j8r Yea, once https://github.com/crystal-lang/crystal/pull/7648 is merged it would be possible, as you could just annotate a module with like `@[Athena::Routing::Controller]`
<FromGitter>
<Blacksmoke16> but i kinda like the inheritance setup now. easily share methods between all controllers, callbacks get inherited, prefix would trickle down to child controllers (i think i have to fix this tho), etc
<FromGitter>
<Blacksmoke16> since atm those methods just get added to all controllers via inheritance
mistergibson has joined #crystal-lang
mistergibson has quit [Remote host closed the connection]
DmitryBochkarev has quit [Ping timeout: 250 seconds]
marmotini has quit [Remote host closed the connection]
DmitryBochkarev has joined #crystal-lang
mistergibson has joined #crystal-lang
<mistergibson>
Question: Is there a method to call to list the methods of an object? (similar to ruby's .public_methods)
<FromGitter>
<GaryMiller> Any guestemates on when Crystal will have Native Windows support based on current funding and resources? I've reviewed the tasks and message traffic but it's still hard to get a feel if end of summer or end of year is doable. Because I understand that with OpenSource a lot relies on what outside funding is available and where the interests of the major contributors lie.
rohitpaulk has quit [Remote host closed the connection]
<FromGitter>
<j8r> nice, thanks to the core team for the initiative ❤️
<FromGitter>
<vladfaust> Loved it!
<FromGitter>
<ryanstout> yea, thanks for all of the hardwork from the core team and the community. My team is just starting to work with Crystal and we're really enjoying it so far.
<FromGitter>
<ryanstout> unrelated to that, I finally managed to make a simple example that causes this "macro '......' must be defined before this point but is defined later" Even though it is defined. It only happens when its in a default variable assignment. ⏎ https://play.crystal-lang.org/#/r/6pe0 Is there something I'm missing here, or is this a bug? (the macro is defined before its used)
<FromGitter>
<bew> Weird indeed, I'd say it's a bug
<FromGitter>
<ryanstout> @bew ok, I figured, but I'm new to Crystal and wanted to make sure I wasn't doing something incorrectly
boughtly has joined #crystal-lang
<FromGitter>
<rumenzu> Thanks to the core team for addressing my questions in the Q&A, I missed the live but watching it now
<boughtly>
Is there a way to pass a symbol to a method and use it as a key in a double splat?
<boughtly>
def call_splat(key, value) foo(key: value) end doesn't work :( it makes a key thatr's the literal symbol ":key")
<FromGitter>
<bew> Those things must be known at compile time
<FromGitter>
<straight-shoota> @ryanstout Looks like a bug. Care to open an issue?
<FromGitter>
<ryanstout> yea, will do. Thanks
<boughtly>
I have a generic class Foo(T). I have a macro baz defined in class Bar. If I have a Foo(Bar) and I try to include T.baz in the body of the class Foo(T), it tells me T is undefined
<boughtly>
Is there a way around this?
<FromGitter>
<Blacksmoke16> @z64 you around?
<FromGitter>
<Blacksmoke16> well major breaking change to athena but its now concurrent safe
tsundsted has joined #crystal-lang
sz0 has quit [Quit: Connection closed for inactivity]