ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.20.3 | 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
Kug3lis has joined #crystal-lang
onionhammer has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 258 seconds]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 256 seconds]
DTZUZU has joined #crystal-lang
<FromGitter> <firejox> well, I have write a thread safe channel in my lib :) ⏎ https://github.com/firejox/crystal-async_await
soveran has joined #crystal-lang
<FromGitter> <firejox> though they are in different design
soveran has quit [Ping timeout: 252 seconds]
_whitelogger has joined #crystal-lang
matp has quit [Quit: Bye!]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
matp has joined #crystal-lang
vivus-ignis has quit [Ping timeout: 256 seconds]
<FromGitter> <maiha_twitter> Happy new year! (JST)
<literal> how do I create a hash whose values are of varying types? tried without much luck: https://gist.github.com/hinrik/f7ddc49b7d7b6a3cd465b0fd8e09e792
matp_ has joined #crystal-lang
matp has quit [Ping timeout: 246 seconds]
matp_ is now known as matp
<RX14> literal, like this: https://carc.in/#/r/1ih4
<Papierkorb> literal: Hash(String, Int32 | String).new == {} of String => Int32|String
<RX14> as you can see it's a gigantic pain in the ass, so don't do it
<RX14> well i mean for recusrive types
<Papierkorb> Ah you wanted a recursive hash, sorry
<RX14> in crystal we tend to use a class/struct instead of using hashes as generic data bags
<literal> yeah, I only have a fixed amount of 3 keys in the top level hash, so I just made them 3 separate variables
<literal> makes sense
<RX14> hashes are used mainly for key -> value mappings only where the values are a known type
<RX14> which can of course be a union
<RX14> you could change the default hash value to be 0
<RX14> or you could do hash[key] = (hash[key]? || 0) + 1
<literal> ah, nice
<RX14> or actually
<RX14> hash.fetch(key, 0) works too i think
<RX14> for key or 0
<RX14> yup
<RX14> Hash#fetch(key, default)
<literal> that'll work
chamar has joined #crystal-lang
Philpax_ has joined #crystal-lang
Philpax has quit [Ping timeout: 258 seconds]
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
vivus-ignis has joined #crystal-lang
Philpax_ has quit [Ping timeout: 258 seconds]
Kug3lis has joined #crystal-lang
soveran has quit [Remote host closed the connection]
martinium has joined #crystal-lang
soveran has joined #crystal-lang
bjz has joined #crystal-lang
<Kug3lis> where I can find old ruby based compiler source code? :D
<RX14> there's a branch
<RX14> but it's really old
<RX14> i lied, it's a tag
<RX14> called ruby
<Kug3lis> yeah I know, I am just curious how it looks
<Kug3lis> thanks :)
<Kug3lis> new year in front of pc? D:
<RX14> yes
<RX14> practicing for an exam even
Ven has quit [Ping timeout: 264 seconds]
<Kug3lis> those jan 2 exams are crazy :D
<RX14> yeah
Ven has joined #crystal-lang
soveran has quit [Remote host closed the connection]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Kug3lis> Could someone explain me why sometimes there are in class def self.new() and def initialize() ?
<Kug3lis> isnt it the same?
<RX14> no
<RX14> initialize runs in the new class instance
<RX14> self.new runs at the class level
<RX14> self.new is mostly used for passing to another definition of `new`
<BlaXpirit> Kug3lis, they both serve a very similar purpose but have different advantages
<Kug3lis> ahh ok
<BlaXpirit> you can initialize fields only in "initialize"
<BlaXpirit> you can pass through to a different constructor only in "new"
<Kug3lis> and new basically overloads different arguments for initialize?
<BlaXpirit> something like that. but technically that sounds wrong
<BlaXpirit> it's the other way around maybe
<Kug3lis> because I was looking at Http::Server and did not much understand thats difference
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has quit [Remote host closed the connection]
matp has quit [Remote host closed the connection]
matp has joined #crystal-lang
DTZUZU has quit [Ping timeout: 268 seconds]
Ven has quit [Ping timeout: 256 seconds]
soveran has joined #crystal-lang
Ven has joined #crystal-lang
Kug3lis has quit [Quit: Textual IRC Client: www.textualapp.com]
martinium has quit [Quit: WeeChat 1.5]
Ven has quit [Ping timeout: 256 seconds]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 260 seconds]
soveran has quit [Remote host closed the connection]
Ven has joined #crystal-lang
DTZUZU has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
Ven has quit [Ping timeout: 268 seconds]
Ven has joined #crystal-lang
soveran has quit [Remote host closed the connection]
Ven has quit [Ping timeout: 256 seconds]
Ven has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 244 seconds]
Raimondii is now known as Raimondi
Ven has quit [Ping timeout: 260 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Ven has joined #crystal-lang
bjz has joined #crystal-lang
Ven has quit [Ping timeout: 265 seconds]
vivus-ignis has quit [Ping timeout: 268 seconds]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 258 seconds]
matp_ has joined #crystal-lang
matp has quit [Ping timeout: 245 seconds]
matp_ has quit [Read error: Connection reset by peer]
Ven has joined #crystal-lang
matp has joined #crystal-lang
Ven has quit [Ping timeout: 246 seconds]
_whitelogger has joined #crystal-lang
Ven has joined #crystal-lang
Ven has quit [Read error: Connection reset by peer]
chino has joined #crystal-lang
bjz has quit [Ping timeout: 248 seconds]
bjz has joined #crystal-lang
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 265 seconds]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 258 seconds]
bjz has quit [Ping timeout: 264 seconds]
bjz has joined #crystal-lang
Ven has joined #crystal-lang
Ven has quit [Read error: Connection reset by peer]
Ven has joined #crystal-lang
ragmaanir has quit [Quit: Leaving]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang