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
markong has joined #ruby
konsolebox has joined #ruby
MyNetAz has joined #ruby
hwpplayer1 has quit [Remote host closed the connection]
hwpplayer1 has joined #ruby
MyNetAz has quit [Remote host closed the connection]
hwpplayer1 has quit [Remote host closed the connection]
<havenwood> ih8u: Yeah, the main usage I see is via DragonRuby.
MyNetAz has joined #ruby
markong has quit [Ping timeout: 265 seconds]
konsolebox has quit [Ping timeout: 248 seconds]
ftajhii has quit [Read error: Connection reset by peer]
o0x1eef has quit [Quit: Brb]
ftajhii has joined #ruby
o0x1eef has joined #ruby
o0x1eef has quit [Quit: Quit]
o0x1eef has joined #ruby
cappy has joined #ruby
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
cappy has quit [Quit: Leaving]
hwpplayer1 has joined #ruby
grenierm has joined #ruby
hwpplayer1 has quit [Ping timeout: 252 seconds]
hwpplayer1 has joined #ruby
hwpplayer1 has quit [Remote host closed the connection]
dviola has quit [Read error: Connection reset by peer]
diego has joined #ruby
hwpplayer1 has joined #ruby
diego has quit [Ping timeout: 252 seconds]
diego has joined #ruby
JulioPapel has joined #ruby
JulioPapel has quit [Quit: JulioPapel]
diego has left #ruby [WeeChat 4.4.4]
dviola has joined #ruby
___nick___ has joined #ruby
R2robot has quit [Quit: Pull the lever, Kronk. Wrong leverrrrrrr!]
grenierm has quit [Ping timeout: 240 seconds]
R2robot has joined #ruby
markong has joined #ruby
___nick___ has quit [Ping timeout: 244 seconds]
user71 has joined #ruby
<ih8u> how can i define an assignment method for my class?
<ih8u> as in i have a `class Vector3` and i want to be able to say `v = [0, 1, 2]` and not have it transform v into an array
fmccann has joined #ruby
fmccann has quit [Quit: Exeunt!]
<havenwood> ih8u: Instead, `Vector3.new(0, 1, 2)` or alias ::# for `Vector3[0, 1, 2]` or define a method `Vector(0, 1, 2)`.
<havenwood> You might consider using a Data class.
<havenwood> It would provide the `Vector3[0, 1, 2]` version as well.
<havenwood> Vector3 = Data.define(:i, :j, :k)
<havenwood> Vector3[0, 1, 2] #=> #<data Vector3 i=0, j=1, k=2>
<havenwood> You can then reopen it to define constants and methods: class Vector3; SIZE = 3; ...
hwpplayer1 has quit [Quit: I'll be back later]
markong has quit [Ping timeout: 260 seconds]
hwpplayer1 has joined #ruby
<havenwood> Also the interface if you: require 'matrix'
<havenwood> Vector[0, 1, 2] #=> Vector[0, 1, 2]
<havenwood> You can create a new one with a different dimension with #with.
<havenwood> Data#with
<havenwood> v.with(j: 42) #=> #<data Vector3 i=0, j=42, k=2>
<havenwood> Or: Numo::NArray[0, 1, 2] #=> Numo::Int32#shape=[3]; [0, 1, 2]
<havenwood> Numo::Int64#shape=[3] #=> Numo::Int64#shape=[3]; [0, 1, 2]
<havenwood> Oops, I meant: Numo::Int64[0, 1, 2]
guest-12423 has quit [Quit: Client closed]
manveru has quit [Quit: Ping timeout (120 seconds)]
brw has quit [Read error: Connection reset by peer]
manveru has joined #ruby
brw has joined #ruby
patrick has quit [Ping timeout: 272 seconds]
patrick_ is now known as patrick
markong has joined #ruby
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
hwpplayer1 has quit [Remote host closed the connection]
hwpplayer1 has joined #ruby
o0x1eef has quit [Quit: Quit]
o0x1eef has joined #ruby
hwpplayer1 has quit [Read error: Connection reset by peer]
hwpplayer1 has joined #ruby
markong has quit [Ping timeout: 246 seconds]
crespire has quit [Remote host closed the connection]
crespire has joined #ruby
hwpplayer1 has quit [Remote host closed the connection]
cappy has joined #ruby
R2robot has quit [Ping timeout: 248 seconds]
R2robot has joined #ruby
hwpplayer1 has joined #ruby
cappy has quit [Quit: Leaving]
Starfoxxes has joined #ruby
hwpplayer1 has quit [Remote host closed the connection]
user71 has quit [Quit: Leaving]
szkl has quit [Quit: Connection closed for inactivity]
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
<weaksauce> what does hello do o0x1eef
<o0x1eef> Afaict it is 'make golf' but renamed to 'make hello'
<weaksauce> and what did make golf do?
<weaksauce> odd
markong has joined #ruby