Yes, I'm sorry, but the <dyn> tag is only for HTML and the DOM.  It would take extra implementation effort to make it compatible with SVG, and that effort has not yet been made... so it's good that the compiler is raising a static error!

On 05/01/2018 06:04 PM, Jonas Mellin wrote:

Dear all, I have tried to adapt ListEdit.ur in the tutorial to a small SVG application that adds circles to the screen as you double click (the code is at the end). The SVG.urs is found at https://github.com/karsar/urweb-examples/blob/master/SVGTest/SVG.urs

I get a problem at row 57 “<dyn signal={circleDraw p}/>” and also at line 22 “show' (pl : plist) : signal xsvg   =” where the compiler gets stuck on “Error in final record unification

Can't unify record constructors”. My hypothesis is that there is some problem between html and SVG.

An excerpt of the error messages sis:

/home/a/SVGTest5/SVGTest.ur:57:3: (to 58:8) Error in final record unification

Can't unify record constructors

Have: <UNIF:U571::{Unit}> ++ [Dyn = ()]

Need:  [Svg = ()]

===== CODE =====

[...]

    <circle cx={show ((fst x')-60)} cy={show ((snd x')-100)} r="10" stroke="red" fill="blue"/>

[...]

and show' (pl : plist) : signal xsvg   =

    case pl of

Nil => return <xml/>

| Cons {Point = p, Tail = t } => return <xml>

    <dyn signal={circleDraw p}/>

</xml>


_______________________________________________
Ur mailing list
Ur@impredicative.com
http://www.impredicative.com/cgi-bin/mailman/listinfo/ur

Reply via email to