This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GSOC | Extending Common Lisp support


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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]