ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.22.0 | 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> <will> Does the XML have the mapping macros like json and yaml? I'm not finding it but figured I'd ask
_whitelogger has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Kug3lis has joined #crystal-lang
Kug3lis has quit [Quit: Textual IRC Client: www.textualapp.com]
hightower has quit [Ping timeout: 255 seconds]
bjz has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Philpax has joined #crystal-lang
<FromGitter> <codenoid> :worried: i got this error while starting my compiled crystal app ⏎ `` ./educode: error while loading shared libraries: libgc.so.2: cannot open shared object file: No such file or directory ``
<FromGitter> <codenoid> `` sudo apt-get install libgc1c2:i386 `` for linux 64bit
<FromGitter> <kazzkiq> Any tools for unit testing?
<FromGitter> <fridgerator> @kazzkiq https://crystal-lang.org/api/0.23.0/Spec.html ?
<FromGitter> <kazzkiq> Beautiful. Thanks.
<FromGitter> <fridgerator> built into the stdlib, pretty nice
<FromGitter> <kazzkiq> Funny how its not cited in the docs (https://crystal-lang.org/docs/overview/). Looked for "testing" and "spec", found nothing
chimkan has quit [Quit: chimkan]
Philpax has quit [Ping timeout: 255 seconds]
<FromGitter> <codenoid> sir, how to define variable from bash input,
<FromGitter> <codenoid> hi sir, how to define crystal variable from bash input
Philpax has joined #crystal-lang
<FromGitter> <codenoid> cool sir, thanks ^^
<FromGitter> <codenoid> but how to do like this, ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=595472adc101bc4e3a30b5d0]
<FromGitter> <codenoid> on buffer, we write some text, enter, than defined to variable and run next function
we0we0w0ew0 has joined #crystal-lang
<we0we0w0ew0> trump yea or nay?
we0we0w0ew0 has quit [Client Quit]
we0we0we0we0 has joined #crystal-lang
_whitelogger has joined #crystal-lang
we0we0we0we0 has quit [Quit: Page closed]
Raimondi has quit [Ping timeout: 268 seconds]
Raimondi has joined #crystal-lang
<FromGitter> <will> @codenoid I think you're looking for `gets` example: `print "enter your name: "; name = gets; puts "your name is #{name}"`
<FromGitter> <johnjansen> well crystal is certainly fast enough for my requirements … a ternary search tree of 30+M strings, search in ~5µs
<FromGitter> <sdogruyol> @johnjansen that's nuts
<FromGitter> <johnjansen> all .NET domains for starters
<FromGitter> <johnjansen> thanks @sdogruyol, i ripped off your timer formatting code from kemal ;-)
<FromGitter> <sdogruyol> 5 nanoseconds???
<FromGitter> <sdogruyol> @johnjansen awesome 😎
<FromGitter> <johnjansen> yeah nanoseconds, if you got yout elapsed_time method right ;-)
<FromGitter> <sdogruyol> It's
<FromGitter> <johnjansen> swallows a bit of ram, but hey, its fast
<FromGitter> <sdogruyol> How much
<FromGitter> <johnjansen> ~6GB
<FromGitter> <sdogruyol> Wow that's something
<FromGitter> <sdogruyol> 😂😂
<FromGitter> <johnjansen> not quite sure what to make of that comment
<FromGitter> <johnjansen> bizarrely im getting different number from different panels but anyhoo
<FromGitter> <johnjansen> but wait it gets better ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=595498d676a757f808b8e8a6]
<FromGitter> <johnjansen> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59549922c101bc4e3a31436e]
<FromGitter> <johnjansen> `3.71µs per query`
<FromGitter> <sdogruyol> cool
<FromGitter> <codenoid> my first public app with crystal https://github.com/codenoid/ficha
<FromGitter> <sdogruyol> @codenoid congrats :clap:
<FromGitter> <codenoid> thanks for everybody in this room ^^ :sparkles: , my bf make the logo, and i write the code :sparkles:
<FromGitter> <alpert> @codenoid it seem you put binaries to repo. It would be better to put source files instead of binaries :)
hightower has joined #crystal-lang
<FromGitter> <elorest> What is it written in?
<FromGitter> <akzhan> is it Masha/Petya whatever else malware? Source code preferred.
<FromGitter> <anddimario> hi all, i've created my first crystal app days ago, maybe someone could see the code and give me some suggestions about the style and others stuff (maybe there're alternatives to Process.run): https://github.com/anddimario/interstellar-cry
<FromGitter> <akzhan> please write the specs to know what it does well
<FromGitter> <akzhan> run(info, headers, params) looks strange ⏎ ⏎ Apostrophe looks weird to qoute params too.
<FromGitter> <akzhan> Simply pass any args as argv array.
<FromGitter> <anddimario> ok
<FromGitter> <akzhan> Run(command, headers = nil, params = nil, mode = :wait)
<FromGitter> <akzhan> Something like above
<FromGitter> <anddimario> i'll read about spec and do some test about argv as array, i've used this code because i had errors if i pass argv without ''
<FromGitter> <akzhan> looks like you need ShellWords module that absent yet in stdlib.
<hightower> Hey, I'm trying to define a variable as able to contain some Range, I do it like: @var : Nil | Int32 | Enumerable. But I get: can't use Enumerable(T) in unions yet, use a more specific type. How do I solve that?
<FromGitter> <akzhan> use Range(B, E), or just 1..4
<FromGitter> <akzhan> range = Range.new(1, 4)
<FromGitter> <akzhan> range = 1..4
hightower2 has joined #crystal-lang
<hightower2> akzhan: Yes but I have no trouble creating a range, I need to just declare that the variable may contain it
<FromGitter> <akzhan> def purcu( range : Range(Int32, Int32) ) ⏎ end
<hightower2> Right, just figured it out. Thanks!
hightower has quit [Ping timeout: 276 seconds]
<FromGitter> <codenoid> ok
bjz has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
sz0 has joined #crystal-lang
Nouv has joined #crystal-lang
<Nouv> Papierkorb: ping
Nouv_ has joined #crystal-lang
<Nouv_> Where does the compiler handle linking?
Nouv has quit [Disconnected by services]
Nouv_ is now known as Nouv
<hightower2> How do I specify that a method can optionally receive a block? (And/or if I don't have to do anything for that, how do I check if block was given?)
<hightower2> (I'd ideally avoid overloading here since it's a very small difference)
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<oprypin> hightower2, must overload
<hightower2> Ok, thanks@
<Nouv> does crystal use llvm-lld?
<oprypin> never heard of it
<FromGitter> <sdogruyol> @Nouv no
<FromGitter> <sdogruyol> it doesnt use llvm's linker
<Nouv> sdogruyol: I've searched the src but I can't find where the compiler calls linkers from
<FromGitter> <sdogruyol> it's gcc
<FromGitter> <sdogruyol> not entirely sure though :)
rohitpaulk has joined #crystal-lang
<Nouv> sdogruyol: I thought crystal used llvm, how does it use gcc?!
<Papierkorb> Nouv: `crystal build --cross-compile some_program.cr` - see for yourself
<Nouv> Papierkorb: I don't have crystal installed D:
<Nouv> Unfortunately I'm on the least reliable connection in the world
rohitpaulk has quit [Ping timeout: 260 seconds]
hightower2 has quit [Ping timeout: 260 seconds]
rohitpaulk has joined #crystal-lang
Nouv has quit [Quit: Nouv]
Nouv has joined #crystal-lang
Nouv has quit [Read error: Connection reset by peer]
Nouv has joined #crystal-lang
<FromGitter> <bew> this is where the linker is called to build the final binary
<FromGitter> <sdogruyol> @bew wow, thanks
bjz has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Nouv has quit [Ping timeout: 240 seconds]
<Papierkorb> Ah dang he just left
<FromGitter> <sdogruyol> haha
Nouv has joined #crystal-lang
<Papierkorb> Nouv: Make sure to read up on what a linker is, what a compiler is, and how they're not "the same" of any kind
<FromGitter> <sdogruyol> actually the names are quite self explanatory :)
<FromGitter> <sdogruyol> compiler , linker
<FromGitter> <bew> not when you don't know what they do, and how compilation work etc..
<Papierkorb> Nouv: TL;DR is, a compiler translates some kind of input (i.e. source code) into something that is usually *nearer* to the machine than it was before. E.g., Crystal (through LLVM) compiles down to machine code, but the Java compiler compiles down to JVM Bytecode. However, this output itself doesn't have to be runable by itself. A `.class` file from the java compiler can be, but if you compile to machine code, you usually output an object
<Papierkorb> file (`.o` file). This you then feed into a linker, which can take one, or more, object file, and which now produces an executable file. On Linux, this is ELF, and on Windows it's the PE format.
<Papierkorb> Nouv: The linker is also the place where static libraries are *linked into* the resulting program
<Nouv> Papierkorb: Ahhhh
<Papierkorb> Many compilers automatically call a linker for you by default, but you can usually tell compilers to not do that. For gcc, that's the `-c` flag, and for Crystal, it's `--cross-compile`
<Papierkorb> Nouv: But in more generic terms, think of a linker as a program which links separate modules (e.g. `.o` files) into a bigger module. This "bigger module" could now be runnable by itself, or may have to be linked again. That's where dynamic libraries come into play later.
<FromGitter> <schoening> I would like to write a small game engine in crystal to test out a bit of "data driven design". ⏎ So when I want to change what a npc does when he is clicked I don't wanna re-compile the whole program but instead just restart and load in a different script for that behaviour. I want to avoid compilation when I make changes to a script, so I guess my only bet would be a scripting language? ⏎ I'm thinking
<FromGitter> ... of either ruby or javascript here. What would be the best way to make them communicate with my crystal app?
<FromGitter> <sdogruyol> Anyone using Crystal with AWS Lambda?
<FromGitter> <bew> why not Lua ?
<Papierkorb> schoening, use Lua. really.
<FromGitter> <sdogruyol> @schoening lua is best for that kind of stuff
<FromGitter> <sdogruyol> all the big games using lua for that purpose
<Papierkorb> For good reason I might add
<FromGitter> <schoening> For the great 1 indexed arrays :P ?
<Papierkorb> For the actually good API
<Papierkorb> Everything else is plain crap
<FromGitter> <sdogruyol> haha
<FromGitter> <schoening> I can go for Lua no problem. Was only thinking ruby because then those scripts could be changed to crystal for perf eventually haha!
Nouv has quit [Ping timeout: 268 seconds]
<FromGitter> <schoening> Would the way to interact between lua -> crystal be different than other scripting languages?
<Papierkorb> Well for quests and stuff, Lua is most likely by far fast enough
<Papierkorb> No it's the same in theory, just with a sane API
rohitpaulk has quit [Ping timeout: 276 seconds]
<Papierkorb> And if Lua is too slow, LuaJIT is the next contender.
Nouv has joined #crystal-lang
rohitpaulk has joined #crystal-lang
<FromGitter> <schoening> Performance won't be an issue I think. It's just me learning stuff
<FromGitter> <schoening> So how would I invoke a crystal method from a lua script? Unix socket?
<Papierkorb> You ... embed lua?
<Papierkorb> See lua.org
<FromGitter> <schoening> never embedded anything, sorry if the answer was supposed to be obvious :) I'll check
<Papierkorb> Make sure to actually read the docs, and then getting a simple hello world script to run. If at any point you're thinking "oh let's use a socket here", you're doing it wrong.
<FromGitter> <schoening> Haha! Okay well then I was way off
ragmaanir has joined #crystal-lang
<FromGitter> <codenoid> sir, can i run web socket client connect inside my crystal app ?, (not in browser) https://crystal-lang.org/api/0.20.1/HTTP/WebSocket.html
<FromGitter> <straight-shoota> Of course, why shouldn't you?
<Papierkorb> Nouv: Have you thought about renting some cheap vps, and using it as VPN and irc bnc, and/or terminal server with tmux?
<Papierkorb> Nouv: Even the most basic ones will have better uptime than your local internet, and if you connect back to the VPN "quick enough" , your local TCP connections won't drop (timeout) anymore either
<Papierkorb> Nouv: Cheap ones can go for around 2€/Month (or your regional equivalent). Just make sure it's a proper vServer, and not some useless kind of 'shared hoster', else stuff like VPN won't work. And on top of that, you get to learn how to set up OpenVPN and stuff.
Nouv has quit [Quit: Nouv]
tankfeeder has joined #crystal-lang
panderssen has joined #crystal-lang
<panderssen> signed up to Crystal Weekly just over a week ago ... is it defunct, or just irregular?
<panderssen> is there an archive of Crystal Weekly?
<FromGitter> <fridgerator> @serdardogruyol was actually just looking into running crystal in lambda the other day, never implemented it though
<panderssen> i see that there is an archive, and indeed the issues are not every week
<olbat> Hello, does anyone else have some issues running tests with the TravisCi macOS image ?
<FromGitter> <bew> there's a PR allowinf macosx failures: #4528 because it fails way too much
<DeBot> https://github.com/crystal-lang/crystal/pull/4528 (Allow OSX failures on Travis CI)
<FromGitter> <sdogruyol> @panderssen it's irregular
<FromGitter> <sdogruyol> hopefully it'll be regular soon :)
<panderssen> hopefully, very much liking crystal so far
<panderssen> not a big fan of the end keyword (prefer significant whitespace) but i can tune it out
<FromGitter> <sdogruyol> @panderssen welcome!
<FromGitter> <sdogruyol> that's great to hear
chimkan has joined #crystal-lang
<FromGitter> <bew> panderssen why do you prefer significant whitespace? because then you don't have to type `end` ? or because it's visually clearer for you?
<FromGitter> <bew> or other reason?
<FromGitter> <fridgerator> a python guy
<FromGitter> <bew> yeah probably
<panderssen> let's put it this way: all the code i write is properly indented anyway
<panderssen> so whether it's end keyword or { and }, either way that exists purely for the compiler and is useless to the coder
<panderssen> after all, python, coffeescript, nim, other languages go without both and their compiler also knows what's happening
<Papierkorb> A visual ending marker is heavily useful to me to quickly consume code
<panderssen> who said "code exists primarily for people to read, and secondarily for the computer to interpret"
<FromGitter> <fridgerator> I prefer `end` or brackets
<FromGitter> <fridgerator> @panderssen its preference really
<Papierkorb> Saw it with coffeescript. Code longer than what my screen can show at once immediately becomes hard to read
<FromGitter> <bew> well, without end or brackets it's hard to do oneline filters like `[1, 2, 3].filter { |i| i.odd? }.map { |i| i.to_s }` and this will give `["1", "2"]` (I think, not tested)
<panderssen> i think eventually we will have a language which is just an AST and you can write it like Ruby and me like Python and someone else like C and we will each see the code presented as we prefer
rohitpaulk has quit [Ping timeout: 276 seconds]
<FromGitter> <akzhan> @panderssen have you seen other modern languages like Go? gofmt supports indentation with tabs only for example. ⏎ ⏎ Anyway Crystal inspired by Ruby and follows its beauty
<panderssen> i also prefer tabs because my vision is poor and i have the editor set to display a lot more spaces than 2, yet strangely i am used to the lack of { or end and it doesn't bother me
<FromGitter> <akzhan> I just increased fontSize for same reason. but are you read about holy war? https://stackoverflow.blog/2017/06/15/developers-use-spaces-make-money-use-tabs/ :smile:
bjz has joined #crystal-lang
<panderssen> yeah if my colleagues could enforce a font + size as well as 2 spaces they would - so i have to waste time with editor settings and git hooks to convert to/from spaces so i can read the code
<panderssen> come to think of it, they also may not approve of my color scheme
rohitpaulk has joined #crystal-lang
<crystal-gh> [crystal] mverzilli closed pull request #4536: Adds PCG32 random generator, makes it default (master...rng) https://git.io/vHMg0
<FromGitter> <tarvit> Hi all. Can someone recommend any tool for debugging Crystal programs. I use pry-like tools for Ruby. What approach is idiomatic for Crystal?
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 276 seconds]
<FromGitter> <sdogruyol> @tarvit unfortunately, there's no direct alternative to pry atm
<FromGitter> <sdogruyol> you can use lldb though
<crystal-gh> [crystal] straight-shoota opened pull request #4635: Added --include and --exclude options to format tool (master...tool-format-exclude-option) https://git.io/vQlAL
<FromGitter> <tarvit> @sdogruyol thank you.
<FromGitter> <tarvit> Maybe sometimes it will possible to call some `binding.cry` and debug like a boss :D
<olbat> ty for your answer bew, btw that's strange, 1 month ago it was ~stable and now it's failing 100% of the time ...
<travis-ci> crystal-lang/crystal#76b4f2d (master - added PCG32 random generator): The build has errored. https://travis-ci.org/crystal-lang/crystal/builds/248368649
bjz has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 260 seconds]
bjz_ has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <sdogruyol> what's failing @olbat?
tankfeeder has quit [Quit: Leaving]
minus has quit [Ping timeout: 240 seconds]
Philpax has quit [Ping timeout: 260 seconds]
panderssen has quit [Quit: Page closed]
minus has joined #crystal-lang
<olbat> @sdogruyol the job does not even start, it fails during the preparation phase with the error " Multi-schedulers support (simple fifo and fifo with matching)
<olbat> oops: *with the error "The repository key needed to install Crystal did not have the expected fingerprint. Your build was aborted." (cf. https://github.com/travis-ci/travis-ci/issues/7894)
<travis-ci> crystal-lang/crystal#76b4f2d (master - added PCG32 random generator): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/248368649
<FromGitter> <krypton97> Why doesn't crystal supports {} as well?
<FromGitter> <krypton97> I mean end could be anoying sdometimes
<FromGitter> <krypton97> nm
<FromGitter> <krypton97> nn
chimkan has quit [Quit: chimkan]
hightower2 has joined #crystal-lang
<hightower2> Hey, how do I subclass Time? When I try "struct Time2 < Time", I get can't extend non-abstract struct Time
cyberarm has quit [Read error: Connection reset by peer]
<FromGitter> <bigtunacan> Structs cannot inherit non abstract structs
<FromGitter> <bigtunacan> Eg; you don't inherit from it
<FromGitter> <bigtunacan> You would need to use composition instead
<FromGitter> <straight-shoota> hightower2, what's your use case?
cyberarm has joined #crystal-lang
<hightower2> straight-shoota: I want to "subclass" Time because it is used to store both date and time, and I need differently-named classes/structs to define a couple of overloaded methods
<hightower2> Where some would only deal with the date-part of Time, some with time-part, and one with both date and time
<hightower2> bigtunacan: I'm not dependent on using inheritance, any method that would achieve the effect would be fine
<FromGitter> <elorest> In reference to @sdogruyol post above lets try to get crystal to 9000 stars on GitHub. https://stackoverflow.blog/2017/06/15/developers-use-spaces-make-money-use-tabs/
<FromGitter> <elorest> Have all of your coworkers with github accounts star it
sz0 has quit [Quit: Connection closed for inactivity]
chimkan has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 246 seconds]
rohitpaulk has joined #crystal-lang
Yxhuvud has quit [Remote host closed the connection]
Yxhuvud has joined #crystal-lang
<FromGitter> <straight-shoota> hightower2, maybe it would make sense to define independent structs for date and time and store values like hours, minutes, seconds, day, month, year in attributes
<FromGitter> <straight-shoota> in #4556 we're currently discussing the features Crystal standard lib should have for handling date and time
rohitpaulk has quit [Ping timeout: 240 seconds]
chimkan has quit [Quit: chimkan]
mhib has joined #crystal-lang
<hightower2> straight-shoota: yeah, but I do need those to be backed by a Time object. I suppose I could do @time= Time.new in there and delegate methods to @time object, but I'd prefer to avoid that if possible
<FromGitter> <bew> just made a little "script" to remove 350_000 specific files... it's so cool how fast it is (to write crystal and to execute) ;)
<FromGitter> <straight-shoota> well, for now you'll need to either delegate to `Time` or use a custom implementation
<hightower2> Ok, will do a delegate then, thanks!
<Yxhuvud> straight-shoota: I think one thing to not forget about the time discussion is that Ruby didn't start out with the mess there is today, but still with the mess of options, it still *wasn't good enough* for the rails usecase, so they had to invent TimeWithZone.
<FromGitter> <straight-shoota> maybe you'd like to voice your use case in #4556 as an example?
<hightower2> straight-shoota: checked the ticket, it's a bit more advanced than what I ask for, so don't see the need to participate there.
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter> <straight-shoota> yes, it is a huge task^^
<hightower2> straight-shoota: In general though I kind of like that it's all in a single class Time. I just rewrote my Ruby code to use just Time in crystal and I was surprised how convenient it was, and how it even brought some possible features/use cases for free.
<Yxhuvud> Necessary at some point. Of course, if you get it wrong someone is bound to reimplement TimeWithZone.
hightower2 has quit [Ping timeout: 240 seconds]
<FromGitter> <johnjansen> anyone encountered this before `Increase MAXHINCR or MAX_HEAP_SECTS`
<FromGitter> <johnjansen> and if so, how did you handle it
chimkan has joined #crystal-lang
rohitpaulk has joined #crystal-lang
<crystal-gh> [crystal] matiasgarciaisaia pushed 2 new commits to master: https://git.io/vQ8zw
<crystal-gh> crystal/master 2fea1fd Matías García Isaía: Merge pull request #4528 from Sija/remove-osx-from-travis-ci...
<crystal-gh> crystal/master 7eabdcf Sijawusz Pur Rahnama: Allow OSX failures on Travis CI
<FromGitter> <johnjansen> ok so it looks like the solution is something akin to ⏎ ⏎ ```export GC_INITIAL_HEAP_SIZE=8G && ./my_executable``` [https://gitter.im/crystal-lang/crystal?at=59553e34c101bc4e3a34524e]
chimkan has quit [Quit: chimkan]
chimkan has joined #crystal-lang
chimkan has quit [Client Quit]
<travis-ci> crystal-lang/crystal#2fea1fd (master - Merge pull request #4528 from Sija/remove-osx-from-travis-ci): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/248470629
<DeBot> https://github.com/crystal-lang/crystal/pull/4528 (Allow OSX failures on Travis CI)
<crystal-gh> [crystal] konovod opened pull request #4636: Remove MT19937 and ISAAC PRNGs (master...master) https://git.io/vQ8aV
chimkan has joined #crystal-lang
mhib has quit [Ping timeout: 240 seconds]
chimkan has quit [Quit: chimkan]
<travis-ci> crystal-lang/crystal#2fea1fd (master - Merge pull request #4528 from Sija/remove-osx-from-travis-ci): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/248470629
<DeBot> https://github.com/crystal-lang/crystal/pull/4528 (Allow OSX failures on Travis CI)
mhib has joined #crystal-lang
chimkan has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 276 seconds]
<travis-ci> crystal-lang/crystal#2fea1fd (master - Merge pull request #4528 from Sija/remove-osx-from-travis-ci): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/248470629
<DeBot> https://github.com/crystal-lang/crystal/pull/4528 (Allow OSX failures on Travis CI)
ragmaanir has quit [Quit: Leaving]
chimkan has quit [Quit: chimkan]
chimkan has joined #crystal-lang
hightower2 has joined #crystal-lang
<hightower2> Hey, help me a little bit. I've created a struct, and it's not allowing me to do something like "@my = My.new; if Time.now > @my", saying no overload matches 'Time#>' with type My.
<hightower2> How do I solve that and make My comparable? (I assume that's the issue?)
<hightower2> very awesome!
<wmoxam> ✨ 🎉 ✨
<FromGitter> <mgarciaisaia> (Debian repo is broken *right now*, but working on that :) )
<wmoxam> I'll try to have an OpenBSD build working soon (ish)
<hightower2> We should update the channel title :)
<FromGitter> <straight-shoota> :clap:
<hightower2> wmoxam, looks like a version of that approach helped. But ideally I would extend the original method's argument type rather than have to copy/paste the code in a new method simply to change arg type
<hightower2> E.g. I see that Time#<=> is defined as (other : self). I'd just need to extend the type
<hightower2> And since ">" comes from Comparable, would be great if I could somehow reuse that.
mhib has quit [Remote host closed the connection]
chimkan has quit [Ping timeout: 255 seconds]
ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.23.0 | 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
<hightower2> wmoxam, I solved my issue by doing struct Time; include Comparable( myClasses... ); def <=>( myClasses...) .
<hightower2> I didn't get away without redefining <=> because the original one only had provision for comparing with self, so I essentially copy-pasted the code, but well...
<hightower2> (the original implementation of <=> in Time, I mean)
hightower2 has quit [Ping timeout: 240 seconds]
bjz has joined #crystal-lang
hightower2 has joined #crystal-lang
burky has joined #crystal-lang
burky has quit [Client Quit]
burky has joined #crystal-lang
burky has quit [Client Quit]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
A124 has quit [Ping timeout: 255 seconds]
A124 has joined #crystal-lang
hightower4 has joined #crystal-lang
hightower3 has quit [Ping timeout: 260 seconds]
ragmaanir has joined #crystal-lang