home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / scheme / 2035 < prev    next >
Encoding:
Internet Message Format  |  1992-08-16  |  3.9 KB

  1. Path: sparky!uunet!psgrain!percy!data!kend
  2. From: kend@data.rain.com (Ken Dickey)
  3. Newsgroups: comp.lang.scheme
  4. Subject: Re: random rant on random files
  5. Message-ID: <700@data.rain.com>
  6. Date: 16 Aug 92 03:15:25 GMT
  7. References: <9208130624.1.11214@cup.portal.com>
  8. Organization: Microtek DSD, Hillsboro, OR
  9. Lines: 106
  10.  
  11. vanMeule@cup.portal.COM writes:
  12.  
  13. >I feel a little upset at Scheme for lack of direct support in 
  14. >most Schemes for random files.  These are essential for business
  15. >programming.  Scheme should and could revolutionize business and
  16. >supplant BASIC with all its basic flaws if Scheme provided a 
  17. >library routine for random files that was part of the definition.
  18. > ...
  19. >Any comments that might help me towards my desire to be able to
  20. >do real business programming in Scheme??? 
  21.  
  22. One reason is that random access is not supported is the desire not to
  23. support "files" when persistent data objects are just around the
  24. corner.  My aproach to the random access problem follows.
  25.  
  26. Enjoy!
  27. -Ken Dickey                kend@data.rain.com
  28. ;;=====================================================================
  29. ; FILE        "store.doc"
  30. ; IMPLEMENTS    Proposal for a `Store' data abstraction.
  31. ; AUTHOR    Ken Dickey
  32. ; DATE        1991 November 26
  33. ; LAST UPDATED    1991 December 12 -- added WRITE-STORE-SLICE
  34.  
  35.  
  36. PRIMARY REASON DE ETRA:  Random & Binary i/o.
  37.  
  38. BASIC IDEA: A (binary) store with size and permissions.
  39.  
  40. NOTA BENE:  This data type has no print representation.
  41.  
  42.  
  43. SYNOPSIS:
  44.  
  45. (MAKE-STORE num-bytes . fill-integer) -> store
  46. (MAKE-STORE num-bytes fill-integer . permissions) -> store
  47. (MAP-STORE  start end . permissions) -> store
  48. (PERMISSIONS store) -> 'read-only 'read+write or 'write-only
  49. (STORE-SET-PERMISSIONS! store permissions) -> unspecified
  50. (ENDIAN store) -> 'big-endian or 'little-endian
  51. (STORE-LENGTH store) -> num-bytes
  52.  
  53. (STORE-REF-BYTE store address) -> integer
  54. (STORE-REF-WORD store address) -> integer
  55. (STORE-REF-LONG store address) -> integer
  56. (STORE-REF-CHAR store address) -> character
  57. (STORE-SLICE->STRING store start end) -> string
  58.  
  59. (STORE-SET-BYTE! store address integer) -> unspecified
  60. (STORE-SET-WORD! store address integer) -> unspecified
  61. (STORE-SET-LONG! store address integer) -> unspecified
  62. (STORE-SET-CHAR! store address character)     -> unspecified
  63. (STRING->STORE-SLICE-SET! string store start) -> unspecified
  64. (STORE-SLICE->STORE-SLICE-SET! store1 start1 end1 store2 start2)
  65.  -> unspecified
  66.  
  67. (FILE->STORE path) -> store
  68. (STORE->FILE store path) -> unspecified
  69. (WRITE-STORE-SLICE store start end . port) -> unspecified
  70.  
  71. optional:
  72.   (STORE-REF-IEEE-SINGLE->REAL   store address) -> real
  73.   (STORE-REF-IEEE-DOUBLE->REAL   store address) -> real
  74.   (STORE-REF-IEEE-EXTENDED->REAL store address) -> real
  75.   (STORE-SET-IEEE-SINGLE!   store address real) -> unspecified
  76.   (STORE-SET-IEEE-DOUBLE!   store address real) -> unspecified
  77.   (STORE-SET-IEEE-EXTENDED! store address real) -> unspecified
  78.   ...
  79.  
  80.  
  81. DISCUSSION:
  82.  
  83. The Store abstraction allows one to deal with low-level file,
  84. unscanned-vector, and computer memory `objects', allowing device
  85. drivers and other system programs to be written in Scheme.  An
  86. implementation may supply predefined stores which map to computer
  87. memory or memory mapped devices.  Memory which remains fixed, e.g. C
  88. structs and Pascal records can be mapped as stores and dereferenced.
  89. Memory can be copied to memory, file to file, file to memory, etc.
  90.  
  91. Permissions are used to allow EPROM memory and read-only files to
  92. signal an error upon assignment.  An error is also signaled if an
  93. integer of greater size than the unit is assigned [byte = 8 bits; word
  94. = 2 bytes; long = 4 bytes].
  95.  
  96. A Scheme character is of implementation-dependent size (e.g. Japanese
  97. or Chinese characters may be multi-byte quantities).
  98.  
  99. Returned integers are always non-negative.
  100.  
  101.  
  102.  
  103. ISSUES:
  104.  
  105. No file extension is provided for.
  106.  
  107. No support for specifying and mapping between multiple address spaces. 
  108.  
  109.  
  110. DETAILS:
  111.  
  112. [Elided -- Hopefully obvious]
  113.  
  114.  
  115.  
  116. ;;            --- E O F ---
  117.