ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.21.1 | Fund Crystal's development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
<FromGitter> <domgetter> How do you check if something is a NamedTuple?
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter> <domgetter> so `is_a?` works, but where is that method defined? It wasn't in the instance method list for `Object`
<FromGitter> <fridgerator> hrm
bjz has joined #crystal-lang
bjz has quit [Client Quit]
<FromGitter> <fridgerator> good question, I don't know where its defined
<FromGitter> <domgetter> Apparently it's baked into the parser: https://github.com/crystal-lang/crystal/blob/master/src/compiler/crystal/syntax/parser.cr#L610
Renich has joined #crystal-lang
Renich has quit [Quit: Renich]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
bjz has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
DaleK5whr has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
DaleK5whr has quit [Quit: Leaving]
<kodo[m]> we need something like https://elixirstatus.com/ for crystal
<FromGitter> <domgetter> Be the change you wish to see in the world
<kodo[m]> I was just looking at creating it. heh tempted to just copy the design and use kemal
<kodo[m]> What's the crystal colour scheme?
<kodo[m]> the website makes me think black and white
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
phase_ has joined #crystal-lang
olek_poz has joined #crystal-lang
Renich has joined #crystal-lang
Renich has quit [Remote host closed the connection]
_whitelogger has joined #crystal-lang
olek_poz has quit [Ping timeout: 260 seconds]
_whitelogger has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
<BlaXpirit> kodo[m], it's kinda funny, they have the color scheme here https://crystal-lang.org/media/
phase_ has quit [Remote host closed the connection]
<vegai_> to familiarize myself with the codebase, I started looking at the second oldest issue: adding unsafe to the language
<vegai_> extending the semantic parts with the unsafe attribute seemed easy, but now I'm wondering where the compile-time checking should go to
<vegai_> MainVisitor class, perhaps?
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
snsei has quit [Remote host closed the connection]
vegai has joined #crystal-lang
vegai_ has left #crystal-lang [#crystal-lang]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 268 seconds]
bjz has quit [Ping timeout: 268 seconds]
bjz has joined #crystal-lang
KCreate has joined #crystal-lang
pduncan has joined #crystal-lang
fenicks has joined #crystal-lang
KCreate has quit [Quit: leaving]
<FromGitter> <luislavena> @domgetter `.is_a?` gets translated at compile time to ensure type safety https://crystal-lang.org/docs/syntax_and_semantics/if_varis_a.html
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 258 seconds]
snsei has joined #crystal-lang
<FromGitter> <bew> Why `1+2..9-1` is parsed as `(1+2)..(9-1)`
endou has quit [Ping timeout: 240 seconds]
<FromGitter> <bew> for example, `1..str.size - 1`is visually easier to parse as `(1..str.size) - 1` (even if it's semantically not correct), although it's parsed as `1..(str.size - 1)`
<vegai> another reason to get rid of .. and ... altogether :)
<vegai> even though it's a very neat literal in many places
<FromGitter> <domgetter> The Perl6 range literal syntax is kind of interesting. If you put a ^ next to one of the boundaries, it is exclusive on that boundary. So `1^..^5` is 2 to 4.
<vegai> the mathematical notation would be neat too: [1,5], [1,5), (1,5], (1,5) but would obviously be hell to parse
<vegai> or just plain impossible
Ven has joined #crystal-lang
Ven is now known as Guest13463
<vegai> perhaps [1..5] [1..5) (1..5] (1..5) -- according to wikipedia, such notation is sometimes used in math
<vegai> although it was followed by (citation needed) :)
<vegai> the double dot would make it at least theoretically parseable
Guest13463 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <Sija> @vegai syntax parsing would be awful
<Papierkorb> vegai: Yep that's the syntax we've learnt in uni too
<vegai> Sija: yeah :-/
<vegai> sometimes I wish that the world would've stopped finding new syntaxes after Lisp was invented
<vegai> we should teach s-expressions to kids at kindergarten
olek_poz has joined #crystal-lang
<FromGitter> <domgetter> Anyone know where I can look up more information about the "run" method on this line? https://github.com/crystal-lang/crystal/blob/19abbfc755aff555ad5a25cadaf6ce2e025a634b/src/ecr/macros.cr#L70
<FromGitter> <drosehn> @domgetter : check https://crystal-lang.org/api/Crystal/Macros.html
<kodo[m]> Is there anything like ECR that works on an IO instead of a filename?
<FromGitter> <Sija> ECR works with IO
<FromGitter> <Sija> see `ECR.embed`
<FromGitter> <Sija> https://crystal-lang.org/api/0.21.1/ECR.html#embed%28filename%2Cio_name%29-macro
<kodo[m]> embed takes a filename and embeds into an io
<kodo[m]> I want to take an io and put into another io
<FromGitter> <Sija> oh, i see
<FromGitter> <Sija> `ECR#process_string`
<FromGitter> <Sija> ?
<kodo[m]> is that an actual thing?
<kodo[m]> oh my docs are outdated
<FromGitter> <Sija> uhm, it’s `:nodoc:`-ed
<kodo[m]> thats what i get for googling
<kodo[m]> sija, I don't see it in the source
<kodo[m]> ah in ecr/processor thanks
snsei has quit [Remote host closed the connection]
<kodo[m]> what do I do with process_string output? eval it?
<kodo[m]> spec file looks like it creates a "program" not sure what that means
asterite has quit [Ping timeout: 246 seconds]
asterite has joined #crystal-lang
<BlaXpirit> kodo[m], oh, it might produce actual Crystal code that, when run, renders a template
<BlaXpirit> thats probably why it's nodoced
<BlaXpirit> how ecr works: a macro invokes a process that runs this process_string and produces code and the code is baked in place
DeBot has quit [Ping timeout: 258 seconds]
<kodo[m]> yeah
<kodo[m]> I get that's how it works. I looking for something that takes an io and interpolates the ecr and returns an interpolated io
<kodo[m]> seems weird you only have the option to hard code the template into program
<kodo[m]> I looked at Kilt but it looks like it does the same thing
<FromGitter> <bew> kodo[m]: this is because ECR tempates files can contain arbitrary crystal code, and crystal doesn't have runtime code evaluation
<kodo[m]> ah
<kodo[m]> good point
<FromGitter> <bew> if you only need simple templating, you should use sth like crustache: https://github.com/MakeNowJust/crustache
<kodo[m]> I was just looking at at
<kodo[m]> at tha*
* kodo[m] can't type
<FromGitter> <bew> ^^
<kodo[m]> That's exactly what I want. thanks
phase_ has joined #crystal-lang
ssvb has quit [Read error: Connection reset by peer]
<FromGitter> <sdogruyol> @kodo[m] are you domgetter on GH?
<kodo[m]> nope
<crystal-gh> [crystal] adamtrilling opened pull request #4227: Add headers parameter for HTTP::WebSocket constructors (master...websocket-client-supports-headers) https://git.io/vSls9
<FromGitter> <domgetter> sdogruyol: I am
<FromGitter> <domgetter> @sdogruyol what's up?
Ven has joined #crystal-lang
Ven is now known as Guest36204
DeBot has joined #crystal-lang
olek_poz has quit [Ping timeout: 260 seconds]
phase_ has quit [Ping timeout: 246 seconds]
vikaton has joined #crystal-lang
* kodo[m] uploaded an image: Selection_060.png (43KB) - https://matrix.org/_matrix/media/v1/download/tyler.cat/BVzJeAZoDRHRxLkytLMQJamL
<kodo[m]> Sneak peek
<kodo[m]> react + kemal for the win
<FromGitter> <bew> Is the Crystal logo animated? :D
<kodo[m]> nope
<FromGitter> <bew> What are you doing exactly?
<kodo[m]> essentially the crystal version of https://elixirstatus.com/
<FromGitter> <bew> Nice!
txdv has quit [Ping timeout: 264 seconds]