From 1c7ca7ac1f71b8076e1195fa1d2952169898782b Mon Sep 17 00:00:00 2001 From: Tristan Cacqueray Date: Tue, 9 Apr 2019 00:01:41 +0000 Subject: [PATCH] update contrib and macro to use the new list? function --- hy/contrib/hy_repr.hy | 2 +- hy/contrib/walk.hy | 2 +- hy/core/macros.hy | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hy/contrib/hy_repr.hy b/hy/contrib/hy_repr.hy index 9fd59be..c99a45a 100644 --- a/hy/contrib/hy_repr.hy +++ b/hy/contrib/hy_repr.hy @@ -18,7 +18,7 @@ (setv -registry {}) (defn hy-repr-register [types f &optional placeholder] - (for [typ (if (instance? list types) types [types])] + (for [typ (if (list? types) types [types])] (setv (get -registry typ) (, f placeholder)))) (setv -quoting False) diff --git a/hy/contrib/walk.hy b/hy/contrib/walk.hy index a7a46e9..d30f29e 100644 --- a/hy/contrib/walk.hy +++ b/hy/contrib/walk.hy @@ -19,7 +19,7 @@ (outer (HyExpression (map inner form)))] [(instance? HyDict form) (HyDict (outer (HyExpression (map inner form))))] - [(instance? list form) + [(list? form) ((type form) (outer (HyExpression (map inner form))))] [(coll? form) (walk inner outer (list form))] diff --git a/hy/core/macros.hy b/hy/core/macros.hy index 5e06751..1021c76 100644 --- a/hy/core/macros.hy +++ b/hy/core/macros.hy @@ -213,7 +213,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 (instance? list arg) (.startswith (first arg) "o!")) + [(and (list? 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)))))