<johnjaye>
(I have macs windows and linux pcs in my house so I wanted something for all of them)
<johnjaye>
lol
<johnjaye>
so strange. why in class.c does it undefine macro names first?
<johnjaye>
e.g. rb_define_method is undefined as a macro first before defining it
<Sampersand>
johnjaye in case somehow something did `#define rb_define_method_id haha` or whatever, `void rb_define_method_id` woudl become `void haha`
<Sampersand>
it's more of a defensive technique
Linux_Kerio has joined #ruby
<johnjaye>
defensive coding. i learned a new thing today
<Sampersand>
people are idiots, so you have to code around them
<johnjaye>
we agree on so much. i wish i could friend you on irc
<johnjaye>
sadly irc has no such function
_whitelogger_ has quit [Remote host closed the connection]
<mange>
I just had a look at where the undefine of the macro is, and rb_define_method and rb_define_method_id are defined as macros in include/ruby/internal/anyargs.h (which ends up included in ruby/ruby.h). I don't really understand how it holds together, but it seems like the #undef is slightly more than just defensive programming.
_whitelogger_ has joined #ruby
<johnjaye>
hmm^
<mange>
Presumably what happens is that the macros get included when class.c is being compiled, so the undef is needed to keep the syntax valid. The macro is used to dispatch between different functions based on the arity of the call (or something), but keeping the call sites using the same name.
Sampersand has quit [Ping timeout: 256 seconds]
grenierm has joined #ruby
sphex has quit [Read error: Connection reset by peer]
sphex has joined #ruby
grenierm has quit [Ping timeout: 256 seconds]
c10l has quit [Ping timeout: 252 seconds]
weaksauc_ has joined #ruby
weaksauce has quit [Ping timeout: 252 seconds]
konsolebox has quit [Quit: .]
royo25 has joined #ruby
konsolebox has joined #ruby
royo25 has quit [Quit: Goodbye cruel world]
c10l has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tumdum1 has joined #ruby
tumdum has quit [Ping timeout: 265 seconds]
tumdum1 is now known as tumdum
Linux_Kerio has quit [Ping timeout: 260 seconds]
Munto has joined #ruby
SaveFerris5 has joined #ruby
SaveFerris5 is now known as SaveFerris
SaveFerris has quit [Ping timeout: 245 seconds]
Artea has joined #ruby
cappy has quit [Quit: Leaving]
donofrio has joined #ruby
c10l has quit [Ping timeout: 248 seconds]
c10l has joined #ruby
Thanzex02 has quit [Ping timeout: 260 seconds]
<havenwood>
ih8u: 3.4.0-dev
donofrio has quit [Ping timeout: 276 seconds]
tuxcrafter has quit [Quit: Client closed]
tuxcrafter has joined #ruby
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
royo25 has joined #ruby
royo25 has quit [Quit: Goodbye cruel world]
donofrio has joined #ruby
mange has quit [Remote host closed the connection]
donofrio has quit [Ping timeout: 260 seconds]
dstein64 has quit [Ping timeout: 252 seconds]
mweckbecker has quit [Quit: leaving]
mweckbecker has joined #ruby
desnudopenguino has quit [Ping timeout: 252 seconds]