<FromGitter>
<tenebrousedge> I wonder if that would let you write something like Ruby's refinements
<FromGitter>
<Blacksmoke16> hm?
<FromGitter>
<tenebrousedge> Refinements are useful for extending core classes, but only in a single file/class
<FromGitter>
<Blacksmoke16> ah gotcha
<FromGitter>
<Blacksmoke16> anyone know if its possible to have vars scoped to a fiber?
<FromGitter>
<Blacksmoke16> like an ivar specific to that fiber
<FromGitter>
<tenebrousedge> a fiber uses a proc, right? shouldn't variables be scoped within that proc?
<FromGitter>
<Blacksmoke16> i was more so imaging like during an http request, which spawns a fiber, id like all my code that gets executed to have access to an ivar but that would be specific to that request, i.e. fiber
<FromGitter>
<Blacksmoke16> im doubting that is doabl
<FromGitter>
<tenebrousedge> you could just add one to the class?
<FromGitter>
<Blacksmoke16> class wouldnt be concurrent safe, since there could be two requests, i.e. two fibers, with only one class var
<FromGitter>
<Blacksmoke16> i suppose you could give a fiber a name, and use same name as a key in some top level class hash and assign the instance to that hash, but that seems kinda hacky
<FromGitter>
<tenebrousedge> well, sure, but couldn't you just do `class Fiber; property @myprop; end` ?
<FromGitter>
<Blacksmoke16> :0
<FromGitter>
<Blacksmoke16> 😮
<FromGitter>
<Blacksmoke16> yea that might do it
<FromGitter>
<Blacksmoke16> lol i swear if if thats simple
<FromGitter>
<tenebrousedge> so why would `Array` be a `FeedPartner` ?
<FromGitter>
<Blacksmoke16> because the array contains the type `FeedPartner`
<FromGitter>
<tenebrousedge> but it does not include that type
<FromGitter>
<Blacksmoke16> how you figure?
<FromGitter>
<Blacksmoke16> `type_restriction` is `Array(FeedPartner)`
<FromGitter>
<tenebrousedge> it's not part of the object heirarchy
<FromGitter>
<Blacksmoke16> so in theory it should b like `Array(FeedPartner) <= FeedPartner` which im thinking should be true since self includes other
<FromGitter>
<tenebrousedge> `<=` seems to test the inheritance chain, not what's in the container
<FromGitter>
<Blacksmoke16> `includes other.` makes me think it would be testing for the types in the generic as well?
<FromGitter>
<tenebrousedge> your example seems to imply otherwise
<FromGitter>
<Blacksmoke16> apparently so :p
<FromGitter>
<tenebrousedge> I mean, I could easily be wrong
<FromGitter>
<Blacksmoke16> i guess all i want to do is determine if an array contains another type
<FromGitter>
<Blacksmoke16> macro land it would be easier
<FromGitter>
<tenebrousedge> it does sound like you want to do some metaprogramming
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter>
<Blacksmoke16> trying to at least haha
<FromGitter>
<Blacksmoke16> might have to think of plan b
<FromGitter>
<watzon> I'll be publishing it later today, so any suggestions would be appreciated before then
<FromGitter>
<dscottboggs_gitlab> you said "you're in for a treat" twice in paragraph two
<FromGitter>
<tenebrousedge> the brainfuck benchmark might be a thing, but I think you might want to use a euphemism. "leading benchmark" or "standard benchmark"
<FromGitter>
<malkomalko> Anybody know a good way of debugging or at least printing out some backtraces?
<FromGitter>
<malkomalko> I have a part of my code that's being called more than I'd expect and just trying to figure out the best way to debug it
<FromGitter>
<malkomalko> I did some searching and looking at the guides but didn't see anything
<FromGitter>
<dscottboggs_gitlab> @watzon I really like the article.
<FromGitter>
<dscottboggs_gitlab> @malkomalko you can load up your program in lldb or gdb
<FromGitter>
<tenebrousedge> I would also avoid comparisons with steaming piles of cow dung
<FromGitter>
<dscottboggs_gitlab> @tenebrousedge I thought that was pretty spot on 😉
<FromGitter>
<dscottboggs_gitlab> @malkomalko I think there's also a macro to print the stack trace but I'm not sure
<FromGitter>
<malkomalko> Ok, I'll take a look at the macro and thanks for the lldb tip
<FromGitter>
<tenebrousedge> I dislike C++ code as much as anyone but there's no reason to be crude
<FromGitter>
<dscottboggs_gitlab> I don't see the reason for *not* being crude
<FromGitter>
<tenebrousedge> if you happened to really like C++ this would tend to dissuade you from considering the merits of the author's arguments
<FromGitter>
<dscottboggs_gitlab> I think anyone who would switch from C++ to Crystal would do so because they were dissatisfied with the syntax
moei has quit [Quit: Leaving...]
<FromGitter>
<malkomalko> Ok, I can just `begin ... rescue ex ... end` and `puts ex.backtrace`
alexherbo2 has quit [Quit: Ping timeout (120 seconds)]
<FromGitter>
<dscottboggs_gitlab> oh, yeah that's an idea
alexherbo2 has joined #crystal-lang
<FromGitter>
<tenebrousedge> I don't think that there are any good arguments against civility
<FromGitter>
<dscottboggs_gitlab> Idk i just don't see the harm in expressing one's opinions
alexherbo2 has quit [Client Quit]
alexherbo2 has joined #crystal-lang
<FromGitter>
<dscottboggs_gitlab> @malkomalko you can also do `CallStack.new.printable_backtrace.join('\n')` https://carc.in/#/r/6wdv
<FromGitter>
<dscottboggs_gitlab> it seemed a little silly to me to raise an exception just to get to the backtrace -- but `CallStack` is an undocumented part of the stdlib so maybe that's the way you're supposed to do it...
<FromGitter>
<malkomalko> I just added a little snippet so I'll stick with the rescue approach, I won't use it very often
<FromGitter>
<dscottboggs_gitlab> 👍 yeah usually lldb or `pp!` is enough in my experience
<FromGitter>
<watzon> > I dislike C++ code as much as anyone but there's no reason to be crude ⏎ ⏎ I see your point, but it's part of my humour lol. Even people who generally like C++ have to understand that an optimized C++ script looks like crap
<FromGitter>
<asterite> there's `caller`, like in Ruby, to get the call stack
<FromGitter>
<dscottboggs_gitlab> Is there an example anywhere?