[gambit-list] Identifier renaming on load?

Marc Feeley feeley at iro.umontreal.ca
Fri Sep 27 16:04:45 EDT 2013


On 2013-09-27, at 3:48 PM, Mikael <mikael.rcv at gmail.com> wrote:

> Dear Marc,
> 
> When (load):ing a binary file ("myfile.o1" etc.) , would there be any way to do identifier renaming at load time?
> 
> E.g.,
> 
> echo "(define x 5)" >> myfile.scm
> 
> gsc
> 
> (compile-file "myfile.scm")
> 
> (set! ##load-symbol-import (lambda (loaded-symbol-name) 'y))
> 
> (load "myfile.o1")
> 
> y ; => 5
> 
> I believe this could be very useful for a module system - not sure though would be happy to understand if there's any problem about it. Without or with modification to Gambit's source.
> 
> Best regards,
> Mikael
> 

Are you thinking about this in order to load a module multiple times with different renamings?  That will not work because the C names will clash.

Why don't you do the renaming at compile time?

Marc




More information about the Gambit-list mailing list