5 ms·
I would love if they added "?" to the list of valid characters for names, so I could write something like `valid?()` instead of ``is_valid()`.
by jp_sc 7y ago
I would love if they added "?" to the list of valid characters for names, so I could write something like `valid?()` instead of ``is_valid()`.
- bandrami 7y agojust use "_P", a fairly-widely-recognized substitute from the Lisp world.
- maksimum 7y agoAs a python programmer I would have no idea what `valid_P` is supposed to mean. Valid Pascals?
- bandrami 7y agoP is shaped like a question mark, though I think it was retronymed to stand for "Predicate"
- NateEag 7y agoI think "predicate" is the original meaning of that postfix. Emacs Lisp, at least, can use question marks in names without batting an eyelash. I see no reason that would not have been true for Lisps generally since their birth.
- ptx 7y agoThe suffix is just "p" in Common Lisp[1], so I think the "predicate" explanation is more likely to be correct than the visual analogy to the question mark. [1] http://www.lispworks.com/documentation/HyperSpec/Body/f_listp.htm http://www.lispworks.com/documentation/HyperSpec/Body/f_list...
- alanfranz 7y agoRuby to the rescue!
- cutler 7y agoOr even better, just `valid?` Oh, wait .... that's Ruby.