jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.28.0 | 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
lucasb has quit [Quit: Connection closed for inactivity]
alexherbo2 has joined #crystal-lang
alexherbo285 has quit [Ping timeout: 258 seconds]
waheedi has quit [Quit: waheedi]
<FromGitter> <tenebrousedge> sheesh. That was difficult. I'm kinda sad that CodeSignal (formerly CodeFights) doesn't have Crystal as an option
<FromGitter> <tenebrousedge> ```code paste, see link``` ⏎ ⏎ look ma, no indexes [https://gitter.im/crystal-lang/crystal?at=5cd8d08fbdc3b64fcf37ec10]
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter> <watzon> It would be really nice if they did. Hopefully someday.
waheedi has joined #crystal-lang
<FromGitter> <watzon> Correct me if I'm wrong, but the shards cli currently doesn't allow you to globally install a shard like you can with rubygems right?
<FromGitter> <watzon> It would be nice if one could do `shards install crystal-community/icr` to install icr globally without having to manually download, build, and then link the binary
waheedi has quit [Quit: waheedi]
waheedi has joined #crystal-lang
waheedi has quit [Quit: waheedi]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Remote host closed the connection]
tdc has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter> <alex-lairan> Hi, I'm trying to play with spawn in Crystal. ⏎ ⏎ I have an exception when I want receive a value : https://carc.in/#/r/6wt4 ⏎ ⏎ Any idea to fix this ? [https://gitter.im/crystal-lang/crystal?at=5cd92bf75a887e1cd9dcad31]
<FromGitter> <kaukas_gitlab> https://carc.in/#/r/6wt5
<FromGitter> <straight-shoota> @watzon No, dependencies are checked out directly into the `lib` folder of each shard. This is by design. Dependencies should not rely on global state. So everything's bundled in one place and there are no issues with mismatching version constraints.
<FromGitter> <watzon> @straight-shoota oh I'm not referring to installing a shard globally in that way, but rather installing a binary for a shard that's designated as an `app` rather than a `lib`
<FromGitter> <straight-shoota> That's not the purpose of `shards`.
<FromGitter> <straight-shoota> You just need to install the `icr` executable somewhere in your `PATH`
<FromGitter> <straight-shoota> @alex-lairan It works if you assign `@channel` to a closured local variable: ⏎ ⏎ ```channel = @channel ⏎ spawn do ⏎ channel.send proc.call ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=5cd932228fcdb05d47c9a570]
<FromGitter> <watzon> That's what I was wondering. It would be convenient if it could build and install a binary though.
<FromGitter> <straight-shoota> Yes, that would certainly be great. It's not easy though. And I'd probably see this more as a separate tool from `shards`.
<FromGitter> <alex-lairan> Thanks for your help !
<FromGitter> <straight-shoota> @alex-lairan #7771
<DeBot> https://github.com/crystal-lang/crystal/issues/7771 (Closured instance variable of a struct results in invalid memory access)
<FromGitter> <alex-lairan> 👍
<FromGitter> <watzon> Starting another very ambitious project. Wish me luck :) https://github.com/hydecr
return0e has quit [Ping timeout: 246 seconds]
return0e has joined #crystal-lang
<FromGitter> <codenoid> hi
<FromGitter> <straight-shoota> @watzon Have you seen https://github.com/straight-shoota/criss ?
alexherbo21 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 246 seconds]
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter> <mwlang> What's Crystal's equivalent to Ruby's File::NULL?
<FromGitter> <r00ster91> maybe `File::DEVNULL`?
<FromGitter> <mwlang> that worked! thanks
<FromGitter> <j8r> not very portable name :/
<FromGitter> <r00ster91> yea it should be called `File::NULL`. This is really windows unfriendly
<FromGitter> <mwlang> what would be more portable?
<FromGitter> <r00ster91> `File:NULL`
<FromGitter> <j8r> @r00ster91 👍
<FromGitter> <mwlang> or maybe my real question is what makes a name portable or not?
<FromGitter> <j8r> when there are platform specific terminologies
<FromGitter> <r00ster91> `FileUtils` has the same problem
<FromGitter> <r00ster91> I really think some should be renamed. They are not windows friendly at all and it doesn't look very Rubyish either
<FromGitter> <j8r> Yes, that's very UN*X inspired.
<FromGitter> <j8r> `File` and `Dir` too, they aren't OOP either
<FromGitter> <r00ster91> #7772
<DeBot> https://github.com/crystal-lang/crystal/issues/7772 (Rename File::DEVNULL to File::NULL)
OvermindDL1 has quit [Ping timeout: 252 seconds]
mntmn has quit [Ping timeout: 248 seconds]
OvermindDL1 has joined #crystal-lang
mntmn has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron- has joined #crystal-lang
<FromGitter> <parruda> Good morning folks! Is there a way to disable macros when compiling?
<FromGitter> <tenebrousedge> interesting question. Why?
<FromGitter> <r00ster91> no there's no way to make the usage of macros impossible
jeremycw has joined #crystal-lang
<FromGitter> <r00ster91> I would just not use them. Or do you want to restric a user that uses your library maybe?
<FromGitter> <parruda> yep, that’s what it is
<FromGitter> <Blacksmoke16> could make the macro private
<FromGitter> <Blacksmoke16> pretty sure they are also constrained by the private/protected modifiers
<FromGitter> <parruda> actually that’s not what it is, I was confused
<FromGitter> <parruda> the use case is: I am compiling things for the user
<FromGitter> <r00ster91> ooh so you want to restrict a macro, not the usage of macros in general
<FromGitter> <parruda> no i want to restrict use of macros
<FromGitter> <parruda> Like crystal build —no-macros
<FromGitter> <parruda> haha
<FromGitter> <r00ster91> but why would it be bad for you that the user uses macros?
<FromGitter> <r00ster91> you can compile things for the user though
<FromGitter> <Blacksmoke16> and i lied, can only mark them private
<FromGitter> <yxhuvud> that is not possible, there is a lot of macros all over the place in stdlib.
<FromGitter> <parruda> Right ok. Just for security purposes, that’s all
<FromGitter> <parruda> but there are other ways around it. I just thought of asking this first because that’d be the easier way
<FromGitter> <straight-shoota> I could definitely see some kind of safe mode for macros to avoid executing arbitrary commands on the build system. You probably wouldn't need to disable macros alltogether (which would pretty much cripple parts of the stdlib) but disallowing features such as running commands (``` `` ``` ) and executing Crystal files (`run`).
DeBot has quit [Ping timeout: 252 seconds]
<FromGitter> <mwlang> @Blacksmoke16 Thanks for sharing this Athena snippet. I'm needing this very pattern in what I'm building now. Really elegant solution, esp. in Crystal.
<FromGitter> <Blacksmoke16> np, its up on github under the `di` branch if you wanted to play with it
<FromGitter> <Blacksmoke16> but considering its still a WIP some things may change here and there
<FromGitter> <Blacksmoke16> few more things id like to figure out before merging it in
<FromGitter> <mwlang> it's ok...it's more like the working concept that was important for me. I couldn't figure out how to do this
<FromGitter> <Blacksmoke16> ah fair enough
<FromGitter> <Blacksmoke16> main things left to figure out would be auto injecting services for other services, as you would have to make sure to resolve dependencies in order so you do not try to inject one that hasn't be registered yet
<FromGitter> <Blacksmoke16> also maybe a better way for the injection, are work arounds for this but it would be nice to be able to directly inject tagged services, or services of a given type into a class
<FromGitter> <Blacksmoke16> TBD :p
<FromGitter> <mwlang> you're talking about circular referencing, right?
<FromGitter> <mwlang> at least that's what I kept bumping into myself.
<FromGitter> <Blacksmoke16> yea something like
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5cd9894e56271260f955b86c]
<FromGitter> <Blacksmoke16> where a service depends on another service
<FromGitter> <Blacksmoke16> but could be deeply dependent
<FromGitter> <Blacksmoke16> currently to get this to work would have to do like ⏎ ⏎ ```@[Athena::DI::Register(Store.new] ⏎ class SomeClass``` [https://gitter.im/crystal-lang/crystal?at=5cd9899df251e60ffa759924]
<FromGitter> <Blacksmoke16> not terrible but deff not optimal if you have multiple services depending on the one. have some ideas on how to fix this but will see how it goes
<FromGitter> <mwlang> I'll keep an eye out here for your progress. I'm not in position to try to leverage this new knowledge yet, but definitely added to my refactor todo list.
<FromGitter> <Blacksmoke16> 👍
<FromGitter> <mwlang> trying to push through getting a working MVP first and then come back around to refactoring for more robust and modularized approach.
<FromGitter> <Blacksmoke16> sounds like a plan
<FromGitter> <silmanduin66> Hello, is there a way to the client IP address from a get or post request to my Crystal server?
<FromGitter> <jwoertink> I think `remote_address` is what you're looking for https://crystal-lang.org/api/0.28.0/HTTP/Request.html#remote_address:String?-instance-method
<FromGitter> <silmanduin66> thanks
moei has joined #crystal-lang
nathanj has joined #crystal-lang
hightower2 has joined #crystal-lang
<FromGitter> <silmanduin66> @jwoertink do you know how i can also get the ```X-Forwarded-For``` ?
<FromGitter> <alex-lairan> Hi guy's ! ⏎ ⏎ It is possible to have a review on my code here ? ⏎ https://github.com/alex-lairan/monads/pull/45 ⏎ ... [https://gitter.im/crystal-lang/crystal?at=5cd9bcdc56271260f9573b9e]
_whitelogger has joined #crystal-lang