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.
18:26:01
thymage
Why are you still going on about typedef. I literally have not looked at and may not ever need typedef. I don't want to typedef.
18:26:55
mrcom
You want to globally declare a type which is then usable inside a (function foo ((MY-GLOBALLY-DEFINED-TYPE x)) ...), right?
18:27:19
thymage
I'm not working on that right now. I want to be able to compute all different kinds of structs using the macro language.
18:28:54
mrcom
Got it. Different combinations. Are you intending to use a particular combination in more than one (function...) block?
18:29:12
thymage
I am not really knowing whether it has to be in any (function. Originally, I thought that the (decl had to be taken off of each variable before their being concatenated and then put back on.
18:30:07
thymage
Mrcom I haven't thought that far ahead. Basically, after generating combinations I will then generate some C functions that use each of the different structs.
18:30:57
mrcom
You want to create a structure type-ish-thingy, and then include that thingy in various functions.
18:34:46
mrcom
Before you get that far, how do you use DECLARE-STRUCT? It appears you need to include it in each (function ...).
18:36:05
thymage
I could have the struct declarations at the C top level. So, I just think the permutation computation needs to be able to pass each possible set of arguments to the declare-struct macro
18:36:38
mrcom
In other words, does this work in C-Mera: "(struct z ((a float) (b int))) (function ((foo (struct z))) ...)"
18:40:15
thymage
And I just want to know how I define the macro correctly so I can compute v3. Please