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

Last change on this file since 38550 was 38550, checked in by Kon Lovett, 11 months ago

move srfi-111 into own test, forgot arfi-111 box?

File size: 766 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  box?
12  unbox
13  set-box!
14  immutable-box)
15
16(import scheme)
17(import (chicken base))
18(import (chicken syntax))
19(import (chicken type))
20(import (only (chicken platform) register-feature!))
21(import box-core)
22
23;;;
24
25(define-syntax box
26  (syntax-rules ()
27    ((box ?arg)
28      (make-box-mutable ?arg) ) ) )
29
30(define-syntax immutable-box
31  (syntax-rules ()
32    ((immutable-box ?arg)
33      (make-box-immutable ?arg) ) ) )
34
35(define-syntax unbox
36  (syntax-rules ()
37    ((unbox ?box)
38      (box-ref ?box) ) ) )
39
40(define-syntax set-box!
41  (syntax-rules ()
42    ((set-box! ?box ?val)
43      (box-set! ?box ?val) ) ) )
44
45;;;
46
47(register-feature! 'srfi-111)
48
49) ;module srfi-111
Note: See TracBrowser for help on using the repository browser.