about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2014-12-14 08:14:13 -0800
committerKartik K. Agaram <vc@akkartik.com>2014-12-14 08:14:13 -0800
commit0274f7d8ef6f098fb670da8873c07457b3dec179 (patch)
tree087de347f4457143cdfaefc16037a812a5288a33
parent640ddefe755abe7828df06eb234ebd65be99c5ce (diff)
downloadmu-0274f7d8ef6f098fb670da8873c07457b3dec179.tar.gz
421
-rw-r--r--mu.arc12
-rw-r--r--mu.arc.t4
2 files changed, 12 insertions, 4 deletions
diff --git a/mu.arc b/mu.arc
index cdadc9f9..c441d2e5 100644
--- a/mu.arc
+++ b/mu.arc
@@ -1372,11 +1372,15 @@
     (= function*.name (convert-names:convert-labels:convert-braces:tokenize-args:insert-code body name))))
 
 (def tokenize-arg (arg)
+;?   (tr "tokenize-arg " arg)
   (if (in arg '<- '_)
-    arg
-    (map [map [fromstring _ (read)] _]
-         (map [tokens _ #\:]
-              (tokens string.arg #\/)))))
+        arg
+      (isa arg 'sym)
+        (map [map [fromstring _ (read)] _]
+             (map [tokens _ #\:]
+                  (tokens string.arg #\/)))
+      :else
+        arg))
 
 (def tokenize-args (instrs)
 ;?   (tr "tokenize-args " instrs)
diff --git a/mu.arc.t b/mu.arc.t
index 65f3a9a8..d51bdbe3 100644
--- a/mu.arc.t
+++ b/mu.arc.t
@@ -3303,6 +3303,10 @@
 (assert:iso '_
             (tokenize-arg '_))
 
+; idempotent
+(assert:iso (tokenize-arg:tokenize-arg 'a:b/c:d)
+            (tokenize-arg              'a:b/c:d))
+
 ; support labels
 (assert:iso '((((default-scope scope-address)) <- ((new)) ((scope literal)) ((30 literal)))
               foo)