ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.23.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
alex`` has quit [Ping timeout: 265 seconds]
<FromGitter> <drujensen> Wishing DockerHub was setup for automatic build of crystallang/crystal. Waiting for 0.24.1 update of official docker image. https://hub.docker.com/r/crystallang/crystal/tags/
<FromGitter> <drujensen> Maybe santa will grant me my wish? ;-)
<FromGitter> <elorest> Apparently homebrew doesn't have the latest crystal yet?
sz0 has joined #crystal-lang
<FromGitter> <drosehn> Not yet. Probably someone having a holiday...
<FromGitter> <elorest> Yeah that makes sense, more or less lol
vivus has quit [Quit: Leaving]
cremes has joined #crystal-lang
cremes has quit [Client Quit]
<FromGitter> <sam0x17> .ticks was removed from Time in the new update -- is there an equivalent now?
faustinoaq has quit [Quit: IRC client terminated!]
faustinoaq has joined #crystal-lang
<FromGitter> <marksiemers> I think it is `utc_now`
DTZUZU has joined #crystal-lang
<FromGitter> <marksiemers> nm, that doesn't have the same output. That is the commit where `ticks` was removed though.
<FromGitter> <marksiemers> @sam0x17 - Is it for the amber code runner - the file naming?
<FromGitter> <marksiemers> We started using this: `Time.utc_now.to_s("%Y%m%d%H%M%S%L")`
<FromGitter> <marksiemers> That is not the same as ticks, but it is a slightly more readable timestamp than ticks, and it is precise to milliseconds
<FromGitter> <marksiemers> It looks like ticks is here, it just depends on your use case how you calculate/use it: ⏎ https://crystal-lang.org/api/0.23.1/Time/Span.html#from%28value%2Ctick_multiplicator%29%3Aself-class-method
<FromGitter> <marksiemers> `crystal eval 'puts (Time.utc_now - Time.new(0)).ticks, Time.new.ticks'`
<FromGitter> <marksiemers> nm, looks like ticks was removed from Time::Span too
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Read error: Connection reset by peer]
rohitpaulk has joined #crystal-lang
sz0 has quit [Quit: Connection closed for inactivity]
sz0 has joined #crystal-lang
_whitelogger has joined #crystal-lang
<FromGitter> <HCLarsen> Hey guys, anyone still in here.
DTZUZO has quit [Quit: WeeChat 2.0]
<FromGitter> <codenoid> me
<FromGitter> <HCLarsen> Cool.
<FromGitter> <HCLarsen> I don't remember you, are you part of the core team?
DTZUZO has joined #crystal-lang
DTZUZU has quit [Quit: WeeChat 1.9]
<FromGitter> <codenoid> wat
<FromGitter> <codenoid> i'm just crystal fan boy
alex`` has joined #crystal-lang
<FromGitter> <codenoid> https://s.id/TdX
<FromGitter> <elorest> Merry Christmas everyone!
<FromGitter> <Qwerp-Derp> Merry Christmas!
<FromGitter> <Qwerp-Derp> Should I create an issue in Homebrew for the new Crystal release (0.24.1)?
<FromGitter> <Qwerp-Derp> nvm
DTZUZU has joined #crystal-lang
sz0 has quit [Quit: Connection closed for inactivity]
DTZUZU has quit [Quit: WeeChat 1.9]
claudiuinberlin has joined #crystal-lang
<FromGitter> <mjago> @barachy Shainet looks very cool 👍
afraeim has joined #crystal-lang
DTZUZU has joined #crystal-lang
bijan_ has joined #crystal-lang
bijan_ is now known as bijan_awaaaay
bijan_awaaaay has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
DTZUZO has quit [Ping timeout: 265 seconds]
yllumina_ has quit [Remote host closed the connection]
faustinoaq has quit [Ping timeout: 264 seconds]
<FromGitter> <sdogruyol> merry christmas everyone ⛄
ashirase has quit [Ping timeout: 263 seconds]
ashirase has joined #crystal-lang
hightower3 has joined #crystal-lang
<Yxhuvud> Hmm, https://bugs.ruby-lang.org/issues/11286 was a pretty nice usage of case-equality.
hightower2 has quit [Ping timeout: 272 seconds]
Yxhuvud has quit [Remote host closed the connection]
Yxhuvud has joined #crystal-lang
<Yxhuvud> Also, topic should be updated.
afraeim has quit [Remote host closed the connection]
<Papierkorb> That case equality stuff there doesn't look like type-safety. meh.
<FromGitter> <bararchy> @mjago Thanks :)
<FromGitter> <bararchy> we added a gitter chat to it also, if you need help
<FromGitter> <bararchy> irprop is coming soon
<FromGitter> <bararchy> @ArtLinkov is adding it as we speak XD
<FromGitter> <bararchy> Oh, and Merry christmas everyone :)
<FromGitter> <sdogruyol> @bararchy great job 👍
<FromGitter> <bararchy> Thanks, but most of the job was done by @ArtLinkov
<FromGitter> <ArtLinkov> Based on our tests, SHAInet is already much faster than the FANN-binded library (and that's with using only SGD + momentum) :)
<FromGitter> <bararchy> because it's pure crystal, it wont halt the whole event loop either, so you can multi-task while it runs in the background
<FromGitter> <bararchy> it's cool to see that in this scenario Crystal is faster then C
<FromGitter> <mjago> Nice one @ArtLinkov ~ I’ve been having fun with crystal-fann!
<Papierkorb> Does shainet wait on I/O?
<Papierkorb> If not, it won't run "in the background".
<FromGitter> <mjago> Oh and Merry Xmas all 🎅 :tara:
<FromGitter> <mjago> 1) 🎉
<FromGitter> <ArtLinkov> @mjago Thanks
<FromGitter> <bararchy> Papierkorb it is in our regard, before we had C binding to FANN, and while it ran web (Kemal) would get unresponsive, now, it can both ran and show the web XD
<Papierkorb> You already claimed it to be faster
<FromGitter> <bararchy> Also, taking into account FANN's speed, we got it from 7 min a run to ~7 sec a run using SHAInet
<FromGitter> <bararchy> I guess we can add Fiber.yeild in between EPOCHs so that is will release the event loop if needed
<Yxhuvud> papierkorb: I would not mind a type safe case equality, given that case type checking would be smart enough to apply things like Class#=== smart enough.
hightower2 has joined #crystal-lang
<Papierkorb> Yxhuvud: Class#=== already works, the point was that it needs to be (if at all) carefully crafted. I don't want array_of_ints.any?(/asd/) to compile.
<Papierkorb> Because that predicate can never be true
<crystal-gh> [crystal] MakeNowJust opened pull request #5452: Fix formatting multi assignment with newline after equal (master...fix/crystal-format/multi-assign-newline) https://git.io/vb7EK
<Yxhuvud> papierkorb: I was thinking of cases like a : Int|String; case a; when String; a else a += 1; end should continue to work.
<Yxhuvud> (well given that a actually has a value and not only a type :P)
<Papierkorb> What's the difference? That already works
<Yxhuvud> But would it continue to work if === for most stuff stops accepting whatever and returning nil in that case?
<Papierkorb> It should, all methods that do type re-restriction are "special" already
<Yxhuvud> sure, but I've never been in a situation to verify that case actually does that.
<Yxhuvud> but if it does, then I certainly agree === should be tightened up.
<Papierkorb> I'm not sure what do you mean? What's wrong with current #=== ?
<Papierkorb> What doesn't it do what you want it to do?
<Yxhuvud> well, you complained that it would be type unsafe to use it in the context of #any?, but the same is basically same with usage inside case statements.
<Papierkorb> No I said that allowing to pass arbitrary types into #any? and friends is not a good idea
<Papierkorb> classes and union types aren't usually stored in variables, so allowing those could be sane
<Papierkorb> But not allowing an regex to be passed in on an array of int
<crystal-gh> [crystal] MakeNowJust opened pull request #5453: Parse slash after open-paren as regex delimiter (master...fix/crystal/parse-slash-in-paren-as-regexp) https://git.io/vb7uU
<Yxhuvud> yes, and you can totally do a similar things in case statments: case 5; when /xyz/; else; p :hi; end compiles just fine.
<Papierkorb> case statements aren't easily comparable to those predicate methods
<Papierkorb> cases are commonly static in structure, including their types
<Papierkorb> Can't say the same about methods
<Papierkorb> In fact, it doesn't make sense that a case on a Array(Int32) even compiles with regex branch
<Papierkorb> It won't ever run, it can't ever run. That's dead code. The only point why to allow is to make it easy to write generic code
<crystal-gh> [crystal] MakeNowJust opened pull request #5454: Fix to keep paren information for `to_s` on clone (master...fix/crystal/keep-keyword-info-on-clone) https://git.io/vb7z7
<FromGitter> <HCLarsen> Hey guys, when working with the JSON.mapping macro, is it possible to get a property from the JSON object that's buried a layer or two within the object, instead of just top level values?
<oprypin> HCLarsen, if those subobjects are also mapped and specified as part of the top level one
<oprypin> or specify different root for json.mapping
<oprypin> uh wait, i think root is specified when parsing
<FromGitter> <HCLarsen> When you say subobjects being mapped and specified as part of the top level one, what do you mean?
<FromGitter> <HCLarsen> Here's my code example if it helps. I'm trying to get the "temp" property, which is within the "main" subobject.
cremes has joined #crystal-lang
<FromGitter> <bararchy> how do I do the reverse of Char.ord ? as in turn Int to Char via ASCII mapping
<FromGitter> <bararchy> Oh, Int#chr
<FromGitter> <bararchy> XD
snsei has joined #crystal-lang
faustinoaq has joined #crystal-lang
hightower2 has quit [Ping timeout: 260 seconds]
hightower2 has joined #crystal-lang
A124 has quit [Read error: Connection reset by peer]
A124 has joined #crystal-lang
snsei has quit [Remote host closed the connection]
WeirdGuest has joined #crystal-lang
Poeticide is now known as Poeticode
WeirdGuest has quit [Quit: Page closed]
DTZUZO has joined #crystal-lang
cremes has quit [Quit: cremes]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
ylluminate has joined #crystal-lang
yllumina_ has joined #crystal-lang
ylluminate has quit [Ping timeout: 268 seconds]
<FromGitter> <Jens0512> If you guys were to make a simple program like `crystal-cd ...`- simply doing just the same as `cd ...` what do you think you would do?
snsei has quit [Remote host closed the connection]
<Papierkorb> `crystal init app my-ls` would be a good starting point.
<Papierkorb> Note that cd can't even be a program by itself, your example is too simple and can thus lead to confusion.
<Papierkorb> Jens0512, What are you actually trying to do? Please don't simplify the problem, it has too often lead to confusion on both sides and resulted in inferior solution recommendations based on that.
snsei has joined #crystal-lang
<FromGitter> <marksiemers> @Jens0512 - It wouldn't actually be doing anything, but you could use backticks to execute `cd` and use `ARGV` to pass along the command.
<FromGitter> <marksiemers> Based on "doing the same this as `cd ...`" - that should work
hightower2 has quit [Ping timeout: 256 seconds]
snsei has quit [Remote host closed the connection]
yllumina_ has quit [Quit: Textual IRC Client: www.textualapp.com]
ua_ has joined #crystal-lang
hightower2 has joined #crystal-lang
<FromGitter> <straight-shoota> @sam0x17 what do you need `ticks` for? It was an implementation detail that shouldn't have been useful for anything before it was removed.
faustinoaq has quit [Quit: IRC client terminated!]
faustinoaq has joined #crystal-lang
<FromGitter> <marksiemers> @straight-shoota - I'm not sure if this is what @sam0x17 is looking to correct, but he did use it for `amber exec` - which creates log files. `ticks` was used for ensuring uniqueness. ⏎ If that's what he's looking into now, I think a timestamp for the file will work better.
faustinoaq has quit [Ping timeout: 268 seconds]
<FromGitter> <marksiemers> Nm, it looks like `Time.now.epoch_ms` was used there. I'm not sure what his use case is. ⏎ I couldn't figure out exactly what ticks was, did it represent any measure of time?
<FromGitter> <straight-shoota> `Time` was using it internally as measurement of time, where each tick represented a specific amount of milliseconds.
<FromGitter> <marksiemers> Ah, is it used instead of nanoseconds (or microseconds) to support a larger range of time while being more precise than milliseconds?
<FromGitter> <marksiemers> As well as the meta-info in the higher bits
<FromGitter> <straight-shoota> basically, yes
<FromGitter> <marksiemers> In hindsight, it should have been a private or protected method all along?
<FromGitter> <straight-shoota> yes
<FromGitter> <straight-shoota> It didn't make much sense to use it. The improved precision over `epoch_ms` is just one order of magnitude and it would certainly not work now that time has nanosecond precision.
<FromGitter> <straight-shoota> If we had kept the concept of uing ticks internally with nanoseconds, each tick might now amount to a nanosecond or something
<FromGitter> <straight-shoota> it wouldn't have been guaranteed to be 1 tick == 10 ms
<FromGitter> <straight-shoota> but ticks were completely removed anyway because they didn't make much sense
<Papierkorb> ticks were defined in terms of constants, that was never an issue
rohitpaulk has quit [Ping timeout: 260 seconds]
<FromGitter> <straight-shoota> It might have been, if you just used the plain number returned by `ticks`
<FromGitter> <straight-shoota> it wasn't supposed to be used outside the implementation of `Time` and `Time::Span` and even for that it wasn't really useful.
<FromGitter> <straight-shoota> Could have used miliseconds directly like we now have seconds and nanoseconds
<FromGitter> <marksiemers> @sam0x17 - If you're around today, let us know what your use case for ticks was/is. I'm curious (if it is something other than time-stamping files).
<FromGitter> <fridgerator> interesting : react-like rust framework : https://github.com/DenisKolodin/yew
<FromGitter> <Jens0512> @marksiemers `\`cd #{wherever}\``would not do anything useful at all as it would be done in a new process. How could i make it so calling the program in a terminal would actually cd in that terminal?
<FromGitter> <Jens0512> (And thanks for answering)
<FromGitter> <Jens0512> Even if you do not see this message for a long time, please tag me with a reply if you have any.
bijan_ has joined #crystal-lang
bijan_ is now known as bijan_awaaaay
bijan_awaaaay has quit [Client Quit]
<FromGitter> <marksiemers> As previously mentioned, I think more context will help here - why do you need to change directories in the terminal using Crystal?
<FromGitter> <Jens0512> I do not need to. I simply want to know how to
<Papierkorb> Jens0512, Why haven't you looked yet into the docs?
<Papierkorb> Chaning directories has something to do with Directories, so it'll be in Dir.
<FromGitter> <Jens0512> I have, but i can't find anything regarding it.
<FromGitter> <Jens0512> The Dir.cd does not change directory in the shell the program is called in does it?
<Papierkorb> Why exactly shouldn't it? Have you tried it?
cremes has joined #crystal-lang
<FromGitter> <Jens0512> Yes, and it does not work
<Papierkorb> Why haven't you posted the code you're having issues?
<FromGitter> <Jens0512> Now i have: `Dir.cd ENV["HOME"]`
<Papierkorb> And further?
<FromGitter> <Jens0512> This is it currently. This is what i do not manage
<Papierkorb> What have you tried to put after that line?
<FromGitter> <Jens0512> Couple of other stuff, but i do not see why it matters
<FromGitter> <Jens0512> ~~stuff~~ *things
<Papierkorb> Look. We *want* to help. Like, really we want to. Many in here love it. That's why we're here.
<Papierkorb> But for that, the helpee has to help the helper to receive help themselves.
<oprypin> geez just stop
<oprypin> Jens0512, it is literally impossible for a process to affect the current directory of the parent process
<FromGitter> <Jens0512> Oh ok
<oprypin> too bad i couldn't save you those 3 hours :/
<FromGitter> <Jens0512> Thats too bad
<Papierkorb> Everyone could have, if that would've been the question
GoldenBear has quit [Quit: bai]
<FromGitter> <Jens0512> Sorry for wasting your time ⏎ Ill be more clear next time
<oprypin> i don't know what wasn't clear, that was just feigning ignorance
<oprypin> > make a simple program like `crystal-cd ...`- simply doing just the same as `cd ...`
<oprypin> if you don't know what `cd` does, try `man cd`
<oprypin> its secret is that it must be implemented in the shell itself and can't be an external process
GoldenBear has joined #crystal-lang
<FromGitter> <marksiemers> @Jens0512 - Please feel free to ask other questions. In general, it is easier with a bit of context and an end goal in mind. ⏎ For example: ⏎ ⏎ > I need to change directories based on user input so that custom config files can be used to execute the program, and the user can store those files in arbitrary directories. ⏎ > So far I have this code `...` (or link to a gist), this is what is happening:
<FromGitter> ... '...', and this is what I want to happen: '...' [https://gitter.im/crystal-lang/crystal?at=5a41510effa3e379197c1a53]
<FromGitter> <marksiemers> Thanks for your interest.
cremes has quit [Quit: cremes]
alex`` has quit [Quit: WeeChat 2.0]
<FromGitter> <barisbalic> I'm trying to cross-compile for the first time and have some questions, first off, the command that `--cross-compile` generates for me looks a bit odd... `cc 'test.o' -o 'test' -rdynamic -L/usr/local/lib -lSDL2 -lpcre -lgc -lpthread /Users/barisbalic/.anyenv/envs/crenv/versions/0.23.1/src/ext/libcrystal.a -levent -lrt -ldl -L/usr/lib -L/usr/local/lib` it seems to reference a bunch of things local to my
<FromGitter> ... machine, including `libcrystal.a`, is it expected that this file exists somewhere on the target?
faustinoaq has joined #crystal-lang
alex`` has joined #crystal-lang
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
cremes has joined #crystal-lang
vanbuur740 has joined #crystal-lang
<vanbuur740> ▄▄▄▄▄▄▄▄▄▄▄▄ HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! tsdhryy: pabs foca pleiosaur fiete avdi justinmcp hightower3 lvmbdv mroth SuperChickeNES hightower2 swav FromGitter dostoyevsky DTZUZO asterite tliff hmans A124 DTZUZU Papierkorb ephem
<vanbuur740> ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! agnkqa: danzilio bmcginty jfontan hightower2 maxpowa binBASH aarongodin ua_ SuperChickeNES hightower3 li
<vanbuur740> ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! pjiwchrd: mjblack Vexatos hmans dostoyevsky asterite andersh binBASH ua_ foca hightower2 Yxhuvud ashirase _whitelo
<vanbuur740> ▄▄▄▄▄▄▄▄▄▄ HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! ykaugu: foxxx0 Majost pleiosaur Vexatos cremes bmcginty Yxhuvud A124 shelvacu literal justinmcp Papierkorb TIMEBONEZ dostoyevsky hightower3 binBASH alex`` ashirase maxpowa foxbot andrewzah salvor fiete as
<vanbuur740> ▄▄▄▄▄▄▄▄▄▄ HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! tbtzjdr: dostoyevsky tliff foxbot jeromegn asterite Majost lvmbdv pleiosaur andersh maxpowa faustinoaq binBASH SuperChickeNES foxxx0 DTZUZO hmans shelvacu jhass ephemera_ danzilio swav jfontan hightower2
vanbuur740 has quit [K-Lined]
<FromGitter> <greenbigfrog> who doesn't love the freenide spammers
<FromGitter> <bararchy> :\
<FromGitter> <fridgerator> ugh
<FromGitter> <HCLarsen> WTF???
<FromGitter> <drosehn> Note that the `cd` question might be fueled by the fact that there *is* a `cd` command in unix. As you might expect it is pretty worthless, however it does exist and it is defined by POSIX. So if someone looks under `/usr/bin` for some easy command to re-implement in crystal, they might be fooled by the fact that a `cd` command exists there.
<oprypin> bash: /bin/cd: No such file or directory
<FromGitter> <drosehn> `type -a cd`
<FromGitter> <HCLarsen> Hey @oprypin can you please elaborate on your earlier statement about my JSON.mapping issue? How do I access a property within a subobject of the JSON object I'm mapping?
<FromGitter> <bararchy> ```type -a cd ⏎ cd is a shell builtin ⏎ ``` [https://gitter.im/crystal-lang/crystal?at=5a416b24b48e8c3566667d27]
<FromGitter> <drosehn> Note that I said `/usr/bin/cd`, although I seem to remember some OS's do have it as `/bin/cd`.
<FromGitter> <drosehn> Huh, interesting. I checked RHEL, osx, and solaris before posting that. What OS are you on?
<FromGitter> <bararchy> Arch Linux
<FromGitter> <bararchy> :)
<oprypin> File: /bin -> usr/bin
<oprypin> HCLarsen, i have nothing more to say without an example, mainly because i've never used json.mapping
<FromGitter> <HCLarsen> @oprypin does this example help:
<oprypin> definitely
<FromGitter> <HCLarsen> For example, I want the "temp" value that's within the "main" subobject. How would I fix the code on the line for temp to get that value?
<oprypin> ehhhh
<jsn-> debian, gentoo, centos and ubuntu i've checked don't seem to have (/usr)/bin/cd; surprisingly, freebsd does have it, though
<oprypin> HCLarsen, maybe you don't wanna use json.mapping
<oprypin> j["main"]["temp"].as_f so easy
<FromGitter> <HCLarsen> No?
<FromGitter> <drosehn> freebsd is where I remember it from, actually. long ago we had a discussion as to why do we bother to have it, and the answer was "because POSIX says it's there".
<FromGitter> <HCLarsen> Ohhh. Well that's what I did the first time around. Resulted in lots of boilerplate code.
<FromGitter> <HCLarsen> I was hoping that json.mapping would help me slim down the code.
<FromGitter> <HCLarsen> @oprypin so I do have to create a struct within my parent class for each subobject within the JSON that I'm parsing.
<oprypin> yes
<FromGitter> <HCLarsen> Ok. I was hoping there'd be a way around that, but at least I know there isn't.
<FromGitter> <HCLarsen> Now I just have to decide if I want to do that, or stick with the manual approach of `["main"]["temp"].as_f` for all the properties I'm extracting.
<jsn-> that's ugly, though
<jsn-> and apparently doesn't do what you want :)
<jsn-> ah, no, it does what you want
<jsn-> but still ugly
<FromGitter> <HCLarsen> It is a bit ugly, it does what I want, but I'd want to access it as "temp" instead of as "main." I'm also going to want to extract the other properties within the "main" subobject.
<jsn-> then yes, you should create a separate mapping for the subobject, obviously
<FromGitter> <HCLarsen> Like this: https://play.crystal-lang.org/#/r/3akt
<oprypin> this is a huge hack and defeats the point.
<oprypin> dont forget forward_missing_to
<jsn-> if it's a hack, it's a hack in JSON.mapping, though
<jsn-> but yeah, not gonna win any beaty contests
<FromGitter> <HCLarsen> Yeah, I was originally thinking that json.mapping would make the code cleaner than what I've currently got, but it seems that this is just as complicated.
<FromGitter> <HCLarsen> The question is, will it be cleaner than the current version: https://github.com/HCLarsen/OpenWeatherMapCr/blob/master/src/open_weather_map/weather.cr
<oprypin> yes
<FromGitter> <HCLarsen> Then I guess I've got a lot of work ahead of me.
GoldenBear has quit [Quit: bai]
<FromGitter> <HCLarsen> Is there a way to do forward_missing_to with multiple delegates?
<oprypin> no
<FromGitter> <HCLarsen> Damn.
<oprypin> HCLarsen, you can do better though -- if you really want. {% for name in %w[a b c] %}def {{name}}; @foo.{{name}}; end{% end %}
<FromGitter> <HCLarsen> I'm gonna be honest, I do not understand that code in the slightest.
<oprypin> HCLarsen, good time to learn macros then
<FromGitter> <HCLarsen> Then that's what I'll learn. Thanks.
<oprypin> HCLarsen, https://carc.in/#/r/3ali
<FromGitter> <HCLarsen> This a good place to start? ⏎ https://crystal-lang.org/docs/syntax_and_semantics/macros.html
<oprypin> yeah, no other place that i know of
<FromGitter> <HCLarsen> Thanks.
<oprypin> macros are the solution to boilerplate here no matter how you frame it
<FromGitter> <HCLarsen> That's a great description.
<FromGitter> <HCLarsen> Does Crystal have anything analogous to Ruby's Object#methods
<oprypin> in macro context yes, but i would avoid it
<FromGitter> <HCLarsen> Ok.
<oprypin> it's pretty nice to be explicit about it. yeah, some dulppication, oh well
<oprypin> https://crystal-lang.org/api/0.23.1/Crystal/Macros/TypeNode.html#methods%3ACrystal%3A%3AMacros%3A%3AArrayLiteral%28Def%29-instance-method
<FromGitter> <HCLarsen> In the macro example you gave me, I'd have to type out all the methods manually, but that would give me an option to get that list without so much typing.
<oprypin> certainly
GoldenBear has joined #crystal-lang
<hightower2> Looks like channel title should be updated to mention 0.24.1
<FromGitter> <HCLarsen> Is 0.24.1 available for all platforms?
<oprypin> seems so
<hightower2> Seems so by looking at https://github.com/crystal-lang/crystal/releases
<FromGitter> <HCLarsen> When I asked, I was told that you can only get it by compiling from source.
<oprypin> HCLarsen, that was true when you were told that
<oprypin> v0.24.1 tag appeared 10+ days ago, binary releases appeared ~2 days ago
<FromGitter> <HCLarsen> Ahhh. So is there an Ubuntu package then?
<oprypin> probably
<FromGitter> <HCLarsen> Good, good.
<FromGitter> <Jens0512> So no way to execute an executable in a crystal executable parent process
<oprypin> Jens0512, whaaaaaaaat
<FromGitter> <Jens0512> Thought for a second that `Process.exec "an-executable"`would work, but apparently not
<FromGitter> <HCLarsen> Wow, I don't know how to execute that statement. :D
<oprypin> now we definitely have no idea what you're talking about, you just started the conversation with a very vague and probably false statement
<FromGitter> <HCLarsen> I think I saw something about this earlier in this chat, so please jog our memory @Jens0512
<FromGitter> <drosehn> You couldn't force it to happen. If the parent process is something that you're writing, then you could set up something where the child process writes a command which the parent reads in.
<FromGitter> <drosehn> so, if the parent process was a shell, and you typed in: `eval "$(your_crystal_pgm)"`, then that'd probably work. ... assuming I've typed that in correctly.
<RX14> yeah I was going to modify the topic
RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.24.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> <HCLarsen> What about the API documentation? It still says 0.23.1 as well
<RX14> yeah well thats fucked
<oprypin> uhh
<RX14> the CI's broken
<RX14> travis is meant to do that automatically
<FromGitter> <HCLarsen> Oh.
<RX14> but it needs tweaking
<RX14> because travis sucks
<FromGitter> <HCLarsen> No argument here.
<RX14> aka: it doesn't build when you push tags
<RX14> but if you push tags and commits at the same time
<oprypin> the only thing travis is good at is providing free hardware
<RX14> it does
<RX14> :ok_hand:
<RX14> we need to enable building tags properly
<RX14> and we need to fix the CI script to strip the new v prefix for versions too
<RX14> i've been putting off thinking about it
<FromGitter> <HCLarsen> 1) 24.1 also doesn't show up yet on play.crystal-lang.org.
<oprypin> that's a whole another deal
<oprypin> i still disagree with the "play.crystal-lang.org" alias
<oprypin> just use carc.in
<oprypin> the reason that i bring this up is that Manas does not manage this service
<hightower2> I have a macro as part of which I create a "def" in the following form: def somefunc({{ call.args.splat }}) : Bool. Now, in that method, I need to access the value of first argument. How do I do that given that I don't clearly see what the argument names are?
<oprypin> call.args[0] i dunno
<oprypin> first time i see .splat being used
<oprypin> there's a syntax for it {{*["a", "b"]}}
<oprypin> aha it's literally rewritten to that.splat, same for ** that.double_splat
<hightower2> oprypin, {{ call.args[0] }} seems to expand to literal "name : String", rather than just "name"
<oprypin> hightower2, the result of it is a value of type Arg, hopefully you can figure out what to do with that
<oprypin> you say it expands to that. that's true, but only because you didnt do anything else with it
<hightower2> I tried .id on it, got same result
<hightower2> Yes, I tried {{ call.args[0].name }}, got undefined macro method 'TypeDeclaration#name'
<oprypin> hightower2, well then something's wrong
alex`` has quit [Ping timeout: 265 seconds]