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

coercion of symbols to strings



    Date: Fri, 16 May 86 15:40:10 PDT
    From: fateman@dali.berkeley.edu (Richard Fateman)

    To convert a symbol to a string one apparently must use the string function.
    That is, (coerce 'x 'string) is illegal.  But (string 'x) ==> "X" .
    Why not allow the former as a synonym for the latter?

Research shows that the Common Lisp archives up to a couple of months
ago contains 18 messages that mention COERCE.  None explicitly addresses
this iccue, but the general tone of the messages is one of conservatism.
I now remember that this issue was tied up with the design of the
sequence functions.  There was real resistance to letting symbols be
treated as general sequences, and so the general decision was made that
string-specific functions would accept symbols, but general sequence
functions would not.  COERCE was limited to performing, for the most part,
sequence coercions and numerical coercions.  (As for the latter, there
was an explicit decision not to let COERCE translate between numbers
and characters.)