Re: Effeciency of any predicate



Pascal Costanza <pc@xxxxxxxxx> writes:
Style comments:

- In Common Lisp, it's unusual to use the question mark to indicate
predicates. It's more usual to have predicates end in p (like numberp,
listp, etc.). And even that is not a strict rule.

A little bit of background that may help the original poster
understand this. On page 33 of CLtL2 Steele explains

Many people have suggested that brackets be used to
notate vectors, as [a b c] instead of #(a b c)
... However, to preserve the usefulness of the
user-definable macro-character feature of the function
read, it is necessary to leave some characters to the
user for this purpose.

http://www.franz.com/support/documentation/6.2/ansicl/subsecti/characte.htm

tells you that six characters are ! ? [ ] { }

The idea is that you are going to define a read macro for ?
and then you will have to escape any? as |any?| or any\? to
avoid triggering that read macro.

Alan Crowe
Edinburgh
Scotland
.



Relevant Pages

  • Irregularity of names
    ... What is the reason for the irregularity of function and macro names ... and argument order in common lisp? ... Some predicates having a p and the ...
    (comp.lang.lisp)
  • Re: bad-idea-p?
    ... The rectification of names is a "There should be one-- and preferably only one --obvious way to do it" idea, more at home in python than common lisp. ... but the simple question is whether it is useful to name predicates consistently. ... The existing convention has two cases, justified by hyphen inertia and apparently hyphen inertia has direction. ... Heck, why don't we add naming conventions for all operators that deal with numbers, that directly or indirectly call themselves, that are guaranteed to terminate, that may not terminate, that can be implemented in less than five lines of code, that were implemented on weekends, and so on, and so forth. ...
    (comp.lang.lisp)
  • Re: Irregularity of names
    ... | What is the reason for the irregularity of function and macro names ... Some predicates having a p and the ... it had multiple designers with somewhat ... By the time the Common Lisp ...
    (comp.lang.lisp)
  • Re: Irregularity of names
    ... | What is the reason for the irregularity of function and macro names ... Some predicates having a p and the ... it had multiple designers with somewhat ... By the time the Common Lisp ...
    (comp.lang.lisp)