guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: binary loadable files


From: Keisuke Nishida
Subject: Re: binary loadable files
Date: Fri, 02 Feb 2001 02:59:17 -0500
User-agent: Wanderlust/2.4.0 (Rio) SEMI/1.13.7 (Awazu) FLIM/1.13.2 (Kasanui) Emacs/21.0.96 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI)

At Thu, 01 Feb 2001 12:08:01 -0500,
Keisuke Nishida wrote:
> 
> > > What about `binary-read' and `binary-write'?  These might be better
> > > because they indicate they use a different format than that of
> > > `read' and `write', while taking the same types of arguments.
> > 
> > I like that.  OK, assuming the difficult part has been solved, we can
> > think about simple things like how to implement them :-)))

One more problem.  What is the best file name?  binary.[ch] or dump.[ch]?

It's somehow working now:

  % guile
  guile> (define l '(foo "bar" #:baz))
  guile> (set-cdr! (cddr l) l)
  guile> l
  (foo "bar" #:baz . #0#)
  guile> (call-with-output-file "foo.go" (lambda (p) (binary-write l p)))
  guile> (quit)

  % od -x foo.go 
  0000000 477f 4642 302d 302e 0010 0000 0001 0000
  0000020 0001 0000 0004 0000 0000 0000 6f66 006f
  0000040 622d 7a61 0000 0000 8130 0808 7c88 4028
  0000060 0315 0000 7c60 4028 0000 0000 0018 0000
  0000100 0020 0000 0028 0000 6162 0072 0008 0000
  0000120 0010 0000
  0000124

  % guile
  guile> (call-with-input-file "foo.go" binary-read)
  (foo "bar" #:baz . #0#)
  guile> 

Kei



reply via email to

[Prev in Thread] Current Thread [Next in Thread]