havenwood changed the topic of #ruby to: Ruby 3.3.6 (3.4.0-rc1) https://www.ruby-lang.org | Log https://libera.irclog.whitequark.org/ruby
<ih8u> havenwood: thank you
<ih8u> i will play around some more with those options
<ih8u> would you happen to have any insight into why i wouldn't be able to send a float to c with mruby?
<ih8u> i can send `0`, but not `0.0`, `Float(0.0)`, or `0.0.to_f`
<ih8u> `
<ih8u> mrb_value float_test(mrb_state *mrb, mrb_value self) {
<ih8u> mrb_float f;
<ih8u> mrb_get_args(mrb, "f", &f);
<ih8u> printf("%f\n", f);
<ih8u> return mrb_nil_value();
<ih8u> }
<ih8u> `
<ih8u> that's what the function looks like on the c side
<o0x1eef> weaksauce: 2007 :o
<weaksauce> it's an oldie
konsolebox has joined #ruby
konsolebox has quit [Ping timeout: 276 seconds]
brokkoli_origin has quit [Ping timeout: 252 seconds]
crespire has quit [Remote host closed the connection]
crespire has joined #ruby
konsolebox has joined #ruby
markong has quit [Ping timeout: 276 seconds]
brokkoli_origin has joined #ruby
brokkoli_origin has quit [Remote host closed the connection]
brokkoli_origin has joined #ruby
cappy has joined #ruby
sympt has quit [Ping timeout: 245 seconds]
snoojin has joined #ruby
fercell has joined #ruby
chen has quit [Quit: No Ping reply in 180 seconds.]
chen has joined #ruby
<ih8u> also, is there a shortcut for Array#size - 1?
<ih8u> i.e. get the last index
slothby has quit [Ping timeout: 252 seconds]
slothby has joined #ruby
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
brw has quit [Quit: The Lounge - https://thelounge.chat]
brw has joined #ruby
<weaksauce> you can make one ih8u
<weaksauce> class Array; def last_index; self.size - 1; end
<weaksauce> end
Guest64 has joined #ruby
cappy has quit [Quit: Leaving]
Guest64 has quit [Quit: Client closed]
<ih8u> weaksauce: indeed, i'm just kind of surprised there isn't something like that built in
<weaksauce> ih8u if you want the last element it's just some_array[-1]
<ih8u> or `last`
<weaksauce> not sure how often a last index is useful
<ih8u> useful when handling array overflows
<ih8u> actually, it comes up a lot
<weaksauce> i guess maybe if you're doing c style ruby
<weaksauce> usually a < array.size should suffice right
<ih8u> not even
<ih8u> i'm not talking about iteration
<ih8u> whatever, it doesn't matter
<ih8u> i know i can do it
<ih8u> i was just making sure there wasn't some convenience method i was overlooking
<weaksauce> i'm not talking about iteration either but ot
<weaksauce> ok
<ih8u> consider a situation where you have values stored in an array, and you need to cycle through them
snoojin has quit [Quit: Connection closed for inactivity]
<ih8u> it's like iteration, but not in one go
<ih8u> you track the index, and have the ability to increment and decrement it
<ih8u> eventually, that index is going to need to be cycled back around
<weaksauce> is that not what mod is for
<weaksauce> %
<ih8u> show me what that looks like
<weaksauce> index % array.size
<ih8u> nice
<ih8u> that idea never occurred to me
<ih8u> though it's not as immediately obvious what's going on
<weaksauce> it's actually a c thing tbf
<ih8u> i guess i don't dislike what you call "c style" in this case
<weaksauce> but ruby is for c programmers to have nice thing
<weaksauce> s
<weaksauce> i mean c style has a place
<weaksauce> just depends on what you're doing
<ih8u> handling index overflows lol
<weaksauce> yeah if you want it to cycle and don't care that it's going over like a ring buffer would modulus is the way to go
<weaksauce> or if you want it to stay between an upper bound and 0 mod is the way
hwpplayer1 has joined #ruby
grenierm has joined #ruby
hwpplayer1 has quit [Remote host closed the connection]
konsolebox has quit [Ping timeout: 250 seconds]
hwpplayer1 has joined #ruby
brokkoli_origin has quit [Ping timeout: 260 seconds]
hwpplayer1 has quit [Remote host closed the connection]
brokkoli_origin has joined #ruby
brokkoli_origin has quit [Remote host closed the connection]
brokkoli_origin has joined #ruby
<balo> reggelt
mange has joined #ruby
dviola has quit [Read error: Connection reset by peer]
diego has joined #ruby
rvalue- has joined #ruby
rvalue has quit [Ping timeout: 248 seconds]
rvalue- is now known as rvalue
nmollerup has quit [Quit: Leaving]
markong has joined #ruby
rvalue- has joined #ruby
rvalue has quit [Ping timeout: 252 seconds]
rvalue- is now known as rvalue
___nick___ has joined #ruby
___nick___ has quit [Client Quit]
___nick___ has joined #ruby
mange has quit [Quit: Zzz...]
grenierm has quit [Ping timeout: 240 seconds]
markong has quit [Ping timeout: 244 seconds]
hwpplayer1 has joined #ruby
cappy has joined #ruby
Munto has quit [Ping timeout: 244 seconds]
smp has quit [Read error: Connection reset by peer]
smp has joined #ruby
diego has left #ruby [WeeChat 4.4.4]
dviola has joined #ruby
admin1234 has joined #ruby
<admin1234> Merry christmas y'all!
<admin1234> "integration": {
<admin1234> "enabled": true,
<admin1234> "rules": [
<admin1234> "Ensure Rails applications deployed on OpenBSD comply with both Rails conventions and OpenBSD security standards.",
<admin1234> "Leverage OpenBSD-native tools (e.g., pf, relayd) to secure Rails deployments."
<admin1234> ]
<admin1234> }
<admin1234> Kamal 2 can't even compare
markong has joined #ruby
teardown has quit [Ping timeout: 264 seconds]
admin1234 has quit [Ping timeout: 265 seconds]
admin1234 has joined #ruby
admin1234 has quit [Ping timeout: 252 seconds]
admin1234 has joined #ruby
admin1234 has quit [Ping timeout: 248 seconds]
admin1234 has joined #ruby
admin1234 has quit [Quit: Lost terminal]
ih8u2 has joined #ruby
manveru8 has joined #ruby
miguno3 has joined #ruby
balrog has joined #ruby
Perflosopher0 has joined #ruby
ih8u has quit [Remote host closed the connection]
manveru has quit [Quit: Ping timeout (120 seconds)]
Perflosopher has quit [Quit: Ping timeout (120 seconds)]
miguno has quit [Quit: Ping timeout (120 seconds)]
miguno3 is now known as miguno
ih8u2 is now known as ih8u
balrog_ has quit [Ping timeout: 265 seconds]
Perflosopher0 is now known as Perflosopher
manveru8 is now known as manveru
Vonter has quit [Ping timeout: 248 seconds]
markong has quit [Ping timeout: 245 seconds]
Vonter has joined #ruby
grenierm has joined #ruby
donofrio has joined #ruby
advorak has joined #ruby
cappy has quit [Quit: Leaving]
donofrio has quit [Ping timeout: 244 seconds]
donofrio has joined #ruby
donofrio has quit [Ping timeout: 244 seconds]
___nick___ has quit [Ping timeout: 248 seconds]
donofrio has joined #ruby
donofrio has quit [Ping timeout: 265 seconds]
markong has joined #ruby
rvalue has quit [Ping timeout: 252 seconds]
teardown has joined #ruby
polishdub has quit [Remote host closed the connection]
cappy has joined #ruby
grenierm has quit [Ping timeout: 240 seconds]
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
hwpplayer1 has quit [Remote host closed the connection]
hwpplayer1 has joined #ruby