Problem calling a macro
Posted: Sat Jun 30, 2012 1:46 pm
Hi,
I have defined a macro that returns a closure. The basic idea is to provide a very simple OOP without using CLOS so that you can call the closure using some key parameters to get or set some attributes (free variables in the closure). The thing is that I have a function that provides a simple interface to the macro (the macro has a lot of parameters and this interface function sets some of them to default values using key parameters). This function simply calls the macro and returns the corresponding closure.
Then I can to create an "object" by calling the macro and storing the result it in a var an then I can use "funcall" on this var to set/get the "object attributes". This works well when I call the macro directly. However if I get the closure by calling the wrapper function everything seems to be ok at first (the closure is created successfully) but when I use funcall to access a specific parameter I got an error (something seems not to be evaluated during the macro expansion).
So, to summarize, A direct call to the macro works well and the same call (I mean the same call literally) inside the wrapper function doesn't. What could be causing that?
Thanks in advance,
Luis.
I have defined a macro that returns a closure. The basic idea is to provide a very simple OOP without using CLOS so that you can call the closure using some key parameters to get or set some attributes (free variables in the closure). The thing is that I have a function that provides a simple interface to the macro (the macro has a lot of parameters and this interface function sets some of them to default values using key parameters). This function simply calls the macro and returns the corresponding closure.
Then I can to create an "object" by calling the macro and storing the result it in a var an then I can use "funcall" on this var to set/get the "object attributes". This works well when I call the macro directly. However if I get the closure by calling the wrapper function everything seems to be ok at first (the closure is created successfully) but when I use funcall to access a specific parameter I got an error (something seems not to be evaluated during the macro expansion).
So, to summarize, A direct call to the macro works well and the same call (I mean the same call literally) inside the wrapper function doesn't. What could be causing that?
Thanks in advance,
Luis.