[][src]Function glsp::seed_gensym

pub fn seed_gensym()

Makes future gensyms globally unique.

When code is expanded in one Runtime and then evaluated in another (as for the compile! and eval! macros, and the glsp::load_and_compile function), gensym collisions may occur, because the gensym counter will have been reset.

glsp::seed_gensym mitigates this by appending a 128-bit ID (derived from the current wall-clock time) to all future gensyms produced by this Runtime. We don't switch it on by default, because it makes gensyms' printed representation harder to read. However, it's automatically switched on within glsp::load_and_compile.

prn!("{}", glsp::gensym()); //prints #<gs:0>
glsp::seed_gensym();
prn!("{}", glsp::gensym()); //prints #<gs:1:wTz8iriBJYB>