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> <jwoertink> Is there a way to tell a NamedTuple that it's not empty? It would be nice to do `named_tuple.not_empty!.to_h` or something
<FromGitter> <Blacksmoke16> what do you mean not empty?
<FromGitter> <Blacksmoke16> like has values?
<FromGitter> <bew> huh no it's doesn't make sense, it's empty or not empty
marius has quit [Ping timeout: 256 seconds]
<FromGitter> <bew> do you have an example?
<FromGitter> <jwoertink> yes, has values.
<FromGitter> <jwoertink> `hash = options.empty? ? {} of Symbol => String : options.to_h`
<FromGitter> <jwoertink> something like this, but this doesn't actually work
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/4l8o ?
<FromGitter> <Blacksmoke16> or actually
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/4l8p
<FromGitter> <Blacksmoke16> can you make a code example @jwoertink ?
<FromGitter> <jwoertink> ^ that last one I just pushed?
marius has joined #crystal-lang
<FromGitter> <jwoertink> `some_named_tuple.to_h`
<FromGitter> <bew> but where is that named_tuple coming from?
<FromGitter> <jwoertink> I want to convert a NamedTuple to a hash, but in this example, the `some_named_tuple` may or may not be empty
<FromGitter> <jwoertink> it comes down from one of these things `some_methods(thing, **options)`
<FromGitter> <jwoertink> `options` here is a NamedTuple, but depending on where `some_method` gets called, it may or may not be empty
<FromGitter> <jwoertink> so if I call `to_h`, I get "Can't convert an empty NamedTuple to a Hash"
<FromGitter> <jwoertink> I hope I'm making sense here.... lol
<FromGitter> <Blacksmoke16> i see what you mean, even if its in if/else that error still happens
<FromGitter> <jwoertink> Right. So like in this, I can't call `options.to_h` inside this `tag` method because it tanks
<FromGitter> <jwoertink> I was hoping there was something hidden that worked like `thing.not_nil!` lol `thing.not_empty!`
<FromGitter> <Blacksmoke16> could be unintended behavior?
<FromGitter> <Blacksmoke16> prob some fancy explanation for it tho :p but i can make examples where it'll never be empty and still throws that error
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/4l9a
<FromGitter> <Blacksmoke16> like it should never be empty
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/4l9d
<FromGitter> <jwoertink> Yeah, exactly. I bet that would be super hard to implement though.
<FromGitter> <jwoertink> I wonder if it would be easier to have a method that just doesn't have the `**options` argument
<FromGitter> <Blacksmoke16> cant you do like
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/4l9g
<FromGitter> <jwoertink> The reason I need it to be a hash is so I can call `reject`. If it comes through as a NamedTuple, it would throw an error on that.
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/4l9k :shrug:
<FromGitter> <Blacksmoke16> am sure there is some reason to it but yea, wish solution was cleaner :/
<FromGitter> <jwoertink> interesting... I'm gonna play with your last example there and see how that works out
<FromGitter> <jwoertink> Thanks for the help!
<FromGitter> <jwoertink> > cast from NamedTuple() to Hash(Symbol, String)+ failed
<FromGitter> <jwoertink> lol
<FromGitter> <Blacksmoke16> rip
<FromGitter> <jwoertink> right? I started just commenting some stuff out to see where I can get it to compile, then got
<FromGitter> <jwoertink> > Error: you've found a bug in the Crystal compiler
<FromGitter> <jwoertink> woo hoo!
<FromGitter> <Blacksmoke16> xD
<FromGitter> <paulcsmith> Does anyone know of a clever way to get around this limitation? I'm trying to restrict the instance variable type that is a generic https://play.crystal-lang.org/#/r/4l9q
<FromGitter> <paulcsmith> I can't seem to get it to work (maybe because it isn't supported πŸ˜•)
<robacarp> @paulcsmith I ran into that with amber_router and found that you have to pass T into OtherClass as well
<robacarp> er, OtherThing
<FromGitter> <paulcsmith> robacarp: Hmm, could you give an example? I'm not sure I understand
<FromGitter> <jwoertink> `OtherThing(T)`
<FromGitter> <jwoertink> `def initialize(@field : T)`
<FromGitter> <jwoertink> maybe that?
<robacarp> yeah, that
<FromGitter> <paulcsmith> Sweeet :) Thanks
<FromGitter> <jwoertink> how did that not fail?
<FromGitter> <jwoertink> You didn't pass `Bool` in to the OtherThing in that exmaple
<robacarp> it doesn't need to
<robacarp> that play makes Thing and OtherThing both generic
<FromGitter> <jwoertink> I thought `class OtherThing(T)` meant that you have to write `OtherThing(SomeConstantRequredHere)`
<robacarp> @paulcsmith I think, unfortunately, that because of `@field : Field(T)` restriction on the constructor, that this locks both Field and OtherThing to be the _same_ generic
<robacarp> @jwoertink are you confused about the type restriction on the constructor parameter?
<FromGitter> <jwoertink> no, that makes sense to me
<FromGitter> <jwoertink> Just the part where the `T` is passed in to the class, but you don't actually have to pass a type in
<FromGitter> <jwoertink> learn something new everyday! :d
<FromGitter> <jwoertink> :D
<robacarp> oh, I think that part is a bug
<robacarp> that'll explode later, I think
<FromGitter> <jwoertink> lol
<FromGitter> <jwoertink> ok, then that makes sense to me
<robacarp> you mean it should be `OtherThing(Bool).new(field)`
<FromGitter> <jwoertink> right
<robacarp> Crystal support for generics is shakey, and that's one place where it is so (cc @paulcsmith)
<FromGitter> <paulcsmith> Oh I thought that was a feature (one that I like a lot :P)
<FromGitter> <jwoertink> "feature" ...
<FromGitter> <paulcsmith> I like that I don't need to pass the generic type in and that the compiler can figure it out
<robacarp> if you can get it to work, :celebrate: but when it segfaults :sadness:
<FromGitter> <jwoertink> That's awesome if it works!
<FromGitter> <paulcsmith> Have you had it segfault because of that? It seems like it should fail or work
<FromGitter> <paulcsmith> Or maybe you were joking and I didn't catch on until it was too late :P
<robacarp> It's been several weeks, but I have had crystal experience some catastrophic failures that required manually dividing the code to find resolution
<robacarp> I don't remember the exact situation, but I do know that it was related to some fancier use of Generics
<robacarp> come to think of it, that might have been on the query builder for granite
<FromGitter> <paulcsmith> Uh-oh! I'll definitely keep an eye out then. Thanks for the heads up
<FromGitter> <drinkmorewaters> http://zetcode.com/lang/python/ ⏎ ⏎ Anyone done something like this for Crystal?
<robacarp> @drinkmorewaters the community effort is at crystal-lang.org/docs
<FromGitter> <drinkmorewaters> @FromIRC It's a great resource for people coming to Crystal as professional developers. But i'm more looking at complete beginner materials.
<robacarp> oh, I see. I've heard chatter about this sort of thing, but I have no idea if anything has materialized
<FromGitter> <jwoertink> @drinkmorewaters there's https://crystalmastery.io if you're looking for beginner stuff. I think it's down at the moment, but there's a few different starter things out there
<FromGitter> <jwoertink> https://crystal-ann.com/ also has some good stuff that pops up if you keep an eye on that
<FromGitter> <jwoertink> And I think http://crystalweekly.com/ might have some tutorials that come up from time to time
<FromGitter> <drinkmorewaters> @jwoertink I check all those daily, i also check Medium, Reddit and Twitter "Crystal Lang" daily. But i guess the tutorials will come at a later date for now, until the language reaches 1.0+.
moei has quit [Read error: Connection reset by peer]
moei has joined #crystal-lang
pinupgeek has quit [Quit: pinupgeek]
<FromGitter> <drinkmorewaters> Does this OSX package work for anyone? Does it load?
<FromGitter> <drinkmorewaters> window.app (https://files.gitter.im/crystal-lang/crystal/Z9GC/window.app)
pbodev1 has joined #crystal-lang
<FromGitter> <drinkmorewaters> Crystal Playground.app (https://files.gitter.im/crystal-lang/crystal/8FJS/Crystal-Playground.app)
<FromGitter> <drinkmorewaters> Weird that the file works on 2 machines, 1 host, 1 test, but when it's downloaded from here it stops working. Hmm
<Groogy> Morning! o/
<FromGitter> <icyleaf> Morning Groggy :P
ua_ has joined #crystal-lang
ua has quit [Ping timeout: 248 seconds]
<FromGitter> <yorci> βœ‹
RX14 has quit [Remote host closed the connection]
RX14 has joined #crystal-lang
alex`` has joined #crystal-lang
rohitpaulk has joined #crystal-lang
<FromGitter> <Qwerp-Derp> Let's say I install LibUI on Windows - there's no way I can use WSL to link that to Crystal, right?
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 244 seconds]
Raimondii is now known as Raimondi
flaviodesousa has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 260 seconds]
<crystal-gh> [crystal] RX14 closed pull request #5591: Win exceptions (master...win-exceptions) https://git.io/vNWXX
<FromGitter> <drinkmorewaters> `accounts = [1, 2, 3] ⏎ ⏎ if accounts.is_a?(Number) ⏎ ⏎ ``` puts "Is a string"``` ... [https://gitter.im/crystal-lang/crystal?at=5b57087c63cf1636bdeac6da]
Groogy has quit [Quit: WeeChat 2.1]
<FromGitter> <drinkmorewaters> accounts = [1, 2, 3] ⏎ ⏎ if accounts[2].is_a?(Number) ⏎ ⏎ ``` puts "Is a string"``` ... [https://gitter.im/crystal-lang/crystal?at=5b5709ad63cf1636bdeaca68]
<FromGitter> <Daniel-Worrall> You might be able to send things to cmd hmm
<FromGitter> <Daniel-Worrall> Through wsl
rohitpaulk has joined #crystal-lang
<FromGitter> <colonlc> Hi, i got a CrSFML question/bug: ```crystal ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b5713bfe06d7e74099be1fc]
<FromGitter> <colonlc> This produces an error at `sound.buffer.finalize()`: `argument 'result' of 'VoidCSFML#sfml_sound_getbuffer' must be Pointer(Pointer(Void)), not SF::SoundBuffer (nor Pointer(Void) returned by 'SF::SoundBuffer#to_unsafe')`
<FromGitter> <colonlc> Seems like a bug at `VoidCSFML.sfml_sound_getbuffer`
rohitpaulk has quit [Ping timeout: 256 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
livcd has quit [Ping timeout: 276 seconds]
livcd has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 268 seconds]
DTZUZO has quit [Ping timeout: 276 seconds]
<crystal-gh> [crystal] RX14 opened pull request #6439: Change Foo:Class representation of Class types to Foo.class (master...feature/change-class-string) https://git.io/fN4Aa
<FromGitter> <bew> @drinkmorewaters you can do `if accounts.is_a?(Array(String))` to check that `accounts` is an array of strings
<FromGitter> <bew> for numbers you'd do `if accounts.is_a?(Array(Int32))` (`Int32` is the default number type when you write `2`)
akaiiro has quit [Ping timeout: 276 seconds]
<oprypin> colonlc, why are u calling finalize?
<FromGitter> <drinkmorewaters> @bew cheers dude!
<FromGitter> <colonlc> This is just an example to show the error, I actually tried to build a 'finalize-everything' method and I do not have a reference to the soundbuffer.
<oprypin> colonlc, this works for me https://bpaste.net/show/0ec8aff4da18
<FromGitter> <drinkmorewaters> my_array = ["Samson", "Erica", "Tommy", "Jessica", "Donald"] my_array.at(1) ⏎ ⏎ my_array = ["Samson", "Erica", "Tommy", "Jessica", "Donald"] ⏎ puts my_array[1] [https://gitter.im/crystal-lang/crystal?at=5b573eb863cf1636bdeb8220]
<FromGitter> <drinkmorewaters> Which one is the proper solution?
<FromGitter> <colonlc> `SF::Sound#buffer=` works as expected, only the getter `SF::Sound#buffer` doesn't
<oprypin> colonlc, you're right, it returns a weird copy instead
<FromGitter> <colonlc> seems like this: ```crystal ```
<FromGitter> <colonlc> oh
<FromGitter> <colonlc> how do i paste multiline code?
<FromGitter> <colonlc> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b57402fc331e0355214bbb9]
<FromGitter> <colonlc> ok
<FromGitter> <colonlc> seems like the c++ wrapper does not like the SoundBuffer reference
<oprypin> compare it to sfml_rendertarget_getview
<oprypin> colonlc, this is a bug. meanwhile, dont use sound.buffer, keep your own copy
<oprypin> not copy but reference
DTZUZO has joined #crystal-lang
<FromGitter> <colonlc> hm ok thanks, should i create an issue?
<oprypin> as you wis
<oprypin> h
kixune[m] has quit [Quit: removing from IRC because user idle on matrix for 30+ days]
<FromGitter> <colonlc> Created the issue.
braidn[m] has quit [Quit: removing from IRC because user idle on matrix for 30+ days]
<oprypin> thx
<FromGitter> <rishavs> How do I show loops inside a string interpolation? I want to do something similar to this; ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b5747dc9ddf5f4aad065a92]
return0e has quit []
<oprypin> O_O
<oprypin> have you considered not doing that inside string interpolation?
<oprypin> https://carc.in/#/r/4lls pls don't tho
wontruefree has joined #crystal-lang
<crystal-gh> [crystal] RX14 pushed 1 new commit to master: https://git.io/fNBsX
<crystal-gh> crystal/master 4f720ab Johannes MΓΌller: Extract platform-specifics from ENV to Crystal::System::Env and implement for win32 (#6333)...
<robacarp> yikes
<FromGitter> <rishavs> :D
<FromGitter> <rishavs> I assume this is a disgusting quality code?
akaiiro has joined #crystal-lang
<crystal-gh> [crystal] j8r closed pull request #6092: Move Dir.mkdir_p to FileUtils.mkdir_p (master...dir-rename) https://git.io/vpSy1
return0e has joined #crystal-lang
Ven`` has joined #crystal-lang
<FromGitter> <rishavs> Seriously though, is there downside to that kind of code? I was planning on using these blocks in my HTML heredocs to take care of the conditional views
<FromGitter> <colonlc> How do I get Zipfile entries behind a subfolder? `Zip::Reader#each_entry` only gets me the folder, not the contents of it.. (Zipfile structure: ``` ⏎ file.zip ⏎ ⏎ 1) foo.txt (file) ⏎ 2) bar (directory)1) baz.txt (file) <- how do i get to this? ... [https://gitter.im/crystal-lang/crystal?at=5b57520ec579673e6b903167]
<FromGitter> <j8r> @rishavs use at least `xx += " Index: #{index}"` πŸ˜„
<travis-ci> crystal-lang/crystal#4f720ab (master - Extract platform-specifics from ENV to Crystal::System::Env and implement for win32 (#6333)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/407675676
<DeBot> https://github.com/crystal-lang/crystal/pull/6333 (Extract platform-specifics from ENV to Crystal::System::Env and implement for win32)
<FromGitter> <rishavs> :D thanks @j8r ⏎ regarding the `#{block ... end}`, is there any issue with using that all over in my code?
wontruef_ has joined #crystal-lang
wontruefree has quit [Ping timeout: 255 seconds]
<FromGitter> <j8r> @rishavs personally I'll rather do https://carc.in/#/r/4lm1
<FromGitter> <j8r> I never had to use `begin; end` outside exception handling with `rescue`
<Yxhuvud> rishavs: yes, it is very inefficient as you will end up allocating an exponential length of strings. Use Array#join to merge the strings, instead.
<Yxhuvud> or a stringbuilder.
<Yxhuvud> hmm. or quadratic perhaps, but still very inefficient
hightower4 has quit [Ping timeout: 264 seconds]
<FromGitter> <rishavs> thanks
<FromGitter> <colonlc> To my question: My zipfile subfolder was empty lol
hightower4 has joined #crystal-lang
alex`` has quit [Quit: WeeChat 2.1]
<FromGitter> <bew> @rishavs you'd better use ECR instead
<FromGitter> <rishavs> @bew I actually didnt want to use ECR. I wanted to see how far can I go without using it. So far, things have been great and my pure string templates render in 0.5 ms
<FromGitter> <rishavs> By using simple case-when routing and string/heredoc templates, i am so far getting about 2x the speed of Kemal. Of course, everything goes for a toss when Db calls get into the picture
<FromGitter> <rishavs> Then my lovely 50us pages become 250ms pages T_T
alex`` has joined #crystal-lang
<FromGitter> <bew> ECR is a compile time templating system, so you'd get the same speed
<FromGitter> <rishavs> ooh, nice! I didn't know that
<FromGitter> <rishavs> btw, do you have any idea if our db/pg connections are not fully optimized? I could have sworn that when I was using node/koa to connect to a cloud based elephantsql instance, i was getting must faster query replies than I am getting now with my crystal db
alex`` has quit [Quit: WeeChat 2.1]
<FromGitter> <fridgerator> I have heard others say crystal-db is not optimized and needs some work, but I dont' have any specific information
<FromGitter> <talbergs> may crystal-db have `dgraph` or `neo4j` as they become more of use these days
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wontruefree has joined #crystal-lang
wontruef_ has quit [Ping timeout: 256 seconds]
wontruefree has quit [Client Quit]
wontruefree has joined #crystal-lang
wontruefree has quit [Client Quit]
<FromGitter> <sam0x17> in crystal how can I set an Int32 to equal infinity?
<FromGitter> <bew> That doesn't exist, an Int32 has a limit
<FromGitter> <sam0x17> yeah I just need the max and min int values
<FromGitter> <bew> Int32::MAX
<FromGitter> <sam0x17> omg
<FromGitter> <sam0x17> thx
<FromGitter> <bew> Same for min
<FromGitter> <sam0x17> thx
wontruefree has joined #crystal-lang
alex`` has joined #crystal-lang
wontruefree has quit [Quit: bye]
wontruefree has joined #crystal-lang
wontruefree has quit [Quit: bye]
<hightower4> What's the fastest way to check a .cr file for syntax?
<hightower4> (i.e. a syntax check like ruby -c)
<FromGitter> <colonlc> You could use `crystal tool format --check <file / folder>`
jokke is now known as foxxx0
foxxx0 has quit [Disconnected by services]
jokke has joined #crystal-lang
<FromGitter> <DanilaFe> How does the Crystal tuple type work? The docs says its type is Tuple(*T), and I'd like to be able to implement something that can take an arbitrary number of types
hightower4 has quit [Ping timeout: 265 seconds]
<FromGitter> <straight-shoota> a tuple has a fixed number of elements
<FromGitter> <DanilaFe> What I mean is, you can have Tuple(Int32), Tuple(Int32, String), and so on
<FromGitter> <straight-shoota> if you need dynamic size, you should use a different data structure like `Array`
<FromGitter> <straight-shoota> I don't understand
<FromGitter> <DanilaFe> The size is known at compile time
<FromGitter> <DanilaFe> From what I understand, tuple is a single generic type. But the generic type can have different numbers of type parameters. { 3 } creates Tuple(Int32), and { 3, 4, "hi" } creates Tuple(Int32, Int32, String). These two instances of the tuple struct, but they have a different number of type parameters (though fixed at compile time)
<FromGitter> <j8r> What do you need?
<FromGitter> <j8r> You could either use Tuple, Array or StaticArray
<crystal-gh> [crystal] straight-shoota opened pull request #6442: Change WinError to get message as UTF16 string (master...jm/winerror-wchar) https://git.io/fNBXd
<FromGitter> <j8r> Depending of how much flexibility you need
<FromGitter> <DanilaFe> I'd like to be able to do things like MyClass(Int32), MyClass(Int32, String) and so on, similarly to the way that Tuple does it
<FromGitter> <DanilaFe> I'm wondering if that's possible at all
<FromGitter> <j8r> Does the type and the size change at run time or not?
<FromGitter> <DanilaFe> no, it does not
<FromGitter> <j8r> Ok you can use Tuple so, which is immutable
<FromGitter> <j8r> (by types I mean the elements inside the array, not the array itself)
<FromGitter> <DanilaFe> Yeah, nothing changes at run time. My question isn't what built-in type to use, but whether it's possible to use generics to achieve the same effect that tuple has, where it can have 1, 3, or any number of type parameters
<FromGitter> <straight-shoota> yes, just do the same thing as tuple: Use `*T` as generic argument
<FromGitter> <straight-shoota> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b578b70a31e386158acc526]
<FromGitter> <DanilaFe> That's what I've been trying to do. I've gotten the *args : *T part, but now, I don't know where to go from there: what's the type of *args? Can I iterate over each arg while being aware of its type? Do I need to use macros to write code that does work on each individual argument?
<FromGitter> <DanilaFe> Sorry if this is a dumb question
<FromGitter> <straight-shoota> `args` is of type `*T` which is essentially a `Tuple` type
<FromGitter> <straight-shoota> you can use it like any splat argument
wontruefree has joined #crystal-lang
<FromGitter> <DanilaFe> Thank you. I'm going to try this out
wontruefree has quit [Ping timeout: 256 seconds]
pbodev1 has quit [Quit: ChatZilla 0.9.93 [Firefox 56.0/20170903140023]]
return0e has quit [Read error: Connection reset by peer]
return0e has joined #crystal-lang
alex`` has quit [Ping timeout: 256 seconds]
alex`` has joined #crystal-lang
<FromGitter> <DanilaFe> Ok, I've got another question. Say I've got my `*T` type parameter. But I'd like a method that accepts a different type, which depends on `*T`. To clarify, let's say I have `*T = Int32, String` and I'd like to have a method that accepts `Array(Int32), Array(String)`. This is asking for a lot it seems like. Is there even a way to do this?
<FromGitter> <DanilaFe> I've tried to mess with typeof until I realized it's not allowed in type restrictions
<FromGitter> <straight-shoota> This can probably be done with a macro
<FromGitter> <DanilaFe> My first attempt (the "dumb way") was to try use macros inside the parameter declaration. That didn't work (not that I expected it to)
<FromGitter> <straight-shoota> Yeah, that's not that easy. I think it can be done, though, somehow...
<FromGitter> <straight-shoota> @asterite would know =)
<FromGitter> <DanilaFe> I would be very impressed to see this done
<FromGitter> <DanilaFe> or even to get a pointer in the right direction
<FromGitter> <DanilaFe> (by the way, thanks a lot for helping me with the `*T` thing)
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 264 seconds]
Raimondii is now known as Raimondi
<FromGitter> <j8r> @DanilaFe like this? https://carc.in/#/r/4loc
<FromGitter> <j8r> or https://carc.in/#/r/4lof ?
<FromGitter> <j8r> I've don't get it I think :|
<FromGitter> <DanilaFe> almost, except that A and B in the second example are actually `*T`, that is, a tuple-like type like straight-shoota explained above
<FromGitter> <bew> I think he wants `*T` as the generic, like
<FromGitter> <bew> `class Test(*T) ... `
<FromGitter> <DanilaFe> yeah, exactly
<FromGitter> <j8r> ha ok
<FromGitter> <j8r> a tuple yeah
<FromGitter> <bew> tried this https://carc.in/#/r/4loi but it doesn't work :/
alex`` has quit [Ping timeout: 260 seconds]
<FromGitter> <j8r> It could be done with an array :/
<FromGitter> <DanilaFe> but an array has union types, which I can't have
<FromGitter> <j8r> but not easy with a tuple
<FromGitter> <DanilaFe> I need { Int, String} not [(Int | String)]
<FromGitter> <bew> do you have a usage example?
<FromGitter> <DanilaFe> somewhat, it may take some time to explain
<FromGitter> <DanilaFe> Can someone explain why https://carc.in/#/r/4loo works, but https://carc.in/#/r/4lot doesn't?
<FromGitter> <DanilaFe> The compiler spits out true for Tuple(*T) == Tuple(Int32), but doesn't accept Tuple(Int32) as a field of type Tuple(*T)
<FromGitter> <bew> note, T is a tuple already https://carc.in/#/r/4lov
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/4lou shouldnt this be handled by the dynamic casting stuff in 0.25.0?
<FromGitter> <bew> and `Tuple(*T)` is somewhat broken (like most of generics in Crystal ^^)
<FromGitter> <DanilaFe> Ah. Makes sense
<FromGitter> <DanilaFe> not the broken part, especially considering it works as a method param
<FromGitter> <bew> hmm I have no idea why it works
<FromGitter> <bew> @Blacksmoke16 the dynamic casting stuff only works when you have restrictions
<FromGitter> <bew> it doesn't works automatically
<FromGitter> <Blacksmoke16> ah
<FromGitter> <Blacksmoke16> darn
<FromGitter> <bew> (and I'm not sure I understand what you want to happen here)
<FromGitter> <Blacksmoke16> ah nothing, was just curious
<FromGitter> <bew> you can add a restriction though https://play.crystal-lang.org/#/r/4low