|
|
|
|
|
by kung-fu-master
5724 days ago
|
|
I'm not a Lisp expert, so I have another question. Is it possible to embed DSL into Lisp which will looks like pseudo-code? For example: (pseudo a = 0
b = 100
s = 0
for (i from a to b)
s = s + i
write(s)
)If such pseudo code can be embedded into SBCL it would generate fast machine code, also it would be possible to easily modify pseudo code syntax. |
|
This lets you write things like:
(for var in form do ...
or
(for var in form collect ...
where form can be anything that has an iterator method defined on it.
There's also a macro I use called BINDING-BLOCK (BB for short) which subsumes a bunch of binding forms. So you can write things like:
(bb
It's extensible so you can add your own clauses. Code is here:http://www.flownet.com/ron/lisp/rg-utils.lisp
(It's a little out of date. If you want the latest let me know and I'll update it.)