[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Coerce (Symbols)

    Date:     Tue, 20 May 86 15:31 EST
    From:     ELIOT%umass-cs.csnet@CSNET-RELAY.ARPA

    Coercing symbols to strings is fine, as long as NIL is treated as
    the empty SEQUENCE, rather than as a symbol.

    I have also wanted to have an :initial-contents argument to make-string
    and make-sequence, analogous to make-array.  (Make-list should also
    have an :initial-contents arg.)

Does (coerce <symbol> 'string) return
	(symbol-name <symbol>), or
	(format nil "~S" <symbol>), which would (possibly) include the package, or
	(format nil "~A::~A"
		(package-name (symbol-package <symbol>))
		(symbol-name <symbol>))
or what?  If this weren't enough, added in with my personal views of
style and functionality, for me to want to help veto this coersion, the
special casing of NIL certainly would.  Programs should reflect their
meaning.  A string is a sequence, a symbol is not.  Why shouldn't
	(coerce :ascii-EOT 'integer)
work?  The answer is that the requested behavior is not a coersion
between compatible types, it is a functional translation between human
understandable names for the ascii control characters and the integers
that are their corresponding values.