Hacker News new | past | comments | ask | show | jobs | submit login
How to Check If a Variable Is Defined with Ruby's defined? Keyword (akshaykhot.com)
3 points by software_writer on Aug 27, 2023 | hide | past | favorite | 2 comments



I didn't know about this!

It's interesting that "local-variable" and "instance-variable" are hyphenated, but "class variable" contains a space. I wonder why that is?


I'm not sure why, but all the source values are listed here: https://github.com/ruby/ruby/blob/1cc700907d3ad3368272488a6f...

Maybe someone knowledgeable in the underpinnings of Ruby will explain why "class variable" was not hyphenated.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: