From 058dc758d48631c026a66e28630b05b9a554dbcd Mon Sep 17 00:00:00 2001 From: gilch Date: Sun, 27 Oct 2024 15:55:37 -0600 Subject: [PATCH] Fix alias dots _macro_ keys should be identifiers. There's no valid use for `.` in local tags, so munge as if escaped. --- src/hissp/macros.lissp | 2 +- src/hissp/reader.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hissp/macros.lissp b/src/hissp/macros.lissp index ddff7760..f2061922 100644 --- a/src/hissp/macros.lissp +++ b/src/hissp/macros.lissp @@ -1205,7 +1205,7 @@ See `hissp.macros`. ;; See also: `prelude`, `attach`, `hissp.alias`. ;; ;; - `(defmacro ,(.format "{}{}" abbreviation '#) + `(defmacro ,(.format "{}{}" (.replace abbreviation '. '\.) '#) ($#attr :/ : :* $#args :** $#kwargs) ',(.format "Aliases ``{}`` as ``{}#``." qualifier abbreviation) (let ($#attr (if-else (hissp..is_control $#attr) diff --git a/src/hissp/reader.py b/src/hissp/reader.py index 81cc6b83..76db131e 100644 --- a/src/hissp/reader.py +++ b/src/hissp/reader.py @@ -509,6 +509,7 @@ def _fully_qualified(tag: str): return cast(Fn, reduce(getattr, function.split("."), import_module(module))) def _local(self, tag: str): + tag = tag.replace(".", force_qz_encode(".")) try: return getattr(self.lissp.env[C.MACROS], tag + munge("#")) except (AttributeError, KeyError):