[Ur] Several patches and questions

Edward Z. Yang ezyang at MIT.EDU
Sun Dec 30 21:09:00 EST 2012


Looks good. One addition I noticed missing was the ability to add tags
to the singletons list in monoize.sml:

    val singletons = SS.addList (SS.empty,
                                 ["link",
                                  "br",
                                  "p",
                                  "hr",
                                  "input",
                                  "button",
                                  "img"])

I'm not sure what the best way of doing this would be, but maybe the emptiness
information can be put in the type? (That way, we can also rule out <br>foo</br>, etc.)

Edward

Excerpts from Adam Chlipala's message of Fri Dec 28 03:35:44 +0700 2012:
> OK, I've added the feature proposed below.  Let me know if it doesn't 
> work as it ought to.
> 
> On 12/19/2012 08:16 AM, Edward Z. Yang wrote:
> > Excerpts from Adam Chlipala's message of Wed Dec 19 21:09:59 +0800 2012:
> >    
> >> On 12/19/2012 08:08 AM, Edward Z. Yang wrote:
> >>      
> >>> Excerpts from Adam Chlipala's message of Wed Dec 19 21:02:18 +0800 2012:
> >>>
> >>>        
> >>>>>        1. Some tags/attributes conflict with reserved keywords in Ur/Web
> >>>>>        (e.g. name) so we need a way of using that is not reserved but
> >>>>>        specifying the proper translation.
> >>>>>
> >>>>>
> >>>>>            
> >>>> I grant you this one.  Might be enough of a pain in the ass to put off
> >>>> until someone requests it for a specific case. ;)
> >>>>
> >>>>          
> >>> Here are two specific requests, motivated as "Ur/Web on mobile" ;-)
> >>>
> >>>       1.<meta name="viewport" content="width=device-width, initial-scale=1">
> >>>       ("name" is reserved; note there are already some special-cased things in
> >>>       the Ur/Web compiler already)
> >>>
> >>>       2.<ul data-role="listview">
> >>>       (#Data-role is not a valid label since it contains a hyphen)
> >>>
> >>>        
> >> It doesn't strike me as epically awful to include a special mapping from
> >> [Nam] to "name", and also to replace underscores with hyphens in forming
> >> HTML attributes (with new parsing sugar to hide both of these rules).
> >> Would that cover your projected near-term use cases?
> >>      
> > Yup, those sound like adequate workarounds.
> >    



More information about the Ur mailing list