Answer by Alfgaar for Scheme and Clojure don't have the atom type predicate -...
Atom is either a symbol, a character, a number, or null. (define (atom? a) (or (symbol? a) (char? a) (number? a) (null? a)))I think those are all the atoms that exist, if you find more add to the...
View ArticleAnswer by Óscar López for Scheme and Clojure don't have the atom type...
In the book The Little Schemer, atom? is defined as follows:(define (atom? x) (and (not (pair? x)) (not (null? x))))Noting that null is not considered an atom, as other answers have suggested. In the...
View ArticleAnswer by Vijay Mathew for Scheme and Clojure don't have the atom type...
In Scheme anything that is not a pair is an atom. As Scheme already defines the predicate pair?, the atom? predicate is not needed, as it is so trivial to define:(define (atom? s) (not (pair? s)))
View ArticleAnswer by Rainer Joswig for Scheme and Clojure don't have the atom type...
It's a trivial function:(defun atom (x) (not (consp x)))It is used in list processing, when the Lisp dialect uses conses to build lists. There are some 'Lisps' for which this is not the case or not...
View ArticleAnswer by Stuart Sierra for Scheme and Clojure don't have the atom type...
Clojure has the coll? (collection?) function, which is (sort of) the inverse of atom?.
View ArticleAnswer by mikera for Scheme and Clojure don't have the atom type predicate -...
In Clojure, the atom predicate isn't so important because Clojure emphasizes various other types of (immutable) data structures rather than focusing on cons cells / lists. It could also cause...
View ArticleAnswer by leppie for Scheme and Clojure don't have the atom type predicate -...
In the entire IronScheme standard libraries which implement R6RS, I never needed such a function.In summary:It is uselessIt is easy enough to write if you need it Which pretty much follows Scheme's...
View ArticleScheme and Clojure don't have the atom type predicate - is this by design?
Common LISP and Emacs LISP have the atom type predicate. Scheme and Clojure don't have it. http://hyperpolyglot.wikidot.com/lispIs there a design reason for this - or is it just not an essential...
View Article
More Pages to Explore .....