5.1 Scheme Library
5.2 Input and output
5.3 Structures and Records
5.4 Serialization
5.5 Bit manipulation
5.6 Hash Tables
5.7 System programming
5.8 Process support
5.9 Socket support
5.10 Posix Regular Expressions
Copyright
Acknowledgements
1. Table of contents
2. Overview of Bigloo
3. Modules
4. Core Language
5. Standard Library
6. Pattern Matching
7. Object System
8. Threads
9. Regular parsing
10. Lalr(1) parsing
11. Errors and Assertions
12. Eval and code interpretation
13. Macro expansion
14. Command Line Parsing
15. Explicit typing
16. The C interface
17. The Java interface
18. Bigloo Libraries
19. SRFIs
20. DSSSL support
21. Compiler description
22. User Extensions
23. Bigloo Development Environment
24. Global Index
25. Library Index
Bibliography
|
string->obj string | bigloo procedure |
This function converts a string which has been produced by
obj->string into a Bigloo object.
|
obj->string object | bigloo procedure |
This function converts into a string any Bigloo object
which does not contain a procedure.
|
The implementation of the last two functions ensures that for every
Bigloo object obj (containing no procedure), the expression:
(equal? obj (string->obj (obj->string obj)))
=> #t
|
binary-port? obj | bigloo procedure |
open-output-binary-file file-name | bigloo procedure |
append-output-binary-file file-name | bigloo procedure |
open-input-binary-file file-name | bigloo procedure |
close-binary-port binary-port | bigloo procedure |
input-obj binary-port | bigloo procedure |
output-obj binary-port obj | bigloo procedure |
input-char binary-port | bigloo procedure |
output-char binary-port char | bigloo procedure |
Bigloo allows Scheme objects to be dumped into, and restored from, files.
These operations are performed by the previous functions. The dump and
the restore use the two functions obj->string and
string->obj .
It is also possible to use a binary file as a flat character file. This can
be done by the means of output-char and input-char functions.
|
register-procedure-serialization serializer unserializer | bigloo procedure |
There is no existing portable method to dump and restore a procedure. Thus,
if obj->string is passed a procedure, it will emit an error message.
Sometime, using strict restrictions, it may be convenient to use an
ad-hoc framework to serialize and unserialize procedures. User may
specify there own procedure serializer and unserializer. This is the
role of register-procedure-serialization . The argument
serializer is a procedure of one argument, converting a procedure
into a characters strings. The argument unserializer is a procedure
of one argument, converting a characters string into a procedure. It belongs
to the user to provide correct serializer and unserializer.
Here is an example of procedure serializer and unserializer that
may be correct under some Unix platform:
(module foo
(extern (macro %sprintf::int (::string ::string ::procedure) "sprintf")))
(define (string->procedure str)
(pragma "(obj_t)(strtoul(BSTRING_TO_STRING($1), 0, 16))" str))
(define (procedure->string proc)
(let ((item (make-string 10)))
(%sprintf item "#p%lx" proc)
item))
(register-procedure-serialization procedure->string string->procedure)
(let ((x 4))
(let ((obj (cons "toto" (lambda (y) (+ x y)))))
(let ((nobj (string->obj (obj->string obj))))
(print ((cdr nobj) 5)))))
|
|
get-procedure-serialization | bigloo procedure |
Returns the a pair whose car is the current procedure serializer
and the cdr is the current procedure unserializer.
|
register-process-serialization serializer unserializer | bigloo procedure |
Same as register-procedure-serialization for Bigloo processes.
|
get-process-serialization | bigloo procedure |
Same as get-procedure-serialization for Bigloo processes.
|
|