alvatar / spheres

Spheres - A set of tools and libraries for practical Scheme. Multiplatform and Mobile.
MIT License
69 stars 10 forks source link

disable spheres runtime temporarily #13

Closed ovenpasta closed 8 years ago

ovenpasta commented 8 years ago

Sometimes I need to disable spheres because of incompatibilities with other libraries. And I had to move back and forth .gambini file which was too complicated.

I fixed the thing with the following fix to the .gambini

[....]

(if (not (member "--disable-spheres-ini" (command-line))) 
    (begin 
      ;; Gambit lightweight library support
      (for-each eval (with-input-from-file
              (string-append %%spheres-root-dir "/spheres/gambit/library.scm")
              read-all))
      ;; Load syntax-case expander
      (load (string-append %%spheres-root-dir "/spheres/gambit/syntax-case.o1"))

      ;; Eval Gambit prelude for SchemeSpheres
      (for-each eval (with-input-from-file
             (string-append %%spheres-root-dir "/spheres/gambit/prelude.scm")
               read-all))

      (for-each %add-library-path! %%spheres-library-paths)

      ;; -- 2) SET UP AN ENVIRONMENT
      (eval '(add-cond-expand-feature! debug))
      (eval `(include ,(string-append %%spheres-root-dir "/spheres/gambit/environments.scm")))
      ))

Then I invoke gsi with --disable-spheres-ini option and I get a fresh gambit without spheres I don't know if there is other way of doing this

alvatar commented 8 years ago

gsi -f avoids reading the .gambini file. Does that suffice in your case?

ovenpasta commented 8 years ago

Yes thanks :)