Hi,
This may or may not be helpful, but I'll add that, if it were me, I'd represent an IP address as a list of four fixnums rather than a u8vector. Then the default hash function will work out of the box, and many of your functions can be written more concisely. E.g.
(define IPv4-addr= equal?)
(define (IPv4-address->string a)
(string-intersperse (map number->string a) "."))
It's true that a u8vector will be a bit more space-efficient, but IMO it's wise to refrain from that level of optimization unless and until it's the only way to deal with an observed bottleneck.
Normally I wouldn't disagree with the basic idea here, although I would advocate a vector rather than list.
However the existing srfi-69 implementation doesn't follow a pair's references. (Also I think there is a bug where "list?" beats "pair?" in the type discrimination.)
But vectors (structures are treated as vectors) and vector-like objects do recurse into the contents, at least for 4 levels.
Regards,
Kevin Wortman
_______________________________________________
Chicken-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/chicken-users