RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.26.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
<jokke> hey o/ (how) can i map bit fields of c structs in crystal?
<jokke> ah i see
akaiiro has quit [Ping timeout: 250 seconds]
Tortice has joined #crystal-lang
akaiiro has joined #crystal-lang
moei has joined #crystal-lang
_whitelogger has joined #crystal-lang
druonysus has quit [Ping timeout: 252 seconds]
Heaven31415 has quit [Quit: Leaving]
akaiiro has quit [Ping timeout: 268 seconds]
akaiiro has joined #crystal-lang
<FromGitter> <proyb6> @Blacksmoke16 CRSerializer readme stated Symphony but it’s Symfony
akaiiro has quit [Remote host closed the connection]
_whitelogger has joined #crystal-lang
_whitelogger has joined #crystal-lang
<FromGitter> <fusillicode_twitter> Am I reading the doc right? Does File.write support only file names & not paths?
<FromGitter> <fusillicode_twitter> Ok nevermind
<FromGitter> <fusillicode_twitter> It does support paths but only absolute, at least it so seems :)
<FromGitter> <girng> Good morning!!
<FromGitter> <girng> I'm up early, almost 2:00am here lolz.
<FromGitter> <fusillicode_twitter> It's so early that it feels kind of late @girng XD
<FromGitter> <fusillicode_twitter> Try to get some more sleep buddy! XD
ashirase has quit [Ping timeout: 246 seconds]
ashirase has joined #crystal-lang
return0xe has quit [Remote host closed the connection]
<FromGitter> <girng> my sleep schedule is screwed lol
<FromGitter> <fusillicode_twitter> I know that feeling
<FromGitter> <girng> tmw when i finally moved to crystal.... feelsgoodman
return0e has joined #crystal-lang
_whitelogger has joined #crystal-lang
ua_ has quit [Ping timeout: 252 seconds]
ua has joined #crystal-lang
<FromGitter> <ljuti> Just noticed that https://play.crystal-lang.org/ is an Ember app πŸ‘
<FromGitter> <ljuti> My favorite JS web app framework
<FromGitter> <fusillicode_twitter> Question about generics...
<FromGitter> <fusillicode_twitter> ```record ArrayPresentObject, x : Array(T) do ⏎ # just some instance methods ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=5bc32c576e5a401c2d6d7b94]
<FromGitter> <fusillicode_twitter> It seems that this is not allowed πŸ€”
<FromGitter> <fusillicode_twitter> Spoiler: as already known I'm a noob with Crystal & even more with generics πŸ˜…
<FromGitter> <fusillicode_twitter> (My mind is still shaped by my experience with dynamic programming languages)
<FromGitter> <vladfaust> @fusillicode_twitter it's not about generics but about `record` macro which does not support blocks afaik
<FromGitter> <fusillicode_twitter> @vladfaust I think that they support them :)
<FromGitter> <fusillicode_twitter> let me get a piece of code
<FromGitter> <vladfaust> I found it
<FromGitter> <vladfaust> Yes, it has {{yield}}
<FromGitter> <fusillicode_twitter> Yep
<FromGitter> <vladfaust> TIL
<FromGitter> <fusillicode_twitter> I was just writing a carc
<FromGitter> <fusillicode_twitter> but you've been faster XD
<FromGitter> <vladfaust> So, you might want to do `record ArrayPresentObject(T)`
<FromGitter> <fusillicode_twitter> Oh yeah! That's it! It's working ;)
<FromGitter> <vladfaust> Because generic variables must be within generic types πŸ€“
<FromGitter> <fusillicode_twitter> Thanks as always πŸ™‡β€β™‚οΈ ⏎ P.S: you may have guessed that I'm trying to add a `present` validations and open a PR ;)
<FromGitter> <vladfaust> Please follow Angular commit style!
<FromGitter> <fusillicode_twitter> > Because generic variables must be within generic types πŸ€“ ⏎ ⏎ that makes sense
<FromGitter> <fusillicode_twitter> Uhm let met check
<FromGitter> <vladfaust> I'll add .contributing to all my shards soon
<FromGitter> <vladfaust> Btw, I have a dout of naming that kind of rule `presence`... Shouldn't it be smth like `nil: false`? :thinking:
<FromGitter> <vladfaust> Yep, that' right. But no scopes
<FromGitter> <fusillicode_twitter> > Yep, that' right. But no scopes ⏎ ⏎ Got it
<FromGitter> <fusillicode_twitter> Regarding the naming it all depends on the rule internals IMHO
<FromGitter> <vladfaust> I wonder what is your PR involving Arrays πŸ˜…
<FromGitter> <vladfaust> Btw, if you have doubts about commit style, just take a look at any of my shards' commits
<FromGitter> <fusillicode_twitter> > Btw, if you have doubts about commit style, just take a look at any of my shards' commits ⏎ ⏎ That's the first thing that I've done ;)
<FromGitter> <vladfaust> ☺️
<FromGitter> <fusillicode_twitter> Regarding the validation rule, well I had in mind to build something that complies to the `present?` (https://api.rubyonrails.org/classes/Object.html#method-i-present-3F)
<FromGitter> <vladfaust> I don't get it. You want to patch `Object`?
<FromGitter> <fusillicode_twitter> Nope nope
<FromGitter> <fusillicode_twitter> I had in mind to simply build a validation that would tell if you have a nil, an empty string, an empty array or an empty hash
<FromGitter> <vladfaust> I don't like it!
<FromGitter> <vladfaust> Shouldn't it be better to split into two rules: `nil` and `empty`?
<FromGitter> <fusillicode_twitter> I can guess the reason but can you articulate it :)
<FromGitter> <fusillicode_twitter> Oh well
<FromGitter> <fusillicode_twitter> I like it :)
<FromGitter> <vladfaust> It's more explicit
<FromGitter> <vladfaust> *achually*
<FromGitter> <fusillicode_twitter> πŸ‘
<FromGitter> <fusillicode_twitter> I'll try to submit 2 PRs
<FromGitter> <vladfaust> If you dare! 😈
<FromGitter> <fusillicode_twitter> well 2 PRs, 1 for the `nil` and 1 for the `empty`, not 1 for the `presence` XD
<FromGitter> <vladfaust> Yes, yes, do it!
<FromGitter> <vladfaust> Add specs!
<FromGitter> <fusillicode_twitter> Don't worry, I'm a Rubyist. I'll begin working from the specs! ;D
<FromGitter> <fenicks> Hi
<FromGitter> <bew> Hello
<FromGitter> <drum445> Hullo
<FromGitter> <fusillicode_twitter> πŸ‘‹πŸ˜„
<FromGitter> <drum445> Does anyone know why this doesn't work please? https://play.crystal-lang.org/#/r/58hg
<FromGitter> <drum445> can't use module vars within a class :(
<FromGitter> <fusillicode_twitter> mmm
<FromGitter> <fusillicode_twitter> Maybe the `puts @@name` searches the `@@name` of the encapsulating class and not the one of the encapsulating module πŸ€”
<FromGitter> <Blacksmoke16> @proyb6 oops! Good catch, thanks!
<FromGitter> <j8r> yes it's what @fusillicode_twitter said @drum445
<FromGitter> <j8r> @drum445 https://play.crystal-lang.org/#/r/58if
<FromGitter> <fusillicode_twitter> Wow, I'm begging to understand something than! 😱 πŸŽ‰
<FromGitter> <drum445> ah nice one @j8r, cheers
_whitelogger has joined #crystal-lang
<FromGitter> <drum445> would it be better practice to pass the module variable into the class, if said class isn't part of the module?
<FromGitter> <drum445> asking as I can't see any docs online around class_getter
<FromGitter> <drum445> I guess my question is, which is better? https://play.crystal-lang.org/#/r/58iw
<FromGitter> <drum445> bearing in mind the class will be in a seperate directory/file
<FromGitter> <kingsleyh> @fenicks Hey - I have released my crystal-rethinkdb driver now - seems to be working for my old projects: https://github.com/kingsleyh/crystal-rethinkdb
<FromGitter> <kingsleyh> @straight-shoota and @dscottboggs_gitlab - I had a look through the rethinkdb code this weekend - and have created my own version that updates the original repo to work with 0.26.1 and takes the authentication stuff from the newer rethinkdb-lite repo and merges them together - since the older repo had way better coverage of the api - so at least it's working now - I did more of a patch up job to get it
<FromGitter> ... working than a proper overhaul - but I'd say it's functioning about the same as it used to now
<FromGitter> <j8r> @drum445 I'd say https://play.crystal-lang.org/#/r/58j1
<FromGitter> <j8r> but don't know the code, can't say it's the best in your case
<FromGitter> <drum445> yep that works best I think, I have a BaseRepo class which will contain that include line. Then all the repos that inherit off it will also have access to @@name
<FromGitter> <drum445> Thanks again!
<FromGitter> <drum445> although including the entire module (as it contains kemal routes) seems overkill, so for this use case I think I'll pass it through the the baserepo initializer
<FromGitter> <chussenot> ```code paste, see link``` ⏎ ⏎ Caramba, running `spec` failed one time on my laptop [https://gitter.im/crystal-lang/crystal?at=5bc37072435c2a518ea7ad85]
<FromGitter> <j8r> `Channel#<<` for `Channel#send`. I know aliases are bad, but we already have `Array#<<` `Array#push`
<FromGitter> <j8r> or replace `send` by `<<`
<FromGitter> <chussenot> Do you have an Idea to remove line break before parsing `.json` file?
<FromGitter> <chussenot> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5bc3749dc7bf7c36620ed2e2]
<FromGitter> <j8r> @chussenot give a little example on carc.in
<FromGitter> <chussenot> I've got a `JSON::ParseException`
<FromGitter> <chussenot> ;)
<FromGitter> <chussenot> I will try more... before
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 252 seconds]
ua_ has joined #crystal-lang
ua has quit [Ping timeout: 268 seconds]
Heaven31415 has joined #crystal-lang
<Heaven31415> Hi
<FromGitter> <ljuti> Porting some Ruby code over, what’s the best way to deal with the absence of `.send`?
<FromGitter> <j8r> Call directly the method? Or do a `case; when` if there is no other choices
<FromGitter> <ljuti> Yeah, `case; when` seems like the best bet
return0e has quit [Remote host closed the connection]
<FromGitter> <fenicks> @kingsleyh Yep thank you I'll try it soon.
tankf33der has joined #crystal-lang
return0e has joined #crystal-lang
pabs has quit [Ping timeout: 252 seconds]
<FromGitter> <kingsleyh> hi - what has `SecureRandom.hex` been replaced with?
<FromGitter> <kingsleyh> oh found it: `Random::Secure.hex `
pabs has joined #crystal-lang
marmotini_ has joined #crystal-lang
marmotini_ has quit [Quit: Leaving]
marmotini_ has joined #crystal-lang
akaiiro has joined #crystal-lang
marmotini_ has quit [Ping timeout: 245 seconds]