Hacker News new | ask | show | jobs
by bjoli 1534 days ago
Ruby inherited that ?! convention fromm scheme. All mutating procedures end with ! and all predicates with !.

Prefix notation has none of those pesky limitations if you can live with it :)

Edit: oh. Scheme is painfully monomorphic. Equality for.strings is string=?. Equality for chars is char=?.

Then there is object equality (eq? ...), eqv? ("Normally eq?") and equal? which is a generic equality predicate that works for all objects (including circular data structures).

Eq? is the one you would use for symbols. Symbols are always (almost, at least) eq?. One string is only eq? To itself, but not a string containing the same content.

1 comments

I think you meant to say this in your first sentence: "all predicates with ?"
Yup. Thanks. I hate writing on my phone. I make so many mistakes that I frequently wonder if I am literate when I read things I have written.