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
(import
contextlib [nullcontext])
(with [a (nullcontext) b (do a (nullcontext))])
This raises NameError: name 'a' is not defined. How this happens is clear enough to the experienced Hy programmer, but that it happens at all can be surprising considering that e.g.
(for [a [1] b (do a [1])])
works fine. And the Python language reference specifies that
With more than one item, the context managers are processed as if multiple with statements were nested:
withA() asa, B() asb:
SUITE
is semantically equivalent to:
withA() asa:
withB() asb:
SUITE
So it's surprising that this equivalency doesn't hold for Hy.
The text was updated successfully, but these errors were encountered:
Consider:
This raises
NameError: name 'a' is not defined
. How this happens is clear enough to the experienced Hy programmer, but that it happens at all can be surprising considering that e.g.works fine. And the Python language reference specifies that
So it's surprising that this equivalency doesn't hold for Hy.
The text was updated successfully, but these errors were encountered: