Skip to content

Commit

Permalink
scheme: allow keyword argument for keyword built-in
Browse files Browse the repository at this point in the history
  • Loading branch information
asarhaddon committed Jul 17, 2019
1 parent 3b797cd commit 643ee7d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scheme/lib/core.sld
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,9 @@
(symbol? . ,(lambda (x) (coerce (mal-instance-of? x 'symbol))))
(symbol . ,(lambda (x) (mal-symbol (string->symbol (mal-value x)))))
(keyword? . ,(lambda (x) (coerce (mal-instance-of? x 'keyword))))
(keyword . ,(lambda (x) (mal-keyword (string->symbol (mal-value x)))))
(keyword . ,(lambda (x) (if (mal-instance-of? x 'keyword)
x
(mal-keyword (string->symbol (mal-value x))))))
(vector? . ,(lambda (x) (coerce (mal-instance-of? x 'vector))))
(vector . ,(lambda args (mal-vector (list->vector args))))
(map? . ,(lambda (x) (coerce (mal-instance-of? x 'map))))
Expand Down

0 comments on commit 643ee7d

Please sign in to comment.