~ chicken-core (chicken-5) /eval-modules.scm
Trap1;;;; module registrations for all core modules2;3; Copyright (c) 2017-2022, The CHICKEN Team4; All rights reserved.5;6; Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following7; conditions are met:8;9; Redistributions of source code must retain the above copyright notice, this list of conditions and the following10; disclaimer.11; Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following12; 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 promote14; 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 EXPRESS17; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY18; AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR19; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR20; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR21; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY22; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR23; OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE24; POSSIBILITY OF SUCH DAMAGE.252627(declare28 (unit eval-modules)29 (uses eval))3031(include "common-declarations.scm")3233(define-syntax put!34 (syntax-rules ()35 ((_ sym prop val)36 (##core#inline_allocate ("C_a_i_putprop" 8) sym prop val))))3738(define-syntax get39 (syntax-rules ()40 ((_ sym prop)41 (##core#inline "C_i_getprop" sym prop #f))))4243(define-syntax defmod44 (er-macro-transformer45 (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"))))))))5657(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)9697(set! ##sys#import-library-hook98 (let ((hook ##sys#import-library-hook))99 (lambda (mname)100 (cond ((get mname '##sys#import) => (lambda (il) (il)))101 (else (hook mname)) ) ) ) )