sys:load   scheme


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/runtime/scheme.xtm

Implementation

(define sys:load
  (lambda (path . quiet?)
    (let ((file-string (or (sys:slurp-file path)
                           (sys:slurp-file (string-append (sys:share-dir) "/" path))))
          (cnt 0))
      (if (not file-string)
          (if (or (null? quiet?) (not (car quiet?)))
              (begin (print-with-colors 'red 'default #t (print "File Error"))
                     (print " couldn't find file ")
                     (print-with-colors 'blue 'default #f (print path "\n"))
                     #f)
              #f)
          (let ((input (open-input-string file-string))
                (msg (call/cc
                      (lambda (k)
                        (set! *sys:load-escape-stack* (cons k *sys:load-escape-stack*))
                        ""))))
            (if (string=? msg "")
                (begin
                  (let loop ((sexpr (read input)))
                    (if (not (eof-object? sexpr))
                        (begin
                          (set! *global-sysload-evals* (cons sexpr *global-sysload-evals*))
                          (set! *global-sysload-evals* (list-head *global-sysload-evals* 10))
                          (eval (car *global-sysload-evals*) (interaction-environment))
                          (loop (read input)))))
                  (close-input-port input)
                  (set! *sys:load-escape-stack* (cdr *sys:load-escape-stack*))
                  #t)
                (let ((words (regex:split msg " ")))
                  (if (or (null? quiet?) (not (car quiet?)))
                      (begin (print-with-colors 'yellow 'default #t (print "sys:load notification "))
                             (for-each (lambda (w) (print w "")) words)
                             (println)))
                  (close-port input)
                  #f)))))))


Back to Index

Similar Entries

  • ai_load_ogl_texture    xtlang    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • ai_load_ogl_texture_from_buffer    xtlang    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • analogue-load-preset    scheme    /digego/extempore/tree/v0.8.9/libs/core/instruments/analogue_fileio-scm.xtm
  • analogue-load-state    scheme    /digego/extempore/tree/v0.8.9/libs/core/instruments/analogue_fileio-scm.xtm
  • assimp_load_model    xtlang    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • assimp_load_model    xtlang    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • assimp_load_model    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • cerberus-load-preset    scheme    /digego/extempore/tree/v0.8.9/libs/core/instruments/cerberus_fileio-scm.xtm
  • cerberus-load-state    scheme    /digego/extempore/tree/v0.8.9/libs/core/instruments/cerberus_fileio-scm.xtm
  • db_load    xtlang    /digego/extempore/tree/v0.8.9/examples/external/sqlite.xtm
  • dsp_load    xtlang    /digego/extempore/tree/v0.8.9/examples/sharedsystem/audiosetup.xtm
  • get_download_handler    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • get_load_handler    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • gl_load_image    xtlang    /digego/extempore/tree/v0.8.9/libs/external/soil.xtm
  • gl_load_image_rect    xtlang    /digego/extempore/tree/v0.8.9/libs/external/soil.xtm
  • gl_load_movie_textures    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/gstvideo_multi.xtm
  • gl_load_movie_textures    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/gstvideo.xtm
  • gl_load_tex    xtlang    /digego/extempore/tree/v0.8.9/libs/external/soil.xtm
  • gl_load_tex_bgr    xtlang    /digego/extempore/tree/v0.8.9/libs/external/soil.xtm
  • gl_load_tex_ext    xtlang    /digego/extempore/tree/v0.8.9/libs/external/soil.xtm
  • gl_load_tex_ext_bgr    xtlang    /digego/extempore/tree/v0.8.9/libs/external/soil.xtm
  • gl_load_tex_rect    xtlang    /digego/extempore/tree/v0.8.9/libs/external/soil.xtm
  • impc:aot:insert-load-dylib-details    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:compiler:print-dylib-loading-details-to-log    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • ipc:load    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • is_loading    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • lilv_load_plugin    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/lilv.xtm
  • load-sample    scheme    /digego/extempore/tree/v0.8.9/libs/external/instruments_ext-scm.xtm
  • load-sampler    scheme    /digego/extempore/tree/v0.8.9/libs/external/instruments_ext-scm.xtm
  • load-tex    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/particles.xtm
  • load-tex    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/kinect_fire.xtm
  • load_assim_material_texture    xtlang    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • load_blep_tables_from_blob    unknown    /digego/extempore/tree/v0.8.9/libs/core/audio_dsp.xtm
  • load_cube_data    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm
  • load_data    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm
  • load_vg_fonts    xtlang    /digego/extempore/tree/v0.8.9/examples/external/xtmrender5.xtm
  • nvg_load_opensans_fonts    xtlang    /digego/extempore/tree/v0.8.9/libs/external/nanovg.xtm
  • print-load    scheme    /digego/extempore/tree/v0.8.9/examples/external/convolution_reverb.xtm
  • reload    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • reload_ignore_cache    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • stop_load    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • sys:load-escape    scheme    /digego/extempore/tree/v0.8.9/runtime/scheme.xtm
  • sys:load-preload-check    scheme    /digego/extempore/tree/v0.8.9/runtime/scheme.xtm
  • sys:load-then-quit    scheme    /digego/extempore/tree/v0.8.9/runtime/scheme.xtm
  • xtm_load_vgimage    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/openvg.xtm
  • xtm_projection_texture_load    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm