RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.27.1 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
DTZUZO has quit [Ping timeout: 250 seconds]
<FromGitter> <Blacksmoke16> @shreeve you can unadd me from that repo btw
DmitryBochkarev has joined #crystal-lang
DmitryBochkarev has quit [Ping timeout: 255 seconds]
DmitryBochkarev has joined #crystal-lang
_whitelogger has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Remote host closed the connection]
DTZUZO has joined #crystal-lang
<FromGitter> <j8r> Why attributes in Crystal are called annotations? This can be confused with the existing Type Annotations, which aren't the same
<FromGitter> <r00ster91> asterite decided to rename them in 6063
<FromGitter> <j8r> I just got this PR with GH search
<FromGitter> <j8r> `TypeNode#annotated_types` is a bit confusing, we don't really know if this is about type annotations or type annotation in annotation
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
ashirase has quit [Ping timeout: 240 seconds]
ashirase has joined #crystal-lang
laaron has quit [Remote host closed the connection]
DTZUZO has quit [Ping timeout: 244 seconds]
laaron has joined #crystal-lang
DTZUZO has joined #crystal-lang
<FromGitter> <j8r> I just setup Drone CI - it's nice!
<FromGitter> <j8r> Open Source, and ability to build on arm64 and armhf
alexherbo2 has joined #crystal-lang
DmitryBochkarev_ has joined #crystal-lang
DmitryBochkarev_ has quit [Max SendQ exceeded]
DmitryBochkarev has quit [Read error: Connection reset by peer]
alexherbo2 has quit [Ping timeout: 246 seconds]
alexherbo2 has joined #crystal-lang
<FromGitter> <vladfaust> Does it have a publicly accessible build history for a project? Does it have GitHub integration (i.e. build pull requests)?
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter> <Blacksmoke16> @j8r Im not really sure what you mean? It would types that are annotated with `self`
<FromGitter> <Blacksmoke16> `MyAnnotation.annotated_types`
<FromGitter> <Blacksmoke16> And whats not the same? An annotation is still an annotation no matter what it is on
rohitpaulk has joined #crystal-lang
<FromGitter> <j8r> if we see in the docs annotated types, this isn't obvious what this means
<FromGitter> <j8r> in `a : String, b : Int32`, `String` and `int32` are annotated types too
<z64> strictly speaking, those are type restrictions, not annotations
<z64> and they are not "annotated types", the thing being annotated is an argument or ivar
rohitpaulk has quit [Remote host closed the connection]
<FromGitter> <Blacksmoke16> ^
<FromGitter> <j8r> that's not really what said in docs
<FromGitter> <j8r> > Crystal's philosophy is to require as few type annotations as possible. However, some type annotations are required.
<FromGitter> <j8r> And what's called annotations is called attributes https://crystal-lang.org/reference/syntax_and_semantics/attributes.html
<FromGitter> <Blacksmoke16> id prob update the docs to say `as few type restrictions`, that would be the more clear way
<FromGitter> <Blacksmoke16> they're annotations now, were renamed a year or so ago
<FromGitter> <Blacksmoke16> i can make a PR to update some things
<FromGitter> <Blacksmoke16> in the git book
<FromGitter> <j8r> The problem isn't only in Crystal
<FromGitter> <j8r> This is a very common term in programming, too https://duckduckgo.com/?q=type+annotation&t=canonical&ia=web
<FromGitter> <j8r> This aren't always type restriction, for instance take ivars
<FromGitter> <j8r> Take this for instance https://carc.in/#/r/6ql3
<FromGitter> <Blacksmoke16> do you have a better name?
<FromGitter> <Blacksmoke16> they keyword to define annotations is `annotation`
<FromGitter> <j8r> type annotation, that act sometimes has restriction
<FromGitter> <j8r> I'd say this are type annotations
<FromGitter> <Blacksmoke16> then what would you call like ⏎ ⏎ ```@[Foo] ⏎ class Klass ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=5cb72a641cd0b8307d29054f]
<FromGitter> <Blacksmoke16> an `annotated type`, a type with an annotation
<FromGitter> <j8r> `annotated_typenodes`? That's what they return, no?
<FromGitter> <Blacksmoke16> i suppose but that would be the first macro method where we do something like that. For `Union` its `.union_types` not `union_typenodes`
<FromGitter> <j8r> Not sure, I don't know. I just pointed out it's a bit confusing
<FromGitter> <Blacksmoke16> kinda hard when you have two similarly named things
<z64> i think its simple if we are just consistent when talking about type restrictions. i'm not sure what you mean about ivars, as i've always thought of it as "@foo : Bar restricts @foo to being of type Bar, instead of letting it be inferred if possible"
<FromGitter> <Blacksmoke16> granted this is macro related, so its not like its going to be an issue for new people, is under the assumption you already know what macros are and such
<FromGitter> <Blacksmoke16> yea, I can make a PR later to update some git book docs, finally add my section on annotations
<FromGitter> <j8r> z64: what do yout think of this https://carc.in/#/r/6ql8
<FromGitter> <Blacksmoke16> its defining a getter for `num` with a return type restriction of `Int32`
<FromGitter> <j8r> I guess you're right @Blacksmoke16 , this is an advanced topic
alexherbo21 has joined #crystal-lang
<FromGitter> <j8r> But this doesn't restrict anything, it's already `Int32`
<FromGitter> <j8r> and can't be another type, because of the constructor type restriction
<FromGitter> <Blacksmoke16> https://carc.in/#/r/6qlg
<FromGitter> <Blacksmoke16> it still restricts the value that `num` can be
alexherbo2 has quit [Ping timeout: 246 seconds]
<z64> indeed, getter expands to @num : Int32
<FromGitter> <kinxer> https://carc.in/#/r/6qli
<FromGitter> <kinxer> Sometimes people re-open things.
<FromGitter> <Blacksmoke16> ye, basically overrides the type restriction of `num` in the initializer
<FromGitter> <j8r> Ok
<FromGitter> <j8r> it wasn't a good example 😅
<FromGitter> <j8r> https://carc.in/#/r/6qll
<z64> that still restricts the type of the local var https://carc.in/#/r/6qln
<FromGitter> <Blacksmoke16> and since there is no other *possible* assignment it can only ever be a string
<FromGitter> <j8r> I got the perfect example, one can say it's a bug https://carc.in/#/r/6qlq
<FromGitter> <j8r> sorry, https://carc.in/#/r/6qlr
<z64> not a bug, just a well known missing feature :P
<FromGitter> <j8r> You're right, mostly type annotations are restrictions (not in this very case, alas)
<FromGitter> <K155K155BAN6BAN6> will crystal be participating in google season of docs this year?
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
<FromGitter> <K155K155BAN6BAN6> https://developers.google.com/season-of-docs/
laaron has joined #crystal-lang
<FromGitter> <Blacksmoke16> yea so some PRs on the git book would prob be a good idea
alexherbo21 has quit [Quit: The Lounge - https://thelounge.chat]
fanta1 has joined #crystal-lang
fanta1 has quit [Quit: fanta1]
_whitelogger has quit [Ping timeout: 240 seconds]
DTZUZO has quit [Ping timeout: 246 seconds]
return0e has quit [Read error: Connection reset by peer]