[CM] pre-parsing scheme code

Kjetil Matheussen k.s.matheussen at gmail.com
Mon Mar 21 10:29:11 PDT 2022


Nice code. But isn't the result of doing:

  s7_eval_c_string("(list 1 2 3)");

the same as the result of doing:

  s7_list_nl(s, 3, s7_make_integer(s, 1),\
    s7_make_integer(s, 2),\
    s7_make_integer(s, 3),\
    NULL);

?

Except that the second version probably runs much faster...


On Mon, Mar 21, 2022 at 5:25 PM Woody Douglass
<wdouglass at carnegierobotics.com> wrote:
>
> All,
>
> I have a habit of creating a lot of s7 lists in C. this manifested in
> my C code being littered with nested `s7_list_nl` calls, and became
> unwieldy pretty quickly. So i wrote the attached script to "pre-parse"
> scheme s-expressions that i use in my C code, and generate C code -- it
> has done wonders for the maintainability of my codebase; also, it makes
> running the linter against the embedded scheme less finicky.
>
> Have any of you done something similar to this? is there a reason it's
> a bad idea? is there a better way?
>
> I guess this is just a request for comment; thanks for any insight you
> can provide. also, feel free to use/improve this script!
> -Woody Douglass
> _______________________________________________
> Cmdist mailing list
> Cmdist at ccrma.stanford.edu
> https://cm-mail.stanford.edu/mailman/listinfo/cmdist


More information about the Cmdist mailing list