Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does the predicate naming convention differ between different functions?

I am a Common Lisp newbie who's beginning to learn the language. My question is: I've seen several functions use the predicate syntax in different ways. For example (just looked this up), there is streamp and pathnamep, but there is also input-stream-p and output-stream-p. Why aren't all functions standardized to use *p or *-p? Is this maybe just a historical artifact?

like image 863
Daniel Neel Avatar asked Mar 26 '13 15:03

Daniel Neel


Video Answer


1 Answers

The rule is that one-word predicate names end in just P, while multi-word predicate names end in -P. The reason for the former is mostly historical; the reason for the latter is that a name like input-streamp would wrongly suggest that the question being asked is “is this input a stream?” or something like that.

like image 105
Matthias Benkard Avatar answered Sep 21 '22 08:09

Matthias Benkard