[CM] pre-parsing scheme code

Woody Douglass wdouglass at carnegierobotics.com
Mon Mar 21 10:31:46 PDT 2022


The second version running much faster is the goal; so i'm mechanically
transforming the first version to the second

-Woody

On Mon, 2022-03-21 at 18:29 +0100, Kjetil Matheussen wrote:
> CAUTION: This email originated from outside of the organization. Do
> not click links or open attachments unless you recognize the sender.
> 
> 
> 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