You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attempting to decorate an fn that can compile down to a lambda fails, but it won't fail if the fn contains statements that force compilation to an anonymous def
=> (with-decorator cache (fn [x] x))
Traceback (most recent call last):
File "stdin-ecb69bbf92e18e5e87b4bc8c6fd3222c5969d4a8", line 1, in <module>
(with-decorator cache (fn [x] x))
File "<stdin>", line 1
(with-decorator cache (fn [x] x))
^
hy.errors.HySyntaxError: Decorated a non-function
I think it makes the most sense to force the anon def when an fn uses a decorator like it already does when it contains statements or type annotations.
The text was updated successfully, but these errors were encountered:
I think that's implied by "with-decorator and #@ have been removed in favor of decorator lists (see below)" and the description of decorator lists only mentioning defn and defclass.
Attempting to decorate an
fn
that can compile down to alambda
fails, but it won't fail if thefn
contains statements that force compilation to an anonymousdef
I think it makes the most sense to force the anon
def
when anfn
uses a decorator like it already does when it contains statements or type annotations.The text was updated successfully, but these errors were encountered: