2005-01-29 14:18:28 -05:00
|
|
|
! Copyright (C) 2004, 2005 Slava Pestov.
|
|
|
|
|
! See http://factor.sf.net/license.txt for BSD license.
|
2005-08-29 18:18:10 -04:00
|
|
|
IN: words
|
|
|
|
|
USING: hashtables kernel math namespaces parser sequences
|
|
|
|
|
strings ;
|
2004-09-02 16:40:34 -04:00
|
|
|
|
2004-11-03 23:35:36 -05:00
|
|
|
: gensym ( -- word )
|
|
|
|
|
#! Return a word that is distinct from every other word, and
|
|
|
|
|
#! is not contained in any vocabulary.
|
2005-08-29 18:18:10 -04:00
|
|
|
"G:"
|
|
|
|
|
global [ \ gensym dup inc get ] bind
|
|
|
|
|
number>string append f <word> ;
|
2004-07-16 02:26:21 -04:00
|
|
|
|
2005-08-29 18:18:10 -04:00
|
|
|
0 \ gensym global set-hash
|