GSOC | Extending Common Lisp support
Jamison Hope
jrh@theptrgroup.com
Mon Jun 11 21:50:00 GMT 2012
On Jun 11, 2012, at 4:13 PM, Charles Turner wrote:
> I'm finding MAKE-SYMBOL a bit mysterious, I "blindly" followed the
> spec and chose this as a definition, all the tests I could find
> passed:
>
> (defun make-symbol (x)
> (invoke-static gnu.mapping.Symbol 'makeUninterned x))
>
> But I'm struggling to see what the motivation for MAKE-SYMBOL is, when
> do you use such a function?
This http://cl-cookbook.sourceforge.net/macros.html has an example using
it. I'm not sure whether the uninterned-ness of MAKE-SYMBOL-made symbols
is crucial to that macro working correctly (maybe!), but its ability to
construct a symbol at runtime with a specified name is.
So, it's kind of like Scheme's string->symbol, which is handy in macro
definitions (for an example, see gnu/kawa/slib/enums.scm).
In regular (non defmacro) code, it's probably not all that useful.
--
Jamison Hope
The PTR Group
www.theptrgroup.com
More information about the Kawa
mailing list