ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.34.0 | 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
<FromGitter> <paulcsmith> That did it!! Thanks again
<FromGitter> <Blacksmoke16> mhm
kotrcka has joined #crystal-lang
adam12 has left #crystal-lang [#crystal-lang]
ur5us has quit [Ping timeout: 260 seconds]
ur5us has joined #crystal-lang
<sagax> hi all!
<sagax> crystal very awesome
<FromGitter> <Blacksmoke16> indeed
<FromGitter> <smalls12> was on the crystal landing page, specifically on install ( https://crystal-lang.org/install/ ) and noticed that if you click the rotating crystal in the top left, it just freezes and stops rotating
<FromGitter> <smalls12> should it redirect to homepage?
<FromGitter> <smalls12> ( just a funny quirk )
ur5us has quit [Ping timeout: 250 seconds]
_whitelogger has joined #crystal-lang
_whitelogger has joined #crystal-lang
lanodan has quit [Ping timeout: 240 seconds]
lanodan has joined #crystal-lang
_ht has joined #crystal-lang
<FromGitter> <naqvis> that allows to use mouse-up/down to rotate the crystal
<FromGitter> <3n-k1> is it possible to read a class' annotations from a different macro/function? something like this ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e8c1f61d021c45cc7cc8c0d]
rohitpaulk has joined #crystal-lang
<FromGitter> <3n-k1> ah, it was `{{c.resolve.annotation(MyAnnotation)}}`
rohitpaulk has quit [Ping timeout: 260 seconds]
_ht has quit [Remote host closed the connection]
_ht has joined #crystal-lang
<FromGitter> <3n-k1> does `Class.instance_vars` not work? This code is printing an empty array ⏎ ⏎ ```class Options ⏎ @temp : String? ⏎ end ⏎ ⏎ puts {{Options.instance_vars.stringify}}``` [https://gitter.im/crystal-lang/crystal?at=5e8c268a5b98016d6a1c36a7]
<FromGitter> <3n-k1> oh i'm using it wrong
<FromGitter> <3n-k1> okay, so is there something like `methods` but for the class and instance variables?
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 264 seconds]
<FromGitter> <3n-k1> how do I use `instance_vars`?
<FromGitter> <naqvis> what is your use-case? or what is it you are trying to achieve?
<FromGitter> <3n-k1> just screwing around. found a github issue, realized it only works in methods, not `finished`
return0e_ has joined #crystal-lang
<FromGitter> <3n-k1> which is interesting because finished can call that method /shrug
DeBot has quit [Ping timeout: 246 seconds]
return0e has quit [Ping timeout: 250 seconds]
deavmi has joined #crystal-lang
davic has quit [Excess Flood]
<Subsentient> How do I perform a narrowing integer cast in Crystal?
<oprypin> Subsentient: that.to_i16
<Subsentient> oprypin: So it's a method, there's no cast operator?
<oprypin> why do u want an operator specifically
<oprypin> there's a universal wrapper too. Int16.new(that)
<oprypin> not sure if that might have changed with the overflow handling. maybe it needs to be new! if u want to truncate instead of erroring on overflow
<FromGitter> <naqvis> to avoid overflow use bang! operator `that.to_i16!`
deavmi has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
deavmi has joined #crystal-lang
<Subsentient> The problem I'm having is converting a UTF-32 Char to 7-bit ASCII. I know the character will always only be 7-bit. I want to convert a Char to UInt8
<Subsentient> Without checking for overflow
<Subsentient> I get "Invalid integer" when invoking e.g. 'h'.to_u8
<Subsentient> In C I'd just do (char)L'h' and that'd be the end of it
return0e has joined #crystal-lang
<raz> crystal 0.34 has been out for multiple hours but homebrew still points to 0.33
* raz is deeply disappoint
<raz> on a more serious note :P - how do you guys keep your crystal on osx? with homebrew or one of the version mgrs?
return0e_ has quit [Ping timeout: 258 seconds]
ur5us has joined #crystal-lang
<Subsentient> So nobody knows how to convert a Char to a UInt8 unconditionally?
<Subsentient> Short of endian-dependent bit fiddling?
<oprypin> Subsentient: you have been told how in 2 ways by 2 people
<Subsentient> oprypin: Both of those ways throw a runtime exception
<oprypin> raz: homebrew updates at its own pace manually
<oprypin> Subsentient: look for "!" in the messages that's the key
<raz> oprypin: yup i know. wasn't entirely serious, just eager to try out the new shards (sounds like it got a speed boost) :)
<Subsentient> Nope, no dice
Human_G33k has joined #crystal-lang
<oprypin> raz: i just have a Crystal repo and alias cr=path/to/repo/bin/crystal
<oprypin> and in there u `git pull` and make. no need to even wait for release
<raz> hmmm i see
davic has joined #crystal-lang
HumanG33k has quit [Ping timeout: 256 seconds]
<Subsentient> oprypin: As you can see, the prescribed methods do not exist
<oprypin> Subsentient: u first need Char.ord
<oprypin> a character is not a number
<Subsentient> Ahh, so it's not an integer type at all?
<oprypin> it's not
<Subsentient> okay, that makes more sense
<oprypin> the fact that it's implemented as int32 is not too hidden tho
<Subsentient> Yeah, that's what I was going by
<Subsentient> used to C/C++ where chars are a primitive type
<oprypin> Subsentient: but if u claim that it's always 7 bit then how can .to_u8 overflow?
<Subsentient> That's a good question, I'm literally feeding it a character literal and getting an overflow.
<yxhuvud> Perhaps every char needs to be split in 4?
<oprypin> nono
<oprypin> Subsentient: oh lol right
<oprypin> it's behaving looks a string not like a number
<oprypin> '9'.to_u8 == 9_u8
<oprypin> like*
<yxhuvud> oh right, so missing `.ord`, again
<FromGitter> <naqvis> raz Brian has already submitted the PR#52644 (https://github.com/Homebrew/homebrew-core/pull/52644) and awaiting merge on HomeBrew
<raz> naqvis: :partyparrot:
ur5us has quit [Ping timeout: 260 seconds]
<FromGitter> <naqvis> 👍
deavmi has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
deavmi has joined #crystal-lang
ur5us has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
travis-ci has joined #crystal-lang
<travis-ci> crystal-lang/crystal#62b5d52 (master - Merge pull request #9012 from crystal-lang/ci/update): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/672002237
travis-ci has left #crystal-lang [#crystal-lang]
ur5us has quit [Ping timeout: 260 seconds]
return0e_ has joined #crystal-lang
return0e has quit [Ping timeout: 265 seconds]
rohitpaulk has joined #crystal-lang
deavmi has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
deavmi has joined #crystal-lang
yxhuvud has quit [Read error: Connection reset by peer]
yxhuvud has joined #crystal-lang
return0e_ has quit [Read error: Connection reset by peer]
return0e has joined #crystal-lang
return0e has quit [Read error: Connection reset by peer]
return0e has joined #crystal-lang
<FromGitter> <smalls12> > that allows to use mouse-up/down to rotate the crystal ⏎ ⏎ oh that makes sense : )
<FromGitter> <Blacksmoke16> @3n-k1 you can also just use the class type directly like `{{Options.annotation(MyAnnotation)}}`