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
<FromGitter> <Timbus> From what I can see, it only accepts fixed offsets, using `%z`, `%:z`, and `%::z` ⏎ I can't see it in the docs, but it's here: https://github.com/crystal-lang/crystal/blob/master/src/time/format.cr
<FromGitter> <Timbus> If it's a string zone like 'Luna/Copernecus', you'll have to parse the location out first, then use `Time::Location.load` and pass it as a third argument to `Time.parse`
<FromGitter> <Timbus> I guess =/
DTZUZO has joined #crystal-lang
tilpner_ has joined #crystal-lang
tilpner has quit [Ping timeout: 264 seconds]
tilpner_ is now known as tilpner
Groogy has quit [Ping timeout: 240 seconds]
Jenz has joined #crystal-lang
<Jenz> Is something wrong with crystalshards.xyz?
<Jenz> I just get loads of errors
<Jenz> Oh there it works again, nvm
alex`` has joined #crystal-lang
<hightower4> Jenz, you can also always use crystalshards.org
<Jenz> Oh I didn't know, thanks
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 244 seconds]
Raimondii is now known as Raimondi
Jenz has quit [Ping timeout: 244 seconds]
Jenz has joined #crystal-lang
Jenz has quit [Ping timeout: 240 seconds]
Groogy has joined #crystal-lang
Ven`` has joined #crystal-lang
alex`` has quit [Quit: WeeChat 2.1]
alex`` has joined #crystal-lang
alex`` has quit [Ping timeout: 244 seconds]
alex`` has joined #crystal-lang
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Groogy> so I am having an unexpected nil type
<Groogy> I don't get why it is telling me gui.remove_root window on line 10 that the type can be nil?
<Groogy> I tried adding the unless gui.nil? but it still says that
<Yxhuvud> strange. What happens if you cahnge it to `if gui` ?
<Groogy> same
<Groogy> I am working around it by just passing a method for it to call
<Groogy> but yeah this is a very unexpected behaviour
<Groogy> unless I'm missing something
<Yxhuvud> right, the if statement in the block shouldn't be necessary as you check it outside
<Groogy> yepp, and the type shouldn't magically disappear if @gui is set to nil for instance
<Groogy> and the context shouldn't be collected by the gc as logn as I have a reference so I am a bit puzzled as of why
Ven`` has joined #crystal-lang
<crystal-gh> [crystal] j8r closed pull request #6423: Create an abstract Any for JSON/YAML (master...any_abstract_struct) https://git.io/fNWXs
<Groogy> if I have a @type.subclasses in a macro, is there a way to check if one of the subclasses are abstract and skip it?
<Groogy> just .abstract?
<crystal-gh> [crystal] ysbaddaden opened pull request #6426: Fix: fork and signal child handlers (master...fix-fork-and-signal-child-handlers) https://git.io/fNlmO
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<crystal-gh> [crystal] r00ster91 opened pull request #6427: Add :default to colorize and document ColorRGB, Color256 (master...patch-3) https://git.io/fNlm8
rohitpaulk has joined #crystal-lang
Ven`` has joined #crystal-lang
renzhi has quit [Quit: WeeChat 2.1]
cjd has joined #crystal-lang
<literal> do I need anything more than "make spec" to run the test suite? I get this failure on master: https://gist.github.com/hinrik/747587c37c2119c2815b7bf729a93cda
pinupgeek has joined #crystal-lang
<literal> kind of strange because that spec passes just fine if I do "bin/crystal spec/std/file_spec.cr"
<crystal-gh> [crystal] Exilor opened pull request #6428: Fix Atomic#swap with reference types (master...master) https://git.io/fNlGp
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Jenz has joined #crystal-lang
Jenz has left #crystal-lang [#crystal-lang]
<crystal-gh> [crystal] hinrik opened pull request #6429: JSON: Handle non-standard UTF-8 string escapes (master...json_utf8_escapes) https://git.io/fNln0
hightower4 has quit [Ping timeout: 268 seconds]
hightower4 has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 276 seconds]
rohitpaulk has joined #crystal-lang
akaiiro has joined #crystal-lang
<FromGitter> <bew> Groogy still there?
<Groogy> yepp
<FromGitter> <bew> Because the block is captured, the captured variable `gui` gets referenced for this block, and currently the compiler will keep all the types of the var (without current type restriction/simplification) when it's passed to a captured block.
<Groogy> but the type should not have nil? right? @gui is the one that has nil
<Groogy> and even if I did test for nil inside the block it didn't work
DTZUZO has quit [Ping timeout: 240 seconds]
<FromGitter> <bew> @literal that looks weird.. I think the explanation is that some other spec uses a `base` variable, and the compiler thinks that you're trying to use it..
<FromGitter> <bew> Groogy because you have a reference inside the block to the variable, you have the handle it like an ivar, so assign it to a local var first
<Groogy> so if I do gui = gui it would work?
<Groogy> that's... weird
<FromGitter> <bew> And `if gui = @gui` is basically rewitten as `gui = @gui` and `if gui` so the full type has Nil too, but we never see it in the if
<FromGitter> <bew> Groogy yeah should work (maybe, with another local var name though), I agree it's weird.. I know there's an open issue to fix this but it's not for now..
<Groogy> ah okay, it's not by design at least
<Groogy> I needed the code to be in a method anyway because it needed to be used by other stuff anyway
<Groogy> so it solved itself
<FromGitter> <bew> Ahah nice
<FromGitter> <bew> Not sure now if it's by design or not..
rohitpaulk has quit [Ping timeout: 244 seconds]
<FromGitter> <bew> #6040
<DeBot> https://github.com/crystal-lang/crystal/issues/6040 (Bug: Only typeof in proc body does not account for closure var)
<FromGitter> <bew> But there is no question of `if` hefe
<FromGitter> <bew> Here*
<Groogy> I have a function defined like this: def internal_marshal(tuple : Tuple(*U)) forall U
<Groogy> how do I write the signature to make it work with named tuples?
<FromGitter> <bew> `NamedTuple(**U)`?
<Groogy> "expecting token 'CONST', not '**'
<Groogy> hmm how is named tuple actually defined
<Groogy> hmm it is defined like that
<Groogy> maybe double splatting isn't supported in a generic method?
<FromGitter> <rishavs> Any ideas what am i doing wrong here? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b54d3f4f477e4664ab55d44]
<FromGitter> <bew> Groogy looks like a bug, it should be supported I think
<FromGitter> <bew> @rishavs you forgot to call `new` for the hash
<Groogy> yeah, you are assigning the type to the tree variable
<FromGitter> <rishavs> @bew thanks, as always
<FromGitter> <bew> Yw :)
alex`` has quit [Ping timeout: 276 seconds]
alex`` has joined #crystal-lang
Groogy has quit [Ping timeout: 240 seconds]
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 264 seconds]
Raimondii is now known as Raimondi
alex`` has quit [Ping timeout: 240 seconds]
alex`` has joined #crystal-lang
rohitpaulk has joined #crystal-lang
<FromGitter> <DanilaFe> Hi! I've got a question about C bindings in Crystal. What would be the best way to bind C code that isn't installed system-wide? Say, I have a git submodule with a C library in it, how should I proceed with linking it to Crystal?
<oprypin> for cross platform: compile a shared library and always add it to LIBRARY_PATH when compiling and LD_LIBRARY_PATH when using
<oprypin> for posix: example here https://github.com/Papierkorb/qt5.cr/tree/master-ready-to-use/src/qt5/binding `@[Link(ldflags: "#{__DIR__}/../../../ext/binding_linux-gnu-x86_64-qt5.10.a -lstdc++ -lQt5Core -lQt5Gui -lQt5Widgets")]`
<FromGitter> <DanilaFe> Thanks a lot!
<oprypin> well my first message is also posix-specific, i guess, but that's just because on Windows you don't need to do this, current directory is in library path
<oprypin> also windows is not really supported lol
<FromGitter> <DanilaFe> Not yet, anyway
<FromGitter> <DanilaFe> hopefully Crystal gets there
rohitpaulk has quit [Ping timeout: 244 seconds]
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 244 seconds]
Raimondii is now known as Raimondi
<FromGitter> <DanilaFe> hold on, inside lib, i can't create a struct with a lowercase name?
<crystal-gh> [crystal] asterite opened pull request #6432: Fix: private aliases at top-level not considered private (master...bug/5752-private-alias-top-level) https://git.io/fNlgo
alex`` has quit [Ping timeout: 264 seconds]
alex`` has joined #crystal-lang