jhass changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Crystal 0.35.1 | Fund Crystal's development: https://crystal-lang.org/sponsors | GH: https://github.com/crystal-lang/crystal | Docs: https://crystal-lang.org/docs | Gitter: https://gitter.im/crystal-lang/crystal
postmodern has joined #crystal-lang
gangstacat has quit [Ping timeout: 260 seconds]
gangstacat has joined #crystal-lang
f1refly has joined #crystal-lang
f1reflyylmao has quit [Ping timeout: 260 seconds]
zorp has joined #crystal-lang
alexherbo2 has joined #crystal-lang
_whitelogger has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 256 seconds]
psydroid has quit [Quit: killed]
ryanprior has quit [Quit: killed]
return0e[m] has quit [Quit: killed]
psydroid has joined #crystal-lang
hamoko[m] has joined #crystal-lang
ryanprior has joined #crystal-lang
return0e[m] has joined #crystal-lang
renich has joined #crystal-lang
renich has quit [Client Quit]
renich has joined #crystal-lang
Andriamanitra has quit [Ping timeout: 260 seconds]
Andriamanitra has joined #crystal-lang
renich has quit [Ping timeout: 246 seconds]
renich has joined #crystal-lang
Human_G33k has quit [Ping timeout: 264 seconds]
HumanG33k has joined #crystal-lang
renich has quit [Ping timeout: 240 seconds]
renich has joined #crystal-lang
deavmi_ has quit [Read error: No route to host]
deavmi has joined #crystal-lang
renich has quit [Ping timeout: 246 seconds]
renich has joined #crystal-lang
renich has quit [Ping timeout: 240 seconds]
Human_G33k has joined #crystal-lang
HumanG33k has quit [Ping timeout: 240 seconds]
renich has joined #crystal-lang
<FromGitter> <acoolstraw> hey, I'm trying to generate docs for crystal-gobject, but when I do `./gi-doc`, it says `Please give one or more GIR namespaces!`
<FromGitter> <acoolstraw> nevermind, `Gtk` worked, but it's just an empty page
xyhuvud has joined #crystal-lang
yxhuvud has quit [*.net *.split]
FromGitter has quit [*.net *.split]
FromGitter has joined #crystal-lang
return0e[m] has quit [Read error: Connection reset by peer]
psydroid has quit [Write error: Connection reset by peer]
ryanprior has quit [Remote host closed the connection]
hamoko[m] has quit [Remote host closed the connection]
return0e[m] has joined #crystal-lang
<postmodern> can you override getter/setter fields in a struct?
<postmodern> have a weird edge-case where a field should be an enum, except the field is UInt32, but the enum is UInt8, so i need to map the raw value to the enum
<FromGitter> <Blacksmoke16> cant just do that in the initializer?
<postmodern> Blacksmoke16, that would handle the setting, but not the getting
<FromGitter> <Blacksmoke16> but once you convert it to the enum, isnt it fine now?
<FromGitter> <Blacksmoke16> like
<FromGitter> <Blacksmoke16> ```@enum = Enum.from_value value```
<postmodern> Blacksmoke16, also this is a C lib struct, so can't define custom initializer methods on it
<FromGitter> <Blacksmoke16> ah
<FromGitter> <Blacksmoke16> in that case im not sure
<postmodern> guess i'll have to wrap the struct in a class and do the translation there
hamoko[m] has joined #crystal-lang
psydroid has joined #crystal-lang
ryanprior has joined #crystal-lang
<deimos_> after learning crystal last week, i've migrated some ruby programs to crystal, which was far easier than i expected. this week is chasing down "Index Out of Bounds" errors that i didn't know i had with ruby ;)
<deimos_> i do need to figure out fibers or some other way to go horizontal since i have 100 cpus to use, rather than 1
<FromGitter> <grkek> Error: undefined constant CallStack
<FromGitter> <grkek> what does this even mean?
<FromGitter> <acoolstraw> hey
<FromGitter> <acoolstraw> I'm trying to generate docs for crystal-gobject, but it doesn't work. I've downgraded to 0.34.0, compiled crystal and shards myself, and built `gi-doc`, but it just gives me an empty page
<FromGitter> <Blacksmoke16> its called `Exception::CallStack` now
<FromGitter> <acoolstraw> `$ bin/gi-doc Gtk ⏎ Docs written to docs/gobject`
<postmodern> is there a better way to define a bunch of arguments that are optional, other than doing `x : Int32? = nil`?
<FromGitter> <Blacksmoke16> make another constructor?
<FromGitter> <acoolstraw> I think I fixed it
<FromGitter> <acoolstraw> nope
<FromGitter> <acoolstraw> still empty
<FromGitter> <grkek> @acoolstraw nice nu pogody pfp
<FromGitter> <grkek> gg
<FromGitter> <acoolstraw> haha thanks
zorp has quit [Ping timeout: 256 seconds]
<FromGitter> <grkek> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5f3453dc1f13b45edb72c3d8]
<FromGitter> <grkek> does anyone else have a problem with this?
<FromGitter> <dscottboggs_gitlab> what do you mean by a "problem"?
<FromGitter> <dscottboggs_gitlab> oh, I see never mind
<FromGitter> <Blacksmoke16> that method is added by jennifer
<FromGitter> <grkek> Yeah but where do I define it?
<FromGitter> <Blacksmoke16> might need to require the related adapter
<FromGitter> <Blacksmoke16> jennifer also implements it
<FromGitter> <Blacksmoke16> so might just be missing a require
<FromGitter> <grkek> require to what
<FromGitter> <grkek> I required the pg shard in the main file
<FromGitter> <Blacksmoke16> `require "jennifer/adapter/postgres"`
<FromGitter> <grkek> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5f3454ef1f13b45edb72c5b9]
<FromGitter> <grkek> its now this
<FromGitter> <Blacksmoke16> rip
<FromGitter> <grkek> tf is this even
<FromGitter> <dscottboggs_gitlab> 🌈 macros 🌈
<FromGitter> <grkek> I found it out
<FromGitter> <grkek> I was requiring the wrong file
<FromGitter> <grkek> sorry
<FromGitter> <grkek> thank you guys
<postmodern> weird just noticed that crystal C structs technically support mutli-dimensional arrays, but the order is backwards. Int32[2][24] creates 24 arrays of 2 Int32s.
<FromGitter> <grkek> It is not backwards
<FromGitter> <grkek> it is in a correct way
<FromGitter> <grkek> the C has it backwards
<postmodern> wow cool `delegate baz, to: @foo.bar` totally works
renich has quit [Read error: Connection reset by peer]
<FromGitter> <Blacksmoke16> neat
<postmodern> is there a macro method that can convert FOO_BAR ids to camel case?
<FromGitter> <Blacksmoke16> `.camelcase`?
Human_G33k has quit [Remote host closed the connection]
<postmodern> hmm .camelcase exists, but i can't find it in the docs. it doesn't seem to CamelCase SHOUT_CASE constants though. Just maps them to SHOUTCASE instead.
<FromGitter> <Blacksmoke16> `.stringify.camelcase`?