this is an exert of the code foor a game that I am writing.
(for [sprite self.sprites]
(if (!= (type sprite.content) NoneType)
(sprite.content.render)))
it complains about a parse error for pattern macro 'if': got unexpected end of input, expected: some(...)
, even though thus IS valid Hy code.
Ran with both Hy version 0.25.0 on PyPy, 0.24.0 and 0.25.0 on CPython. Still threw the same error. The code should not have thrown the error at all, because it was working perfectly fine yesterday, I come back today and it'd throw an error, despite no changes.
This is not, in fact, valid Hy code. As suggested by the error message,
if
requires a third argument. See the manual entry onif
.As for how this code could've been "working perfectly fine yesterday", I have no explanation, unless you were using a different version of Hy yesterday.