diff --git a/NEWS b/NEWS index 0f4b5f6..2414f89 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ Changes from 0.12.1 [ Language Changes ] + * `let` has been removed. Python's scoping rules do not make a proper + implementation of it possible. Use `setv` instead. * xor: If exactly one argument is true, return it [ Bug Fixes ] diff --git a/hy/core/bootstrap.hy b/hy/core/bootstrap.hy index 8d8a3f8..4b07e91 100644 --- a/hy/core/bootstrap.hy +++ b/hy/core/bootstrap.hy @@ -41,23 +41,13 @@ (defmacro defn [name lambda-list &rest body] "define a function `name` with signature `lambda-list` and body `body`" - (if (not (= (type name) HySymbol)) + (import hy) + (if (not (= (type name) hy.HySymbol)) (macro-error name "defn takes a name as first argument")) - (if (not (isinstance lambda-list HyList)) + (if (not (isinstance lambda-list hy.HyList)) (macro-error name "defn takes a parameter list as second argument")) `(setv ~name (fn ~lambda-list ~@body))) -(defmacro let [variables &rest body] - "Execute `body` in the lexical context of `variables`" - (if (not (isinstance variables HyList)) - (macro-error variables "let lexical context must be a list")) - (if (= (len variables) 0) - `((fn [] - ~@body)) - `((fn [] - (setv ~@variables) - ~@body)))) - (defmacro if-python2 [python2-form python3-form] "If running on python2, execute python2-form, else, execute python3-form" (import sys)