[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Keywords in make-instance?

Make-instance takes keyword arguments like this:

   (make-instance 'class :key1 arg1 :key2 arg2 ...)

It could take ordinary symbols instead of keywords like this:

   (make-instance 'class 'key1 arg1 'key2 arg2 ...)

I'm making an object-oriented system that has a similar syntax for
make-instance, and I have a choice about which way to do it.  Does
anyone have any advice about the pros and cons of the two
alternatives?  I see these:

Pros for first choice:
   User doesn't have to mess with packages as much.

Cons against first choice:
   If the keywords are the same as the names of slots, then forgetting
   the package may create collisions.

Any others?