~ubuntu-branches/ubuntu/hardy/sigscheme/hardy-proposed

« back to all changes in this revision

Viewing changes to slib.scm

  • Committer: Bazaar Package Importer
  • Author(s): NIIBE Yutaka
  • Date: 2006-05-23 21:46:41 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060523214641-6ix4gz34wpiehub8
Tags: 0.5.0-2
* debian/control (Build-Depends): Added ruby.
  Thanks to Frederik Schueler.  Closes: #368571
* debian/rules (clean): invoke 'distclean' instead of 'clean'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
(define (software-type) 'UNIX)
 
2
 
 
3
;;@ (scheme-implementation-type) should return the name of the scheme
 
4
;;; implementation loading this file.
 
5
(define (scheme-implementation-type) 'SigScheme)
 
6
 
 
7
;;@ (scheme-implementation-version) should return a string describing
 
8
;;; the version the scheme implementation loading this file.
 
9
(define (scheme-implementation-version) "0.1.0")
 
10
 
 
11
;;@ (implementation-vicinity) should be defined to be the pathname of
 
12
;;; the directory where any auxillary files to your Scheme
 
13
;;; implementation reside.
 
14
(define (implementation-vicinity)
 
15
  "/home/kzk/tarball/slib/")
 
16
 
 
17
(define library-vicinity
 
18
  (lambda () "/home/kzk/tarball/slib/"))
 
19
 
 
20
(define (slib:error . args)
 
21
  (display "slib:error : ")
 
22
  (print args))
 
23
 
 
24
;@
 
25
(define in-vicinity string-append)
 
26
 
 
27
(define *load-pathname* #f)
 
28
 
 
29
(define home-vicinity
 
30
  (lambda ()
 
31
    "/home/kzk/"))
 
32
 
 
33
(define (user-vicinity)
 
34
  "")
 
35
 
 
36
;@
 
37
(define sub-vicinity
 
38
  (lambda (vic name)
 
39
    (string-append vic name "/")))
 
40
 
 
41
;@
 
42
(define with-load-pathname
 
43
  (let ((exchange1
 
44
         (lambda (new)
 
45
           (let ((old *load-pathname*))
 
46
             (set! *load-pathname* new)
 
47
             old))))
 
48
    (lambda (path thunk)
 
49
      (let* ((old (exchange1 path))
 
50
             (val (thunk)))
 
51
        (exchange1 old)
 
52
        val))))
 
53
 
 
54
 
 
55
;;@ *FEATURES* is a list of symbols naming the (SLIB) features
 
56
;;; initially supported by this implementation.
 
57
(define *features*
 
58
      '(
 
59
;       source                          ;can load scheme source files
 
60
;                                       ;(SLIB:LOAD-SOURCE "filename")
 
61
;;;     compiled                        ;can load compiled files
 
62
                                        ;(SLIB:LOAD-COMPILED "filename")
 
63
;       vicinity
 
64
;       srfi-59
 
65
 
 
66
                       ;; Scheme report features
 
67
   ;; R5RS-compliant implementations should provide all 9 features.
 
68
 
 
69
;       r5rs                            ;conforms to
 
70
        eval                            ;R5RS two-argument eval
 
71
;;;     values                          ;R5RS multiple values
 
72
;;;     dynamic-wind                    ;R5RS dynamic-wind
 
73
;;;     macro                           ;R5RS high level macros
 
74
        delay                           ;has DELAY and FORCE
 
75
;       multiarg-apply                  ;APPLY can take more than 2 args.
 
76
;;;     char-ready?
 
77
;       rev4-optional-procedures        ;LIST-TAIL, STRING-COPY,
 
78
                                        ;STRING-FILL!, and VECTOR-FILL!
 
79
 
 
80
      ;; These four features are optional in both R4RS and R5RS
 
81
 
 
82
        multiarg/and-                   ;/ and - can take more than 2 args.
 
83
;       rationalize
 
84
;       transcript                      ;TRANSCRIPT-ON and TRANSCRIPT-OFF
 
85
        with-file                       ;has WITH-INPUT-FROM-FILE and
 
86
                                        ;WITH-OUTPUT-TO-FILE
 
87
 
 
88
;       r4rs                            ;conforms to
 
89
 
 
90
;       ieee-p1178                      ;conforms to
 
91
 
 
92
;       r3rs                            ;conforms to
 
93
 
 
94
;;;     rev2-procedures                 ;SUBSTRING-MOVE-LEFT!,
 
95
                                        ;SUBSTRING-MOVE-RIGHT!,
 
96
                                        ;SUBSTRING-FILL!,
 
97
                                        ;STRING-NULL?, APPEND!, 1+,
 
98
                                        ;-1+, <?, <=?, =?, >?, >=?
 
99
;       object-hash                     ;has OBJECT-HASH
 
100
 
 
101
;;      full-continuation               ;not without the -call/cc switch
 
102
;       ieee-floating-point             ;conforms to IEEE Standard 754-1985
 
103
                                        ;IEEE Standard for Binary
 
104
                                        ;Floating-Point Arithmetic.
 
105
 
 
106
                        ;; Other common features
 
107
 
 
108
;       srfi                            ;srfi-0, COND-EXPAND finds all srfi-*
 
109
;;;     sicp                            ;runs code from Structure and
 
110
                                        ;Interpretation of Computer
 
111
                                        ;Programs by Abelson and Sussman.
 
112
;       defmacro                        ;has Common Lisp DEFMACRO
 
113
;;;     record                          ;has user defined data structures
 
114
;       string-port                     ;has CALL-WITH-INPUT-STRING and
 
115
                                        ;CALL-WITH-OUTPUT-STRING
 
116
;;;     sort
 
117
;       pretty-print
 
118
;       object->string
 
119
;;;     format                          ;Common-lisp output formatting
 
120
;;;     trace                           ;has macros: TRACE and UNTRACE
 
121
;;;     compiler                        ;has (COMPILER)
 
122
;;;     ed                              ;(ED) is editor
 
123
;       system                          ;posix (system <string>)
 
124
;       getenv                          ;posix (getenv <string>)
 
125
;;;     program-arguments               ;returns list of strings (argv)
 
126
;;;     current-time                    ;returns time in seconds since 1/1/1970
 
127
 
 
128
                  ;; Implementation Specific features
 
129
 
 
130
;       promise
 
131
;       string-case
 
132
        ))
 
133
 
 
134
;;@ Here for backward compatability
 
135
(define scheme-file-suffix
 
136
  (lambda () ".scm"))
 
137
 
 
138
;;@ (SLIB:LOAD-SOURCE "foo") should load "foo.scm" or with whatever
 
139
;;; suffix all the module files in SLIB have.  See feature 'SOURCE.
 
140
(define (slib:load-source f)
 
141
  (begin
 
142
    (load f)))
 
143
 
 
144
;;@ At this point SLIB:LOAD must be able to load SLIB files.
 
145
(define (slib:load file)
 
146
  (begin
 
147
    (define file (string-append file (scheme-file-suffix)))
 
148
    (slib:load-source file)))
 
149
 
 
150
;;@
 
151
(define slib:warn
 
152
  (lambda args
 
153
    (display "Warn : ")
 
154
    (print args)))
 
155
 
 
156
;;; Return argument
 
157
(define (identity x) x)
 
158
 
 
159
;;; SLIB:EVAL is single argument eval using the top-level (user) environment.
 
160
(define slib:eval
 
161
    (lambda (form)
 
162
      (eval form '())))
 
163
 
 
164
(print "load require.scm")
 
165
(load "/home/kzk/tarball/slib/require.scm")
 
166
 
 
167
(print "require multiarg-apply")
 
168
(require 'multiarg-apply)
 
169
 
 
170
(print "require srfi-1")
 
171
(require 'srfi-1)