will be helpful for those in need The FIRST, SECOND and so on accessor functions are "just" utility functions on top of CAR/CDR or NTH. SO, I guess, the answer to your specific question is "use NTH or ELT" (or build your own specific acccessor functions). If you want, you can define an ELEVENTH as:
Common Lisp: This is not a number NIL and &rest parameters
To fix the issue you can do If (second args) is NIL then either args has no second or its second is NIL. However, the third argument to mem-aref must be a number since it is an index. Therein lies the problem. If in your program (second args) is allowed to be NIL (or to not exist), then you'll have to test for that possibility and avoid passing NIL to mem-aref (maybe by leaving out that optional argument). If (second args) is not allowed to be NIL, then the bug is somewhere else in your program.
wish helps you It's generally not a good idea to mix rest parameters with keyword parameters within a function definition in Common Lisp. If you do so, you should probably consider rewriting the function definition because it can lead to some unexpected behavior. If both &rest and &key appear in a parameter list, then both things happen--all the remaining values, which include the keywords themselves, are gathered into a list that's bound to the &rest parameter, and the appropriate values are also bound to the &key parameters. So the (name "who") keyword parameter is bound to your list of rest parameters by default. if you try to enter the arguments (1 2 3 4 5), you will get an error because they aren't bound to your parameter (name "who"). Here is an example:
(defun test (&rest args &key (name "who"))
(list args name))