[cl-store-devel] Fastest way to convert an object to a vector?

Sean Ross rosssd at gmail.com
Wed Jan 17 09:54:21 UTC 2007


On 1/17/07, Chris Dean <ctdean at sokitomi.com> wrote:
> The flexi-streams form is called WITH-OUTPUT-TO-SEQUENCE, so the code
> is very simple:
>
>     (defun to-storage-vector (obj)
>       (with-output-to-sequence (out)
>         (cl-store:store obj out)))
>
>     (to-storage-vector 123) => #(67 108 115 84 24 0 1 123)
>
> Is there a way to do this same sort of operation using cl-store
> directly and bypassing WITH-OUTPUT-TO-SEQUENCE ?

I'm afraid not, cl-store just knows how to serialize objects to streams.
Are you looking to bypass WITH-OUTPUT-TO-SEQUENCE
for performance reasons or aesthetic ones?

Sean.



More information about the cl-store-devel mailing list