Lambda Example Generation Tool

Stephen Colebourne scolebourne at joda.org
Tue Jun 21 03:53:15 PDT 2011


I played with this and found it useful, although I think the best
option families are already under discussion.

If anyone wants a copy of my syntax and/or generated files (which I've
enhanced to enable the simplifed-strawman alternative), email me
PRIVATELY.

Stephen


On 21 June 2011 05:59, Collin Fagan <collin.fagan at gmail.com> wrote:
> Hi Everybody,
>
> With this talk about syntax I thought I would put together a quick tool to
> help generate lambda examples.
>
> https://sourceforge.net/projects/project-strum/files/lambda-gen.zip/download
>
> lambda-gen takes a very simple xml syntax file and combines it with a
> template to generate example lambdas. The README  file explains more but
> here is the gist.
>
> Syntax
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <syntax name="Strawman with Colon">
>  <prefix>:</prefix>
>  <startParamList>(</startParamList>
>  <endParamList>)</endParamList>
>  <startBlock>{</startBlock>
>  <endBlock>}</endBlock>
> </syntax>
>
> +
>
> Template
>
> /*
>  * Syntax Poll Example:
>  */
> list.filter(<syntax.prefix><syntax.startParamList>Foo
> t<syntax.endParamList><syntax.startBlock>t.length() \> 3<syntax.endBlock>)
>    .map(<syntax.prefix><syntax.startParamList>Foo
> t<syntax.endParamList><syntax.startBlock>t.barCount<syntax.endBlock>)
>    .max();
>
> =
>
> Example:
>
> /*
>  * Syntax Poll Example:
>  */
> list.filter(:(Foo t){t.length() > 3})
>    .map(:(Foo t){t.barCount})
>    .max();
>
>
> I've put together a number of different syntax files for the strawman, BGGA
> and others. That said, it is a simple tool meant for experimentation and
> syntax comparison only.
>
> I have a few examples already in the template. I would be happy to add more
> if people think they have a good use case.
>
> Enjoy,
>
> Collin
>
>


More information about the lambda-dev mailing list