Open japanoise opened 4 years ago
Hi @japanoise that would be pretty cool. Just add a couple of correctness tests to the test suite and file a pull request, and we'll put it in.
Well, currently the API is too clumsy. I wouldn't put it in as-is.
You have to do e.g.
(while (fn [] (==cond true) (fn [] (body goes here))
I was wondering if you had a macro hack or something to make it nicer.
The proper way would be to add it to the built in codegen, alongside the for
builtin. You could probably just copy and modify the for
Generator.GenerateForLoop code in generator.go:817 to be like Go and only need the middle test.
It'd be rad to have a while loop construct. I've had to hack it in myself, using this:
Is there a better way? Or would this require extending the language?
I'd like to be able to do: