<FromGitter>
<mattrberry> That was just a random example of โ1โ vs 1 :p Really, I just want a way to constrain the types that the macro is called with :p
<FromGitter>
<Blacksmoke16> @bcardiff just a heads up, the API docs haven't been added to GH assets for `0.36.0` and `0.36.1`
<FromGitter>
<Blacksmoke16> some automated thing prob broke
<FromGitter>
<Daniel-Worrall> There was a crystaljobs site, but it's down.
<FromGitter>
<Daniel-Worrall> You could the forums, here, the discord
<FromGitter>
<Daniel-Worrall> for what it's worth, I'm open for employment but I lack rails experience
<deimos_>
probably to your benefit...;)
<FromGitter>
<Daniel-Worrall> heh, searching crystal on upwork just gets me people called Crystal
jrayhawk_ is now known as jrayhawk
<FromGitter>
<naqvis> @Daniel-Worrall ๐
<FromGitter>
<mattrberry> @Blacksmoke16 I think I got something like what I want working :) https://carc.in/#/r/acz6
_ht has joined #crystal-lang
MasterdonX has joined #crystal-lang
<FromGitter>
<mattrberry> What's the practical difference between `Nil` and `Void`? Specifically, should there be any difference between `Proc(Nil)` and `Proc(Void)`? I'm guessing that `Void` is just meant to be used for typing in c-bindings, but I assumed that it was effectively an alias for `Nil` otherwise?
<FromGitter>
<mattrberry> Looking at issues on github, my assumption that `Void` is really only meant for c bindings seems correct. I also see a comment from Ary that says "Nil and Void are synonyms" though, which is a little confusing. Even though we shouldn't use Void outside of bindings, I wouldn't expect it to cause issues. I see that Julien also left a comment on the forum last month asking if we could restrict the use of `Void`
<FromGitter>
... outside of bindings
<FromGitter>
<mattrberry> For a specific example of the problem I'm having, here's a place that I use `Proc(Void)`: https://github.com/mattrberry/crab/blob/master/src/crab/scheduler.cr#L14-L22 โ I've been doing this for awhile, and it's effectively the same code I use for the Scheduler in CryBoy as well. โ I just made some changes to the emulator, but nothing that interacts differently with c-bindings, and nothing to do with the
flaviodesousa has quit [Remote host closed the connection]
alexherbo2 has joined #crystal-lang
<FromGitter>
<Uzay-G> sorry I kinda got distracted and didn't tell you how it went, but your idea of directly using IO worked @Blacksmoke16
<FromGitter>
<Uzay-G> thanks a bunch!
<FromGitter>
<Uzay-G> now it's writing that's becoming a pain ๐
<FromGitter>
<Uzay-G> ^ very slow ๐
<FromGitter>
<Uzay-G> if I have a `Hash(String, Hash(String, <Custom Object>))`
<FromGitter>
<Uzay-G> is the most efficient way to dump it to a file just to iterate through all the values?
<FromGitter>
<Uzay-G> alright I think I fixed it again
<FromGitter>
<Uzay-G> wow directly calling IO is so much faster !
<FromGitter>
<asterite> @mattrberry it would be great if you could reduce the code so we can see why it's crashing. But no need to do it if it's a lot of work
<FromGitter>
<Blacksmoke16> @Uzay-G yea using IOs is almost always the better way to handle reading/writing files
<FromGitter>
<Blacksmoke16> Just released Athena `0.13.0`
alexherbo2 has quit [Ping timeout: 240 seconds]
<FromGitter>
<djberg96> noob here, still learning, is there any downside to doing `include Comparable(self)` instead of `include Comparable(SomeClassName)` in typical cases?
<FromGitter>
<Blacksmoke16> not really afaik
<straight-shoota>
No, it means the same
<FromGitter>
<djberg96> ok, thanks
deavmi has quit [Ping timeout: 272 seconds]
<FromGitter>
<mattrberry> @asterite I truly have no idea if I could minimize it since Iโve had Proc(Void) for months without issue, unfortunately. It only started becoming a problem yesterday with my newest changes. Iโm happy to push the current state to a branch if you like, though. Not sure how helpful thatโd be
<FromGitter>
<asterite> @djberg96 if you use `self` and you have types that inherit `SomeClassName`, types in different places of the hierarchy won't be comparable
<FromGitter>
<asterite> @mattrberry Yeah, I could debug it if I had time, but I don't. Also if it works with Nil then then there's less pressure to fix it
DTZUZU has quit [Read error: Connection reset by peer]
<FromGitter>
<djberg96> Can you give me an example of what you mean?
deavmi has joined #crystal-lang
<FromGitter>
<mattrberry> @asterite Iโll push it to a branch for you to check out if you ever have time or if youโre curious. As you said, not a blocker for me atm since I can just use Proc(Nil). In the meantime, is there any reason we shouldnโt prohibit use of Void outside of c-bindings?
ua has quit [Ping timeout: 256 seconds]
ua has joined #crystal-lang
<FromGitter>
<wyhaines> Anyone around who has tinkered with Lucky? I'm playing with it. I've done all of the basic install according to the web site, and wired it up to a fresh, empty db. On running the script/setup, though, it throws an error:
<FromGitter>
<Blacksmoke16> traitor :P. I'd maybe try their gitter/discord. People there would prob be more familiar
deavmi has quit [Ping timeout: 272 seconds]
alexherbo2 has quit [Ping timeout: 256 seconds]
alexherbo23 is now known as alexherbo2
<FromGitter>
<wyhaines> Hahaha. I'm just tinkering and exploring the ecosystem. And yeah, seems that they have moved from gitter to discord. :)
deavmi has joined #crystal-lang
<FromGitter>
<Blacksmoke16> all good :P
<FromGitter>
<asterite> @djberg96 Try with another subtype, `Baz`, and comparing `Bar` with `Baz`. It won't compile with `self`, it will compile with `Foo`
<FromGitter>
<asterite> @mattrberry because you have to interact with C code, Void can leak outside of C libs so it's hard to restrict that
gangstacat has quit [Ping timeout: 272 seconds]
<FromGitter>
<watzon> Ok I think I know why this isn't working, but how would I get similar behavior to what I'm looking for here? https://carc.in/#/r/ad2h/edit
<FromGitter>
<watzon> I know I've seen something like this done before, probably in something that @Blacksmoke16 wrote
<FromGitter>
<djberg96> ha, you can use a splat operator in a require statement in Crystal. I remember the Ruby community hated that suggestion, but I don't remember why now.
<FromGitter>
<watzon> Yeah I don't get the Ruby methodology. You have require, require_relative, autoload, and a couple other ways to load things. In Crystal it's simple: require without a relative path will search your installed shards in `lib` and with a relative path will search along that path.
<FromGitter>
<watzon> Globbing support is definitely nice as weoo
<FromGitter>
<djberg96> books says do `crystal build src/crchinook.cr`, but I get `Error: can't find file './crchinook/*' relative to '/Users/dberger/Programming/Crystal/crchinook/src/crchinook.cr'`
<FromGitter>
<Blacksmoke16> just require extra files one at a time
<FromGitter>
<Blacksmoke16> using glob like that is kinda meh most of the time
<FromGitter>
<djberg96> ok :)
<FromGitter>
<Blacksmoke16> figure it out @watzon ?
<FromGitter>
<watzon> Nope, not even kinda
<FromGitter>
<watzon> Did you ever have any luck with that @Blacksmoke16?
<FromGitter>
<Blacksmoke16> well for one thing its `macro finished` not `macro finalized`
<oprypin>
is there any good way to call a class method of the current class without naming that class? note: i'm looking for "everyday use", not macros
<FromGitter>
<djberg96> i get a struct with data in it, i'm just not sure how to unroll it
<oprypin>
wow i found that adding a backslash at **every single `%}\n`** gives the best result
<oprypin>
dont even need to check
<oprypin>
i have a module with `macro finished` and when i include it on something, the immediate expansion doesn't see any {{@type.methods}}, it sees them only if i do `include MyModule` at the very end. what am i doing wrong?
<straight-shoota>
instance methods are not available in finished hook because you can define additional methods there
<straight-shoota>
{{@type.methods}} only works in a method
<straight-shoota>
so you can call a method in the hook to do what you want