[gambit-list] SRFI-63 without SLIB

William James w_a_x_man at yahoo.com
Sat Apr 16 18:15:11 EDT 2011


Here's a simple way to use srfi-63 (arrays) when you don't
have SLIB installed.

Create a file named srfi-9.scm.  At the top of the file
paste the bottom-layer code from
http://srfi.schemers.org/srfi-9/srfi-9.html
starting with the comment
; This implements a record abstraction that is identical to vectors,

At the bottom of the file paste the middle-layer code that
begins with
; We define the following procedures:
; 
; (make-record-type <type-name <field-names>)    -> <record-type>

The top layer (2 macros) isn't needed.

Save the reference implementation of srfi-63 from
http://srfi.schemers.org/srfi-63/srfi-63.html
in a file named srfi-63-reference.scm.  Create a file named
srfi-63.scm and paste this into it:

(define (require sym) #t)
(define slib:error error)
(include "srfi-63-reference.scm")


Now when you want to use srfi-63, just include srfi-9.scm and
srfi-63.scm.




More information about the Gambit-list mailing list