anchor.diff:     (interp-toplevel x :timeout timeout)))
    
   
  +
  +(defun smack-string-simple (s &key timeout)
  +  "takes a string, reads it, interprets it and converts the result to a string"
  +  (with-output-to-string (ss)
  +    (with-smack-readtable ()
  +      (let* ((*standard-output* ss)
  +             (results (multiple-value-list
  +                       (interp-toplevel (read-from-string s)
  +                                        :timeout timeout))))
  +        (mapcar #'fresh-print results)))))
  +
  +
   (defun smack-string (s &key timeout)
     "takes a string, reads it, interprets it and converts the result to a string"
     (smack-error-handle
  -   (with-output-to-string (ss)
  -     (let* ((*standard-output* ss)
  -            (results (multiple-value-list
  -                         (interp-toplevel (read-from-string s)
  -                                          :timeout timeout))))
  -       (mapcar #'fresh-print results)))))
  +   (smack-string-simple s :timeout timeout)))
  +
  +(defun smack-string-values (s &key timeout)
  +  "takes a string, reads it, interprets it and converts the result to a string"
  +  (let ((value-str (make-adjustable-string 0))
  +        (output-str (make-adjustable-string 0))
  +        (success-p nil))
  +    (with-output-to-string (sv value-str)
  +      (with-output-to-string (so output-str)
  +        (with-smack-readtable ()
  +          (handler-case
  +              (let* ((*standard-output* so)
  +                     (results (multiple-value-list
  +                               (interp-toplevel (read-from-string s)
  +                                                :timeout timeout))))
  +                (let ((*standard-output* sv))
  +                  (mapcar #'fresh-print results))
  +                (setf success-p t))
  +            (simple-condition (condition)
  +              (apply 'format sv
  +                     (simple-condition-format-control condition)
  +                     (simple-condition-format-arguments condition)))
  +            (serious-condition (condition)
  +              (format sv "~A" condition))))))
  +    (values value-str output-str success-p)))
   
   (defun smack (&key timeout)
     "A Smacklisp read-eval-print loop (using interp)"
  -  (loop
  -    (format t "~&==> ")
  -
  -    (when (eq :smack-quit
  -              (first (mapcar #'fresh-print
  -                             (multiple-value-list
  -                                 (smack-error-handle
  -                                  (interp-toplevel (read)
  -                                                   :timeout timeout))))))
  -      (return "Bye"))))
  +  (with-smack-readtable ()
  +    (loop
  +      (clear-input )
  +      (format t "~&==> ")
  +
  +      (when (eq :smack-quit
  +                (first (mapcar #'fresh-print
  +                               (multiple-value-list
  +                                (smack-error-handle
  +                                 (interp-toplevel (read)
  +                                                  :timeout timeout))))))
  +        (return "Bye")))))
   
   
   (defmacro fresh-smack (&rest x)
     `(let ((*smack-symbols* (make-hash-table)))
        (smack ,@x)))
   
  -(defun smack-tagbody (body env fenv)
  +(defun smack-tagbody (body env fenv denv)
     (let ((goto nil))
       (tagbody top
          (setq goto
  
positive.code:                    (if (symbolp x)
                         (setf evalp (or evalp (eql x goto)))
                         (when evalp
                           (interp x env fenv))))
                   nil)))
         (when goto
           (unless (member goto body)
             (throw 'tagbody-go goto))
           (go top)))))
            
  (defun smack-go (body env fenv)
    (declare (ignore env fenv))
    (unless (singlep body)
      (error "Multiple arguments to GO"))
    (let ((tag (car body)))
  
negative.code: 
  
  (defun get-global-func (symbol)
    (unless (smack-fboundp nil symbol) 
      (error "Unbound smacklisp function: ~a" symbol))
    (get-smackprop symbol 'global-func))
  
  
  (defun smack-quit (denv)
    (declare (ignore denv))
    :smack-quit)
  
  (defun smack-constantp (denv form)
    (declare (ignore denv))
    (typecase form
        ;; copied from sbcl and altered
        (symbol
         (get-smackprop form 'constant))
        (list
         (eq (car form) 'quote))
        (t t)))
  
  (defun smack-boundp (denv symbol)
    (declare (ignore denv))
    (smackprop-p symbol 'global-val))
        
  
  (defun smack-fboundp (denv symbol)
    (declare (ignore denv))
    (smackprop-p symbol 'global-func))
        
  
  (defun smack-fdefinition (denv symbol)
    (unless (smack-fboundp denv symbol)
      (error "Unbound global smacklisp function: ~a" symbol))
    (get-global-func symbol))
  
  (defun smack-fmakunbound (denv symbol)
    (declare (ignore denv))
    (rem-smackprop symbol 'global-func))
    
  
  (defun smack-funcall (denv fn &rest args)
    (smack-apply denv fn args))
  
  (defun smack-defconstant (denv symbol val)
    (declare (ignore denv))
    (rem-smackprop symbol 'constant)
    (set-global-var symbol val)
    (set-smackprop symbol 'constant t)
    symbol)
  
    
  
  
  (defun smack-symbol-plist (denv symbol)
    (declare (ignore denv))
    (get-smackprop symbol 'symbol-plist))
  
  (defun smack-get (denv symbol indicator &optional default)
    (declare (ignore denv))
    (getf (get-smackprop symbol 'symbol-plist) indicator default))
  
  (defun smack-put-prop (denv symbol indicator value)
    (declare (ignore denv))
    (setf (getf (get-smackprop symbol 'symbol-plist) indicator)
          value))
  
  (defun smack-putf (denv plist indicator value)
    (declare (ignore denv))
    (setf (getf plist indicator) value)
    plist)
  
  