olofson / audiality2

A realtime scripted modular audio engine for video games and musical applications.
http://audiality.org/
zlib License
79 stars 5 forks source link

Allow 'def' to alias to any kind of symbol #265

Closed olofson closed 8 years ago

olofson commented 8 years ago

The 'def' construct currently creates an actual new symbol, that is a clone of the right hand expression result. This works only for a few special cases, as seen in a2c_Def(); TK_VALUE, TK_REGISTER, TK_WAVE, TK_PROGRAM, and TK_STRING.

For example, TK_NAMESPACE will not work, nor is it a simple matter of adding it, because you can't clone a namespace symbol, as it contains the list head for the symbols within the namespace.

Maybe it's better to add an explicit alias symbol type, which the lexer automatically evaluates, returning the target symbol instead?