So you have a list ((property-name1 value1) (property-name2 value2) ...)
if that list is given as argument l
then (car l)
isn't (property-name1)
but (property-name1 value1)
. Luckily you see that the symbol you should check is in the results first element and that means you should use (car (car l))
or (caar l)
for short. (eq (caar l) 'property-name1) ; ==> t
Notice that when you don't find it in the first iteration you call a totally different function IdReturn
, not with the rest of l
but a different variable list
(whatever that is). You haven't supplied it so I cannot tell how you get (357)
but it's not from functions supplied in your question.
PS: Any list (a)
(a b)
or (a b c)
you pull the first value with car
. (car '(357)) ;==> 357