Hello all!
I was wondering why the gambit interpreter complains about loading multiple times an object file (i.e. a compile .o1 file). It is pretty annoying not being able to reload a file that loads its required modules... :(
What should I do instead? Load the requirements manually in the repl? This is not very convienient :( I could also just load the source file (load "module.scm") instead of the object file (load "module") but I would not benefit of compiled code perf...
Thanks!
David
Afficher les réponses par date
On 4-Mar-09, at 11:30 AM, David St-Hilaire wrote:
Hello all!
I was wondering why the gambit interpreter complains about loading multiple times an object file (i.e. a compile .o1 file). It is pretty annoying not being able to reload a file that loads its required modules... :(
.o1 files can't be loaded more than once due to an OS limitation. A .o1 file is a dynamically loadable shared lib (a "DLL" in Windows speak) and many operating systems don't allow them to be loaded more than once.
What should I do instead? Load the requirements manually in the repl? This is not very convienient :( I could also just load the source file (load "module.scm") instead of the object file (load "module") but I would not benefit of compiled code perf...
It depends what you want to do... Why do you load them more than once? It can't be because the code has changed, because a different version (i.e. .o2, .o3, ...) would have been generated and then **you can** load the code more than once. Perhaps you have an initialization (in the Scheme code) that you want to redo because you have mutated the binding after loading the file. Perhaps you can abstract the initialization in a function and then call that function to do the initialization. You could write your own version of load, call it my-load, which keeps a table of what has been loaded and avoid calling load on those files that are in the table, instead calling the init function whose name would be derived from the file name.
In other words its your problem!
Marc
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Marc Feeley wrote:
On 4-Mar-09, at 11:30 AM, David St-Hilaire wrote:
Hello all!
I was wondering why the gambit interpreter complains about loading multiple times an object file (i.e. a compile .o1 file). It is pretty annoying not being able to reload a file that loads its required modules... :(
.o1 files can't be loaded more than once due to an OS limitation.
Which OSes have that limitation? Is it that the exact same filename cannot be loaded twice? Does the full path matter? Is there any point to this limitation?
Is there somewhere that I could read up on this?
Thanks,
Marijn
- -- Sarcasm puts the iron in irony, cynicism the steel.
Marijn Schouten (hkBst), Gentoo Lisp project, Gentoo ML http://www.gentoo.org/proj/en/lisp/, #gentoo-{lisp,ml} on FreeNode
I feel your pain, the same thing crossed my mind the other day myself. In my case I list to load the files, which I then modified to not include the object files, but it's a crappy solution.
Pavel
On Wed, Mar 4, 2009 at 8:30 AM, David St-Hilaire sthilaid@iro.umontreal.ca wrote:
Hello all!
I was wondering why the gambit interpreter complains about loading multiple times an object file (i.e. a compile .o1 file). It is pretty annoying not being able to reload a file that loads its required modules... :(
What should I do instead? Load the requirements manually in the repl? This is not very convienient :( I could also just load the source file (load "module.scm") instead of the object file (load "module") but I would not benefit of compiled code perf...
Thanks!
David
Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list