RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.24.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
qard has joined #crystal-lang
alex`` has quit [Quit: WeeChat 2.0.1]
qard has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yuskamal has joined #crystal-lang
Papierkorb has joined #crystal-lang
qard has joined #crystal-lang
qard has quit [Client Quit]
hightower has quit [Ping timeout: 276 seconds]
<FromGitter> <bew> It's really nice that when `{% debug %}` is the last thing in a macro, the generated code gets formatted before printing. I never noticed that before
qard has joined #crystal-lang
jnyw has joined #crystal-lang
<FromGitter> <faustinoaq> @bew Oh, I didn't know that crystal trick, Thank for sharing!
<FromGitter> <watzon> I kind of wish there was a `{% debug_start %}` and `{% debug_end %}`. Sometimes it would be nice to be able to just debug a block rather than everything above the debug
<FromGitter> <bew> yeah, or with anchors, like `{% debug_start foo %}` and later, `{% debug_since foo %}` for everything since the matching start, and `{% debug %}` would still be everything
greengriminal has joined #crystal-lang
qard has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
qard has joined #crystal-lang
qard has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
return0e_ has joined #crystal-lang
return0e has quit [Ping timeout: 256 seconds]
Papierkorb has left #crystal-lang ["Konversation terminated!"]
yuskamal has quit [Ping timeout: 260 seconds]
codenoid has joined #crystal-lang
sz0 has joined #crystal-lang
codenoid has quit [Ping timeout: 268 seconds]
moei has quit [Quit: Leaving...]
greengriminal has quit [Quit: Leaving]
moei has joined #crystal-lang
moei has quit [Client Quit]
moei has joined #crystal-lang
rohitpaulk has joined #crystal-lang
sz0 has quit [Quit: Connection closed for inactivity]
alex`` has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 256 seconds]
jnyw has quit [Quit: WeeChat 2.0.1]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 276 seconds]
hightower has joined #crystal-lang
Papierkorb has joined #crystal-lang
Papierkorb has left #crystal-lang ["Konversation terminated!"]
pta2002 has left #crystal-lang ["WeeChat 2.0.1"]
rohitpaulk has joined #crystal-lang
<FromGitter> <vlazar> Does anybody know if Kotlin-like syntax was considered for Crystal blocks? For example: ⏎ ⏎ ```ints = [1, 2, 3] ⏎ # it: implicit name of a single parameter ⏎ ints.map { it * 2 }``` ⏎ ⏎ https://kotlinlang.org/docs/reference/lambdas.html#it-implicit-name-of-a-single-parameter [https://gitter.im/crystal-lang/crystal?at=5a9bedcf6fba1a703ac7eb05]
<Yxhvd> What would be the point when we can write `ints.map &.*(2)`
<FromGitter> <vlazar> How this would look like if I need several operations?
<FromGitter> <vlazar> Like this ⏎ ⏎ ```ints.map { it * 2 + some_method(it) }``` [https://gitter.im/crystal-lang/crystal?at=5a9beeca458cbde557f3a083]
<FromGitter> <vlazar> I guess the syntax just looks a bit cleaner
<FromGitter> <vlazar> ```ints.map { |it| it * 2 + some_method(it) }```
<FromGitter> <vlazar> Not sure if implicitness is appealing for language designers.
<FromGitter> <aisrael> I think the `it` automatic block parameter is a bit too much magic. But then again, OTOH, we already have `self`.
<Yxhvd> I don
<Yxhvd> t know, I just know it doesn't come up that often in practice as the &. syntax tends to work most of the time
<FromGitter> <vlazar> Sure, `&.` is fine, but that's anther syntax, while `{ |value| }` and `{ it }` is more like single syntax
<FromGitter> <aisrael> Even the `&.syntax` to me is kind of a crude approximation of functions as first class objects. TBH, I'd probably like the `{ it -> it * 2 + some_method(it) }` syntax more, since it has perfect symmetry with the `&block : InputType -> OutputType` annotation
<FromGitter> <vlazar> @aisrael I take it like you don't like too much implicitness, but if it's simple and provides some value then it sounds interesting? :)
<FromGitter> <aisrael> That's why I brought up `self`. It's the OO equivalent of the implicit first parameter in e.g. Elixir.
<FromGitter> <vlazar> Yes, and you quickly learn what `self` means. When I first saw `it` in Kotlin's block it was pretty obvious what it is. And I like symmetry too.
<FromGitter> <vlazar> Without Ruby background the `&.method` syntax wouldn't be so obvious I guess, but I can't tell.
Arn has joined #crystal-lang
<Arn> Hello
<FromGitter> <arn-the-long-beard> Hello :)
Arn has quit [Client Quit]
<FromGitter> <arn-the-long-beard> I just discovered Crystal yesterday ^^ Huhu it is pretty fast :D
<FromGitter> <vlazar> Exactly. It is pretty. It is fast :)
<FromGitter> <arn-the-long-beard> And Simple to write Oo
<FromGitter> <arn-the-long-beard> I come from Node.js mainly, so I need time to adapt
<FromGitter> <arn-the-long-beard> Is the class HTTP::WebSocket only for making client on Crystal, or can I use it also as a server ?
<FromGitter> <faustinoaq> Hi crystal community, take a look to my new PR on Scry repo (Language Server Protocol for Crystal) https://github.com/crystal-lang-tools/scry/pull/53 I making scry faster and lightweight in both compilation and execution 😄
<FromGitter> <aisrael> 💪🏽
<FromGitter> <vlazar> @arn-the-long-beard You can take a look at Kemal https://github.com/kemalcr/kemal#super-simple-%EF%B8%8F
<FromGitter> <arn-the-long-beard> Thank you :) I downloaded the libraries, but I was wondering about trying to do it from scratch to understand how it is working :D
<FromGitter> <vlazar> ah, so that's for learning...
<FromGitter> <arn-the-long-beard> Exactly :D
<FromGitter> <vlazar> the sources are easy to read
<FromGitter> <vlazar> You'll learn quite a lot I guess, it's not a big framework
<FromGitter> <arn-the-long-beard> ok :)
<FromGitter> <arn-the-long-beard> I need to learn more the basics, I am not use to the python/ruby syntax
<FromGitter> <vlazar> I remember the only thing bothering me when I was learning Ruby after C-like syntax was `begin` and `end`, the `{` and `}` was kinda cleaner. But once you get used to it Ruby syntax is much more pleasant on an eye actually ;)
<FromGitter> <arn-the-long-beard> ok :D
<FromGitter> <arn-the-long-beard> For now, I do not need to make module.exports or import things as I do on Node, and this is disturbing xD
<FromGitter> <vlazar> I guess you are right... having named imports is more control, but Ruby ecosystem works pretty well without it.
<FromGitter> <arn-the-long-beard> more control but also more to read :) , well I ll continue my stuff on crystal. I will try to serve some html or something and come back to the websocket thing later :)
<FromGitter> <aisrael> Mainly because you're supposed to `include` a `module` at the `class` level. When you `import` in Javascript (or even in Java), you're bringing names into the global namespace of the current file, mostly.
badeball_ is now known as badeball
<FromGitter> <mxrguspxrt> Hello! I have trouble requiring secure random module. ⏎ ⏎ require 'secure_random' should be enough?
<FromGitter> <mxrguspxrt> Ok, in 0.24.1 it is not part of standard API any more?
<FromGitter> <vlazar> ```require "uuid" ⏎ UUID.random``` [https://gitter.im/crystal-lang/crystal?at=5a9c053ae4d1c63604be475e]
<FromGitter> <vlazar> is that what you need?
rohitpaulk has quit [Ping timeout: 268 seconds]
<FromGitter> <mxrguspxrt> Thank you!
Papierkorb has joined #crystal-lang
Papierkorb has left #crystal-lang ["Konversation terminated!"]
alex`` has quit [Quit: WeeChat 2.0.1]
alex`` has joined #crystal-lang
olbat has joined #crystal-lang
olbat has joined #crystal-lang
olbat has quit [Changing host]
alex`` has quit [Quit: WeeChat 2.0.1]
alex`` has joined #crystal-lang
<FromGitter> <mxrguspxrt> I have changed application logic, syntax validation works ok, but when it is executed, then old version logic is executed, not new code. Any suggestions how to solve this issue?
<FromGitter> <bew> @mxrguspxrt make sure you're actually executing the new code/binary
<FromGitter> <mxrguspxrt> I am always returning array of users, but I am getting error "type must be Array(User), not (Array(User) | Nil)". Why?
snsei has joined #crystal-lang
<oprypin> mxrguspxrt, you must prove that you're always returning array of users. the compiler does not agree.
<oprypin> it's all in the docs. but if you provide an example, we can investigate.
<FromGitter> <bew> He gave one (edited msg i think)
<oprypin> well have fun reading that, cuz i sure cant
jxv has joined #crystal-lang
<FromGitter> <bew> @mxrguspxrt what it the type of `@@saved` in your example?
<FromGitter> <bew> Well just replace your code by `class_getter saved = [] of User`, it will declare a class variable of the correct type with a default value, and a class method `saved` to access it
qard has joined #crystal-lang
DTZUZO has quit [Ping timeout: 256 seconds]
DTZUZO has joined #crystal-lang
hightower has quit [Ping timeout: 260 seconds]
DTZUZU has quit [Ping timeout: 256 seconds]
<FromGitter> <jwoertink> Hey all. I just pulled the latest master branch for crystal. I ran `make`, `make spec`, but when I run `./bin/crystal -v` it says `Crystal 0.23.0+557 [91a025fca] (2018-03-04)`.
<FromGitter> <jwoertink> Shouldn't that say 0.24?
<FromGitter> <jwoertink> or did I miss a step somewhere?
<FromGitter> <bew> on what commit are you?
<FromGitter> <jwoertink> I also tried running `make clean crystal` just in case
<FromGitter> <jwoertink> `91a025fca`
<FromGitter> <jwoertink> hmm.. that's not the last one....
<FromGitter> <jwoertink> hold up
<FromGitter> <bew> last one is `163c0cb0c`
<FromGitter> <bew> just compiled and got `Crystal 0.24.1+164 [163c0cb0c] (2018-03-04)`
<FromGitter> <jwoertink> I deleted the folder then re-cloned and running through it again
<FromGitter> <jwoertink> I may have had something weird there.
<FromGitter> <jwoertink> but good to know that it should say that.
jxv has quit [Quit: zzz…]
jxv has joined #crystal-lang
qard has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <jwoertink> ah ha! `Crystal 0.24.1+164 [163c0cb0c] (2018-03-04)`
<FromGitter> <jwoertink> Must have been cache or something. Thanks for the help!
vivus has joined #crystal-lang
DTZUZU has joined #crystal-lang
jxv has quit [Quit: zzz…]
hightower has joined #crystal-lang
snsei has quit [Remote host closed the connection]
hightower has quit [Ping timeout: 240 seconds]
DTZUZU has quit [Ping timeout: 240 seconds]
jxv has joined #crystal-lang
kotrcka has joined #crystal-lang
jxv has quit [Quit: zzz…]
snsei has joined #crystal-lang
DTZUZU has joined #crystal-lang
snsei has quit [Ping timeout: 276 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <watzon> Keep up the good work @faustinoaq
DTZUZO has quit [Ping timeout: 265 seconds]
DTZUZO has joined #crystal-lang
alex`` has quit [Quit: WeeChat 2.0.1]
daemonwrangler has quit [Quit: ZNC 1.6.5 - http://znc.in]
daemonwrangler has joined #crystal-lang
snsei has joined #crystal-lang
DTZUZU has quit [Ping timeout: 245 seconds]
snsei has quit [Ping timeout: 245 seconds]
jxv has joined #crystal-lang
jxv has quit [Quit: zzz…]
DTZUZU has joined #crystal-lang
<FromGitter> <codenoid> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a9c77e6e4d1c63604c05113]
<FromGitter> <codenoid> bad trace
codenoid has joined #crystal-lang
<FromGitter> <bew> This is a compiler bug, if you're using last crystal, can you reduce the code and open an issue?
<codenoid> umm, i have a lot of lines, i dont know from where this bug can reproduced
<codenoid> i'll try
rohitpaulk has quit [Ping timeout: 276 seconds]
snsei has joined #crystal-lang
jxv has joined #crystal-lang
DTZUZO has quit [Ping timeout: 256 seconds]
snsei has quit [Ping timeout: 252 seconds]
DTZUZO has joined #crystal-lang
<codenoid> got it
codenoid has quit [Ping timeout: 256 seconds]
DTZUZO has quit [Ping timeout: 268 seconds]
codenoid has joined #crystal-lang
codenoid has quit [Quit: i sleep in my keyboard]