Today I was looking for an error that ultimately arose from the following code fragment somewhere in my code (where I tried to filter only the PRIMARY KEY restrictions in the list):
(filter #(= (% :constraint_type "PRIMARY KEY")) aListOfconstraints)
Instead of the correct one:
(filter #(= (% :constraint_type) "PRIMARY KEY") aListOfconstraints)
those. the error was the combined effect of a card accepting a default argument if the key was not found, as in:
({:a 1 :b 2} :a 0)
... and equal functions take only one argument and return true:
(= 1) ; evals to true
Is there any tool I could use instead that would prompt me to similar valid but suspicious code? Or maybe some best practice that I don't know about?
source share