diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:05:27 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:05:27 -0800 |
commit | c7d035ae1a729232579a0fe41ed5affa131d3623 (patch) | |
tree | fb387f7c2a8e01cf603d4c75fbbaa68f711df986 /hobbit.scm | |
parent | deda2c0fd8689349fea2a900199a76ff7ecb319e (diff) | |
download | scm-c7d035ae1a729232579a0fe41ed5affa131d3623.tar.gz scm-c7d035ae1a729232579a0fe41ed5affa131d3623.zip |
Import Upstream version 5d9upstream/5d9
Diffstat (limited to 'hobbit.scm')
-rw-r--r-- | hobbit.scm | 33 |
1 files changed, 11 insertions, 22 deletions
@@ -2,7 +2,7 @@ ;
; HOBBIT: an optimizing scheme -> C compiler for SCM
;
-; scm5d6
+; scm5d9
; 2002-04-11
;
; Copyright (C) 1992-1997: Tanel Tammet
@@ -55,7 +55,12 @@ ; - "copy-tree" and "acons" compilation introduced
; pre-april, 2002, Aubrey Jaffer:
; - numerous changes necessary for co-operation with SCM5d5
-;
+
+;;; Declare modules which might be needed:
+(require-if 'compiling 'pretty-print)
+(require-if 'compiling 'defmacroexpand)
+(require-if 'compiling 'pprint-file)
+
;=================================================================
;
; default compiler options
@@ -63,7 +68,6 @@ ;
;=================================================================
-
;;; The following variable controls whether hobbit will do any
;;; macroexpansion. In that case (require 'defmacroexpand) must
;;; be able to load the macroexpander from the scheme library.
@@ -165,7 +169,7 @@ (for-each display lst)
(display #\newline)
(abort))
-
+;@
(define compile-allnumbers #t)
;=================================================================
@@ -365,13 +369,6 @@ (define *init-fun-prefix* "init_")
-;;; The following is a string which is prepended to the name of your
-;;; scheme file (without .scm) to form a C variable which is generated
-;;; as a new global to gc-protect the constant nonimmediate objects
-;;; in your file.
-
-(define *protect-variable* "protect_constants_")
-
;;; The following is a name of a variable which may be defined to
;;; the list of inlinable functions in your scheme file.
@@ -812,11 +809,7 @@ ;
;=================================================================
-
-(define (Hobbit:compile file . files)
- (hobbit (cons file files)))
-
-
+;@ exported symbol hobbit.
(define (hobbit file . files)
(let* ((tmpname "hobbit.tmp"))
(if *build-intermediate-files*
@@ -824,8 +817,7 @@ (if *expand-macros-flag*
(begin (require 'defmacroexpand)
(require 'pprint-file)))
- (if (not (memq 'hobbit *features*))
- (set! *features* (cons 'hobbit *features*)))
+ (provide 'hobbit)
(if (or (member '"scmhob.scm" (cons file files))
(member '"scmhob" (cons file files)))
(report-error "The file scmhob.scm is not allowed to be compiled!"))
@@ -2384,9 +2376,6 @@ map for-each list call-with-input-file call-with-output-file
open-input-file open-output-file with-input-from-file
with-output-to-file string-append
- logical:logxor logical:lognot logical:logior logical:logand
- logical:ash logical:logcount logical:integer-length
- logical:bit-extract logical:integer-expt
defmacro:expand*
sin cos tan asin acos atan sinh cosh tanh asinh acosh
sin cos tan asin acos atan sinh cosh tanh asinh acosh
@@ -2561,7 +2550,7 @@ (vector->list "vector2list" 1)
(list->vector "vector" 1)
- (read "lread" 1)
+ (read "scm_read" 1)
(read-char "scm_read_char" 1)
(peek-char "peek_char" 1)
(eof-object? "eof_objectp" 1)
|