home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!psgrain!percy!data!kend
- From: kend@data.rain.com (Ken Dickey)
- Newsgroups: comp.lang.scheme
- Subject: Re^2: random rant on random files
- Message-ID: <701@data.rain.com>
- Date: 17 Aug 92 23:00:56 GMT
- References: <9208130624.1.11214@cup.portal.com> <700@data.rain.com> <16ocv6INNl87@agate.berkeley.edu>
- Organization: Microtek DSD, Hillsboro, OR
- Lines: 61
-
- bh@anarres.CS.Berkeley.EDU (Brian Harvey) writes:
-
- >I don't find this "store" idea obvious at all. Does it live in memory
- >or on the disk? If on the disk, does that mean there is a redundant
- >disk-to-disk copy when I finally use store->file? If in memory, how
- >do you handle gigabyte stores?
-
- Sorry. Let me amplify a bit.
-
- The creation operations return a "store" object. All store objects
- are treated the same. For files, the bits stay on the disk (mod
- buffering). STORE->FILE writes the contents of a store (the bits)
- into a file. If the store represents a file, then you are doing a
- file->file copy. If the store represents a slice of memory, you are
- doing a memory->file copy. You have full random, binary access to
- store objects, so (STORE-REF-BYTE aStore 37) reads a byte from a file
- or a memory location at "start"+ 37.
-
- As stores are random, binary i/o, everything is mapped to positive
- integers. If you want to write a Scheme object (e.g. a vector or a
- negative integer, etc.) it is up to you to do the representation
- mapping.
-
- To map memory to a store: (MAP-STORE 100 200) returns a store with
- a base address of 100. (store-ref-byte thisStore 0) gives you the
- byte at address 100+0 in your memory space. Thus you can build a
- structure mechanism on top of stores to get values of C structs,
- Pascal records, whatever, by name.
-
- You can also use stores which are really vectors unscanned by the
- collector. This is what MAKE-STORE returns.
-
- If you have not guessed by now, stores are a pretty low-level
- interface. If done portable, however, this just happens to be a
- higher-level interface than we have now. I think that the abstraction
- is useful.
-
-
- So let me try again.
-
- > Does it live in memory or on the disk?
-
- It does not matter to the user of the abstraction, but memory is
- probably in memory and files are probably on disk (mod buffering).
-
-
- > If on the disk, does that mean there is a redundant
- >disk-to-disk copy when I finally use store->file?
-
- If you are doing a copy, where is the redundancy?
-
-
- > If in memory, how do you handle gigabyte stores?
-
- By doing *nothing* special {I assume bignums and linear addressing}.
- I am not copying anything to create a store (just as opening a file
- does not copy the file).
-
-
- Please ask more questions where confused.
- -Ken
-