libera/#lisp - IRC Chatlog
Search
16:58:38
mrcom
Lotttts of links to interesting Lisp stuff, such as http://lispm.de/docs/Publications/UI/ which links to Lisp UI papers, e.g. "Allegro CL CLIM 2.2.2 User Guide".
17:00:57
mrcom
Then there's the "Links" page, which includes "IGOR - A microprogrammed LISP machine :: Overview :: OpenCores" at https://opencores.org/projects/igor [lispdm.de site points to old opencores.COM]
17:16:44
mrcom
NOTE: lispm.de home page says 'this is a tiny server' and "don't try to copy the whole site". Sometime between 2022-02-23 and 2022-02-28 he started returning an "Access Forbidden" page to the Wayback machine.
17:17:53
mrcom
So we should probably be careful about posting links on something that would get it hugged to death.
17:24:46
thymage
Where decl is defined by: https://github.com/kiselgra/c-mera/blob/master/src/c/syntax.lisp
17:25:16
thymage
I just would like to take the (decl part off of each list and then slap a single one on at the end.
17:32:43
jackdaniel
if you want to "take the decl part out", then (defvar v3 (decls ((float a) (int c))))
17:33:06
jackdaniel
mixing results of macroexpansion with concatenate won't work the way you desire them to
17:37:17
mrcom
Gotcha. Reason I asked is that it appears DECL is creating a structure which the rest of the C-Mera understands. Don't know how C-Mera expects structs or unions (not clear which is meant) to be declared.
17:38:23
mrcom
(C-Mera is a "source-to-source compiler that utilizes Lisp's marcro system for meta programming of C-like languages."
17:43:48
mrcom
thymage: I think DECL is a macro, not a function, and it is evaluating its arguments.
17:46:23
mrcom
This means it won't be simple to compute arguments to it. `(defvar v3 (concatenate ...)' doesn't compute the concatenation of v1 and v2, and then pass that to DECL.
17:48:28
mrcom
DECL sees, I believe, '(concatenate v1 v2); i.e. a list of three symbols CONCATENATE, V1, and V2.
17:49:33
mrcom
It's going to try to interpret that using it's c-like syntax; CONCATENATE would be a variable name, V1 would be a type, and V2 would be some kind of assignment or modifier.
17:51:58
mrcom
Yes. DECL is a macro; the code it generates returns some kind of internal C-Mera structure which lets the rest of the C-Mera macros know what to do.
17:54:46
jackdaniel
I see what you mean, you refer imaginary form that has never appeared on this channel, like (defvar v3 (decl (concatenate v1 v2)))
17:56:11
thymage
jackdaniel, Well, the whole reason I want to concatenate two lists is because I want to be able to make combinations of decl's
17:58:50
thymage
I was able to get it to run correctly by just putting (struct z v1 v2) instead of concatenating into v3 and doing (struct z v3)
17:58:52
mrcom
The biggest one is that DECL *only applies inside a function declaration. I don't see a way to declare a global (special) variable using c-ish syntax.
18:00:46
mrcom
You trying to globaly declare boilerpate to include in function? E.G., declare common sets of variables to include in a function?
18:05:16
thymage
So, if (struct z v1 v2) works, how can I write a macro around that in order to pass an arbitrary set of things that will get spliced in. So, after my defmacro, it would see the correct sequence if I call (declare-struct (v1 v2))
18:13:15
mrcom
So thyimage: Looks like you will need to create boilerplate which is included whereever you reference the structure.
18:24:19
mrcom
Some macro is going to need to evaluate its arguments. Let's make a general TYPEDEF macro.