[PD] External with inline code snippet

Chris McCormick chris at mccormick.cx
Sat Jun 30 08:36:39 CEST 2007


On Fri, Jun 29, 2007 at 02:02:16AM -0300, Carlos Pita wrote:
> I want to write an external that will evaluate a bit of scheme code,
> something along the venue of expr~ but adding the possibility of evaluate
> simple control structures too (but inline, not in external scripts as is the
> case of pyext). What kind of parameter should I declare for my external
> constructor? If I declared A_GIMME, can I assume that the code will have
> been splitted just at whitespaces and so it's safe to reassemble it joining
> the fragments?

Sorry, I can't answer your specific request, but I just want to say:
Wow, this would be awesome! I think if expr and friends can handle the
syntax they do, with brackets, operators etc being parsed just fine,
then Scheme's syntax should be no problem. Maybe check out how this is
done in the expr source?

Things I like about this over other languages embedded in Pd:

1. Scheme's syntax lends itself naturally to one-liner's which fit in
an object box, just like expr.

2. As a functional language it fits much better with Pd than some other
OO languages.

3. Scheme interpreters can be very minimal[1][2][3], hence uncomplicated,
hence more likely not to cause problems and bugs. Should be much easier
to embed right inside Pd than some other languages.

4. 100% cross platform way to make more complicated abstractions than
are currently possible without resorting to externals, which I dislike
because of the portability problems caused by externals.

5. You might win an award for the first practical use of the scheme
language. ;)

For me, this would signify a sort of Pd Nirvana. I will definately help
you with testing this and brush up on my scheme at the same time.

Best,

Chris.

[1] http://www.cs.indiana.edu/scheme-repository/imp/siod.html
[2] http://alex.ability.ru/scheme.html
[3] http://www.crockford.com/javascript/scheme.html

-------------------
http://mccormick.cx




More information about the Pd-list mailing list