ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.19.4 | Fund Crystals development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
dev0urer has joined #crystal-lang
askn has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
idev0urer has quit [Ping timeout: 245 seconds]
askn has quit [Client Quit]
<FromGitter> <iDev0urer> @askn I've been playing around with it and all I've been able to come up with is this ⏎ ```code paste, see link``` ⏎ Records has to be defined in the class and the module isn't allowed to re-define it. Not quite sure why, maybe someone else can pipe in [https://gitter.im/crystal-lang/crystal?at=58153b030e25dbfa1176faca]
<FromGitter> <luislavena> @askn have you tried using `extended` macro instead?
<FromGitter> <luislavena> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=58153b310e25dbfa1176fb28]
<FromGitter> <luislavena> scratch that, just realized that `@type` will be RepoBar and not `Bar`
<FromGitter> <askn> @iDev0urer thanks it's work
<FromGitter> <askn> @luislavena i need to Array(Bar), how can i use T in macro block
Philpax_ has joined #crystal-lang
<FromGitter> <luislavena> @askn A workaround that works: usage of classes and `inherited` macro:
<FromGitter> <luislavena> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5815418683a2008d22e9af3f]
<FromGitter> <luislavena> it is possible that `extended` macro hook doesn't play nice with generics
<FromGitter> <luislavena> and last possible usage is `included`:
<FromGitter> <luislavena> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=58154276c3569a036e32b75c]
<FromGitter> <askn> thank you :+1:
matp has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter> <carlodicelico> Has anyone had an issue where, when running spec, the tests simply don't run?
<FromGitter> <carlodicelico> I'm doing crystal spec and instead of the tests running, my app is running
<FromGitter> <carlodicelico> crystal 0.19.4
<FromGitter> <luislavena> @carlodicelico what kind of app? is a Kemal one? is the spec doing a `require` that will run your app? (Say a CLI runner for example)
<FromGitter> <carlodicelico> Well, I'm doing the tutorial in the Crystal for Rubyists book and I have the simple Hello World Kemal app and the generated spec files
<FromGitter> <carlodicelico> and when I do crystal spec, the kemal app is running and the tests do not
<FromGitter> <carlodicelico> The spec is not requiring the kemal app, only the spec_helper
bjz has joined #crystal-lang
<FromGitter> <carlodicelico> ```carlodicelico at Maria in ~/Documents/Source/sample (master●) ⏎ $ crystal spec ⏎ [development] Kemal is ready to lead at http://0.0.0.0:3000```
<FromGitter> <carlodicelico> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=58155a54482c168b22cddd8d]
<FromGitter> <carlodicelico> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=58155a8f0e25dbfa11774faf]
<FromGitter> <carlodicelico> oh, interesting
<FromGitter> <carlodicelico> if I kill the process w/Ctrl+C, I get the test output
<FromGitter> <carlodicelico> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=58155b4f8ed1c0ff5c425fe6]
<FromGitter> <carlodicelico> if I change the test to be failing, it still says 0 failures when I Ctrl+C
<FromGitter> <carlodicelico> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=58155ee183a2008d22e9fd30]
<FromGitter> <carlodicelico> ah
<FromGitter> <carlodicelico> I got it
<FromGitter> <carlodicelico> well, the Kemal example from the book is still not working but I moved on to the Fizzbuzz chapter and that one didn't work initially, either, until I moved the code block for the div_by_three() function out of the Fizzbuzz module
<FromGitter> <carlodicelico> so, I think it's something about how I'm referencing it in the test
<FromGitter> <carlodicelico> yeah... so... when I wrap the block in a module, the test breaks even if I refer to the function the same way I would in Ruby, like `Fizzbuzz.div_by_three(1).should eq(false)`
<FromGitter> <carlodicelico> doh, okay
<FromGitter> <carlodicelico> I had to comment out Kemal.run to run the test in http://www.crystalforrubyists.com/book/chapter-05.html
<FromGitter> <carlodicelico> and remove the module generated by crystal init to test http://www.crystalforrubyists.com/book/chapter-06.html
<FromGitter> <carlodicelico> I imagine there must be or will be some way to do something like
<FromGitter> <carlodicelico> ```if not testing ⏎ Kemal run ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=581567f0806316005dd4e739]
<FromGitter> <carlodicelico> this is an awesome project - not so I/O bound as elixir (while addressing some of the same problems), so more general purpose, but more approachable and again more general purpose perhaps than something like Julia
<FromGitter> <carlodicelico> really cool - excited to see how things develop!
<FromGitter> <carlodicelico> love the channels :)
<crystal-gh> [crystal] wmoxam opened pull request #3486: Include amd64 because OpenBSD uses it in its target string (master...fix-openbsd-target) https://git.io/vXL96
<FromGitter> <johnjansen> @carlodicelico if testing = ENV["testing"] then yes there is a way, or look at macros
crystal-lang754 has joined #crystal-lang
crystal-lang754 has quit [Ping timeout: 260 seconds]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
dev0urer has quit [Quit: Konversation terminated!]
dev0urer has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
<FromGitter> <John-K> was trying to build crystal on ARMv7 but it seems there is no way of bootstrapping?
<FromGitter> <John-K> setup is Arch linux on ODROID XU-4
_whitelogger has joined #crystal-lang
dev0urer has quit [Ping timeout: 252 seconds]
<crystal-gh> [crystal] ysbaddaden pushed 1 new commit to master: https://git.io/vXLNE
<crystal-gh> crystal/master 5e4e05a Wesley Moxam: Include amd64 because OpenBSD uses it in its target string (#3486)
<travis-ci> crystal-lang/crystal#5e4e05a (master - Include amd64 because OpenBSD uses it in its target string (#3486)): The build was broken. https://travis-ci.org/crystal-lang/crystal/builds/171737525
mhib has joined #crystal-lang
<RX14> @John-K you bootstrap from x86 using --cross-compile and --target
<RX14> the ARM pr has examples
mhib has quit [Quit: Leaving]
<FromGitter> <John-K> aha, thanks!
<RX14> you end up with a .o file
<RX14> and a command to execute on the ARM device
<RX14> but you'll also need to download the crystal source on ARM
<RX14> and run `make llvm_ext libcrystal`
<RX14> which are two libraries written in C that need to be compiled to link the compiler
<RX14> if you're not linking the compiler you only need libcrystal
<FromGitter> <John-K> makes sense
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
<FromGitter> <John-K> thanks for the pointer
<RX14> after all that it might not work though
<RX14> i've had issues...
<FromGitter> <John-K> was reading about some of the issues from the ARM PR
<RX14> you might need to compile llvm 3.9 yourself
<RX14> which on ARM might take a while
<FromGitter> <John-K> ah, yeah arch only has 3.8.1
<RX14> oh... arch on arm
<RX14> yeah that should be better
<RX14> because the packages are more up to date
<RX14> I was running raspbian and had to use llvm 3.5
<RX14> 3.8 is worth a shot
<FromGitter> <John-K> ahh
<RX14> though i'm still not convinced that it is a llvm version issue...
<FromGitter> <John-K> was it failing at runtime?
<RX14> well, I could compile the compiler on LLVM 3.5
<RX14> cross-compile*
<RX14> and it worked to a point
<RX14> but then that compiler refused to compile anything
<RX14> which failed inside LLVM
<FromGitter> <John-K> ah
<RX14> not a segfault or other crash issue
<RX14> and that error message I got was aparrently solved by upgrading from llvm 3.5
<RX14> but i'm not convinced because llvm 3.5 managed to cross-sompile the compiler
<RX14> but it can't compile the compiler normally?
<RX14> thats just weird
<FromGitter> <nilq> Hello, everyone. Anyone got some examples on UDP socketing?
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vXLjw
<crystal-gh> crystal/master b351d65 Ary Borenszweig: Formatter: fix comment indentation in binary expressions. Fixes #3484
<travis-ci> crystal-lang/crystal#b351d65 (master - Formatter: fix comment indentation in binary expressions. Fixes #3484): The build is still failing. https://travis-ci.org/crystal-lang/crystal/builds/171752935
soveran has quit [Ping timeout: 252 seconds]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vXten
<crystal-gh> crystal/master 4126429 Ary Borenszweig: Fixed #3485: Can't make class method `new` private on generic class
<travis-ci> crystal-lang/crystal#4126429 (master - Fixed #3485: Can't make class method `new` private on generic class): The build is still failing. https://travis-ci.org/crystal-lang/crystal/builds/171755674
zotherstupidguy has quit [Quit: WeeChat 1.6]
<crystal-gh> [crystal] asterite pushed 2 new commits to master: https://git.io/vXtvr
<crystal-gh> crystal/master fe44fbc RX14: Add iteration time to Benchmark.ips
<crystal-gh> crystal/master bfb4c24 RX14: Fix IPS::Entry#human_mean for ips < 0.1...
<travis-ci> crystal-lang/crystal#fe44fbc (master - Add iteration time to Benchmark.ips): The build is still failing. https://travis-ci.org/crystal-lang/crystal/builds/171759909
<FromGitter> <carlodicelico> @johnjansen awesome, thanks!
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vXtf5
<crystal-gh> crystal/master 7e1afdb Ary Borenszweig: HTTP: fixed incorrect spec that depended on DST
<travis-ci> crystal-lang/crystal#7e1afdb (master - HTTP: fixed incorrect spec that depended on DST): The build is still failing. https://travis-ci.org/crystal-lang/crystal/builds/171762848
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Philpax_ has quit [Ping timeout: 260 seconds]
ponga has joined #crystal-lang
<FromGitter> <sdogruyol> @carlodicelico i think i need to update that book
<FromGitter> <sdogruyol> it maybe outdated
<RX14> why do I always seem to find bugs :/ https://github.com/crystal-lang/crystal/issues/3488
<FromGitter> <sdogruyol> you mess with Murphy and the bugs will come for you :)
<RX14> it seems that I find one or two in every project I write...
<FromGitter> <jwoertink> Well if you'd stop putting them there... 😜
<FromGitter> <sdogruyol> @RX14 so a case statement combines all the types into Union as result?
<RX14> well
<FromGitter> <jwoertink> 1st job of programmer: write bug. 2nd job of programmer: fix bug. 3rd??? 4th: profit
<FromGitter> <sdogruyol> :D
<RX14> the result of a union is the union of every clause
<RX14> s/union/case
<FromGitter> <sdogruyol> yeah
<RX14> but when you define an "else" with noreturn
<RX14> it shouldn't return nil
<FromGitter> <sdogruyol> obivously
<FromGitter> <sdogruyol> was it always like this ?
<RX14> but if you add multiple conditions for a clausethat breaks
<RX14> well I havent bisected
<FromGitter> <sdogruyol> makes me curious
<RX14> broken in 0.15.0 it seems
<RX14> looks like it's always been broken
<FromGitter> <johnjansen> @sdogruyol Nil is falsy, so that example is not broken (by my reading), bool is the return type, if the case returns at all its a bool
pawnbox has joined #crystal-lang
pawnbox has quit [Read error: Connection reset by peer]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
<FromGitter> <luislavena> The docs doesn't say how empty `when` is treated: https://crystal-lang.org/docs/syntax_and_semantics/case.html
<FromGitter> <luislavena> In the case of an empty `when` I guess `nil` is the default, which is why you're getting `Bool | Nil` union
<RX14> yeah that doesn't look like an empty when to me
<RX14> that looks like multiple conditions
pawnbox has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
pawnbox has quit [Ping timeout: 265 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
lacour has joined #crystal-lang
dev0urer has joined #crystal-lang
bjz has joined #crystal-lang
ponga has quit [Quit: Connection closed for inactivity]
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 260 seconds]
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
bjz_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 260 seconds]
bjz has joined #crystal-lang
bjz has quit [Read error: Connection reset by peer]
<FromGitter> <johnjansen> default return type for case is Nil https://play.crystal-lang.org/#/r/1d11
vifino- is now known as oniifiv
dev0urer has quit [Ping timeout: 252 seconds]
matp_ has joined #crystal-lang
matp has quit [Ping timeout: 260 seconds]
<Papierkorb> johnjansen, that's the "doesn't match anything" result. Same behaviour for `if`
soveran has joined #crystal-lang
Philpax_ has joined #crystal-lang
soveran has quit [Ping timeout: 252 seconds]