<FromGitter>
<Blacksmoke16> that ended up being a lot simpler than i was expecting
<FromGitter>
<HertzDevil> actually wait
<FromGitter>
<HertzDevil> are you emitting the warnings at the use site or the definition site
<FromGitter>
<Blacksmoke16> where the alias/annotation is defined
<FromGitter>
<HertzDevil> but deprecation warnings occur at the former, not the latter
<FromGitter>
<Blacksmoke16> ah rip, which is diff than how the others work
<FromGitter>
<Blacksmoke16> yea :/
<FromGitter>
<HertzDevil> should be checking `#annotations` for types that are `Annotatable`
<FromGitter>
<HertzDevil> aliases i don't know where to check
<FromGitter>
<HertzDevil> might need to add a `#visit` overload
<FromGitter>
<Blacksmoke16> def/macros are based on a `Call`, which makes sense why it reports at the call site
<FromGitter>
<Blacksmoke16> uh oh :grimm
<FromGitter>
<HertzDevil> and that check needs to exclude the alias's own name, obviously
<FromGitter>
<HertzDevil> if you have `@[Deprecated] alias A = Int32 | Array(A)` then the deprecation should ideally be reported at the second `A` but not the first
<FromGitter>
<Blacksmoke16> and anywhere else `A` is used
<FromGitter>
<HertzDevil> yeah in that case the lookup probably produces the `AliasType` directly, so you don't need `resolved_type` there
<FromGitter>
<HertzDevil> but annotations still need that
<FromGitter>
<Blacksmoke16> unfortunately we're a bit beyond my area of understanding. I'd be fine if you wanted to take over the PR otherwise might take me a while...
<FromGitter>
<Blacksmoke16> the line in the warning is also wrong, so now that i look at it again im prob processing the wrong node or something?
<FromGitter>
<naqvis> > wondering which stdlib feature will be first that uses the `@[Experimental]` annotation ⏎ ⏎ Labeled loops? so that one can exit out of nested loop (if any) :P
_ht has quit [Remote host closed the connection]
_ht has joined #crystal-lang
ua has quit [Ping timeout: 240 seconds]
zorp has quit [Read error: Connection reset by peer]
andremedeiros has quit [Quit: ZNC 1.8.2 - https://znc.in]
andremedeiros has joined #crystal-lang
HumanG33k has quit [Ping timeout: 240 seconds]
HumanG33k has joined #crystal-lang
HumanG33k has quit [Remote host closed the connection]
postmodern has joined #crystal-lang
yxhuvud has quit [Ping timeout: 258 seconds]
yxhuvud has joined #crystal-lang
<FromGitter>
<riffraff169> a question, what is the point of annotations? from some of the things ive seen, they can be implemented as just other vars or something in the class....am i missing something?
<FromGitter>
<erdnaxeli:cervoi.se> their only point is to be used by macros
<FromGitter>
<erdnaxeli:cervoi.se> or the compiler
<FromGitter>
<riffraff169> ah, so no real user/in program point...ok sure
<FromGitter>
<erdnaxeli:cervoi.se> at runtime there are useless, and the compiler probably removes them from the final binary
<FromGitter>
<riffraff169> maybe someday ill get to that point
<FromGitter>
<Blacksmoke16> annotations are a great way to store "metadata" about an ivar/class/method that can later be consumed in a macro for more advanced metaprogramming
<FromGitter>
<riffraff169> does `Tester` have access to `@var` directly
<FromGitter>
<riffraff169> no, has to include still?
<FromGitter>
<Blacksmoke16> yes
<FromGitter>
<Blacksmoke16> modules are also used as namespaces, so all that does is namespace the `Tester` class
<FromGitter>
<riffraff169> so `class Tester; include Test`
<FromGitter>
<Blacksmoke16> yes, but whats the end goal here? wanting to share an ivar between multiple types?
r0bby has quit [Ping timeout: 260 seconds]
sz0 has quit [Ping timeout: 258 seconds]
sz0 has joined #crystal-lang
r0bby has joined #crystal-lang
hendursa1 has joined #crystal-lang
<FromGitter>
<riffraff169> i was just namespacing, but i think there might only be one class in the module, so i could just put those vars in the class itself
<FromGitter>
<Blacksmoke16> 👍
<FromGitter>
<Blacksmoke16> fwiw normally you should namespace all your things, not have one namespace pertype
<FromGitter>
<Blacksmoke16> like `module MyLib` then all your stuff lives in that namespace
<FromGitter>
<riffraff169> this is an evolving project, figuring out how i want to arrange it all together
<FromGitter>
<riffraff169> but you can have the module referenced in multiple files, and it adds them all to the same module, right?
<FromGitter>
<Blacksmoke16> right yes
<FromGitter>
<Blacksmoke16> you can also do like `class MyLib::MyClass`
<FromGitter>
<riffraff169> ah, that will work too
<FromGitter>
<Blacksmoke16> which creates `MyLib` as a module if it hasnt already been and puts `MyClass` within in it
<FromGitter>
<Blacksmoke16> versus nesting a bunch of `module X`
<FromGitter>
<riffraff169> is it a pattern to create `MyLib` in a separate file, then add it with all the others...or just reference it as `MyLib::MyClass` to automatically create it
<FromGitter>
<riffraff169> or probably doesnt matter
<FromGitter>
<Blacksmoke16> i usually define it in the name `src/my_lib.cr` file
<FromGitter>
<riffraff169> that also lowers the amount of indentation and whitespace
<FromGitter>
<Blacksmoke16> then use that for documentation/other types that live in that root namespace
<FromGitter>
<riffraff169> just out of curiosity, if you have a bunch of files, and you do `shards build` to create the final library or binary, if you change one file, does it compile everything from scratch again, or only the one file that changed
<FromGitter>
<riffraff169> like c with .o files
<FromGitter>
<Blacksmoke16> some things are cached but pretty much a full rebuild
<FromGitter>
<Blacksmoke16> and why incremental compilation is hard
<FromGitter>
<riffraff169> yeah, c++ is different, not dynamic at all, so it knows everything up front all the time...
<FromGitter>
<riffraff169> i see
<FromGitter>
<riffraff169> one of the difficulties...you change class x, class y uses it, class z uses y, class a uses z, down a few more times...
<FromGitter>
<riffraff169> change x, even though a doesnt use x, it still needs to be recompiled to match signatures up and down the line
<FromGitter>
<ryanstout> I'm trying to create a table with arrays of arrays of a certain type, is there a way to do of `Array(UInt8)` or similar without adding _u8 to each literal?: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=606de436649e837de5ad534f]
<FromGitter>
<ryanstout> I might be missing the obvious here
<FromGitter>
<ryanstout> ok, that works I guess. Just doing a big nested table. Better than changing each literal though. Thanks!
sz0 has quit [Quit: Connection closed for inactivity]
ua has quit [Ping timeout: 252 seconds]
ua has joined #crystal-lang
<_ht>
I cannot include a module in an enum?
<_ht>
Is it possible to share functionality between multiple enums? For example, using "subclassing", or including a module?
<FromGitter>
<oprypin:matrix.org> _ht, if you cannot include then maybe not. but you can always duplicate those functions. and uhh a macro can make it look like you're not duplicating anything
<_ht>
I see this feature has already been implemented :-)
<FromGitter>
<Blacksmoke16> has it? PR was closed it looks like
<_ht>
Oh, then I misread that thread :-(
<_ht>
On the other hand, it does say " wontruefree approved these changes on Mar 26, 2020". That does not mean the changes were actually merged into the project?
<FromGitter>
<Blacksmoke16> no
<FromGitter>
<Blacksmoke16> PR approval isn't the same as merging
<_ht>
So, the best way to go is with @oprypin's solution and use a macro?
<FromGitter>
<Blacksmoke16> probably
<FromGitter>
<oprypin:matrix.org> _ht, literally anyone can go there and "approve these changes" :D
* _ht
is off to aprove all the things!
<FromGitter>
<oprypin:matrix.org> _ht, in Crystal it needs two core team member approvals - their approvals show up in green color
<_ht>
Aha, makes sense
<FromGitter>
<oprypin:matrix.org> oh god i just found that C bindings FFI is bugged not only on non-typical platforms