ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.30.1 | 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
sorcus has quit [Ping timeout: 246 seconds]
<FromGitter> <tenebrousedge> refinements are simply
<FromGitter> <tenebrousedge> I wasn't aware that continuations existed, and I guess as long as they throw a compiler warning, I'm probably not going to pay them much attention
<FromGitter> <stronny> refinements are simple, their scoping is extremely hard (for me at least)
f1refly has quit [Ping timeout: 276 seconds]
gangstacat has quit [Ping timeout: 276 seconds]
chemist69 has quit [Ping timeout: 246 seconds]
chemist69 has joined #crystal-lang
gangstacat has joined #crystal-lang
<FromGitter> <tenebrousedge> @stronny maybe I'm missing something about their scoping. What do you see as being complicated about that?
ht_ has joined #crystal-lang
dostoyevsky has quit [Quit: leaving]
dostoyevsky has joined #crystal-lang
ht_ has quit [Remote host closed the connection]
absolutejam1 has joined #crystal-lang
early has quit [Quit: Leaving]
early has joined #crystal-lang
HumanGeek has quit [Quit: Leaving]
absolutejam1 has quit [Ping timeout: 265 seconds]
HumanG33k has joined #crystal-lang
HumanG33k has quit [Remote host closed the connection]
HumanG33k has joined #crystal-lang
Raimondi has quit [Quit: WeeChat 2.5: ¡Chau!]
ua has quit [Ping timeout: 246 seconds]
Raimondi has joined #crystal-lang
absolutejam1 has joined #crystal-lang
ua has joined #crystal-lang
absolutejam1 has quit [Ping timeout: 276 seconds]
absolutejam1 has joined #crystal-lang
hightower2 has quit [Ping timeout: 265 seconds]
absolutejam1 has quit [Ping timeout: 240 seconds]
absolutejam1 has joined #crystal-lang
absolutejam1 has quit [Ping timeout: 245 seconds]
absolutejam1 has joined #crystal-lang
sorcus has joined #crystal-lang
alex`` has joined #crystal-lang
alex`` has quit [Quit: WeeChat 2.6]
alex`` has joined #crystal-lang
absolutejam1 has quit [Ping timeout: 268 seconds]
absolutejam1 has joined #crystal-lang
hightower2 has joined #crystal-lang
absolutejam1 has quit [Ping timeout: 245 seconds]
absolutejam1 has joined #crystal-lang
alex`` has quit [Ping timeout: 240 seconds]
alex`` has joined #crystal-lang
DTZUZO has quit [Quit: WeeChat 2.0]
DTZUZO has joined #crystal-lang
rohitpaulk has joined #crystal-lang
<FromGitter> <stronny> I've tried to use them to patch redmine like 5 years ago. I've forgotten details and haven't use them since.
<FromGitter> <tenebrousedge> I wouldn't say that their use is always a mistake, but they're usually a last resort. Similar with using `def` on a variable
<FromGitter> <tenebrousedge> (which Crystal does not allow)
alex`` has quit [Quit: WeeChat 2.6]
<FromGitter> <vlazar> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d7f97f85d40aa0d7d47da0f]
<FromGitter> <Blacksmoke16> what about it?
<FromGitter> <Blacksmoke16> maybe try setting some type annotations
<FromGitter> <stronny> I think that's an example of counter-intutive refinements in Ruby, nothing to do with crystal
<FromGitter> <vlazar> yeah, not the one I've struggled with, but maybe it's part of the reason refinements never took off
rohitpaulk has quit [Remote host closed the connection]
<FromGitter> <vlazar> @Blacksmoke16 ⏎ ⏎ > what about it? ⏎ > maybe try setting some type restrictions ⏎ ... [https://gitter.im/crystal-lang/crystal?at=5d7fa27e3cc2b87edf13444a]
<FromGitter> <vlazar> notice the auto generated URL for Crystal version BTW
<FromGitter> <vlazar> the repl.it seem to be quite a sophisticated AI
ht_ has joined #crystal-lang
absolutejam1 has quit [Ping timeout: 245 seconds]
<FromGitter> <tenebrousedge> it returns enumerator because `@a` is nil inside the method
<FromGitter> <tenebrousedge> class instance variables are not the same thing as instance variables
<FromGitter> <tenebrousedge> apparently Crystal thinks otherwise though
<FromGitter> <tenebrousedge> Crystal: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d7fa8665d40aa0d7d4858f2]
<FromGitter> <vlazar> the `@a` in Crystal is instance variable, not class instance variable, right?
<FromGitter> <j8r> yes, a class variable will be `@@a`
return0e has joined #crystal-lang
<FromGitter> <vlazar> I mean not class variable, but class instance variable like in Ruby :)
return0e_ has quit [Ping timeout: 268 seconds]
<FromGitter> <vlazar> there is no such thing as class instance variable in Crystal, is there?
<FromGitter> <tenebrousedge> that seems to be the case
<FromGitter> <j8r> a class instance variable?
<FromGitter> <tenebrousedge> That would be what the code we've been discussing displays, yes
<FromGitter> <j8r> like ⏎ ⏎ ```class A ⏎ def test ⏎ @@test ⏎ end ⏎ end``` ⏎ ⏎ ? [https://gitter.im/crystal-lang/crystal?at=5d7fb115c82c2e0d7ee668ba]
<FromGitter> <tenebrousedge> no
<FromGitter> <tenebrousedge> review the code
<FromGitter> <j8r> a class instance variable is an instance variable, dont see the diff
<FromGitter> <vlazar> in Ruby there is a class instance variable
robacarp has left #crystal-lang [#crystal-lang]
<FromGitter> <tenebrousedge> I don't know how to make it any clearer than the example code displays
<FromGitter> <bararchy> Oh no @bcardiff CI shows invalid mem access
<FromGitter> <bcardiff> in which build @bararchy ?
alex`` has joined #crystal-lang
<FromGitter> <asterite> @vlazar only in Crystal you can define and initialize an instance variable inside a class top-level. In Ruby that's something different
<FromGitter> <bararchy> @bcardiff for https://github.com/crystal-lang/crystal/pull/8190
<FromGitter> <bararchy> The my_preview
<FromGitter> <bararchy> my
<FromGitter> <asterite> @bararchy already reported https://github.com/crystal-lang/crystal/issues/8184
<FromGitter> <bcardiff> Ah, yeah. We are investingating a bit what is happening there. Thanks!
<FromGitter> <asterite> ""??????????????????
<FromGitter> <asterite> sorry, cat
<FromGitter> <bcardiff> 😹
<FromGitter> <bararchy> 🎉
<FromGitter> <firejox> Hi,everyone: )
<FromGitter> <Blacksmoke16> o/
<FromGitter> <firejox> I have some idea about Fiber. If we break swapcontext into two parts, it will be easier to keep thread-safe.
<FromGitter> <firejox> Because we can use rop to add operations (eg. mutex.unlock ) to the targeted context before swap.
<FromGitter> <firejox> After swap, these operations will be executed automatically.
<oprypin> how to print an exception in an informative way? i could just let Crystal print it, but i don't want it to be fatal :D
DTZUZO has quit [Ping timeout: 265 seconds]
<FromGitter> <Blacksmoke16> rescue, print what you want, dont reraise
<FromGitter> <tenebrousedge> @firejox that sounds good to me but it's probably best raised on the Issues list
<oprypin> yeah but what is that part "what you want"
<oprypin> turns out it's e.inspect_with_backtrace
<FromGitter> <Blacksmoke16> what you want would be however you want to print the error
<FromGitter> <Blacksmoke16> using that, or if you wanted to use some custom format etc
<FromGitter> <Blacksmoke16> i.e. could also log it etc
<FromGitter> <firejox> @tenebrousedge ok, i will make issue there
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
dannyAAM has joined #crystal-lang
absolutejam1 has joined #crystal-lang
<FromGitter> <sam0x17> how to get the start and end points of a `Range(T)`? thought doing `.first` and `.last`, `range[0]`, or even `range.0` etc would work, but none do (though `first` works because of ennumerable
<FromGitter> <Blacksmoke16> `#begin`
<FromGitter> <Blacksmoke16> `#end`
<FromGitter> <sam0x17> so `a = range.begin; b = range.end`?
<FromGitter> <Blacksmoke16> yes
<FromGitter> <sam0x17> ah, ty
<FromGitter> <sam0x17> thought those were reserved words xD
<FromGitter> <Blacksmoke16> :p
Human_G33k has joined #crystal-lang
Human_G33k has quit [Remote host closed the connection]
Human_G33k has joined #crystal-lang
HumanG33k has quit [Ping timeout: 268 seconds]
<FromGitter> <codenoid> cool
f1refly has joined #crystal-lang
return0e has quit [Read error: Connection reset by peer]
return0e has joined #crystal-lang
<FromGitter> <Sija> @bararchy I am now, whassup? :)
ht_ has quit [Quit: ht_]
JuanMiguel has joined #crystal-lang
alex`` has quit [Quit: WeeChat 2.6]
JuanMiguel has quit [Client Quit]
alex`` has joined #crystal-lang
<FromGitter> <jwoertink> If I have some code that calls `gets`, and I run that code from `Process.run`, is there a way to give that `gets` a value programmatically?
<FromGitter> <tenebrousedge> like unix `expect`?
<FromGitter> <jwoertink> Not sure what that is. Looking it up
<FromGitter> <kinxer> Could you pass in an IO to be the `STDIN`?
<FromGitter> <jwoertink> Yeah, looks like `expect` is similar to what I'm talking about
alex`` has quit [Quit: WeeChat 2.6]
<FromGitter> <tenebrousedge> would that work, or do you need a Crystal solution?
<FromGitter> <jwoertink> I need a crystal solution
<FromGitter> <jwoertink> I can try passing the IO. I'm already doing that for the output
<FromGitter> <kinxer> @jwoertink Could you do something like this: https://play.crystal-lang.org/#/r/7kqy ?
<FromGitter> <jwoertink> hmm
<FromGitter> <jwoertink> I'm not sure
<FromGitter> <jwoertink> This is basically a CLI wizard asking you questions. So it uses `puts` and `gets`
<FromGitter> <jwoertink> But when running the specs, it's all run through `Process.run`. To be as minimally invasive as possible, I'd need a way to catch when it asks for some question, and then insert the gets value at that point
<FromGitter> <jwoertink> The more I look at this though, it seems like I may need to just keep the OptionParser deal, and pass everything through that
<FromGitter> <kinxer> Would the block argument version of `Process.run` do what you need: https://play.crystal-lang.org/#/r/7kr2 ?
absolutejam1 has quit [Ping timeout: 240 seconds]
_whitelogger has joined #crystal-lang