summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDaniel Santos <dacs.git@brilhante.top>2023-01-11 19:20:16 +0000
committerDaniel Santos <dacs.git@brilhante.top>2023-01-12 12:13:52 +0000
commit74b1bb30dc0afab49eefe97a2022acc3d3c76d6c (patch)
tree5f4fb6c410969b38e666ea57d9287fe0333cdcd3
parentfc441a4bb98add59d111aae4de21f508d8fe38ee (diff)
downloadcl-math-74b1bb30dc0afab49eefe97a2022acc3d3c76d6c.tar.gz
rename explode-from-symbol and implode-from-symbol
-rw-r--r--cl-math.lisp18
1 files changed, 9 insertions, 9 deletions
diff --git a/cl-math.lisp b/cl-math.lisp
index da572de..a022c4d 100644
--- a/cl-math.lisp
+++ b/cl-math.lisp
@@ -15,17 +15,17 @@
 	number
 	(reverse number)))
 
-(defun explode (number)
-  "Given a number (which can have letters), it returns a list of the number"
+(defun explode-to-symbol (number)
+  "Given a number (which can have letters), it returns a list of the symbols of this number"
   (loop for letter across (write-to-string number) collect (intern (string letter))))
 
-(defun implode (number)
-  "Given a list of a number (which can have letters), it returns the number"
+(defun implode-from-symbol (number)
+  "Given a list of the symbols of a number (which can have letters), it returns the symbol of this 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))))
+  "Given a string of a number (which can have letters), it returns a list of the number"
+  (loop for letter across number collect (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."
@@ -71,7 +71,7 @@
 
 (defun plus (numerals a b)
   "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)))))
+  (may-reverse (plus-args-list numerals (may-reverse (explode-to-symbol a)) (may-reverse (explode-to-symbol 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."
@@ -83,8 +83,8 @@
 
 (defun plus-decimal (&rest args)
   "Given decimal numbers, it returns the symbol it's sum."
-  (nth-value 0 (implode (reduce (lambda (a b) (plus '(|0| |1| |2| |3| |4| |5| |6| |7| |8| |9|) a b)) args))))
+  (nth-value 0 (implode-from-symbol (reduce (lambda (a b) (plus '(|0| |1| |2| |3| |4| |5| |6| |7| |8| |9|) a b)) args))))
 
 (defun plus-earth (&rest args)
   "Give earthal numbers, it returns it's sum."
-  (symbol-to-number (nth-value 0 (implode (reduce (lambda (a b) (plus '(|1| |2| |3| |4| |5|) a b)) args)))))
+  (symbol-to-number (nth-value 0 (implode-from-symbol (reduce (lambda (a b) (plus '(|1| |2| |3| |4| |5|) a b)) args)))))
o-out.subx.html?h=main&id=333525360b22f3d3ea31db46a4d2f1b4edbfebdb'>33352536 ^
ce2c1efc ^





b1635a5c ^
33352536 ^

ce2c1efc ^
33352536 ^









ce2c1efc ^

33352536 ^
ce2c1efc ^

33352536 ^
ce2c1efc ^
33352536 ^
ce2c1efc ^
33352536 ^
4a4a392d ^
ce2c1efc ^

33352536 ^



b1635a5c ^
33352536 ^

ce2c1efc ^


b1635a5c ^
33352536 ^


ce2c1efc ^
33352536 ^

ce2c1efc ^

33352536 ^
ce2c1efc ^
4a4a392d ^
ce2c1efc ^
33352536 ^
ce2c1efc ^
33352536 ^
ce2c1efc ^


33352536 ^
ce2c1efc ^


33352536 ^
b1635a5c ^
33352536 ^

ce2c1efc ^






1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147