trapped has quit [Read error: Connection reset by peer]
trapped has joined #crystal-lang
alex`` has quit [Ping timeout: 276 seconds]
<FromGitter>
<Qwerp-Derp> Kindof...
<FromGitter>
<Qwerp-Derp> Well, I just placed all the code in a Github gist
<FromGitter>
<Qwerp-Derp> Cause I might need to use the code for later anyway
<FromGitter>
<Qwerp-Derp> Anyway, the problem is somewhere in `lucas_u`, with subtracting a `BigInt` from an `Int32`, but I'm not sure how it caused a invalid memory access
<FromGitter>
<Qwerp-Derp> Also, are there any BigDecimal classes in Crystal?
go|dfish has quit [Ping timeout: 260 seconds]
hightower has quit [Ping timeout: 240 seconds]
rohitpaulk has quit [Ping timeout: 276 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
rohitpaulk has joined #crystal-lang
renich has quit [Ping timeout: 240 seconds]
<bmcginty>
Qwerp-Derp: Look at BigFloat?
<FromGitter>
<Qwerp-Derp> How would that help? My issue with this code is with subtraction of integers.
<bmcginty>
Qwerp-Derp: You asked if Crystal had Big Decimal support, if I read correctly. Let me glance at your gist. might have to be afk for a bit but will reply when I return.
<FromGitter>
<Qwerp-Derp> Oh yeah, that was before I discovered BigFloat :P sorry for the confusion, I deleted the message.
w-p has joined #crystal-lang
<bmcginty>
Qwerp-Derp: Looking.
w-p has quit [Ping timeout: 240 seconds]
rohitpaulk has quit [Ping timeout: 255 seconds]
<bmcginty>
Qwerp-Derp: Let me see if I can change this code around a bit. I'm not sure if you're just overflowing? the stack, or even if that's possible, but your lucus call is recursing at least 20k+ levels deep...
<bmcginty>
Qwerp-Derp: Sorry, your lucas_u call.
<bmcginty>
Qwerp-Derp: Gotta say my brain is melting trying to figure this out.
<FromGitter>
<johnjansen> like without validating the cert
chamar has joined #crystal-lang
chimkan has joined #crystal-lang
chimkan has quit [Quit: chimkan]
chimkan has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
chimkan has quit [Quit: chimkan]
<bmcginty>
johnjansen: just a sec and I'll find this if you haven't. It's basically providing a new ssl context to the http (or wherever) function you need.
<FromGitter>
<abidon> But I still find this really strange
<FromGitter>
<straight-shoota> Well, it's perfectly fine that you expect this to be different. But because they are only visible in the current type (and subtype), it makes sense to call them without a receiver.
<FromGitter>
<faustinoaq> I didn't realize I can write all crystal code in one line:
<FromGitter>
<faustinoaq> ```code paste, see link```
<FromGitter>
<konovod> @faustinoaq the next problem is significant spaces! they prevent better codegolfing.
<oprypin>
code golfing has undergone terrible "inflation" in that you have no hope to win unless you have a very specialized language that has a different command for each byte
<FromGitter>
<faustinoaq> *<oprypin>* 😅 Not advantage at all but funny
<FromGitter>
<LuckyChicken91_twitter> its definitely an advantage
<FromGitter>
<faustinoaq> @konovod Oh, I see `codegolfing` is the term 👍
<FromGitter>
<faustinoaq> then Crystal is good for codegolfing 😆
<jokke>
hey
<jokke>
is there any implementation of the repository pattern for crystal?
<oprypin>
pls give a reference of what that is
<FromGitter>
<LuckyChicken91_twitter> can someone explain me "fun"?
<jokke>
oprypin: well it's a database access pattern
<jokke>
your models are plain data mappings and the repositories are plain ol' classes that provide a database-agnostic abstraction layer for accessing the db (and turning the db records into objects)
<FromGitter>
<fridgerator> @jokke There are others, but 2 frameworks I've used that use the Repo pattern an Hanami (Ruby) and Ecto (Elixir). Hanami uses a repo per model, and Ecto you define as many Repos as you want usually one per database.
Philpax has quit [Ping timeout: 276 seconds]
Philpax has joined #crystal-lang
<FromGitter>
<fridgerator> Crecto being obviously more like Ecto
<FromGitter>
<fridgerator> always practice safe crystal
<FromGitter>
<faustinoaq> Yeah, is more healthy 😆
rohitpaulk has quit [Ping timeout: 268 seconds]
<FromGitter>
<straight-shoota> @LuckyChicken91_twitter well, translating is one thing - but if you publish a language it also needs to be maintained to track changes in upstream. It's better not to have a localized website or docs than to have outdated one which just confuses people. ⏎ And honestly I don't see any point in creating translations until at least the language is stable and the main docs are somewhat finished. There are
<FromGitter>
... still big gaps and many things will probably change before 1.0. ⏎ So I'd recommend to work on improving the English documentation instead. Let's take small steps and finish one thing after the other.
<FromGitter>
<LuckyChicken91_twitter> okay
snsei has quit [Remote host closed the connection]
alex`` has quit [Ping timeout: 240 seconds]
alex`` has joined #crystal-lang
leandrobighetti has joined #crystal-lang
snsei has joined #crystal-lang
rohitpaulk has joined #crystal-lang
chamar has quit [Quit: Leaving]
leandrobighetti has quit [Remote host closed the connection]
snsei has quit [Remote host closed the connection]
leandrobighetti has joined #crystal-lang
zaiste has joined #crystal-lang
bradleyd has joined #crystal-lang
<bradleyd>
is there a way to dynamically create a channel? For example, instantiate a channel based on input. Thanks!
<crystal-gh>
[crystal] pacuum opened pull request #4797: Fixed #4796: IO::Buffered returned short buffer prematurely (master...bufferedio-boundary) https://git.io/v7rvy
<oprypin>
bradleyd, you'll have to elaborate on that. i dont see anything about it that's not dynamic
http_GK1wmSU has joined #crystal-lang
zaiste has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<crystal-gh>
[crystal] matiasgarciaisaia pushed 1 new commit to master: https://git.io/v7rfk
<crystal-gh>
crystal/master b5dd948 Ary Borenszweig: Fix #4639: Macro lookup from included module broken
http_GK1wmSU has left #crystal-lang [#crystal-lang]
<bradleyd>
sure, i want to be able to pass some any type into a constructor and build a channel from that.
<bradleyd>
For example, @channel = Channel(channel_type).new Throws error
sz0 has quit [Quit: Connection closed for inactivity]
bcardiff has quit [Client Quit]
leandrobighetti has joined #crystal-lang
Ven has joined #crystal-lang
Ven is now known as Guest18728
leandrobighetti has quit [Ping timeout: 276 seconds]
<crystal-gh>
[crystal] pacuum closed pull request #4797: Fixed #4796: IO::Buffered returned short buffer prematurely (master...bufferedio-boundary) https://git.io/v7rvy
tzekid has quit [Remote host closed the connection]
mbuf has joined #crystal-lang
<FromGitter>
<LuckyChicken91_twitter> uh for what can I do for example `exit(21)`, `exit("hello ")` etc
<FromGitter>
<LuckyChicken91_twitter> ?
leandrobighetti has joined #crystal-lang
leandrobighetti has quit [Remote host closed the connection]
mbuf has left #crystal-lang ["Ex-Chat"]
zaiste has joined #crystal-lang
Guest18728 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
trapped has quit [Ping timeout: 246 seconds]
olbat is now known as olbat_
olbat_ is now known as olbat
Renich has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
Ven has joined #crystal-lang
Ven is now known as Guest52379
<FromGitter>
<LuckyChicken91_twitter> is someone here
rohitpaulk has joined #crystal-lang
<FromGitter>
<picatz> I'm here. But, not really sure about your question ( if it's the previous one ).
<FromGitter>
<LuckyChicken91_twitter> yes
<FromGitter>
<LuckyChicken91_twitter> why can I do `exit("helloo")`?
<FromGitter>
<picatz> Can you run that?
<FromGitter>
<picatz> I can't seem to get that to run. I know `exit` is usually given an integer, which will be the error code for why the application failed ( typically non-zero ).
<FromGitter>
<picatz> I would usually use `exit` like `exit(0)` to show the command successful completed.
<FromGitter>
<picatz> I would use `exit(1)` or something other than `0` to show that the command failed.
rohitpaulk has quit [Ping timeout: 260 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter>
<LuckyChicken91_twitter> but where can I view this what i returned??
<FromGitter>
<LuckyChicken91_twitter> where can the user see the error code
<FromGitter>
<picatz> That would be in the shell. There's a variable `$?` that has the status of the last returned command.
<FromGitter>
<straight-shoota> the exit code is returned to the invoking environment
<FromGitter>
<picatz> If you want to provide further context, try adding a `puts "This is why you failed"; exit(1)` to let the user know what happened.
zaiste has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Guest52379 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
Ven is now known as Guest75975
<FromGitter>
<LuckyChicken91_twitter> if im doing puts $? then im getting an error
<FromGitter>
<LuckyChicken91_twitter> ooh if im doing "echo $?" then im getting the thing i returned in the exit
<FromGitter>
<picatz> Yeah. The `$?` will be in the context of the shell.
<FromGitter>
<LuckyChicken91_twitter> but for what is this? i think it would be a lot smarter then to write the number directly in the program or write a message why it failed, if it failed
<FromGitter>
<picatz> This is shell behavior. Typically exit codes will correlate to some specific reason. So, `137` might be a specific status that might mean something. You can still provide further diagnostic information to the user in STDERR or something like that.
<FromGitter>
<LuckyChicken91_twitter> i will never use a exit code i think
<FromGitter>
<picatz> It's helpful to provide at least a non-zero exit code if your program fails for some reason.
<FromGitter>
<picatz> At least if it's a command-line application.
<FromGitter>
<picatz> Of course most of that, honestly, is just personal opinion. But, I think it's nice to do.
<FromGitter>
<straight-shoota> you might not use an exit code explicitly but every Crystal program returns an exit code, by default it's `0`
zaiste has joined #crystal-lang
<FromGitter>
<picatz> I'm pretty sure, without exception, all programs you run in your shell have an exit code, right?
<FromGitter>
<picatz> *I hate speaking in absolutes, but I'm pretty sure.*
<FromGitter>
<bew> Yes they have
Guest75975 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter>
<dishcandanty> (new to crystal, been experimenting with it.) trying to use vs code with a linter extension. I was going to put an issue on the extension, but think it may be my project structure or crystal installation. Build is fine. I'm getting this error: ⏎ ⏎ ```while requiring "prelude": can't find file 'prelude' relative to 'src/file.cr'``` [https://gitter.im/crystal-lang/crystal?at=59863a0af5b3458e30b3aed5]