[Ur] Abstract type for 'id' attributes?
Adam Chlipala
adamc at impredicative.com
Tue Aug 30 18:45:10 EDT 2011
Currently, Ur/Web supports an 'id' attribute on any XML element. I
added this when someone requested support for the <label> tag.
Currently, 'id' attributes have type [string]. This freaks me out
somewhat, since it's anti-modular; different functions written by
different people might need to coordinate to avoid duplicating IDs. The
use of IDs is convenient for FFI JavaScript code that wants to get
handles to DOM nodes.
So, I'm thinking of adding an abstract type of IDs, with only one
built-in operation: "generate fresh ID." Every tag's 'id' attribute
would change to take a value of this type. Under the hood, these would
just be strings, making for easy FFI integration.
Does anyone object to the idea? Any other feedback?
More information about the Ur
mailing list