From 52c0e4e221dbbf48c8f68f6630db42f27204af69 Mon Sep 17 00:00:00 2001 From: Kodi Arfer Date: Fri, 2 Aug 2019 17:09:13 -0400 Subject: [PATCH] Add explicit checks for HyList --- hy/contrib/hy_repr.hy | 2 +- hy/core/macros.hy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hy/contrib/hy_repr.hy b/hy/contrib/hy_repr.hy index 3baaebb..a3c7631 100644 --- a/hy/contrib/hy_repr.hy +++ b/hy/contrib/hy_repr.hy @@ -144,7 +144,7 @@ (hy-repr (dict x))))) (for [[types fmt] (partition [ - list "[...]" + [list HyList] "[...]" [set HySet] "#{...}" frozenset "(frozenset #{...})" dict-keys "(dict-keys [...])" diff --git a/hy/core/macros.hy b/hy/core/macros.hy index 90ddc22..e1d5d48 100644 --- a/hy/core/macros.hy +++ b/hy/core/macros.hy @@ -201,7 +201,7 @@ Such 'o!' params are available within `body` as the equivalent 'g!' symbol." (defn extract-o!-sym [arg] (cond [(and (symbol? arg) (.startswith arg "o!")) arg] - [(and (list? arg) (.startswith (first arg) "o!")) + [(and (instance? HyList arg) (.startswith (first arg) "o!")) (first arg)])) (setv os (list (filter identity (map extract-o!-sym args))) gs (lfor s os (HySymbol (+ "g!" (cut s 2)))))