RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.25.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
Creatornator has joined #crystal-lang
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Creatornator has joined #crystal-lang
<FromGitter> <Timbus> Oh, okay, so Crystal somehow messes with handles before I even open them in kernel.cr .. something in __crystal_main
<FromGitter> <Timbus> wow what a rabbithole
woodruffw has left #crystal-lang ["And then he took off."]
woodruffw has joined #crystal-lang
<FromGitter> <Timbus> Ugh, no, I'm just getting buried in all my small test cases.
abm has quit [Quit: Leaving]
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 244 seconds]
Raimondii is now known as Raimondi
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_whitelogger has joined #crystal-lang
Creatornator has joined #crystal-lang
Creatornator has quit [Client Quit]
alex`` has joined #crystal-lang
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 240 seconds]
DTZUZO has joined #crystal-lang
<FromGitter> <bararchy> Hi @bcardiff how goes the build?
<FromGitter> <bararchy> Or more correctly the signing of binaries
DTZUZO has quit [Ping timeout: 272 seconds]
ashirase has quit [Ping timeout: 248 seconds]
ashirase has joined #crystal-lang
<RX14> nobody wants to release on friday
<RX14> they're probably just signed waiting to go
DTZUZO has joined #crystal-lang
<FromGitter> <codenoid> `Error in csv_parser.cr:5: undefined method 'find_index' for Array(String)`
<FromGitter> <codenoid> it's work on ruby
<FromGitter> <codenoid> idk
<FromGitter> <cpunion> Hi, is there a way to compare crystal version in macro? I want `{% if Crystal::VERSION.split('.').map(&.to_i) < [0, 25, 0] %}`, it doesn’t work.
<FromGitter> <cpunion> Error: `undefined macro method 'ArrayLiteral#<‘`
<FromGitter> <cpunion> `[0, 24, 0] < [0, 25, 0]` works in non-macro code.
<FromGitter> <asterite> Li Jie there's a compare_versions macro method specifically for that
<FromGitter> <asterite> https://crystal-lang.org/api/0.25.1/Crystal/Macros.html#compare_versions%28v1%3AStringLiteral%2Cv2%3AStringLiteral%29%3ANumberLiteral-instance-method
<FromGitter> <cpunion> @asterite Thanks!
<FromGitter> <cpunion> I’m trying to fix `graphql-crystal`, in the following code: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Why? [https://gitter.im/crystal-lang/crystal?at=5b6ed8fa637ee66082d6a87d]
<FromGitter> <cpunion> I wasn’t tested it in crystal@0.24.1, I rewrote the line: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ And now it works in crystal@0.25.1. [https://gitter.im/crystal-lang/crystal?at=5b6eda49988005174ec4a99e]
<FromGitter> <Timbus> Hm. Still newish to crystal, but `.class` probably prints the runtime type. What's the `typeof(data)` ?
<FromGitter> <Timbus> I assume it's also an array, so you need to cast it
<FromGitter> <cpunion> Ah, `typeof(data)` is `(Array(GraphQL::ReturnType) | Array(Hash(String, Array(Int32 | String) | String) | Nil) | Array(Hash(String, Array(String) | String | Nil)) | Array(Hash(String, Array(String) | String)) | Bool | Float64 | GraphQL::Schema::InputType | Hash(String, GraphQL::ReturnType) | Int32 | Int64 | String | Nil)`, thank you.
Creatornator has joined #crystal-lang
<FromGitter> <PlayLights_twitter> Does anybody know if possible to skip a compile time error on Crystal? Its giving me an error because im using a method defined by a macro
Raimondii has joined #crystal-lang
<FromGitter> <kaukas_gitlab> I am trying to use a single method to generate a hash out of two arrays choosing types "dynamically". Would anyone please be able to give hints? Here's a very simplified version: https://play.crystal-lang.org/#/r/4pqp
Raimondi has quit [Ping timeout: 272 seconds]
Raimondii is now known as Raimondi
<RX14> @PlayLights_twitter a compile error means the compiler doesn't know what you mean so it can't continue
<FromGitter> <kaukas_gitlab> A clarified version: https://play.crystal-lang.org/#/r/4pqv
<FromGitter> <PlayLights_twitter> @RX14 oh, ok, i will try to make it work differently then, thanks
<FromGitter> <vegai> @kaukas_gitlab might be useful to know what you’re trying to accomplish there
<FromGitter> <vegai> you want a hash whose keys and values are int32s or strings?
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Creatornator has joined #crystal-lang
<FromGitter> <kaukas_gitlab> @vegai, I want to create a hash with types chosen dynamically. I am working with a DB that supports storing hashes, e.g. `Hash(Int32, String)` or some other combination. My crystal code needs to retrieve keys and values and create a hash out of them.
<FromGitter> <kaukas_gitlab> The code that parses keys and values dispatches to the concrete sub-class at runtime which produce e.g. `Array(Int32)` or `Array(String)`. I need to merge two such outputs into a hash.
<FromGitter> <talbergs> Anyone working on web assembly support for crystal?
Creatornator has quit [Quit: Textual IRC Client: www.textualapp.com]
<FromGitter> <j8r> @kaukas_gitlab Could you print a sample of the initial data you get, and the wanted Crystal result you want?
<FromGitter> <j8r> I think I got it
<FromGitter> <kaukas_gitlab> @j8r I am getting data in C and writing a binding to produce Crystal data structures for the Crystal DB `ResultSet` (https://github.com/crystal-lang/crystal-db/blob/master/src/db/result_set.cr).
<FromGitter> <kaukas_gitlab> As a result I want to get e.g. `Hash(String, Int32)` rather than `Hash(Any, Any)`.
<FromGitter> <j8r> No unions?
<FromGitter> <kaukas_gitlab> No, that won't work. `String` and `Int32` are just examples, there are much more complex types.
<FromGitter> <kaukas_gitlab> Here's a version that works: https://play.crystal-lang.org/#/r/4psw
<FromGitter> <kaukas_gitlab> However, I hoped that the compiler can figure the right types with `forall` by itself.
alex`` has quit [Ping timeout: 272 seconds]