I can’t understand why this code that defun a function name cause a segmenation fault.
(fdefinition ‘realname) –> Output of my function with no error
(eval (setf (fdefinition name) `(lambda (this ,@args) ,@body)))
but if I do (realname param) I get this error
Error: Segmentation violation(11) [code 0] at 8B238080
where is my error?
Thanks
The error in your code is that you’re assigning a list as a
fdefinitioninstead of a function. I would consider it a bug in your implementation though that this is causing a segfault. (I’m not sure if it is actually a bug in the sense that it’s violating the standard, but it would definitely be much nicer if the implementation would catch and report this error itself.)To turn the list starting with
lambdainto a function, you need to evaluate it. On the other hand, theevalaround thesetfdoesn’t seem to be necessary at all. So a possible solution is to switch the positions of theevalandsetf: