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
<FromGitter> <straight-shoota> so HEAD^^ is 5b71ddf8 ?
<FromGitter> <jwoertink> yeah
<FromGitter> <jwoertink> ```[17:02PM] lang (master)$ git rev-parse --short HEAD ⏎ 5b71ddf83``` [https://gitter.im/crystal-lang/crystal?at=597fc5181c8697534a7861e8]
<FromGitter> <jwoertink> that's on master, but on my new branch it's `ec049a08d` which is my latest commit
<FromGitter> <straight-shoota> ok
<FromGitter> <straight-shoota> what exactly does `git push -f origin feature/http_client_put_form` say?
<FromGitter> <straight-shoota> `origin` is `github.com/jwoertink/crystal`?
<FromGitter> <jwoertink> `Everything up-to-date`
<FromGitter> <jwoertink> yeah
<FromGitter> <jwoertink> origin is my fork, and upstream is the crystal repo
<FromGitter> <straight-shoota> oh wait
<FromGitter> <straight-shoota> you're probably tracking `origin feature/http_client_put_form` from your old local branch
<FromGitter> <straight-shoota> try `git push -f origin fix_pr:feature/http_client_put_form`
<FromGitter> <jwoertink> ah ha!
<FromGitter> <jwoertink> noice :D
<FromGitter> <jwoertink> Thanks for the help
<FromGitter> <straight-shoota> sure
<FromGitter> <picatz> Livin' up to his name once again! :D
<FromGitter> <jwoertink> totally!
Philpax has joined #crystal-lang
<FromGitter> <doughsay> hey everyone, what's the state of thread support in crystal? doesn't look like there's been any activity on the `thread-support` branch since march... how likely are we to get something at least experimental soon?
https_GK1wmSU has joined #crystal-lang
https_GK1wmSU has left #crystal-lang [#crystal-lang]
<FromGitter> <watzon> Seconding @doughsay 's question
<FromGitter> <watzon> Also a little Crystal history question if anyone would care to answer it. When Crystal was written in Ruby was it still getting compiled to machine code? Or was it being interpreted at that point?
<crystal-gh> [crystal] wmoxam opened pull request #4770: Refactor platform specific process path (master...refactor-platform-specific-process-path) https://git.io/v7Boc
_tsound has joined #crystal-lang
<_tsound> Does crystal have an inline assembler?
<_tsound> like C++'s "__asm__"
<FromGitter> <mgarciaisaia> @watzon I wasn't really involved in Crystal at the time, but I'm pretty much sure that LLVM was always around, so I'd say 99.9% sure that it was compiled anyway
<FromGitter> <mgarciaisaia> The only difference was that the code that invoked LLVM was written in Ruby instead of in Crystal itself
<FromGitter> <watzon> @mgarciaisaia I figured as much. Thanks :)
<FromGitter> <mgarciaisaia> About `thread-support`, I once again am not sure about the latest news, but I *think* news may be coming on that (an some other main topics) in the next few months. I'm *really* not saying "It'll be done in two months", I'm saying something like "there will probably be more concrete deadlines & statuses in a couple of months".
<FromGitter> <mgarciaisaia> I know how it feels to feel no feedback from a team, and I really apologize for getting you into that position. We're juggling a couple of things here, and I personally have a really hard time to not let something slip when I'm focusing on something else. That balance between multiple stuff - I've never done a great job at that.
<FromGitter> <mgarciaisaia> I am reading the feedback you're sending - haven't replied because I feel I need to think through it instead of just saying something. But believe me Crystal's not dead *at all*, and we're going to be here, supporting it, next year, the other, and (hopefully) many more.
<FromGitter> <doughsay> Thanks for the update; looking forward to some news! I'm only using Crystal for a hobby project right now, but thread support will be needed to bring it to the next level, so I'm very much looking forward to it. I'm also totally happy to use experimental stuff; as I said, it's only a hobby project...
<FromGitter> <mgarciaisaia> We're *definitely* getting thread support. We've discussed that a gazillion times, and we know we're doing that. ⏎ That being said - Node & Ruby are two great examples that force me to re-think the *No can't do without it* chain of thought.
sz0 has quit [Quit: Connection closed for inactivity]
<FromGitter> <doughsay> Yeah, good point, but I wouldn't be trying to write a videogame in Node or Ruby. For games the choice is usually C or C++, or an engine like Unity. With Crystal's great speed and ability to call into C libraries, it makes it a potentially good alternative for games. That's what I'm experimenting with.
snsei has joined #crystal-lang
Split has quit [Quit: Leaving]
<FromGitter> <konovod> Ruby+Gosu is nice for 2d games.
_tsound has quit [Quit: WeeChat 1.9]
snsei has quit [Remote host closed the connection]
<FromGitter> <bararchy> I think Crystal can be a major player in the game industry , just need more love , but it can get there
snsei has joined #crystal-lang
https___GK1wmSU has joined #crystal-lang
https___GK1wmSU has quit [Excess Flood]
snsei has quit [Remote host closed the connection]
Groogy_ has quit [Read error: Connection reset by peer]
<FromGitter> <Qwerp-Derp> Uhhh... how do I compile a program to Windows?
<FromGitter> <Qwerp-Derp> I compiled a program in Mac OS X and it didn't work with Windows (which is probably expected)
ome has quit [Ping timeout: 276 seconds]
ome has joined #crystal-lang
<FromGitter> <straight-shoota> @Qwerp-Derp Windows is not fully supported yet, but you can cross compile simple programs. Instructions and details on #3582
snsei has joined #crystal-lang
<FromGitter> <Qwerp-Derp> Oh, I just thought that you can't actually compile anything in Crystal, I didn't know that even compiled programs can't work :(
<FromGitter> <Qwerp-Derp> Is there a way to get the position of the cursor in the terminal through Crystal?
snsei has quit [Ping timeout: 240 seconds]
mark_66 has joined #crystal-lang
bazaar_ has quit [Quit: leaving]
bazaar has joined #crystal-lang
<FromGitter> <Qwerp-Derp> This stalls forever, for some reason: ⏎ ⏎ ```print "\e[6n" ⏎ line = STDIN.raw &.gets ⏎ puts line``` [https://gitter.im/crystal-lang/crystal?at=598035a1329651f46edda496]
<FromGitter> <Qwerp-Derp> Is anyone on right now?
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 246 seconds]
<crystal-gh> [crystal] RX14 closed pull request #4768: Rescue IO errors from input.close in HTTP request processor (master...bugfix/request-processor-errno) https://git.io/v7Blb
fenicks has joined #crystal-lang
<07EABEBWA> crystal-lang/crystal#919cba9 (master - Rescue IO errors from input.close in HTTP request processor (#4768)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/259674779
<travis-ci> crystal-lang/crystal#919cba9 (master - Rescue IO errors from input.close in HTTP request processor (#4768)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/259674779
<travis-ci> crystal-lang/crystal#919cba9 (master - Rescue IO errors from input.close in HTTP request processor (#4768)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/259674779
<RX14> @sdogruyol I never heard about https://crystal-lang.org/2017/07/31/launching-the-2017-state-of-crystal-survey.html , why don't you advertise it more?
snsei has joined #crystal-lang
leandrobighetti has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
<FromGitter> <Qwerp-Derp> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59804aa6bc4647297442849a]
<FromGitter> <Qwerp-Derp> Right now this won't compile because `char` can be `Char` or `Nil`, is there any way to run the `line += char` line if `char` is not nil, and the compiler will catch that?
<Yxhuvud> wrap it in an if statement.
<FromGitter> <Qwerp-Derp> I did, compiler still trips up
<FromGitter> <Qwerp-Derp> I changed the line to this: `line += char if char != nil`, compiler still doesn't allow me to run
<Yxhuvud> doesn't work with infix if for some unknown reason (it probably should)
<FromGitter> <Qwerp-Derp> Still doesn't work if I change it to ⏎ ⏎ ```if char != nil ⏎ line += char ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=59804b7b329651f46eddf48c]
<RX14> != nil never works
<RX14> == can be overriden so the compiler can't use == or !=
<FromGitter> <Qwerp-Derp> So what do I use?
<RX14> you can use .nil? or .is_a?
<RX14> those are special methods that can't be overridden
<RX14> but really, just use truthiness
<RX14> unless it's a Bool | Nil
<RX14> which is rare
<RX14> line += char if char
rohitpaulk has joined #crystal-lang
<jokke> hey
<jokke> (how) can i statically link a crystal binary on arch linux?
<jokke> if i try with --link-flags static i get /usr/bin/ld: cannot find -lssl etc
rohitpaulk has quit [Ping timeout: 260 seconds]
<FromGitter> <straight-shoota> @sdogruyol on the survey page 2: *Approximately how large are all the Crystal projects that you work on?* - is this asking for total sum? I think it should be more clearly.
<FromGitter> <straight-shoota> and page 3: *What editor(s) do you use when writing Crystal?* - asks for plural but you can only select one.
<FromGitter> <straight-shoota> same for *Which version(s) of Crystal do you use for your applications?*
rohitpaulk has joined #crystal-lang
<FromGitter> <straight-shoota> and just as a suggestion: *How difficult did you find learning Crystal?* has very little meaning if you don't ask for prior experience with programming and similar languages.
<FromGitter> <straight-shoota> never mind it is on a later page
<FromGitter> <sdogruyol> @straight-shoota hey thanks for your valuable feedbacks :)
<FromGitter> <sdogruyol> I haven't publicly announced the survey yet :P
<FromGitter> <sdogruyol> @RX14 I'll announce it today with the weekly + other channels
<RX14> well it was on the crystal-lang blog...
<FromGitter> <sdogruyol> Yes, I'm aware of that
<FromGitter> <sdogruyol> Meanwhile we haven't publicly announced it yet some people actually completed survey :)
<FromGitter> <sdogruyol> That's awesome
<FromGitter> <straight-shoota> published on https://crystal-lang.org/ should considered publicly announced
<FromGitter> <sdogruyol> @straight-shoota yes
<FromGitter> <sdogruyol> I mean we still haven't pushed it to other channels yet
<FromGitter> <sdogruyol> Which is happening shortly :P
<jokke> anyone? :/
<FromGitter> <sdogruyol> sorry @jokke, wish i could help but I'm not using Arch :(
<FromGitter> <bew> Morning guys!
<FromGitter> <sdogruyol> Morning @bew
<jokke> no problem. i'll try building the libs with abs (arch build system)
<FromGitter> <straight-shoota> jokke, seems like you need libssl as a static library in your library path
<FromGitter> <straight-shoota> but I really don't know much about linking... just give it a little time, the experts will eventually turn up :D
<jokke> yeah i figured :)
<RX14> jokke, i don't think anyone knows how to do static linking
<RX14> it's not really been done
<RX14> there are certain libraries which just do not like to be statically linked
<RX14> and i think openssl is one of them
flaviodesousa has joined #crystal-lang
<jokke> RX14: i think i'm almost there! i just cloned the archlinux packagebuilds and added options=('staticlibs') to all libs i need to link
<jokke> RX14: i could compile and link without errors but i still have a few worrying warnings: https://p.jreinert.com/4dClEp/
<RX14> thats the parts about openssl and libc not liking static linking
<RX14> glibc uses dlopen even when statically lniked
<RX14> and if the libraries dlopen finds aren't compatible...
<RX14> then it blows up
<RX14> glibc and openssl are essentially useless to statically link
<RX14> since they blow up more often when statically linked
<Yxhuvud> you basically need a different libc implementation for that. There are other variants that actually do work to statically link, like musl. IIRC
<RX14> yup
<RX14> using alpine linux will help you out here
<Yxhuvud> (. because using arch is not hiptser enough .)
<RX14> no because thats what alpine was built around lol
<RX14> use the right tool for the job and all
<RX14> i'm not saying run alpine on your desktop
<RX14> thats a terrible idea
<RX14> just a docker container or chroot
<Yxhuvud> :P
snsei has joined #crystal-lang
hightower2 has joined #crystal-lang
snsei has quit [Ping timeout: 276 seconds]
<crystal-gh> [crystal] straight-shoota opened pull request #4772: Add JSON.def_to_json (master...jm-def-to-json) https://git.io/v7RGl
<FromGitter> <sdogruyol> :D
<FromGitter> <sdogruyol> @RX14 how's alpine package manager though
<FromGitter> <sdogruyol> I've been itching to dive into alpine but no time yet
<FromGitter> <sdogruyol> everything statically linked by default?
<RX14> yes
<RX14> apk is one of the best package managers i've used
<RX14> it's blazing fast
<FromGitter> <sdogruyol> wow, sounds cool
<FromGitter> <sdogruyol> how come they have everything static by default?
<FromGitter> <sdogruyol> do they keep their own fork of everything or so?
<RX14> no...
<RX14> almost all libraries can be configured to be static easilly
snsei has joined #crystal-lang
<FromGitter> <codenoid> agree @bararchy
<FromGitter> <bararchy> woot
<FromGitter> <bararchy> Agree on what ?
<FromGitter> <bararchy> Oh, the game indestry thingy ?
<crystal-gh> [crystal] MakeNowJust opened pull request #4773: Expand: show expanded macro name and its location (master...feature/crystal-expand/show-expanded-macro-name-and-location) https://git.io/v7R44
<FromGitter> <codenoid> ✨
w-p has quit [Ping timeout: 255 seconds]
<FromGitter> <bararchy> Is there a way to create github.io with Crystal ?
<FromGitter> <bararchy> (static site generator)
<crystal-gh> [crystal] ysbaddaden pushed 1 new commit to master: https://git.io/v7RE7
<crystal-gh> crystal/master 8f2f505 TSUYUSATO Kitsune: Fix chained comparisons `to_s` to work #4663 (#4708)...
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
<crystal-gh> [crystal] ysbaddaden pushed 1 new commit to master: https://git.io/v7RuW
<crystal-gh> crystal/master c8cb5cd TSUYUSATO Kitsune: Don't find in CRYSTAL_PATH if required path is relative (#4765)...
thelonelyghost has quit [Ping timeout: 258 seconds]
TheGillies has quit [Ping timeout: 276 seconds]
braidn[m] has quit [Ping timeout: 264 seconds]
olbat[m] has quit [Ping timeout: 255 seconds]
vegai has quit [Ping timeout: 255 seconds]
jplatte has quit [Ping timeout: 255 seconds]
werthen[m] has quit [Ping timeout: 240 seconds]
sija[m] has quit [Ping timeout: 255 seconds]
krigare[m] has quit [Ping timeout: 240 seconds]
Lex[m] has quit [Ping timeout: 246 seconds]
<FromGitter> <straight-shoota> I have been working on one
<FromGitter> <bararchy> That's cool , any beta to play with ? I'm sick of jykell lol
<FromGitter> <straight-shoota> not yet^^
<travis-ci> crystal-lang/crystal#8f2f505 (master - Fix chained comparisons `to_s` to work #4663 (#4708)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/259758134
<travis-ci> crystal-lang/crystal#8f2f505 (master - Fix chained comparisons `to_s` to work #4663 (#4708)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/259758134
olbat[m] has joined #crystal-lang
<FromGitter> <straight-shoota> though I guess I could put the current version on Github
<FromGitter> <straight-shoota> but it's more alpha/PoC than anything else
<travis-ci> crystal-lang/crystal#c8cb5cd (master - Don't find in CRYSTAL_PATH if required path is relative (#4765)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/259758860
<travis-ci> crystal-lang/crystal#8f2f505 (master - Fix chained comparisons `to_s` to work #4663 (#4708)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/259758134
Philpax has quit [Ping timeout: 260 seconds]
<FromGitter> <codenoid> haha, btw, i looking for a new job just with my crsytal skill ( > "look at my github bio"), 😆
<FromGitter> <codenoid> and i think, i'll got that job,, on `startup`
<FromGitter> <straight-shoota> @bararchy take a look: https://github.com/straight-shoota/criss
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter> <bararchy> Cool ! , stared and will follow
<FromGitter> <bararchy> Is there a config file to work on the project ?
<FromGitter> <bararchy> Or MD syntax ?
<FromGitter> <straight-shoota> markdown is not there yet, but it shouldn't be much effort
snsei has quit [Remote host closed the connection]
<FromGitter> <straight-shoota> config file is `_config.yml` but it does not yet use much configuration
<FromGitter> <straight-shoota> blog posts are only rudimentary, though I have a plan to improve that
<travis-ci> crystal-lang/crystal#c8cb5cd (master - Don't find in CRYSTAL_PATH if required path is relative (#4765)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/259758860
<FromGitter> <straight-shoota> basically working are serving static html files with Crinja templates (there is some limited support for Liquid syntax as well) and rendering SASS/SCSS stylesheets
<FromGitter> <straight-shoota> oh, and it does not generate the static site yet, it just serves it directly - but blazingly fast
<FromGitter> <straight-shoota> it proved itself well when I was working on a website project and got sick of waiting for Jekyll to regenerate
<FromGitter> <bararchy> Oh , I see , is there a way to output the site ? As I want it for github.io pages
kaleido has quit [Read error: Connection reset by peer]
<FromGitter> <sdogruyol> @bararchy have you seen https://github.com/akwiatkowski/tremolite
<FromGitter> <crisward> @bararchy if you're on mac http://ricks-apps.com/osx/sitesucker/ may be a workaround. It's on the app store.
<FromGitter> <straight-shoota> for the moment you could just use `wget -r`, which sends requests to all the URL's and stores the generated pages
rohitpaulk has joined #crystal-lang
<FromGitter> <straight-shoota> or something more fancey like @crisward suggested. but for this purpose wget should be perfectly fine
<FromGitter> <crisward> @straight-shoota didn't know `wget` could do that. Does it ignore external links?
<FromGitter> <straight-shoota> yes, it's a really great tool^^
<FromGitter> <straight-shoota> you can configure it
<FromGitter> <straight-shoota> I think per default it only follows links in the current context
<travis-ci> crystal-lang/crystal#c8cb5cd (master - Don't find in CRYSTAL_PATH if required path is relative (#4765)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/259758860
<FromGitter> <bararchy> @sdogruyol interesting , thanks :)
alibby has quit [Read error: No route to host]
alibby has joined #crystal-lang
Lex[m] has joined #crystal-lang
vegai has joined #crystal-lang
braidn[m] has joined #crystal-lang
krigare[m] has joined #crystal-lang
TheGillies has joined #crystal-lang
thelonelyghost has joined #crystal-lang
jplatte has joined #crystal-lang
werthen[m] has joined #crystal-lang
sija[m] has joined #crystal-lang
<FromGitter> <straight-shoota> tremolite looks like a good alternative with a different approach. it is basically a toolkit to create a custom site generator as a Crystal application. If you change things you need to rebuild.
<crystal-gh> [crystal] wmoxam opened pull request #4774: Add support for max + min intrinsics (master...add-math-operations) https://git.io/v7RNn
<FromGitter> <straight-shoota> My idea is that you just have an executable and don't need any Crystal coding to use it
<FromGitter> <straight-shoota> like you don't need to write any ruby to use Jekyyl
sz0 has joined #crystal-lang
<jokke> in case someone is interested, depite of the warnings my statically linked crystal program seems to run just fine
<jokke> could be just luck though :)
<FromGitter> <sdogruyol> wow
<FromGitter> <sdogruyol> what's it actually doing?
<FromGitter> <bararchy> jokke did you compile in alpine
<FromGitter> <bararchy> ?
<jokke> no i compiled on arch linux
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<jokke> sdogruyol: it reads from stdin, chunks it up, makes a treehash over the chunks and sends the chunks to aws glacier
<jokke> all without ever needing more ram/disk space than a single chuk
<jokke> *chunk
<jokke> i have to archive a 800GiB database
<jokke> so i just pipe the db dump output to my crystal program
hightower2 has quit [Ping timeout: 276 seconds]
<FromGitter> <sdogruyol> Sounds cool.
<FromGitter> <sdogruyol> Hey everyone please join to our survey to make Crystal more awesome :)
<FromGitter> <bararchy> Cool !! @sdogruyol awesome work , you help the community march forward
<FromGitter> <sdogruyol> Thank you @bararchy 😊
mark_66 has quit [Remote host closed the connection]
_whitelogger has joined #crystal-lang
fenicks has left #crystal-lang [#crystal-lang]
flaviodesousa has quit [Ping timeout: 268 seconds]
<FromGitter> <bararchy> BTW , if anyone is willing , please push this link as much as you can (tweet, send links , etc..) It can potentially really help Crystal
<FromGitter> <sdogruyol> Will definitely help :P
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
fiete has quit [Ping timeout: 260 seconds]
fiete has joined #crystal-lang
werthen[m] has quit [Quit: idle]
leandrobighetti has quit [Remote host closed the connection]
leandrobighetti has joined #crystal-lang
leandrobighetti has quit [Ping timeout: 255 seconds]
rohitpaulk has quit [Ping timeout: 260 seconds]
<FromGitter> <jsilverMDX> im not hooked up with Crystal people outside Gitter but I did it
<FromGitter> <jsilverMDX> i have spread crystal with livepost tho
<FromGitter> <sdogruyol> @jsilverMDX awesome 👍
<FromGitter> <fridgerator> 👍
<FromGitter> <bararchy> Thanks @jsilverMDX 👍
<FromGitter> <bararchy> The more the better
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 260 seconds]
rohitpaulk has joined #crystal-lang
Split has joined #crystal-lang
<FromGitter> <jsilverMDX> 👍 :) 💎
kyku has joined #crystal-lang
<kyku> hi
<FromGitter> <sdogruyol> hey
<kyku> I have a newbie question regarding crystal. Is it ok paste a tiny bit of code here?
<Papierkorb> kyku: Sure - If it's longer than a line, use http://gist.github.com and paste the link
<Papierkorb> And your question is?
<kyku> I wonder why the typeof(value) is (Uint32 | Nil) even in the "if value" branch
<kyku> according to https://crystal-lang.org/docs/syntax_and_semantics/if_var.html , shouldn't it be just "UInt32"?
<Papierkorb> the compile-time variable type doesn't change, as the variable still must be able to store a `nil` there. However, the compiler inside the `if value` can be absolutely sure that at run-time, it won't be nil
<kyku> in the same 'program':
<kyku> if valueputs value + 1 end
<Papierkorb> kyku: It has to do with the in-memory layout of the variable, which doesn't change because of an if. Though in this (common) case, inside the then-branch, the compiler is sure which type the variable will be, so you can use it as that for all things freely
<kyku> sorry
<kyku> for the bad formatting, but if I try to "puts value + 1" in the if value
<kyku> branch, then I'm getting a compile time error:
<kyku> Error in line 10: undefined method '+' for Nil (compile-time type is (UInt32 | Nil))
<Papierkorb> kyku: Yes. The issue is that you're catching `value` into a caught-block above (line 6). The code could now use the caught block and run it in parallel, just after the `if value` branch was taken, and change value to `nil` again, producing undefined behaviour
<Papierkorb> kyku: Which is the real reason for the union-type not changing inside the if branch
<kyku> does some work around exist for that?
<Papierkorb> You have to somehow ensure that a used variable can't change in type after a type-check occured for it to really affect the variable as intended
<Papierkorb> in the snippet I do so by stuffing the parsing into a method. The caught variable is not the one returned, so the type-check does what you expected. Another possible way is to initialize value to an UInt32, which is fine if it has a default value
<Papierkorb> Well, or something more similar to your code, using the "assignment in if condition" 'trick': https://gist.github.com/Papierkorb/c5d02b076378da4038b9319dfafcd5a4
<kyku> Ok, I see. Thank you a lot.
leandrobighetti has joined #crystal-lang
<FromGitter> <sdogruyol> thanks @papierkorb always something to learn from you :)
<Papierkorb> sdogruyol, I was more surprised that I didn't run into this before
<FromGitter> <sdogruyol> me too :D
<Papierkorb> Which does however raise the importance for a right-of-the-bat type-safe CLI option parser. And to finally set up a github blog, so I can just point at the article if the same question comes up again (and it will). Oh well.
<FromGitter> <sdogruyol> yeah more reachability and searchability for sure
fenicks has joined #crystal-lang
Lex[m] has left #crystal-lang ["Kicked by @appservice-irc:matrix.org : idle"]
<FromGitter> <jsilverMDX> Does anyone know how to delete by _id with Mongo.cr?
<FromGitter> <sdogruyol> nope sorry
sz0 has quit [Quit: Connection closed for inactivity]
rohitpaulk has quit [Ping timeout: 260 seconds]
<FromGitter> <jsilverMDX> np
rohitpaulk has joined #crystal-lang
mounibec has joined #crystal-lang
Split has quit [Quit: Leaving]
krigare[m] has quit [Quit: idle]
<FromGitter> <drosehn> yeah, I'm going to have to re-read that section on what `parser.on` is doing there.
<crystal-gh> [crystal] ysbaddaden opened pull request #4777: Fix: sanitfy check /dev/urandom (master...fix-add-urandom-chardev-check) https://git.io/v70N6
gloscombe has joined #crystal-lang
<FromGitter> <jsilverMDX> any CAPTCHA solutions for Crystal?
<FromGitter> <jsilverMDX> i dont want recaptcha or any APIs
<FromGitter> <drosehn> Back a bit, @mgarciaisaia wrote: "That being said - Node & Ruby are two great examples that force me to re-think the *No can't do without it* chain of thought." -- I've always thought the main point about getting thread support worked out for version 1.0 is that thread-support might force some incompatible changes to the language. And, for instance, I don't want to push to sort out `signal()` issues until
<FromGitter> ... thread-support is stable.
<Papierkorb> lawl das iPhone 3G hatte keinen fokus in der kamera, weil die so einen irre tiefenschärfenbereich hatte, dass sie den "nicht brauchten"
<oprypin> alrighty then
<Papierkorb> ... wrong channel -.-;
<oprypin> does it have something to do with that comment that camera software on android is bad
leandrobighetti has quit [Remote host closed the connection]
<Papierkorb> Nothing at all, pure physics. Also, my G4 has an acceptable camera app, including giving me RAWs and being able to put the thing into Manual mode ... if you ever need that on your phone
leandrobighetti has joined #crystal-lang
leandrobighetti has quit [Ping timeout: 240 seconds]
kyku has quit [Quit: Page closed]
kali_ has joined #crystal-lang
<kali_> hello! i was gogling but i'm coming up with unrelated results :( does crystal-lang have any way to use rijndael encryption? ruby has mcrypt, but i couldn't find anything related to that for crystal
leandrobighetti has joined #crystal-lang
<Papierkorb> Oh you mean AES
<kali_> not aes, rijndael. aes uses 128 by default, by i need 256/256 :(
<kali_> well technically aes is a subset of rijndael :P
<Papierkorb> it's just a different configuration
<Papierkorb> Can't find any OOTB bindings, would've expected them as part of the OpenSSL bindings
<kali_> hm. i've tried the openssl ones in ruby and i couldn't get aes to work with 256. had to use the mcrypt lib to get actual rijndael 256
<kali_> so i'm guessing it would be the same for crystal (or any other language for that matter)
<kali_> https://stackoverflow.com/a/748645 does say aes is fixed at 128
<Papierkorb> crystalshards.xyz doesn't know of a binding either
<kali_> i see :(
<kali_> ah well, maybe i can use the pure ruby one and see if i can port it over to crystal
<kali_> but for anyone who can point me to a ready-made library, that would be great so i don't have to reinvent the wheel :)
mounibec has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
leandrobighetti has quit []
RX14 has quit [Quit: Fuck this shit, I'm out!]
RX14 has joined #crystal-lang
hightower2 has joined #crystal-lang
<hightower2> Hey folks, is 'out' supposed to have any special recognition when not used inside lib?
<Papierkorb> `out` is a keyword, available "everywhere"
<hightower2> ok, that explains why I had problems naming the variable 'out' ;) thanks
<Papierkorb> Yeah that'll give you funky compiler errors at call-site..
<hightower2> in 0.23 it first requires me to put an extra 'end' in the code, and then segfaults
<hightower2> 0.23.0 I mean. But in 0.23.1, it gives a more reasonable error like "out can only be used with lib funs"
<hightower2> Papierkorb, btw, I used Ruby bindings for Qt a lot (part of qtbindings project) and I submitted patches to it as well. Although that was for Qt4 and they never managed to port 'smoke' (the code parser/extractor) to work with Qt5
<hightower2> But they did have some ruby-specific workarounds, to solve the problem of ruby not supporting method overloading. For example, on the first call of a Qt function, ruby args would be classified to find the most similar overload in C++, and then that method would be cached, so that the next invocation would directly use the cached version instead of doing the argument type comparison again
<Papierkorb> Yeah, Crystal can do method overloading though
<hightower2> But apart from trivia knowledge, not particularly useful/needed in the case of crystal
<hightower2> yeah
<Papierkorb> used Qt4 and later Qt5 with C++ a lot before using Ruby. Did my fair share of hacks with it too. God bless that mess. QObject::setUserData() was the best thing ever lul.
<oprypin> in python you can set arbitrary members on qt objects :p
<oprypin> so basically as bad as setuserdata but you dont know it's bad
cyberarm has quit [Ping timeout: 260 seconds]
fenicks has left #crystal-lang [#crystal-lang]
cyberarm has joined #crystal-lang
bradleyd has quit [Quit: Leaving]
mounibec has joined #crystal-lang
https_GK1wmSU has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
https_GK1wmSU has left #crystal-lang [#crystal-lang]
rohitpaulk has quit [Remote host closed the connection]
hightower2 has quit [Ping timeout: 246 seconds]
Dreamer3 has quit [Quit: Leaving...]
gloscombe has quit [Quit: WeeChat 1.9]
mounibec has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]