anchor.diff: -;;; symbol.lsp --- Symbol Functions
  +;;; call/symbol.lsp --- Symbols
   
  -;; Copyright (c) CALL Team and Сontributors
  -;;
  +;; Copyright (C) CALL Team and Contributors
  +
   ;; This file is part of CALL (Common AutoLISP Library)
   ;; Released under the MIT license
   
  
positive.code: ;;
  ;; AutoLISP built-in.
  
  ;; ### type
  ;; (**type** _v_) -> [cl-symbolp]
  ;; - _v_ : [cl-objectp]
  ;;
  ;; TODO
  ;;
  ;; AutoLISP built-in.
  
  ;; ### cl-typep
  ;; (**cl-typep** _v_ _typespec_) -> [cl-symbolp]
  ;; - _v_ : [cl-objectp]
  ;; - _typespec_ : [listp]
  ;;
  ;; TODO
  (defun cl-typep (v typespec) ; FIXME: read Common Lisp docs
    (if (listp typespec)
      (and (member (type v) type`spec))
      (eq (type v) typespec)))
  
  ;; ### cl-symbol-value
  ;; (**cl-symbol-value** _sym_) -> [cl-objectp]
  ;;
  ;; TODO
  ;;
  ;; Identical to VisualLisp `vl-symbol-value`.
  (if (and (not *call:ignore-vlisp*)
           (boundp vl-symbol-value))
      (setq cl-symbol-value vl-symbol-value)
      (defun cl-symbol-value (sym)
        (or (cl-symbolp sym) (set sym nil)) ; raise error if not symbolp
        (eval sym)))
  
  ;; ### cl-symbol-name
  ;; (**cl-symbol-name** _sym_) -> [cl-stringp]
  ;; - _sym_ : [cl-symbolp]
  ;;
  ;; TODO
  ;;
  ;; Identical to VisualLisp `vl-symbol-name`.
  (if (and (not *call:ignore-vlisp*)
           (boundp vl-symbol-name))
      (setq cl-symbol-name vl-symbol-name)
      (defun cl-symbol-name (sym / bound syms names)
        ;; FIXME: (cl-symbol-name 'names) gives nil
        (or (cl-symbolp sym) (set sym nil)) ; raise error if not symbolp
        (if (boundp sym)
            (setq bound t)
            (set sym t)) ; explicitly define symbol
        (setq syms t  ; preserve space \
              names t ; in atoms-family
              syms (atoms-family 0)
              names (atoms-family 1))
  ; debug: (print (nth (vl-position sym syms) names))
        (while (and syms
                    (not (eq sym (car syms))))
          (setq syms (cdr syms)
                names (cdr names)))
        (or bound
            (set sym nil)) ; undefine symbol
        (car names)))
  
  ;; (defun cl-symbol-name (sym / bound out)
  ;;   (or (eq 'SYM (type sym)) (set sym nil)) ; raise error if not symbolp
  ;;   (if (boundp sym)
  ;;       (setq bound t)
  ;;       (set sym t)) ; explicitly define symbol
  ;;   (setq out t  ; preserve space in atoms-family
  ;;         out (cdr (assoc sym (mapcar (function cons)
  ;;                                     (atoms-family 0)
  ;;                                     (atoms-family 1)))))
  ;;   (or bound
  ;;       (set sym nil)) ; undefine symbol
  ;;   out)
  
  ; (defun cl-true () t)
  ; (defun cl-false () nil)
  
  ;; ### cl-void
  ;; (**cl-void**) -> [cl-voidp]
  ;;
  ;; Returns *void* value.
  ;;
  ;; Equivalent to `(princ)`.
  (defun cl-void ()
    (princ))
  
  
  ;; Exports
  '(
    ;; boundp
    cl-symbolp
    cl-objectp
    cl-booleanp
    cl-voidp
    ;; quote
    ;; set setq
    ;; atoms-family
    ;; type
    cl-typep
    cl-symbol-value cl-symbol-name
    ;; cl-true cl-false
    cl-void
    )
  
negative.code: ;; # Symbols
  ;; =========
  
  ;; ### ll-symbolp
  ;; (**ll-symbolp** [ll-anyp]: _v_) -> [ll-booleanp]
  ;;
  ;; Returns `t` if _v_ is a *symbol*, `nil` otherwise.
  ;;
  ;; Identical to VisualLISP `vl-symbolp`.
  (if vl-symbolp
    (setq ll-symbolp vl-symbolp)
    (defun ll-symbolp (v)
      (eq 'SYM (type v))))
  
  ;; ### ll-symbol-value
  ;; (**ll-symbol-value** [ll-symbolp]: _sym_) -> [ll-anyp]
  ;;
  ;; TODO
  ;;
  ;; Identical to VisualLISP `vl-symbol-value`.
  (if (and (not *call:ignore-vlisp*)
           vl-symbol-value)
      (setq ll-symbol-value vl-symbol-value)
      (defun ll-symbol-value (sym)
        (or (ll-symbolp sym) (set sym nil)) ; raise error if not symbolp
        (eval sym)))
  
  ;; ### ll-symbol-name
  ;; (**ll-symbol-name** [ll-symbolp]: _sym_) -> [ll-stringp]
  ;;
  ;; TODO
  ;;
  ;; Identical to VisualLISP `vl-symbol-name`.
  (if (and (not *call:ignore-vlisp*)
           vl-symbol-name)
      (setq ll-symbol-name vl-symbol-name)
      (defun ll-symbol-name (sym / bound syms names)
        ;; FIXME: (ll-symbol-name 'names) gives nil
        (or (ll-symbolp sym) (set sym nil)) ; raise error if not symbolp
        (if (boundp sym)
            (setq bound t)
            (set sym t)) ; explicitly define symbol
        (setq syms t  ; preserve space \
              names t ; in atoms-family
              syms (atoms-family 0)
              names (atoms-family 1))
        (while (and syms
                    (not (eq sym (car syms))))
          (setq syms (cdr syms)
                names (cdr names)))
        (or bound
            (set sym nil)) ; undefine symbol
        (car names)))
  
  ;; ### atoms-family
  ;; (**atoms-family** [integerp]: _form_ [[listp]: _syms_]) -> [listp]
  ;;
  ;; Returns a list of the currently defined symbols.
  ;;
  ;; An integer _form_ detemines the format in which atoms-family returns the
  ;; symbol names:
  