[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
coercion of symbols to strings
- To: email@example.com, common-lisp@SU-AI.ARPA
- Subject: coercion of symbols to strings
- From: Guy Steele <gls@THINK-AQUINAS.ARPA>
- Date: Mon, 19 May 86 12:20 EDT
- Cc: gls@THINK-AQUINAS.ARPA
- In-reply-to: <8605162240.AA27077@dali.berkeley.edu>
Date: Fri, 16 May 86 15:40:10 PDT
From: firstname.lastname@example.org (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