TIP: Click on subject to list as thread! ANSI
echo: a_cad
to: STEVE GOOD
from: HANNES LUEBBERS
date: 1996-06-21 18:30:00
subject: autolisp variable names, converted to st18:30:4206/21/96

Hi Steve!
Answering a message of Steve Good:
 SG> How does one convert a variavle name, when stored in another variable, 
to a
 SG> string? 
Beside writing the symbol to a file a re-reading it as text, you may profit 
from the 'duality' of the atoms-family, which can return it's contents as 
list of strings _or_ list of text. 
Add your Symbol to the atoms-family and ... 
... to make it all simple: 
(defun sym2str ( symbol / _f _s )
  (if (= 'SYM (type symbol))
    (progn
      (if (null (eval symbol))
        (progn
          (set symbol  'T)
          (setq _f  'T)
      ))
      (setq _s (nth (1- (length (member symbol (atoms-family 0))))
               (reverse (atoms-family 1))
      ))
      (if _f (set symbol nil))
      _s
)))
moin, hannes
---
---------------
* Origin: umrk (2:240/2123.50)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.