[Gsll-devel] MAKE-SYMBOL-FROM-STRINGS does the wrong thing?
Liam Healy
lhealy at common-lisp.net
Mon Mar 3 03:03:28 UTC 2008
I think you're right. I've done it one better though; there were several calls
to #'intern, and I now provide the package argument for each. Checked in.
Thanks.
Liam
On 3/2/08, Zach <elzacho at gmail.com> wrote:
> Okay, so this is my first post, so I may be completely misguided,
>
> After loading asdf loading GSLL, I find that I cannot do any matrix or
> permutation stuff with it, unless I did it from withing the package itself.
> After a while I tracked this to MAKE-SYMBOL-FROM-STRINGS (init/utility.lisp)
> which interns symbols on the fly. The problem is that it creates symbols in
> whatever package you happen to be in when it is called. This matters
> because it is used create class name symbols which should be in the package
> GSLL not where ever I happen to be using GSLL from.
>
> For example:
>
> (gsl:letm ((perm-1 (gsl:permutation 4 t)))
> (gsl:set-identity perm-1)
> (gsl:maref perm-1 2) )
> ==> Error: There is no class named GSL-PERMUTATION.
>
> (use-package :gsll)
> (gsl:letm ((perm-1 (gsl:permutation 4 t)))
> (gsl:set-identity perm-1)
> (gsl:maref perm-1 2) )
> ==> Error: There is no class named GSL-PERMUTATION.
>
> So I think we want to change...
>
> (defun make-symbol-from-strings (&rest strings)
> "Construct a symbol by concatenating words with hyphens."
> (intern (format nil "~{~:@(~a~)~^-~}" (mapcar #'string strings))))
>
> ...to...
>
> (defun make-symbol-from-strings (&rest strings)
> "Construct a symbol by concatenating words with hyphens."
> (intern (format nil "~{~:@(~a~)~^-~}" (mapcar #'string strings)) :gsll))
>
> With the change the test works (returns 2).
>
> What do you think?
> Zach
>
>
>
> _______________________________________________
> Gsll-devel mailing list
> Gsll-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/gsll-devel
>
>
More information about the gsll-devel
mailing list