I have a problem with removing strings from a list of string I use this
(remove "lol" '("lol" "lol2" "lol")
but it returns the same list. What's the problem here?
I have a problem with removing strings from a list of string I use this
(remove "lol" '("lol" "lol2" "lol")
but it returns the same list. What's the problem here?
You're running into the problem of trying to determine equality. I believe remove
uses eql
as its default equality tester. Unfortunately, two strings are not eql
unless they're actually the same object.
Try:
`(remove "lol" '("lol" "lol2" "lol") :test #'equal)
Alternatively, if you know you will be testing strings, you could pass string=
as your test function.