[Cl-store-devel] bug restoring long lists

Sean Ross sdr at jhb.ucs.co.za
Wed Aug 31 15:12:08 UTC 2005


Alain.Picard at memetrics.com writes:

Hi Alain,
  thanks for the report, I've also run into this problem 
  a couple of times but wasn't quite too sure what the 
  right approach would be. 
> 
> I have a private patch, which just stores "proper lists" differently,
> but I thought you'd want to know and perhaps implement something
> better than my hack.
I'm not so sure :-)
Right now i'm trying a slightly long winded approach by using list-length 
to figure out what kind of list is passed in (proper, dotted or circular)
which looks something like this.

(defun proper-list-length (list)
  "Returns 2 values the first being the lenght of the list
if it is a proper-list or NIL of it is a circular list.
The second value can be checked to see if LIST is a dotted list."
  (ignore-errors (list-length list)))

(multiple-value-bind (length errorp)
      (proper-list-length list)
    (cond (errorp (dump-atomed-list list stream))
          (length (dump-proper-list list length stream))
          (t (dump-circular-list list stream))))

Each dumper function then takes a more respectable approach
to serializing the list.

Any comments?
What approach were you taking?


Regards,
  Sean.

-- 
"My doctor says that I have a malformed public-duty gland and a
 natural  deficiency in moral fibre," he muttered to himself, "and
 that I am therefore excused from saving Universes."
 - Life, the Universe, and Everything     Douglas Adams.

Confidentiality Notice: http://ucs.co.za/conf.html




More information about the cl-store-devel mailing list