havenwood changed the topic of #ruby to: Ruby 3.4.2, 3.3.7 https://www.ruby-lang.org | Log https://libera.irclog.whitequark.org/ruby
STASIdownunder has quit [Ping timeout: 252 seconds]
STASIdownunder has joined #ruby
STASIdownunder has quit [Read error: Connection reset by peer]
lutherann has joined #ruby
STASIdownunder has joined #ruby
STASIdownunder has quit [Read error: Connection reset by peer]
___nick___ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
___nick___ has joined #ruby
___nick___ has quit [Client Quit]
___nick___ has joined #ruby
sarna has quit [Ping timeout: 260 seconds]
sahar_sedigh has joined #ruby
<sahar_sedigh> hi.
<sahar_sedigh> can ask rvm questions here?
<sahar_sedigh> can I ask rvm questions here?
<testone> ask
<testone> rvm is always ruby stuff
<testone> I had to stop using rvm and switch to chruby, anyway
<testone> as rvm tried to be too 'smart' in auto-removing deps
<sahar_sedigh> :0
<sahar_sedigh> :)
<sahar_sedigh> hello
<sahar_sedigh> testone:
<sahar_sedigh> problem:
<sahar_sedigh> I am on void linux.
<sahar_sedigh> running command **curl -sSL https://get.rvm.io | bash -s stable --rails** errors out with this
<sahar_sedigh> Error running 'requirements_void_libs_install libressl-devel',
<sahar_sedigh> libressl isn't on voidlinux repo.
<sahar_sedigh> but I built it from the source
<sahar_sedigh> I need to bypass the check.
sarna has joined #ruby
grenierm has joined #ruby
cappy has joined #ruby
<sahar_sedigh> any ideas?
jmcantrell has quit [Quit: WeeChat 4.6.0]
jmcantrell_ is now known as jmcantrell
lutherann has quit [Quit: WeeChat 4.4.3]
STASIdownunder has joined #ruby
<testone> sahar_sedigh: 2 possibilities: 1) you need to set include dir with options or env vars, or 2) you have the compiled lib, while you need sources too (hence -devel)
<testone> anyway, if the script is done with void linux in mind too (as it seems), I would check better for repos to enable or similar
lutherann has joined #ruby
itok has quit [Ping timeout: 252 seconds]
itok has joined #ruby
<sahar_sedigh> testone: the funny thing is this:
<sahar_sedigh> it looks for a package that is not available in void linux repo
<sahar_sedigh> why?
<sahar_sedigh> IDN!
<sahar_sedigh> it seems void doesn't support libressl for sometime. 2021-02-03
<sahar_sedigh> I guess rvm is out for me.
<sahar_sedigh> unless a work around would pop up somewhere
<testone> rvm does a lot of mess, try chruby instead
hexreel has joined #ruby
hexreel has quit [Quit: leaving]
cappy has quit [Quit: Leaving]
STASIdownunder has quit [Ping timeout: 244 seconds]
svm has joined #ruby
msv has quit [Ping timeout: 268 seconds]
andy-turner has joined #ruby
<nakilon> the Numeric#/ should have a "return 0 if zero?"
<nakilon> or "return self if zero?"
<nakilon> this way there will be no DivideByZero error in the methods that count average from the list
<nakilon> millions of projects will be able to omit their own check on size.zero?
<nakilon> if the number is 0, multiplication and division should return 0 no matter what the argument is
<nakilon> so this return should be built in
<nakilon> it would be a profit from the fact that number is an object and operation is a method
<nakilon> especially when there is already a built-in assumption that the sum of empty list is 0
<nakilon> irb(main):001:0> [].sum => 0
Linux_Kerio has joined #ruby
STASIdownunder has joined #ruby
TomyLobo has joined #ruby
STASIdownunder has quit [Remote host closed the connection]
svm is now known as msv
<o0x1eef> C defines division by zero as "undefined behavior" and I'd guess that's why Ruby raises ZeroDivisionError. JavaScript produces Infinity. I don't know the right answer, but your suggestion seems practical.
gemmaro| has quit [Ping timeout: 252 seconds]
gemmaro has joined #ruby
grenierm has quit [Ping timeout: 240 seconds]
STASIdownunder has joined #ruby
GreenResponse has joined #ruby
<havenwood> nakilon: Reminds me of Rust's `try_division` example for Option. Here's a Ruby implementation of the example: https://gist.github.com/havenwood/015713e2e00c54280af16e11c2d09091
<havenwood> Returning the number itself or zero seems bad. Infinity is what Float specs specify, except NaN for zero divided by zero.
<havenwood> Ruby could have chosen to do the same with Integer, and return Float::INFINITY and Float::NAN, but the number itself or zero seems incorrect and prone to causing undiscovered bugs.
<havenwood> At least it's Ruby, so if you want to make a refinement to return Infinity and NaN or None and Some, you can!
patrick has quit [Ping timeout: 246 seconds]
patrick_ is now known as patrick
patrick_ has joined #ruby
patrick has joined #ruby
patrick has quit [Changing host]
patrick_ is now known as patrick
patrick_ has joined #ruby
ih8u has quit [Read error: Connection reset by peer]
ih8u has joined #ruby
ih8u2 has joined #ruby
ih8u has quit [Ping timeout: 252 seconds]
ih8u2 is now known as ih8u
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
user71 has joined #ruby
ih8u has quit [Remote host closed the connection]
fantazo has joined #ruby
__jmcantrell__ has joined #ruby
joako has quit [Quit: quit]
joako has joined #ruby
Sheilong has joined #ruby
Sheilong has quit [Client Quit]
cappy has joined #ruby
jmcantrell is now known as Guest7797
Guest7797 has quit [Killed (copper.libera.chat (Nickname regained by services))]
__jmcantrell__ is now known as jmcantrell
jmcantrell_ has joined #ruby
ih8u has joined #ruby
ih8u2 has joined #ruby
ih8u has quit [Ping timeout: 265 seconds]
ih8u2 is now known as ih8u
___nick___ has quit [Ping timeout: 252 seconds]
Sheilong has joined #ruby
aesthetikx has quit [Ping timeout: 248 seconds]
___nick___ has joined #ruby
dionysus69 has joined #ruby
ih8u2 has joined #ruby
ih8u has quit [Ping timeout: 245 seconds]
ih8u2 is now known as ih8u
mweckbecker has quit [Quit: leaving]
cappy has quit [Quit: Leaving]
mweckbecker has joined #ruby
ih8u2 has joined #ruby
ih8u has quit [Ping timeout: 244 seconds]
ih8u2 is now known as ih8u
user71 has quit [Quit: Leaving]
ih8u has quit [Quit: ih8u]
Sheilong has quit []
ih8u2 has joined #ruby
ih8u2 is now known as ih8u
Linux_Kerio has quit [Ping timeout: 244 seconds]
kathryn1024_ has joined #ruby
ih8u2 has joined #ruby
ih8u has quit [Ping timeout: 248 seconds]
ih8u2 is now known as ih8u
ih8u has quit [Remote host closed the connection]
ih8u has joined #ruby
ih8u has quit [Quit: ih8u]
ih8u has joined #ruby
ih8u has quit [Remote host closed the connection]
ih8u has joined #ruby
___nick___ has quit [Ping timeout: 252 seconds]
ih8u has quit [Remote host closed the connection]
ih8u has joined #ruby
ih8u2 has joined #ruby
ih8u has quit [Ping timeout: 245 seconds]
ih8u2 is now known as ih8u
ih8u has quit [Remote host closed the connection]
ih8u has joined #ruby
ih8u has quit [Remote host closed the connection]
ih8u has joined #ruby
ih8u2 has joined #ruby
ih8u has quit [Ping timeout: 252 seconds]
ih8u2 is now known as ih8u
ih8u has quit [Remote host closed the connection]
ih8u has joined #ruby
ih8u has quit [Remote host closed the connection]
ih8u has joined #ruby
andy-turner has quit [Quit: Leaving]
ih8u has quit [Ping timeout: 245 seconds]
kathryn1024_ has quit [Ping timeout: 264 seconds]
GreenResponse has quit [Quit: Leaving]
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
aesthetikx has joined #ruby
smp has quit [Quit: ZNC 1.8.2 - https://znc.in]
smp has joined #ruby
<o0x1eef> In my experience zero serves well as a no-op value and doesn't skew the results. I think blowing up with an error is not always preferable -- especially if the "fix" is something similar to .reject(&:zero?)
<testone> the very issue is: should mathmatical operations in programming language follow mathematical 'usual' habits?
<testone> if reply is "yes", programmers would expect to have errors/Infinity/... as they would doing math calcs by hand
<testone> if reply is "no", programmers should read 'particular implementations' of arithmetics of each programming language
<testone> and always think about before 'translating' from ona lang to another even supposedly simple things like arithmetics
<testone> IMHO the best solution is the one already adopted: follow math rules
dionysus69 has quit [Ping timeout: 252 seconds]
<o0x1eef> That makes sense. Usually I lean towards being practical. I don't think Infinity is helpful or practical, it is another value to work around -- same as an error would be. But yeah, from the perspective of math, it is correct.
blacknova has joined #ruby