0 Members and 1 Guest are viewing this topic.
I'm not exactly sure what you mean. If you literally mean changing the "defun" subr to some other name, then no. But you can redefine function names on the fly in AutoLisp. A great example of that is with built in "autoload" function. It writes a stub function that loads the Lisp file associated with the command, then rewrites itself when the lisp file is loaded....>%
Is it possible to redefine the defun function? I would like to redefine defun so I could add a function call at the beginning of each procedure.
I didn't spend any time looking at the code but that sounds interesting. Is this a new feature (I am still using 2022 at the moment)? The description also sounds just like something I wrote for myself, but I called mine JIT (just in time) load. Thanks for the tip, I'll try to find some time to look into `autoload`.REF:https://www.theswamp.org/index.php?topic=57707.msg610694#msg610694
No you can not redefine DEFUN but you can create your own "function builder". I give the basic framework/idea/concept in my Bottom-Up design writeup. https://www.theswamp.org/index.php?topic=58123.msg613398#msg613398And a more crazy/wacky idea in a "shortie template" concept post. Works fairly well. https://www.theswamp.org/index.php?topic=58213.msg614022#msg614022