I designed the function to accept a quoted functional argument purely for consistency with standard AutoLISP functions
That makes sence - the main code would be more readable, when generally one passes unevaluated subfunctions as arguments to other ones.
a call to eval redefining the prd symbol before the foreach loop would perhaps yield the best of both.
That seems the most simple and effective solution.
The problem is quickly solvable by correct function specification, so Grrr have overlooked this when posting question...
Yeah, sorry about that - I was trying to be more clear about the required return value, based on the provided input.
Instead of : (foo 'minusp L), he should have written (foo '(lambda ( x ) (and (numberp x) (minusp x))) L)...
Thanks for the correction, Marko,
I didn't had the subfunction to see that it would error-out.
BTW I strongly advise to use the error-trapping technique inside the
prd argument,
and not being used in the
foo subfunction, due the possibility of neglected errors - which could make the debugging in the main code even harder.
So I don't think Lee's code require any more changes and I think he'd be on the same opinion.
IMO Error-trapping is good only in those cases where you can predict all the plausible failures of a given evaluation.