Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Saving blocks

From: al::bri::xtra::co::nz at: 17-Mar-2001 11:21

Further to saving blocks... There's a way to relate a "tree": Tree: [ key1 [ key2 [ key3 [ ; and so on... Item1 Item2 Item3 ; and so on... ] ] ] ] a table (in row format): TableRows: [ [key1 key2 key3 Item1] [key1 key2 key3 Item2] [key1 key2 key3 Item3] ; and so on... ] a table (in column format): TableColumns: [ [key1 key1 key1] [key2 key2 key2] [Item1 Item2 Item3] ] ...rearranging columns: reduce [TableColumns/3 TableColumns/1 TableColumns/2] ...returning to rows and back into a sparse tree again, by reversing the above. So it should be possible to write a database dialect in Rebol with all the power of SQL, and with the capability to manipulate trees and "frozen" objects as well, including saving object member functions as only one function instead of many. Functions that would be useful include Transpose for rotating columns and rows, and a automatic traverser for rolling and unrolling up trees. Currently, there's this "standard" for columns in tables: [Name [datatype!] ...] for example: [FirstName [string!]] "Andrew" Which is much like the standard for function arguments. This could be extended slightly for example: [LastName [string! "Last Name"]] "Martin" Where the string ""Last Name"" is the title description, for printed output. What else would be needed to produce a "thing" storage facility? Andrew Martin ICQ: 26227169