I am relatively new to Scheme, i.e. this is my first significant program. The program uses a few hash tables; some use a four element u8 vector as the key and others use an eight element u16 vector (yes, they are IP addresses). It seems to work but, when dumping the tables, I noticed multiple (two or three) entries for some IPv4 addresses.
I have some questions.
- Is this expected to work?
- Am I doing something off the beaten path?
- How is the hash function's length parameter calculated?
- Could the hash function be looking beyond the end of the vector?
At this point, I am not sure how to approach debugging. I have created a small test program but it just works. Recreating this may be difficult. I will gratefully consider your suggestions.
-------
I am using Chicken Scheme 4.8.0 on Debian Squeeze (i686). The program uses the following packages.