Using condition types with psyntax
This is a possible solution for those wanting to make use of define-
NB: you need a working R6RS records implementation.
1. Add the 'condition-
2. Now create a library for you conditions as follows:
(library (foo conditions)
(export ...) ; do not export the -rtd and -rcd symbols here (but this is where they are defined)
(import ...)
;; implement the basic condition procedures here
;; the base condition class
;; you should check in make-record-
(define-
(define &condition-rtd (record-
(define &condition-rcd (record-
;; now continue to add the condition types as defined in the R6RS lib spec
(define-
make-
(message condition-message))
....
3. In the implementation of make-record-
4. In the implementation of make-record-
5. From the 'backend' you can simply access these types and constructors via symbol-value, and use them when needed.
Initially it looked a lot more complex, but it is rather easy if you have R6RS records in place. :)
Hope this helps someone.
Cheers
leppie
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- leppie
- Solved:
- Last query:
- Last reply: