ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.24.2 | 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
Creatornator has joined #crystal-lang
moei has quit [Quit: Leaving...]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Creatornator has joined #crystal-lang
snsei has joined #crystal-lang
Creatornator has quit [Client Quit]
snsei has quit [Ping timeout: 256 seconds]
snsei has joined #crystal-lang
Creatornator has joined #crystal-lang
Creatornator has quit [Client Quit]
Creatornator has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
duane has joined #crystal-lang
Creatornator has quit [Client Quit]
Creatornator has joined #crystal-lang
Creatornator has quit [Client Quit]
snsei has joined #crystal-lang
Creatornator has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
Creatornator has quit [Client Quit]
Creatornator has joined #crystal-lang
Creatornator has quit [Client Quit]
duane has quit [Ping timeout: 264 seconds]
heaven31415 has quit [Ping timeout: 268 seconds]
<crystal-gh> [crystal] j8r closed pull request #5844: Add `Enumerable#last` (master...enumerable_last) https://git.io/vxnWt
DTZUZU has quit [Read error: Connection reset by peer]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
DTZUZU has joined #crystal-lang
Creatornator has joined #crystal-lang
duane has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 276 seconds]
greengriminal has joined #crystal-lang
greengriminal has quit [Quit: This computer has gone to sleep]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
greengriminal has joined #crystal-lang
greengriminal has quit [Client Quit]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 256 seconds]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duane has quit [Ping timeout: 260 seconds]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
hightower has quit [Ping timeout: 256 seconds]
Creatornator has joined #crystal-lang
straight-shoota has quit [Ping timeout: 240 seconds]
straight-shoota has joined #crystal-lang
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
greengriminal has joined #crystal-lang
DTZUZO has joined #crystal-lang
ryan_ford has joined #crystal-lang
snsei has joined #crystal-lang
greengriminal has quit [Quit: This computer has gone to sleep]
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 252 seconds]
snsei_ has quit [Ping timeout: 240 seconds]
snsei has joined #crystal-lang
ryan_ford has quit [Ping timeout: 240 seconds]
snsei has quit [Remote host closed the connection]
moei has joined #crystal-lang
straight-shoota has quit [Read error: Connection reset by peer]
straight-shoota has joined #crystal-lang
alex`` has joined #crystal-lang
<Groogy> Morning! o/
<FromGitter> <yxhuvud> but now you are mixing << and >>/>>>. IIRC, there is no difference in one of the directions.
<FromGitter> <yxhuvud> but yes, we are missing >>>. there is probably an llvm intrinsic for that
ryan_ford has joined #crystal-lang
moei has quit [Quit: Leaving...]
ryan_ford has quit [Ping timeout: 260 seconds]
moei has joined #crystal-lang
DTZUZO has quit [Ping timeout: 248 seconds]
DTZUZO has joined #crystal-lang
ryan_ford has joined #crystal-lang
<FromGitter> <CImrie> Hey - what's the best way to resolve namespace conflicts? ⏎ Say I have a module `Foo` with the class `Bar` (i.e. `Foo::Bar`) ⏎ ⏎ Inside `Bar` I want to reference a shard namespace of just `Bar` (e.g. `Bar::BarThing.new`) ⏎ But crystal tries to find it in `Foo::Bar::BarThing` instead of `Bar::BarThing` [https://gitter.im/crystal-lang/crystal?at=5ab221cde4ff28713a58d423]
<FromGitter> <bew> To reference the toplevel Bar, do: `::Bar`
Papierkorb has joined #crystal-lang
Papierkorb has left #crystal-lang ["Konversation terminated!"]
<FromGitter> <CImrie> Merci! Works perfectly 🙌
rohitpaulk has joined #crystal-lang
DTZUZO has quit [Ping timeout: 256 seconds]
ryan_ford has quit [Ping timeout: 265 seconds]
straight-shoota has quit [Read error: Connection reset by peer]
straight-shoota has joined #crystal-lang
straight-shoota has quit [Ping timeout: 264 seconds]
ryan_ford has joined #crystal-lang
straight-shoota has joined #crystal-lang
straight-shoota has quit [Read error: Connection reset by peer]
straight-shoota has joined #crystal-lang
<crystal-gh> [crystal] ysbaddaden opened pull request #5848: Security Fix: don't buffer reads from /dev/urandom (master...security-fix-dont-buffer-dev-urandom) https://git.io/vxcXT
Papierkorb has joined #crystal-lang
Papierkorb has left #crystal-lang [#crystal-lang]
rohitpaulk has quit [Ping timeout: 256 seconds]
rohitpaulk has joined #crystal-lang
Creatornator has joined #crystal-lang
sz0 has joined #crystal-lang
duane has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 252 seconds]
greengriminal has joined #crystal-lang
DTZUZO has joined #crystal-lang
heaven31415 has joined #crystal-lang
<FromGitter> <bararchy> Thumb up for `Regex.union` this is really helpful :)
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Creatornator has joined #crystal-lang
straight-shoota has quit [Ping timeout: 245 seconds]
straight-shoota has joined #crystal-lang
straight-shoota has quit [Remote host closed the connection]
heaven31415 has quit [Ping timeout: 248 seconds]
<FromGitter> <straight-shoota> did you know you can also use interpolation?
<FromGitter> <straight-shoota> ```foo = /foo/ ⏎ bar = "bar" ⏎ pp /#{foo}(#{bar})+/``` [https://gitter.im/crystal-lang/crystal?at=5ab26f24458cbde5575dbc17]
<FromGitter> <straight-shoota> ` => /(?-imsx:foo)(bar)+/`
rohitpaulk has joined #crystal-lang
greengriminal has quit [Quit: This computer has gone to sleep]
rohitpaulk has quit [Ping timeout: 248 seconds]
greengriminal has joined #crystal-lang
<FromGitter> <timscott> Hi, i'm fairly new to crystal. I'm trying to debug a spec. So I add `debugger` where I want to break, then run `crystal spec -d`. It crashes with an error "Program received and didn't handle signal TRAP (5)". I haven't found any docs for debugging in general or debugging specs. What am I doing wrong?
sz0 has quit [Quit: Connection closed for inactivity]
rohitpaulk has joined #crystal-lang
<FromGitter> <straight-shoota> Yeah, `debugger` doesn't work that way. The crystal compiler itself does not include a debugger. `debugger` just sets a break point that can be used for an external debugger like `gdb` or `lldb`. While that's possible to do, it has quite a few limitations and probably won't be of much use as a general debugging solution. See #2790 for some details on that.
<FromGitter> <straight-shoota> I have used a debugger in Crystal only once or twice to debug some weird internal stuff.
ryan_ford has quit [Ping timeout: 256 seconds]
<FromGitter> <straight-shoota> Usually you can get around pretty good using essentially `puts` debugging. `pp expression` can receive an expression and prints the expression plus it's value, like `pp 1 + 2` results in `1 + 2 # => 3`.
ryan_ford has joined #crystal-lang
<FromGitter> <timscott> @straight-shoota Thanks. How might one go about running specs with debugging? Is there a way?
<FromGitter> <straight-shoota> Depends on what you want to debug. But I'd recommend inserting a few `pp` at significant places and run the spec just normal. Note that you can limit the execution to a specifc spec using file+line number or even the name of the spec.
<FromGitter> <straight-shoota> `crystal spec spec/my_spec.cr:17` executes the test case incorporating line 17
<RX14> @timscott unless you're getting a segfault you really don't want to use `debugger`
<RX14> it won't help you
<RX14> since you won't be able to do anything useful without a fair bit of effort
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
greengriminal has quit [Quit: Leaving]
Creatornator has joined #crystal-lang
DTZUZO has quit [Quit: WeeChat 2.0]
rohitpaulk has quit [Ping timeout: 240 seconds]
DTZUZO has joined #crystal-lang
duane has quit [Ping timeout: 256 seconds]
<crystal-gh> [crystal] kostya closed pull request #5846: add reinit for Crystal::System::Random on after_fork, fixed #5843 (master...fix_random_after_fork) https://git.io/vxcfe
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
return0e has joined #crystal-lang
<crystal-gh> [crystal] RX14 opened pull request #5849: Always read unbuffered when IO::Buffered#sync = true (master...feature/io-buffered-sync-read) https://git.io/vxCg3
return0e has quit [Ping timeout: 264 seconds]
return0e has joined #crystal-lang
marius has quit [Read error: Connection reset by peer]
marius has joined #crystal-lang
return0e has quit [Remote host closed the connection]
Creatornator has joined #crystal-lang
duane has joined #crystal-lang
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <mlobl> Hey, new to Crystal/Ruby syntax . I'm struggling to recursively yield. I'm trying to replicate Python's os.walk and this is my wip ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ I'm getting a recursive block expansion error and I'm getting the feeling I'm doing something un-crystal like. Any quick thoughts? [https://gitter.im/crystal-lang/crystal?at=5ab2a2c4c3c5f8b90d9b2586]
<RX14> you can't
<RX14> you'll have to take a block and use `block.call`
<RX14> you seem to be already taking a block
<RX14> so that'd be s/yield/block.call/
<RX14> and walk File.join(,,,), block
<FromGitter> <mlobl> thanks, trying to run with that
return0e has joined #crystal-lang
return0e has quit [Client Quit]
Creatornator has joined #crystal-lang
t0nyandre has quit [Remote host closed the connection]
DTZUZU has quit [Read error: Connection reset by peer]
DTZUZU has joined #crystal-lang
ryan_ford has quit [Ping timeout: 264 seconds]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Creatornator has joined #crystal-lang
ryan_ford has joined #crystal-lang
<FromGitter> <mlobl> Got it working! ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Biggest leap for my brain was the need to give the block a type so it can take an arg, while a yield worked without it. Thanks! [https://gitter.im/crystal-lang/crystal?at=5ab2b1e7458cbde5575f51bb]
return0e has joined #crystal-lang
<FromGitter> <straight-shoota> yeah, that's not exactly obvious but with a little explanation completely logical
<FromGitter> <straight-shoota> `yield` inlines the block, so you can essentially think of it as being replaced by the literal source code of the block
<FromGitter> <straight-shoota> you can't do this recursively because it would nest infinetly
<FromGitter> <mlobl> ah i see
<FromGitter> <mlobl> thanks
<FromGitter> <straight-shoota> this literally happens very much at the code level, that's why inlined blocks have no performance penalty
<FromGitter> <straight-shoota> when you capture a block in a variable, it essentially creates a function object that can be called an passed around
heaven31415 has joined #crystal-lang
<heaven31415> Hi
<heaven31415> When i use ! in method name like "def foo! ... end", does it change the behaviour of the method or is it just syntax sugar?
<FromGitter> <straight-shoota> it's just convention
ryan_ford has quit [Quit: WeeChat 1.4]
<FromGitter> <vonKingsley> I'm trying to send a large binary file to a rest api using HTTP::Client.post. ⏎ When I do this using a url with http:// everything works fine. File gets uploaded and is the correct size ⏎ When i switch this to https://, I get the following error ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5ab2b9d727c509a7748c2098]
<crystal-gh> [crystal] r00ster91 opened pull request #5851: Fix wrong link in x86.cr (master...patch-6) https://git.io/vxCQT
<FromGitter> <straight-shoota> I don't know but I'd suggest opening an issue about this, including version numbers of crystal, os and openssl as well as a reproducible example if possible.
rohitpaulk has joined #crystal-lang
<FromGitter> <vonKingsley> Thanks @straight-shoota i think reproducible code will be the tough part, but I'll see if can come up with some.
<FromGitter> <straight-shoota> Maybe just try to generate a random file with about the same size and try to post it to a Crystal HTTP::Server.
<FromGitter> <straight-shoota> If you're lucky it might fail with the same error :D
duane has quit [Remote host closed the connection]
<FromGitter> <vonKingsley> thanks I'll give that a try
Groogy2 has quit [Quit: WeeChat 2.0.1]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<heaven31415> Is there a way to loop some finite amount of times inside macro instead of looping through some collection? Like {% 5.times %} or something.
t0nyandre has joined #crystal-lang
<FromGitter> <straight-shoota> In macros you can use a for loop: https://crystal-lang.org/docs/syntax_and_semantics/macros.html ⏎ ⏎ ```{% for i in (0..10) %} ⏎ puts "{{ i }}" ⏎ {% end %}``` [https://gitter.im/crystal-lang/crystal?at=5ab2ce42a60157d62f141a23]
Creatornator has joined #crystal-lang
<heaven31415> thank you, maybe I will try to add this to gitbook
duane has joined #crystal-lang
alex`` has quit [Quit: WeeChat 2.0.1]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Creatornator has joined #crystal-lang
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Creatornator has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
t0nyandre has quit [Quit: Leaving]
IRATEEE has joined #crystal-lang
IRATEEE is now known as t0nyandre
rohitpaulk has joined #crystal-lang
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Yxhuvud has quit [Read error: Connection reset by peer]
Yxhuvud has joined #crystal-lang
Creatornator has joined #crystal-lang
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]