~ chicken-core (chicken-5) /eval-modules.scm


  1;;;; module registrations for all core modules
  2;
  3; Copyright (c) 2017-2022, The CHICKEN Team
  4; All rights reserved.
  5;
  6; Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
  7; conditions are met:
  8;
  9;   Redistributions of source code must retain the above copyright notice, this list of conditions and the following
 10;     disclaimer.
 11;   Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
 12;     disclaimer in the documentation and/or other materials provided with the distribution.
 13;   Neither the name of the author nor the names of its contributors may be used to endorse or promote
 14;     products derived from this software without specific prior written permission.
 15;
 16; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
 17; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
 18; AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
 19; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 20; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 21; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 22; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 23; OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 24; POSSIBILITY OF SUCH DAMAGE.
 25
 26
 27(declare
 28  (unit eval-modules)
 29  (uses eval))
 30
 31(include "common-declarations.scm")
 32
 33(define-syntax put!
 34  (syntax-rules ()
 35    ((_ sym prop val)
 36     (##core#inline_allocate ("C_a_i_putprop" 8) sym prop val))))
 37
 38(define-syntax get
 39  (syntax-rules ()
 40    ((_ sym prop)
 41     (##core#inline "C_i_getprop" sym prop #f))))
 42
 43(define-syntax defmod
 44  (er-macro-transformer
 45    (lambda (x r c)
 46      (let ((name (cadr x))
 47            (%lambda (r 'lambda))
 48            (%quote (r 'quote))
 49            (%include (r 'include))
 50            (%put! (r 'put!)))
 51        `(,%put! (,%quote ,name)
 52                 (,%quote ##sys#import)
 53                 (,%lambda ()
 54                   (,%include ,(string-append (symbol->string name)
 55                                              ".import.scm"))))))))
 56
 57(defmod chicken.bitwise)
 58(defmod chicken.blob)
 59(defmod chicken.foreign)
 60(defmod chicken.fixnum)
 61(defmod chicken.keyword)
 62(defmod chicken.internal)
 63(defmod chicken.platform)
 64(defmod chicken.errno)
 65(defmod chicken.condition)
 66(defmod chicken.string)
 67(defmod chicken.irregex)
 68(defmod chicken.pathname)
 69(defmod chicken.io)
 70(defmod chicken.port)
 71(defmod chicken.time)
 72(defmod chicken.memory)
 73(defmod chicken.file.posix)
 74(defmod chicken.flonum)
 75(defmod chicken.format)
 76(defmod chicken.gc)
 77(defmod chicken.eval)
 78(defmod chicken.load)
 79(defmod chicken.locative)
 80(defmod chicken.memory.representation)
 81(defmod chicken.plist)
 82(defmod chicken.pretty-print)
 83(defmod chicken.process)
 84(defmod chicken.process.signal)
 85(defmod chicken.process-context)
 86(defmod chicken.process-context.posix)
 87(defmod chicken.random)
 88(defmod chicken.sort)
 89(defmod chicken.time.posix)
 90(defmod chicken.continuation)
 91(defmod chicken.file)
 92(defmod chicken.read-syntax)
 93(defmod chicken.repl)
 94(defmod chicken.tcp)
 95(defmod srfi-4)
 96
 97(set! ##sys#import-library-hook
 98  (let ((hook ##sys#import-library-hook))
 99    (lambda (mname)
100      (cond ((get mname '##sys#import) => (lambda (il) (il)))
101	    (else (hook mname)) ) ) ) )
Trap