[Ur] Hamlet like XML, structured by indentation with tag autoclosing

Adam Chlipala adamc at csail.mit.edu
Thu Jun 18 12:29:23 EDT 2015


On 06/18/2015 12:09 PM, Gabriel Riba wrote:
> (* --- with hamlet like style --- *)
>
> fun mymodule items = <ixml>
>
>    <h3> title
>    <div>
>       $if {null items}
>          <p> Sorry, no items left
>       $else
>          <ul>
>             $forall {item} <- {items}
>                <li> <b>{[item]}</b>
> </ixml>

The special syntax for 'forall' bothers me a bit.  I prefer to see 
standard function-call syntax there.  There are other iteration styles 
that are often useful but that won't fit with the 'forall' syntax.  One 
example is a fold-style traversal maintaining some other accumulator.

P.S.: Sorry for the duplicate post here earlier, where I gave idiomatic 
Ur/Web code for this task very similar to what Ziv had already posted.  
I wasn't paying enough attention, looking at later unread messages 
before replying.



More information about the Ur mailing list