[Ur] New feature round-up

Edward Z. Yang ezyang at MIT.EDU
Sat Jul 21 22:48:07 EDT 2012


Excerpts from Adam Chlipala's message of Sat Jul 21 14:01:12 -0400 2012:
> - The function [Basis.giveFocus] makes it possible to give a tag focus 
> by ID.
> - A new pseudo-tag allows embedding of a [transaction] in HTML, where 
> this code is run to determine what HTML should go in that position, 
> possibly first allocating [source]s or causing other side effects.  Use 
> like: <active code={return <xml>Hi!</xml>}/>

In case anyone is wondering, the pattern of, "Give me a piece of form input
which autofocuses itself when it's in the document", doing the obvious:

    <ctextbox id={nid} />
    <active code={giveFocus nid} />

Doesn't work: <active> seems to get run too early.

This seems to work OK:

    <ctextbox id={nid} />
    <active code={spawn (sleep 1; giveFocus nid)} />

You do need the sleep, unfortunately, so this is all a bit delicate.

Cheers,
Edward



More information about the Ur mailing list