Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I understand it's a Ruby thing, `chat = RubyLLM.chat` looks odd. How do I know whether it's a function call returning an object or just an assignment? Why not just use `RubyLLM.chat()` and eliminate the ambiguity?


In Ruby, chat = RubyLLM.chat is a method call since Ruby doesn't have properties, only methods. Dropping parentheses is standard Ruby style, familiar to Ruby developers. While adding parentheses is allowed, it doesn't match Ruby's readability. The library aims for a clean style consistent with Ruby conventions.


Because everything in Ruby is an object and everything is a passing messages (ie a method call).




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

Search: