Closed stepa2 closed 8 months ago
It's unnecessary.
In the future there will be an analyzer and multiple passes so you could just call functions before they're declared regardless on @strict
like rust or other modern aot languages
This is both an temporal implementation for @strict
until multipass analyzer is implemented and a more explicit way to do forward declaration in non-@strict
chips.
After all, you can't forward declare functions on @strict
otherwise.
This is both an temporal implementation for
@strict
until multipass analyzer is implemented and a more explicit way to do forward declaration in non-@strict
chips.After all, you can't forward declare functions on
@strict
otherwise.
Temporary patches shouldn't lock us into syntax like this. Also not too happy with the compiler/parser implementation
How do you suggest to add this feature without modifying syntax?
Only way I can see is to add special function, say undefined()
, and treat all function bodies only containing undefined()
call as declaration without definition.
However this will be a hack, because function anything() { undefined() }
will be treated differently than function with any other body.
And what is wrong with implementation? I just extracted function-related code to separate functions. Function definition check done in a simple way, so multiple-pass system is not required. Other than that, everything is done in way other E2 features are implemented.
How do you suggest to add this feature without modifying syntax?
By waiting for the analyzer step to be implemented?
And what is wrong with implementation?
I can do a review later. But it's pointless if I'm against this idea entirely, which is why I didn't make one
You've broke forward declaration without providing alternative for almost one month. I implemented a working solution to this problem.
Why shouldn't this be available to other E2 users?
You've broke forward declaration without providing alternative for almost one month.
During the holidays. Really can't be patient?
And I already gave a solution in your issue, just remove @strict
. I never guaranteed backwards compatibility for chips with @strict
. So no, nothing is "broken".
Why shouldn't this be available to other E2 users?
I just gave my reason. You can scroll up to read it again.
Allows using a function before the line of code where it is defined. Fixes #2910.