<FromGitter>
<mattrberry> ```a = 1 ⏎ puts typeof(a) ⏎ spawn { a = "string" }``` ⏎ ⏎ This example prints `(Int32 | String)`. I don't know much about crystal fibers. I figure the compiler *could* track that the main fiber never yields here so the spawned channel will never run. I'm guessing that's just not worth the overhead of tracking at compile-time for silly examples like this? [http
<FromGitter>
<Blacksmoke16> Right, at runtime it knows it's a number
<FromGitter>
<naqvis> aahh, gotcha
<FromGitter>
<naqvis> `typeof` is a pseudo-method
<FromGitter>
<Blacksmoke16> Ye
<FromGitter>
<naqvis> 🌹
<FromGitter>
<mattrberry> I'd like to make a unique Bytes-like type that adds some additional methods. Is that possible? For example, I'd like to have a Slice(UInt8) that adds a method to interpret the first few bytes a certain way
<FromGitter>
<naqvis> You can wrap Bytes inside your custom class
<FromGitter>
<naqvis> and delegate bytes related methods to bytes obj you wrapped
<FromGitter>
<mattrberry> Thanks, that's what I just did 👍
<FromGitter>
<naqvis> 👍
jmd_ has quit [Ping timeout: 244 seconds]
ur5us has quit [Ping timeout: 255 seconds]
ur5us has joined #crystal-lang
ur5us has quit [Ping timeout: 255 seconds]
ur5us has joined #crystal-lang
MariaElis[m] has quit [Quit: You have been kicked for being idle]
ur5us has quit [Ping timeout: 250 seconds]
ua_ has quit [Ping timeout: 240 seconds]
ua_ has joined #crystal-lang
onyx has joined #crystal-lang
Sankalp has quit [Ping timeout: 256 seconds]
Sankalp has joined #crystal-lang
Sankalp has quit [Ping timeout: 248 seconds]
Sankalp has joined #crystal-lang
hexology- has joined #crystal-lang
hexology has quit [Quit: hex on you ...]
analogsalad has joined #crystal-lang
_ht has joined #crystal-lang
renich has joined #crystal-lang
fifr has joined #crystal-lang
_ht_ has joined #crystal-lang
<renich>
@Blacksmoke16: man Chapter 3 has an error in the Location struct for the building instance. It says 'p store' at the end. I think you meant 'p building'. Page 84 in the pdf.
<FromGitter>
<Blacksmoke16> 😱
_ht has quit [*.net *.split]
ua_ has quit [*.net *.split]
HumanG33k has quit [*.net *.split]
fifr_ has quit [*.net *.split]
HumanG33k has joined #crystal-lang
ua_ has joined #crystal-lang
<FromGitter>
<Blacksmoke16> That was one of @lbguilherme's chapters. Not sure how they handle edits tho?
<renich>
@Blacksmoke16: OK, just wanted to report it.
<analogsalad>
I was wondering why I haven't noticed it, turns out I'm on page 81- 3 more pages to go.
<analogsalad>
Though I do have a note from that chapter I want to run by you.
<FromGitter>
<Blacksmoke16> not super familiar with the specifics of it, but ill do what i can
<analogsalad>
There's an example where a class is reopened to add a new method. It's said "when reopening a class, it's parent class should not be specified."
<analogsalad>
This made me think that specifying the parent class would cause a compiler error, rather than it's just redudant.
<analogsalad>
*redundant.
<FromGitter>
<Blacksmoke16> it might just be to prevent issues with changes in the hierarchy of that type
<FromGitter>
<Blacksmoke16> i.e. some refactoring goes on and the parent type changes, then you'd get a compile error
<FromGitter>
<Blacksmoke16> granted that assumes that happened in a way that didnt also break what you were overriding
<analogsalad>
That's a good point.
SamantazFox has quit [Killed (NickServ (GHOST command used by SamantazFox_))]