Open DocSunset opened 3 years ago
Yep - absolutely, it should work, and one day we will make it work, but for enormously complicated reasons, it's a really really difficult one to fix.
We've had it on our to-do-list for ages, but... (deep breath...) processor constants are only known at a late stage in the compile process, so they get resolved in HEART code, not SOUL. You're trying to us this constant as part of a type, but the HEART type system is much simpler than the SOUL one, and it can only represent concrete types, not ones that contain unresolved constants.
So despite this seeming like a trivial problem, to get it working means probably about a month's work to completely re-implement the HEART type system (!)
Thanks for the clear explanation.
Using the soul command line version 0.9.53, the following minimum example fails to compile with the error:
example.soul:
Since
processor.frequency
is described as a compile-time constant in the syntax guide (here), it seems like this should work.Similarly, changing
float[processor.frequency] buffer
tofloat<processor.frequency> buffer
also fails, with the error:I suppose the sizes should technically be converted to int; doing so doesn't change the errors produced.
I would like to use this in order to have a buffer for delays with a maximum delay time specified (at compile time) in seconds. This requires the buffer size to be an expression using processor.frequency.