Arc Forumnew | comments | leaders | submitlogin
1 point by partdavid 6124 days ago | link | parent

I've been thinking about this challenge in terms of Erlang idioms and worked up a (very) minimal web framework using yaws. With SPEWF < http://code.google.com/p/spewf/ > this might look like:

   handle(_, [{said, Value}|_]) ->
        {Value, {ehtml, {a, [{href, self}], "click me"}}};
   handle(S, [_|R]) ->
        handle(S, R);
   handle([], []) ->
        {[], {ehtml, {form, [{action, self}],
                            [{input, [{type, "text"},
                                      {name, "said"}, {size, 50}], []},
                             {input, [{type, "submit"}]}]}}};
   handle(S, []) ->
        {S, {ehtml, {p, [], io_lib:format("you said: ~s", [S])}}}.
Like many of the other examples, it's lacking the clever HTML generation.