Boost logo

Boost :

Subject: [boost] Adam/Eve DSEL - Re: De Bruijn Bind (alternate bind syntax) Interest?
From: Gottlob Frege (gottlobfrege_at_[hidden])
Date: 2010-09-07 23:19:03


On Tue, Sep 7, 2010 at 1:24 PM, Smith, Jacob N <jacob.n.smith_at_[hidden]> wrote:
>
> For an Adam/Eve DSEL in C++ we used this syntax:
>
> sheet save_file =
>  "save_file" == sheet
>    {
>       interface == section
>       {
>         var{"file_name"} == [](arg_map args){ return any(""); },
>         var{"file_type"} == "txt",
>         (var{"password"} <= (var{"file_type"}, var{"password1"})) ==
>             [](arg_map args)
>             {
>               return args.get<string>("file_type") == "txt" ? any("") : args["password1"];
>             }
>         // more constraints
>       },
>       output == section
>       {
>         // more constraints
>       },
>       invariant == section
>       {
>         // more constraints
>       }
>    };
>

Interesting. At Adobe we had a DSEL that looked something like (from memory):

   dialog(name = "Clipping Path")
   [
        column(child_horizontal = align_fill)
        [
            popup(name = "Path:", bind = &path, items = list
               [
                   item(name = "None", value = empty),
                   item(name = "Path 1", value = 1),
                   item(name = "Path 2", value = 2)
               ]),
            edit_number(name = "Flatness:", digits = 9, bind = &flatness)
        ],
        button(name = "OK", dephault = true, bind = &result)
    ];

Or something like that.
Of course we didn't have C++0x at the time.

Tony


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk