From: mopthisandthat@... (Phidippus) Date: 2004-03-13T06:09:40+09:00 Subject: Re: saving array I tried, but it did not seem to work either... irb(main):001:0> require "pstore" true irb(main):002:0> require "narray" true irb(main):003:0> array = NArray.int(2,2,2) NArray.int(2,2,2): [ [ [ 0, 0 ], [ 0, 0 ] ], [ [ 0, 0 ], [ 0, 0 ] ] ] irb(main):004:0> db = PStore.new("myarray") # irb(main):005:0> db.transaction do irb(main):006:1* db["data"] = array irb(main):007:1> end TypeError: can't dump NArray from /usr/local/lib/ruby/1.6/pstore.rb:111:in `dump' from /usr/local/lib/ruby/1.6/pstore.rb:111:in `transaction' from (irb):5 irb(main):008:0> "dhtapp" wrote in message news:... > "Phidippus" wrote in message > news:a2208ca9.0403101236.37762216@posting.google.com... > > After I do bunch of computations and create a huge array with bunch of > > numbers, I like to use the already-computed array in another program > > rather than re-computing it each time I run the program. How can I > > save the array object in one program and read it from another program > > in ruby? > > Hi, > > An instance of PStore, maybe? > > http://www.mattriffle.com/mirrors/ruby_book/html/lib_standard.html > > (do a browser search on "PStore"). > > - dan