For example: If a user defines a procedure named foo, then the pclu compiler generates a C function named foo. That can cause trouble if foo is needed by the pclu runtime.
Anecdotally: Apparently someone wrote a procedure named 'printf` and their program wouldn't work.
One solution is to instead generate a function named Clu_foo, and require that the runtime system define or link any functions that start with foo_. (Note there are symbols in the runtime such as clu_alloc , _pclu_erstr, and pclu_unhandled and CLU_add_parm_info_const. So if we want to use clu_ as a prefix we need to get rid of those, or find a different prefix. It apperas that Clu (note capitilzation) is otherwise unused.
There is currently code to rename symbols that would conflict with C keywords, so that for example the purify procedure renames long to long_UNIQ. I don't think that's needed if we just rename it to Clu_long. I also don't understand why it adds the newly reserved name into reserved.
For example: If a user defines a procedure named
foo, then the pclu compiler generates a C function namedfoo. That can cause trouble iffoois needed by the pclu runtime.Anecdotally: Apparently someone wrote a procedure named 'printf` and their program wouldn't work.
One solution is to instead generate a function named
Clu_foo, and require that the runtime system define or link any functions that start withfoo_. (Note there are symbols in the runtime such asclu_alloc,_pclu_erstr, andpclu_unhandledandCLU_add_parm_info_const. So if we want to useclu_as a prefix we need to get rid of those, or find a different prefix. It apperas thatClu(note capitilzation) is otherwise unused.There is currently code to rename symbols that would conflict with C keywords, so that for example the
purifyprocedure renameslongtolong_UNIQ. I don't think that's needed if we just rename it toClu_long. I also don't understand why it adds the newly reserved name intoreserved.