anchor.diff: +(defpackage "SYSTEM-SPEC")
   (defpackage "STRING-SPEC")
   (IN-PACKAGE "STRING-SPEC")
   
  
positive.code: 
  (defun stringToInt (s)
    (declare (type string s))
    ;; lisp automatically returns the first value as a normal value
    (the integer (read-from-string s)))
  
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  
  
negative.code: (defun stringToNat (s)
    (declare (type string s))
    ;; lisp automatically returns the first value as a normal value
    (multiple-value-bind (n new-index)
        (parse-integer s :junk-allowed t)
      (cond ((null n)
  	   (System-Spec::fail
  	    (format nil "stringToNat could not parse ~S" 
  		    s)))
  	  ((< new-index (length s))
  	   (System-Spec::fail
  	    (format nil "stringToNat found ~D, but also extra junk in ~S" 
  		    n s)))
  	  ((digit-char-p (char s 0))
  	   (the integer n))
  	  (t
  	   (System-Spec::fail
  	    (format nil "stringToNat: leading ~:C in ~S is not allowed"
  		    (char s 0) s))))))
  
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  
  