From: Victor on 29 Mar 2010 06:38 On Sat, 27 Mar 2010 19:03:34 +0200, Slobodan Blazeski <slobodan.blazeski(a)gmail.com> wrote: > I'm working with arrays that are one dimensional,adjustable, hold > only one type of element and could get quite long(*). I need a way to > save them in the file system after doing some work with them (like > inserting , deleting and/or changing elements). Quick test of cl-store > for storing an array of 10 000 000 fixnums takes 31.8 MB and the > 3 > sec to run. So what would you suggest as a pure lisp storing > strategy? Not a completely pure Lisp strategy, but still worth a look: http://cdf.gsfc.nasa.gov/ From their intro: | CDF is a scientific data management package (known as the "CDF Library") | which allows programmers and application developers to manage and | manipulate scalar, vector, and multi-dimensional data arrays. With best regards, Victor
From: Jochen Schmidt on 29 Mar 2010 08:22 On 2010-03-27 18:03:34 +0100, Slobodan Blazeski said: > I'm working with arrays that are one dimensional,adjustable, hold > only one type of element and could get quite long(*). I need a way to > save them in the file system after doing some work with them (like > inserting , deleting and/or changing elements). Quick test of cl-store > for storing an array of 10 000 000 fixnums takes 31.8 MB and the > 3 > sec to run. So what would you suggest as a pure lisp storing > strategy? How about using a functional (persistent) vector? I've written a simple CL implementation of clojures persistent vectors for a published (german) article. In this case "persistent" actually means "full history is available"; but one certainly could employ a scheme were the new nodes are written to disc and a system to reconstruct the persistent vector from disc into memory. ciao, Jochen -- Jochen Schmidt CRISPYLOGICS Uhlandstr. 9, 90408 Nuremberg Fon +49 (0)911 517 999 82 Fax +49 (0)911 517 999 83 mailto:(format nil "~(~36r@~36r.~36r~)" 870180 1680085828711918828 16438) http://www.crispylogics.com
From: Alex Mizrahi on 29 Mar 2010 08:25 ??>> You need to write it like (execute-transaction ??>> (tx-array-change-element *system* 1 2 3)), and then write ??>> tx-array-change-element function... ??>> ??>> It is probably more verbose than some ad-hoc thing one can write. TB> It doesn't strike me as overwhelmingly difficult to create a wrapper TB> class such that (setf (ref o x y z) new) does this for you. Sure, it is easy to create that wrapper. Also, it is easy to print stuff to files and read it back. E.g. (defparameter *log* (open #p"/tmp/my-log" :direction :output :if-exists :append)) (defun (setf paref) (val o x) (print (list val o x) *log*) (setf (aref o x) val)) Now there is a question: how exactly is cl-prevalence useful if it is easier to do these things WITHOUT cl-prevalence?
From: Johan Ur Riise on 29 Mar 2010 08:45 "Alex Mizrahi" <udodenko(a)users.sourceforge.net> writes: > ??>> You need to write it like (execute-transaction > ??>> (tx-array-change-element *system* 1 2 3)), and then write > ??>> tx-array-change-element function... > ??>> > ??>> It is probably more verbose than some ad-hoc thing one can write. > > TB> It doesn't strike me as overwhelmingly difficult to create a wrapper > TB> class such that (setf (ref o x y z) new) does this for you. > > Sure, it is easy to create that wrapper. Also, it is easy to print > stuff to files and read it back. > E.g. > > (defparameter *log* (open #p"/tmp/my-log" :direction :output > :if-exists :append)) > > (defun (setf paref) (val o x) > (print (list val o x) *log*) > (setf (aref o x) val)) > > Now there is a question: how exactly is cl-prevalence useful if it is > easier to do these things WITHOUT cl-prevalence? This just writes a list of values to a file.
From: Tim Bradshaw on 29 Mar 2010 10:53 On 2010-03-29 13:25:59 +0100, Alex Mizrahi said: > Sure, it is easy to create that wrapper. Also, it is easy to print > stuff to files and read it back. > E.g. > > (defparameter *log* (open #p"/tmp/my-log" :direction :output :if-exists > :append)) > > (defun (setf paref) (val o x) > (print (list val o x) *log*) > (setf (aref o x) val)) That would be good, if it worked. But it doesn't (for reasons which I hope are obviious). So you need to wrap some other stuff around it to make it work. Quite soon you'll end up with something which is quite a lot larger than that.
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 4 5 Prev: Stop the Heat from Sun Rays! Next: GSLL, adjusting marrays |