Cid@lemmy.sdf.orgtoLisp Community@lemmy.ml•[CODE-REVIEW] Determine if given lists intersect
·
1 year agoIf you don’t care about the intersection values:
init empty hashmap w best guess on size
Iterate sequences
Iterate elements
If elt in hashmap return t
Add elt to hashmap
return nil
If you have maybe million+ elements, a db like sqlite might help. Unique index, insert each item til you get a unique constraint failure.
Personally, I’d drop all the macro template syntax, applys, intersects, etc. And simplify the function arg to be just: (sequences)