Gensymed Package?

Discussion of Common Lisp
Post Reply
Suroy
Posts: 46
Joined: Sat Dec 19, 2009 11:20 am

Gensymed Package?

Post by Suroy » Wed Mar 24, 2010 8:14 am

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.

ramarren
Posts: 613
Joined: Sun Jun 29, 2008 4:02 am
Location: Warsaw, Poland
Contact:

Re: Gensymed Package?

Post by ramarren » Wed Mar 24, 2010 8:30 am

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.

Suroy
Posts: 46
Joined: Sat Dec 19, 2009 11:20 am

Re: Gensymed Package?

Post by Suroy » Wed Mar 24, 2010 8:50 am

Thats what i suspected. Oh well, its still simple to create unique package names :)

Post Reply