Page 1 of 1

Gensymed Package?

Posted: Wed Mar 24, 2010 8:14 am
by Suroy
This is just a curiousity ;)
Is it possible to make a package which you can only access by having the actual gensym symbol?

Something like:
(setf *var* (gensym))
(make-package *var* :use '(:cl))

accept this doesn't work, because you can still access the package by the string name of the gensymed variable.

Re: Gensymed Package?

Posted: Wed Mar 24, 2010 8:30 am
by ramarren
A package name is a string, as specified by 11.1.1.1. You can even use literal string as an argument to defpackage/make-package (or even a character). When you use a symbol it is used just for its name, it doesn't matter what the symbol actually is.

Re: Gensymed Package?

Posted: Wed Mar 24, 2010 8:50 am
by Suroy
Thats what i suspected. Oh well, its still simple to create unique package names :)