-
Notifications
You must be signed in to change notification settings - Fork 2
/
packages.scm
67 lines (56 loc) · 2.36 KB
/
packages.scm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
;;; -*- Mode: Scheme; scheme48-package: (config) -*-
(define-structure soosy-helpers soosy-helpers/interface
(open scheme names signals srfi-1 srfi-9 srfi-23 srfi-69)
(for-syntax (open scheme srfi-1 srfi-23))
(files class helpers))
(define-structure soosy-disclosers (export)
(open scheme define-record-types soosy-helpers srfi-1 srfi-69)
(begin
(define (disclose-variables object)
(map (lambda (name value) `(,name -> ,value))
(class-variables (object-class object))
(vector->list (object-variables object))))
(define (disclose-methods methods)
(hash-table-keys methods))
(define-record-discloser class
(lambda (c)
`(Class ,(class-name c)
superclass: ,(class-name (class-superclass c))
subclasses: ,(map class-name (class-subclasses c))
variables: ,(class-variables c)
methods: ,(disclose-methods (class-methods c)))))
(define-record-discloser object
(lambda (obj)
`(Object ,(class-name (object-class obj)) ,(disclose-variables obj))))
))
(define-structure soosy-macros soosy-macros/interface
(open scheme signals soosy-helpers srfi-1 srfi-9)
(for-syntax (open scheme soosy-helpers srfi-1))
(files macros))
(define-structure soosy soosy/interface
(open scheme soosy-macros soosy-helpers soosy-disclosers))
;;; SRFI 69: Basic hash tables
;;;
;;; Implement this using the tables module
(define-interface srfi-69-interface
(export make-hash-table hash-table? alist->hash-table
;; hash-table-equivalence-function, hash-table-hash-function
hash-table-ref hash-table-ref/default
hash-table-set! hash-table-delete! hash-table-exists?
;; hash-table-update! hash-table-update!/default
hash-table-size hash-table-keys hash-table-values
hash-table-walk ;; hash-table-fold
hash-table->alist hash-table-copy ;; hash-table-merge!
hash string-hash ;; string-ci-hash hash-by-identity
))
(define-structure srfi-69 srfi-69-interface
(open scheme
(subset signals (error))
define-opt
tables)
(files srfi-69))
(define-structure define-opt
(export (define* :syntax))
(open scheme srfi-1 let-opt)
(for-syntax (open scheme let-opt (subset signals (syntax-error)) srfi-1))
(files define-opt))