Re: [Chicken-users] Two dimensional linked lists

2016-09-11 Thread Kristian Lein-Mathisen
Hi mfv,

I'm not sure this will help you but I just put up a egg I made for myself
that might be useful to you in this context.

https://gist.github.com/kristianlm/9d7e5c1bdae8c443c7deb676d6f4a7d0

Maybe the vector-grid procedure

might be of use.
K.

On Fri, Sep 9, 2016 at 3:21 AM, Justin Ethier 
wrote:

> A vector of vectors would be more efficient to traverse for large values
> of [n], but if the vectors are not the same length you need to check to
> make sure index [n] exists in each one. If you are going to handle random
> insertions of data you also have to worry about growing a vector(s) if the
> requested [n] is larger than the vector size.
>
> A simple and elegant (though perhaps not the most efficient?) solution is
> to use a hashtable to store the cell values:
> https://wiki.call-cc.org/man/4/Unit%20srfi-69
>
> This example is in Python but you get the idea:
> http://code.activestate.com/recipes/355045-spreadsheet/
>
> Thanks,
>
> Justin
>
>
> On Thu, Sep 8, 2016 at 7:07 AM, mfv  wrote:
>
>> Hi,
>>
>> what would be the best way to implement two dimensional linked lists into
>> Scheme? I was thinking about fooling around with spreadsheet calculations
>> in
>> Scheme, but it seems to me tha there are not proper data structures for it
>> here.
>>
>> As I understand, making linked lists from linked lists will create a
>> structure that can not be traverse efficiently in all directions:
>>
>> With the structure being
>>
>> (list (list-A) (list-B) (...) (list-Z) (list-AA))
>>
>> it would be trivial to quick to traverse from A[0] to A[n], but long to
>> get to A[n] to B[n].
>>
>> Would the same thing apply to vectors?
>>
>> Regards,
>>
>>mfv
>>
>>
>>
>> ___
>> Chicken-users mailing list
>> Chicken-users@nongnu.org
>> https://lists.nongnu.org/mailman/listinfo/chicken-users
>>
>
>
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users
>
>
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Two dimensional linked lists

2016-09-08 Thread Justin Ethier
A vector of vectors would be more efficient to traverse for large values of
[n], but if the vectors are not the same length you need to check to make
sure index [n] exists in each one. If you are going to handle random
insertions of data you also have to worry about growing a vector(s) if the
requested [n] is larger than the vector size.

A simple and elegant (though perhaps not the most efficient?) solution is
to use a hashtable to store the cell values:
https://wiki.call-cc.org/man/4/Unit%20srfi-69

This example is in Python but you get the idea:
http://code.activestate.com/recipes/355045-spreadsheet/

Thanks,

Justin


On Thu, Sep 8, 2016 at 7:07 AM, mfv  wrote:

> Hi,
>
> what would be the best way to implement two dimensional linked lists into
> Scheme? I was thinking about fooling around with spreadsheet calculations
> in
> Scheme, but it seems to me tha there are not proper data structures for it
> here.
>
> As I understand, making linked lists from linked lists will create a
> structure that can not be traverse efficiently in all directions:
>
> With the structure being
>
> (list (list-A) (list-B) (...) (list-Z) (list-AA))
>
> it would be trivial to quick to traverse from A[0] to A[n], but long to
> get to A[n] to B[n].
>
> Would the same thing apply to vectors?
>
> Regards,
>
>mfv
>
>
>
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users
>
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] Two dimensional linked lists

2016-09-08 Thread mfv
Hi, 

what would be the best way to implement two dimensional linked lists into
Scheme? I was thinking about fooling around with spreadsheet calculations in
Scheme, but it seems to me tha there are not proper data structures for it
here.

As I understand, making linked lists from linked lists will create a
structure that can not be traverse efficiently in all directions:

With the structure being 

(list (list-A) (list-B) (...) (list-Z) (list-AA))

it would be trivial to quick to traverse from A[0] to A[n], but long to
get to A[n] to B[n].

Would the same thing apply to vectors?

Regards, 

   mfv



___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users