source: project/release/5/box/trunk/srfi-111.scm @ 38539

Last change on this file since 38539 was 38539, checked in by Kon Lovett, 13 months ago

*-test runner, style, remove primitive-inlines, separate srfi-111 module, added make-box-mutable & make-box-immutable, no strict-types since has box "generic"

File size: 749 bytes
Line 
1;;;; srfi-111.scm  -*- Scheme -*-
2;;;; Kon Lovett, Apr '20
3
4;; Issues
5;;
6
7(module srfi-111
8
9(;export
10  box
11  immutable-box
12  set-box!
13  unbox)
14
15(import scheme)
16(import (chicken base))
17(import (chicken syntax))
18(import (chicken type))
19(import (only (chicken platform) register-feature!))
20(import box)
21
22;;;
23
24(define-syntax box
25  (syntax-rules ()
26    ((box ?arg)
27      (make-box-mutable ?arg) ) ) )
28
29(define-syntax immutable-box
30  (syntax-rules ()
31    ((immutable-box ?arg)
32      (make-box-immutable ?arg) ) ) )
33
34(define-syntax unbox
35  (syntax-rules ()
36    ((unbox ?box)
37      (box-ref ?box) ) ) )
38
39(define-syntax set-box!
40  (syntax-rules ()
41    ((set-box! ?box ?val)
42      (box-set! ?box ?val) ) ) )
43
44(register-feature! 'srfi-111)
45
46) ;module srfi-111
Note: See TracBrowser for help on using the repository browser.