From a49047b7a3b77e267ec9d148c2ee6ac39cbabf7f Mon Sep 17 00:00:00 2001 From: schuster-rainer Date: Sat, 1 Mar 2014 00:23:49 +0100 Subject: [PATCH] Added name and keyword functions to core --- hy/core/language.hy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hy/core/language.hy b/hy/core/language.hy index 21c7808..c65bcbe 100644 --- a/hy/core/language.hy +++ b/hy/core/language.hy @@ -26,7 +26,7 @@ (import [hy._compat [long-type]]) ; long for python2, int for python3 (import [hy.models.cons [HyCons]] - [hy.models.keyword [HyKeyword KEYWORD_PREFIX]]) + [hy.models.keyword [HyKeyword *keyword-prefix*]]) (defn _numeric-check [x] @@ -359,7 +359,7 @@ (defn keyword [value] "Create a keyword from the given value. Strings numbers and even objects with the __name__ magic will work" - (if (and (string? value) (value.startswith KEYWORD_PREFIX)) + (if (and (string? value) (value.startswith *keyword-prefix*)) (hyify value) (if (string? value) (HyKeyword (+ ":" (hyify value))) @@ -370,7 +370,7 @@ (defn name [value] "Convert the given value to a string. Keyword special character will be stripped. String will be used as is. Even objects with the __name__ magic will work" - (if (and (string? value) (value.startswith KEYWORD_PREFIX)) + (if (and (string? value) (value.startswith *keyword-prefix*)) (hyify (slice value 2)) (if (string? value) (hyify value)