Commit | Line | Data |
---|---|---|
b05ca4ab BT |
1 | (define-module (language elisp falias) |
2 | #:export (falias? | |
3 | make-falias | |
4 | falias-function | |
5 | falias-object)) | |
6 | ||
7 | (define <falias-vtable> | |
8 | (make-struct <applicable-struct-vtable> | |
9 | 0 | |
10 | (make-struct-layout "pwpw") | |
11 | (lambda (object port) | |
12 | (format port "#<falias ~S>" (falias-object object))))) | |
13 | ||
14 | (set-struct-vtable-name! <falias-vtable> 'falias) | |
15 | ||
16 | (define (falias? object) | |
17 | (and (struct? object) | |
18 | (eq? (struct-vtable object) <falias-vtable>))) | |
19 | ||
20 | (define (make-falias f object) | |
21 | (make-struct <falias-vtable> 0 f object)) | |
22 | ||
23 | (define (falias-function object) | |
24 | (struct-ref object 0)) | |
25 | ||
26 | (define (falias-object object) | |
27 | (struct-ref object 1)) |