summary refs log tree commit diff stats
path: root/cl-math.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'cl-math.lisp')
-rw-r--r--cl-math.lisp8
1 files changed, 8 insertions, 0 deletions
diff --git a/cl-math.lisp b/cl-math.lisp
index 5eae31d..5bb880d 100644
--- a/cl-math.lisp
+++ b/cl-math.lisp
@@ -23,6 +23,10 @@
   "Given a list of a number (which can have letters), it returns the number"
   (intern (apply #'concatenate 'string (mapcar #'symbol-name number))))
 
+(defun explode-string (number)
+  "Given a number (which can have letters), it returns a list of the number"
+  (loop for letter across number collect (intern (string letter))))
+
 (defun next-list-number (numerals number-list)
   "Given a list of a numeral system and a list of a number, it returns a list of the next number."
   (cond
@@ -69,6 +73,10 @@
   "Given a list of a numeral system and 2 numbers, it returns the list of it's sum."
   (may-reverse (plus-args-list numerals (may-reverse (explode a)) (may-reverse (explode b)))))
 
+(defun plus-string (numerals a b)
+  "Given a list of a numeral system and 2 strings, it returns the list of it's sum."
+  (may-reverse (plus-args-list numerals (may-reverse (explode-string a)) (may-reverse (explode-string b)))))
+
 (defun symbol-to-number (symbol)
   "Given a symbol, returns it's number."
   (nth-value 0 (parse-integer (symbol-name symbol))))