Arguments: start-name &key hyphenate package
Creates and returns a unique symbol in the specified package, based on the printed representation of start-name. This is useful for generating unique symbol names for objects.
Basically, gensym-sequential-name takes the print name of start-name,
removes any numerals and hyphens from the end, optionally appends a
hyphen, appends the string representation of the lowest positive
integer that has not yet been used with the print name of start-name
and that causes the completed string to not name an existing symbol
after the string's case has been changed as appropriate for the
*current-case-mode*
,
interns the string in the specified package, and returns the resulting
symbol.
start-name may be any object, but is typically a symbol (which may have been created by gensym-sequential-name as well) or a string.
If hyphenate is specified, then a hyphen is appended before the number if and only if hyphenate is true. If hyphenate is not specified, the a hyphen is appended if and only if there are any other hyphens in the base string (after all numerals and hyphens have been removed from the end).
package may be either a package object or the name of a package. The default value is :keyword.
Examples (in a fresh lisp):
(gensym-sequential-name 'foo) returns :foo1 (gensym-sequential-name 'foo) returns :foo2 (gensym-sequential-name :foo1) returns :foo3 (gensym-sequential-name :foo-bar) returns :foo-bar-1 (gensym-sequential-name :foo-bar-1) returns :foo-bar-2
Common Graphics and IDE documentation is described in About Common Graphics and IDE documentation in cgide.htm.
The documentation is described in introduction.htm and the index is in index.htm.
Copyright (c) 1998-2000, Franz Inc. Berkeley, CA., USA. All rights reserved.
Created 2000.10.5.