 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors sequences kernel assocs combinators http.server
 validators http hashtables namespaces fry continuations locals
-boxes xml.entities html.elements html.components io arrays ;
+boxes xml.entities html.elements html.components io arrays math ;
 IN: http.server.actions
 
 SYMBOL: params
+
+SYMBOL: rest-param
 
 : render-validation-messages ( -- )
     validation-messages get

    [ validate>> call ]
    [ submit>> call ] bi ;

M: action call-responder* ( path action -- response )
    dup action set
    '[
        , empty? [
            init-validation
            ,
            request get [ request-params params set ] [ method>> ] bi
            {
                { "GET" [ handle-get ] }
                { "HEAD" [ handle-get ] }
                { "POST" [ handle-post ] }
            } case
        ] [ <404> ] if
    ] with-exit-continuation ;

: param ( name -- value )

        </ul>
    ] if ;

TUPLE: action rest-param init display validate submit ;

: new-action ( class -- action )
    new
