[racket] lists and pg-arrays
I agree, that should work like you expect. I just pushed a fix.
Ryan
On 12/18/2014 09:03 PM, George Neuner wrote:
> Hi all,
>
> Using 6.0.1. I just painfully discovered that
>
> (pg-array->list (list->pg-array (list)))
> => ERROR
> pg-array->list: expected argument of type <pg-array of dimension 1>;
> given: (pg-array 0 '() '() '#())
>
> The documentation for list->pg-array states that it produces an array
> of dimension 1. However, if you pass an empty list, you get back an
> array of dimension zero which you then can't transform back to a list [
> except by going straight to the internal vector ].
>
> My question is, "shouldn't these conversions be symmetric?" I
> understand an array with no elements is meaningless as an array, but
> Postgresql (ab)uses arrays as substitutes for lists and sets, so an
> empty array does have meaning.
>
> Just a thought.
>
> Thanks,
> George
>
>
> ____________________
> Racket Users list:
> http://lists.racket-lang.org/users