How can I define a &key argument that supersedes an &optional parameter in Lisp -
I have just started writing this function and I was wondering if there was any way, if only & amp; Key argument was entered, & Amp; Optional list can be ignored.
(defun test (& optional AGR & amp; key) (size) ... I <
or
would like to be able to run but this
(test: size) Now this is a pretty ridiculous thing but I do not know where to put: Size in the list of parameters
(continuous test (and alternative arguments (i 0)) (code (ek ajar neil) (from test by return) (test -1)) ((listp arg) (return test ( Trial-2Ege ()) ((Pointer AGR) (MEM-ASF (Test-3 AGR): INTI) (): (size -test arg)) (T-Nil)) I can run (test) and get Can be: & lt; Output (test-1)> I can run (test) (1 2 3)) and get: & lt; Output (test-2 AGR)> I (test & lt ; Pointer; I can run & output: & lt; output (mem-aref (test-3 arg): int i) I can run (test: size) and get: & Lt; Output (test-shaped arc) & gt;
You must use an and the rest of the logic list And process it in the function. Should combine alternative and keyword logic. This is the BAD style to use alternative and keyword arguments. It has been the source of countless errors with some functions that use it (like READ-FROM-STRING ).
Comments
Post a Comment