Hi Everyone,

The set of classes for which seq? returns true is rather large. It contains
Cons, LazySeq, PersistentList, and many others. Experimentation reveals that
any of these types can be used to hold Clojure code for evaluation by eval.

Is a form just anything for which seq? returns true, by definition? Or is
there a more accurate definition of a form?

If it's correct to say that a form is always something for which seq?
returns true and never something for which seq? returns false, then any
ISeq-implementing type can be used to hold the return values of quote and
syntax-quote, in principle.

Currently,

user=> (class '(f arg1 arg2))
clojure.lang.PersistentList

user=> (class `(f arg1 arg2))
clojure.lang.Cons

But those particular classes might be just implementation details. In
principle, in a future release, one or both of those calls might return
ChunkedCons or LazySeq, or any of the other ISeq-implementing types.

I am wondering whether someone could guarantee that this potentiality will
*not* come to pass. To put the question differently, is there a subset of
the ISeq-implementing classes that is guaranteed never to be used to hold
the output of quote, syntax-quote, or any other core code-generation
facilities? In particular, can it be guaranteed that quote and syntax-quote
will never return a lazy-seq? (I can't see why it would ever be desired that
they should, but I am wondering whether a guarantee is available.)

Perhaps no such guarantee is available because it is an implementation
detail that quote and syntax-quote return Java objects in the first place.
In another release they might return deftypes or CLR objects. In that case,
is there any internal-to-Clojure facility I can use to differentiate between
seqs generally, on one hand, and the return values of quote and
syntax-quote, on the other hand? Is there any way I can generate a
"clojure-generated-form?" predicate that is more restrictive than "seq?"?

Thanks,
Garth

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to