Skip to content

Style for dotted method invocation #2622

Answered by Kodiologist
scolobb asked this question in Q&A
Discussion options

You must be logged in to vote

I prefer (.method self 1) (or with Hyrule's meth macro, (@method 1)). I never liked how object-oriented languages tend to put the function second rather than first. It's a needless inconsistency with function calls. But I still call functions from modules, or class methods, with the syntax (foo.bar 1). In those cases, the foo feels more like a part of the function's name, rather than an argument of the function.

There used to be a style guide in the manual, but I felt that official documentation was no place for a really subjective thing like that, so I removed it. Maybe there's another one out there somewhere.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@scolobb
Comment options

Answer selected by scolobb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants