<holst>
here the "total" is shown as 0 even after the call, but obviously, I want it to show 4
ur5us_ has joined #crystal-lang
ur5us_ has quit [Ping timeout: 240 seconds]
notzmv has quit [Ping timeout: 252 seconds]
yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
yxhuvud has joined #crystal-lang
<FromGitter>
<asterite> Atomic is a struct so it's passed by value. You need to use a class that holds that atomic, and then it will work.
notzmv has joined #crystal-lang
<FromGitter>
<jrei:matrix.org> A pointer can work too, but unsafe
f1reflyylmao has joined #crystal-lang
f1refly has quit [Ping timeout: 240 seconds]
ua_ has quit [Ping timeout: 240 seconds]
jrayhawk has quit [Ping timeout: 240 seconds]
f1reflyylmao is now known as f1refly
jrayhawk has joined #crystal-lang
ua_ has joined #crystal-lang
ua_ has quit [Excess Flood]
ua_ has joined #crystal-lang
Vexatos_ has joined #crystal-lang
Vexatos has quit [Quit: Client Quit]
SamantazFox has quit [Killed (NickServ (GHOST command used by SamantazFox_))]
SamantazFox_ has joined #crystal-lang
notzmv has quit [Ping timeout: 250 seconds]
sorcus has quit [Ping timeout: 250 seconds]
lanodan has quit [Ping timeout: 250 seconds]
raz has quit [Ping timeout: 250 seconds]
lanodan_ has joined #crystal-lang
notzmv- has joined #crystal-lang
sorcus has joined #crystal-lang
<holst>
https://play.crystal-lang.org/#/r/cx2f I am struggling with how to define a method that I can use and where I define my "main" code in a CLI app
<holst>
in Python I know about if __name__ == "__main__" or __main__.py
<holst>
but I think a FAQ like discussion on this would be great. I might even volonteer to do a cookbook "Crystal Language for Pythonistas" ;-)
<FromGitter>
<Blacksmoke16> you'd prob want to use two files
<FromGitter>
<Blacksmoke16> one is like the "library" code and the other is the entrypoint to the CLI. I.e. that requires the library code, sets up the option parser logic, etc
<FromGitter>
<Blacksmoke16> there are also some shards out there to help with building CLIs if you want to go that route
<holst>
makes sense; that would be app/{__init__,app}.py and app/__main__.py to run the app
<FromGitter>
<descholar-ceo> Thank you, but that seems like it works for someone who's going to install crystal so he needs to be careful while compiling crystal, what about ? I have already installed and compiled crystal, but didn't provide that flag, how can I integrate it now?
<FromGitter>
<Blacksmoke16> theres a shard `icr`, but its slightly a hack
<FromGitter>
<Blacksmoke16> so will have to wait for proper `crystal i` support, or just leverage a `test.cr` file for now
<FromGitter>
<moe:busyloop.net> icr works fine for me, i use it to try out simple expressions almost every day
<FromGitter>
<descholar-ceo> how can I install `icr` then?
<FromGitter>
<moe:busyloop.net> on osx `brew install crystal-icr`
<FromGitter>
<descholar-ceo> I use linux mint
<FromGitter>
<moe:busyloop.net> don't know about other os'es
<holst>
It's possible to use that tool to slam lots of pre-baked API calls to a REST endpoint or to just upload a bunch of files to S3/Azure Blob storage