[Ur] Several patches and questions

Adam Chlipala adamc at csail.mit.edu
Wed Dec 19 08:02:18 EST 2012


On 12/19/2012 07:29 AM, Edward Z. Yang wrote:
> Excerpts from Adam Chlipala's message of Thu Nov 29 00:58:30 +0800 2012:
>    
>>> 2.) Is it reasonable to support ad-hoc tags in the compiler, defined
>>> by the user? Previously I proposed some tags as compiler patches, but
>>> I realize this is inflexible. Instead, I would like to be able to
>>> write a syntactic form similar to the basis library. Say:
>>>
>>>      tag audio : ...
>>>
>>>        
>> I can support this easily with a small patch to allow tags to be defined
>> in FFI modules beside [Basis].  The core tags don't have actual
>> implementations anywhere, and it's easy to enable the same possibilities
>> for tags in further FFI modules.  I.e., no need to define a C function
>> returning a string.  (The identifier is used to figure out the tag name.)
>>
>> Sound good?
>>      
> This appears to be deficient in a few ways:
>
>      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. ;)

>      2. This doesn't allow us to add extra attributes to Ur/Web for existing
>      tags.  Probably the easiest way to do that is use the translation
>      mechanism to allow "extended tags" which have different types but
>      translate into the same tag as some built-in.
>    

This should already work.  The same tag can be declared in multiple FFI 
module interfaces, and they all compile to the same HTML.  It is, of 
course, necessary to explicitly [open] the module with the alternate tags.



More information about the Ur mailing list