mindcode
mindcode copied to clipboard
Empty functions don't compile
A function that has an empty body won't compile - a syntax error is generated:
def foo(n)
end
foo(0)
Looks like the issue seems to be with the grammar definition. As a workaround, null
can be placed into the body, as a function with an empty body would be expected to return null
anyways. This compiles:
def foo(n)
null
end
foo(0)
As there's a workaround, I won't rush a fix. I plan to have a look at the grammar sometime, there's a bunch of things that need attention.