ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.21.1 | Fund Crystal's 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
<FromGitter> <picatz> @KCreate I've never touched rails myself.
<FromGitter> <picatz> ( late to the partayyy on that one / was in class )
danielpclark has joined #crystal-lang
<FromGitter> <elorest> @fridgerator I didn't check what the current test coverage was at before I said that. However there's an old joke in rails that no matter how many tests you have you always need 1% more.
<FromGitter> <domgetter> How do you convert an Int32 to a UInt32 ? `as` isn't working
<FromGitter> <mverzilli> https://crystal-lang.org/api/0.21.1/Int32.html#to_u32%3AUInt32-instance-method
<FromGitter> <fridgerator> @elorest lol, gotcha
_whitelogger has joined #crystal-lang
olek_poz has joined #crystal-lang
sz0 has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondi has joined #crystal-lang
<FromGitter> <Zhomart> Hi, how to get ENV variable on compile time?
<FromGitter> <Zhomart> found it, macro `env`.
olek_poz has quit [Ping timeout: 268 seconds]
InternetFriend has joined #crystal-lang
InternetFriend has quit [Ping timeout: 260 seconds]
olek_poz has joined #crystal-lang
mark_66 has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
blufor has quit [Ping timeout: 246 seconds]
blufor has joined #crystal-lang
greengriminal has joined #crystal-lang
greengriminal has quit [Quit: This computer has gone to sleep]
danielpclark has quit [Remote host closed the connection]
greengriminal has joined #crystal-lang
ostholz has joined #crystal-lang
ostholz has quit [Client Quit]
bjz has joined #crystal-lang
olek_poz has quit [Ping timeout: 260 seconds]
greengriminal has quit [Quit: This computer has gone to sleep]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
<jokke> while requiring "spec2": can't find file 'spec2' relative to
<jokke> any idea what's going on here?
<jokke> i have spec2 in my deps and it's installed
<jokke> there's a spec2 dir in lib/
<jokke> happens with v 0.21.1
<jokke> (at least)
<jokke> fresh project from crystal init
<FromGitter> <mjago> @jokke I’ve seen that before. Have you left any source files open (in editor)
<jokke> yes
<jokke> well not anymore
<jokke> still get the message
<FromGitter> <mjago> That does stuff like that for me
<FromGitter> <mjago> *meant open and edited
<FromGitter> <mjago> try running crystal tool format . may find whats causing it
<jokke> Error:, couldn't format './lib/spec2/src/next/dsl.cr', please report a bug including the contents of it: https://github.com/crystal-lang/crystal/issues
<FromGitter> <mjago> hmm
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
greengriminal has joined #crystal-lang
mark_66 has quit [Remote host closed the connection]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
InternetFriend has joined #crystal-lang
onionhammer has quit [Ping timeout: 240 seconds]
onionhammer has joined #crystal-lang
InternetFriend has quit [Ping timeout: 260 seconds]
bjz has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
greengriminal has quit [Quit: This computer has gone to sleep]
<bmcginty> Anyone here interfaced with the libevent bits behind crystal? was looking to hook libcurl up that way. If not, it should be fun to learn.
mroth has quit [Quit: Updating details, brb]
mroth has joined #crystal-lang
<FromGitter> <bew> https://carc.in/#/r/1tx8
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vSwxv
<crystal-gh> crystal/master 4ba262d Ary Borenszweig: Fixed #4254: Module validation failed with default debug
<FromGitter> <bew> they are some issues when defining a macro named `dump`
<FromGitter> <bew> need to go, don't have time to open an issue, I'll do it later
Renich has joined #crystal-lang
<Renich> Hey, Cristalians! o/
* Renich just discovered crystal on dockerhub
<Renich> ... what a let down... Ubuntu based... :S
<adam12> \o
<FromGitter> <redcodefinal> I'm having issues adding instance methods to a struct after it's initialization.
<FromGitter> <redcodefinal> My icr output ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=58e7ce2708c00c092a5adece]
tax has joined #crystal-lang
<DavidAlexander[m> renich: There has been some effort into cross-compiling and putting it on Alpine, but no joy so far with MUSL
DavidAlexander[m has left #crystal-lang ["User left"]
DavidAlexander[m has joined #crystal-lang
<DavidAlexander[m> test
DavidAlexander[m is now known as thelonelyghost
<Renich> DavidAlexander[m: well, that sounds much better.
<Renich> I hope some progress can be made on that regard
<Renich> what is the MUSL test, btw?
<Renich> ok, libc test; found out
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vSrv5
<crystal-gh> crystal/master 2229513 Ary Borenszweig: WeakRef: use instance_sizeof in allocate
sz0 has quit [Quit: Connection closed for inactivity]
olek_poz has joined #crystal-lang
<FromGitter> <drosehn> @bew : I expect the problem is because within macros, there is an instance-method named debug. Though obviously the messages that the compiler to an attempt to define a new `macro dump` could be more helpful! I wonder if there would be similar errors for other methods defined for use with macros: https://crystal-lang.org/api/Crystal/Macros.html
<FromGitter> <drosehn> *(I wrote that some time ago, but forgot to hit `return`...)*
greengriminal has joined #crystal-lang
<FromGitter> <redcodefinal> What does the star mean at the beginning of the arguments definition in this method def? ⏎ ⏎ ``` def initialize(*, r : Int32, g : Int32, b : Int32)``` [https://gitter.im/crystal-lang/crystal?at=58e7dfc94cb8d091736ba881]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vSrqk
<crystal-gh> crystal/master d3ae522 Ary Borenszweig: Fixed #4249: parse error with macros with %{}
<BlaXpirit> redcodefinal, all arguments after star cannot be positional arguments
<BlaXpirit> which seems like just an annoying limitation, badly used in this case
<FromGitter> <redcodefinal> @BlaXpirit do you mean that i can't call this method like `Aclass.new(r=1,b=2,g=3)`?
<BlaXpirit> redcodefinal, no that you can't call it Aclass.new(1,2,3)
<FromGitter> <redcodefinal> @BlaXpirit oh so I have to use `(r=1` etc etc
<BlaXpirit> yes
<FromGitter> <redcodefinal> Cool ty for the tip that would have driven me up a wall to try to figure out why that wasn't working the way I wanted
<FromGitter> <asterite> `r: 1, g: 2, b: 3` (instead of `=`)
<FromGitter> <redcodefinal> ty @asterite
<FromGitter> <redcodefinal> oh btw anyone here going to the Crystal CodeCamp in san fran?
greengriminal has quit [Quit: Leaving]
<FromGitter> <sdogruyol> @redcodefinal i am going
leonardschuetz has joined #crystal-lang
leonardschuetz is now known as KCreate
<KCreate> Hey everyone, is there a way to check if a type is defined at compile time?
<KCreate> maybe via macro?
<BlaXpirit> i think not
<BlaXpirit> they'd tell you that you're not supposed to need this
<Yxhuvud> may be needed eventually so easen up to simplyfy depending on having any of multiple different libs
<Yxhuvud> (wtf sentence building)
olek_poz has quit [Ping timeout: 268 seconds]
<BlaXpirit> lol
_whitelogger has joined #crystal-lang
KCreate has quit [Ping timeout: 260 seconds]
bjz has joined #crystal-lang
KCreate has joined #crystal-lang
<FromGitter> <chuckremes> question… I have created a record like so: `record GreetCommand, name : Symbol = :greet` and then created a channel to send it down like so: `ch = Channel(GreetCommand).new(2)
<FromGitter> <chuckremes> Hmmm, while rubber ducking this here I may have a solution… never meind for now :)
<FromGitter> <chuckremes> solved it (for now).
<FromGitter> <chuckremes> Just spiked a (very) simple proof-of-concept for doing actors in crystal a la ruby’s `celluloid` gem. It’s rough and all of the dynamically generated code produced by ruby was hand written, but it works. I now need to clean it up and dive into the `macro` system to see how to generate/write classes at compile time.
<FromGitter> <chuckremes> neat language (and fast!)
<FromGitter> <chuckremes> time for a well deserved adult beverage. have a nice weekend.
onionhammer has quit [Read error: Connection reset by peer]
onionhammer has joined #crystal-lang
fenicks has joined #crystal-lang
KCreate has quit [Quit: leaving]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter> <jwoertink> Anyone know what the crystal equivalent would be of this ruby code?
<FromGitter> <jwoertink> ```2.3.3 :084 > Marshal.dump("abc") ⏎ => "\x04\bI\"\babc\x06:\x06ET" ``` [https://gitter.im/crystal-lang/crystal?at=58e819d1f22385553d1cef26]
ssvb has joined #crystal-lang
Renich___ has joined #crystal-lang
Renich has quit [Ping timeout: 240 seconds]
Renich___ has quit [Quit: Renich___]
<FromGitter> <bew> @drosehn I don't think thats what you described (or I didn't understood...), see my issue #4257
<DeBot> https://github.com/crystal-lang/crystal/issues/4257 (Macro `dump` breaks compilation )
tax has left #crystal-lang ["Leaving"]
bjz has joined #crystal-lang
<FromGitter> <bew> @jwoertink if you want to do (de)serialization of classes state you can use to/from_json/yaml... If you need byte level (de)serialization you should go with
<FromGitter> <jwoertink> Cool. That's what I figured
<FromGitter> <bew> Roughly, the Crystal version would be `"abc".to_json` or sth :smile:
<FromGitter> <jwoertink> haha. Not quite, but I'm running with that anyway
<FromGitter> <jwoertink> Thanks for the msgpack suggestion!
<FromGitter> <bew> You're welcome! There is also a BSON lib (https://github.com/jeromegn/bson.cr) but the last commit is 11 month ago, and does not compile with current crystal version last time I checked :worried:
<FromGitter> <jwoertink> yikes. Yeah. JSON will work for now. It will limit the users, but not in a horrible way
<FromGitter> <jwoertink> and things will always progress later anyway