Recently I asked about programmatically creating names for structs. I realized that I think I want to do something a little different. First, I'm not sure if the idea on how to do the task I have in mind is the right one. I was thinking of writing a macro that takes a name, creates two related structs and then uses the names of those structs as well as other parameters passed to the macro to then call functions which would generate the code to define methods that would specialize to those structs. So here is what pops in my head when trying to create such a macro:
If what I'm saying doesn't make sense, I'll try to clarify.
(defmacro my-macro (name param1 param2)
(let ((struct1 (symb name 'const1))
(struct2 (symb name 'const2)))
(generate-method1 struct1 struct2 param1 param2)
...
(generate-methodn struct1 struct2 param1 param2)))
Does this make sense? Part of the reason I want to do it this way is that I want to encode some information that could be in the structs, but would be constant among many instances, into the definitions of the methods as constants. I think the big problem I have is in understanding where backquotes and commas and everything need to be.If what I'm saying doesn't make sense, I'll try to clarify.