<FromGitter>
<Blacksmoke16> sure you're not setting it in some other file
<FromGitter>
<Blacksmoke16> or twice or something
<FromGitter>
<watzon> Yep, just accessing it
<FromGitter>
<Blacksmoke16> got the code somewhre?
<FromGitter>
<watzon> Ahhhh I know the problem. In the parent class I had set `constructor_id` as a `Int32 | Int64`, so just trying to constrain it to `Int64` was breaking it.
<FromGitter>
<Blacksmoke16> well there you go :p
avane has joined #crystal-lang
<FromGitter>
<RespiteSage> Is there a way to do math at compile-time with a generic type variable?
<FromGitter>
<RespiteSage> I'm trying to represent a square chunk of a particular width `R` with a `StaticArray(T, R * R)`. That code doesn't work, and it seems like it's not treated as a constant for use in macros.
<FromGitter>
<watzon> Afaik there isn't, but that would be nice to have
<FromGitter>
<RespiteSage> Ah, well. Probably I can start with `Array` and optimize to `StaticArray` if really necessary.
<FromGitter>
<watzon> Why tf does `StringLiteral` have a `gsub` method, but no `sub` method?
<FromGitter>
<watzon> Still need to write tests and better docs for it, but this is about ready to be used https://github.com/protoncr/async/
<FromGitter>
<watzon> Basically a `Future` implementation that more closely resembles Python's `asyncio.Future` along with `asyncio.Event` and `async` / `await` macros which utilize those futures.
_whitelogger has joined #crystal-lang
<FromGitter>
<watzon> Is there a limit to the number of subclasses an abstract class can have? Because I think I may have found it.
<FromGitter>
<erdnaxeli:cervoi.se> I am a bit worried that you are introducing colors in a language that isn't colored, but I am not sure how your async / await keywords work, you should provide examples. ⏎ (by colored language I am referring to https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/ )
<FromGitter>
<watzon> Yeah this is more for internal use in a project I'm working on than anything. The `async` and `await` macros are more to make things easier for me.
<FromGitter>
<watzon> But I will be writing better docs in case anyone else wants to utilize it
<FromGitter>
<watzon> Ok I need the help of someone that can help decipher a stack trace and figure out what's going on here. I'm getting a sigfault, and I've managed to narrow down the problem to one file, but I can't make heads or tails of this. ⏎ ⏎ https://github.com/protoncr/proton/blob/native/src/proton.cr has the example code that's causing the sigfault, the line that seems to actually be causing the problem is this one
<FromGitter>
<watzon> I thought I might be hitting some kind of limit with the number of subclasses an abstract class can have, but I generated a test file with 20000 subclasses and everything worked fine.
<jhass>
question in this case is probably less what relationship the data has to each other but what kind of operations are needed or frequent on the structure
<jhass>
does it need to be good at access, insertion, update, deletion? does it need to grow or can it be initialized with a static size? does it need to grow or shrink frequently?
<jhass>
does it need to be good at swapping rows or colums? and so on
<hightower2>
yeah good points. rarely grows/shrinks, but it is important that all Z objects at a particular (X,Y) are easily accessible
<raz>
Hash(x,y) = Array(z)?
<oprypin>
good idea
<raz>
when unsure it's often good to just start out with the simplest thing that can possibly work™
<raz>
and then optimize when structure & access patterns are clearer
<raz>
(but obv that only makes sense when it can be done without rewriting the entire codebase a 2nd time ;))
f1reflyylmao has quit [Quit: bye fags]
f1refly has joined #crystal-lang
<hightower2>
yeah the hash is not a bad idea, especially since the order of keys is guaranteed as well
gangstacat has quit [Quit: Ĝis!]
<hightower2>
Can someone explain where the extra " " is coming from here: https://carc.in/#/r/a739
<hightower2>
I expect the line to be: y=(arg) but it's y = (arg)
<jhass>
I don't think y=(arg) would become a method call either?
<FromGitter>
<Blacksmoke16> pretty sure for setters `y = 1` is equivalent to `y=1`
<jhass>
you wanna prepend self.
<hightower2>
yeah, just realized it after posting, fixed with self., thanks!
<hightower2>
still it's strange
<jhass>
it's just formatted
<hightower2>
ah soo.. ok
gangstacat has joined #crystal-lang
<hightower2>
jhass, is it possible to make the Def have access to it's doc? (node.doc)
<jhass>
maybe? Nothing I know from the top of my head