<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
color:black;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="SV" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Hmm, so <a href="https://github.com/karsar/urweb-examples/blob/master/SVGTest/SVGTest.ur">
https://github.com/karsar/urweb-examples/blob/master/SVGTest/SVGTest.ur</a> works because the SVG is encapsulated in HTML inside the dyn. That restricts the options for employing SVG.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">/Jonas<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-left:65.2pt"><b><span lang="EN-US" style="color:windowtext;mso-fareast-language:SV">From:</span></b><span lang="EN-US" style="color:windowtext;mso-fareast-language:SV"> Ur [mailto:ur-bounces@impredicative.com]
<b>On Behalf Of </b>Adam Chlipala<br>
<b>Sent:</b> den 2 maj 2018 00:59<br>
<b>To:</b> ur@impredicative.com<br>
<b>Subject:</b> Re: [Ur] SVG Test based on ListEdit.ur<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal" style="margin-left:65.2pt"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="margin-left:65.2pt">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!<br>
<br>
On 05/01/2018 06:04 PM, Jonas Mellin wrote:<span style="font-size:12.0pt;mso-fareast-language:SV"><o:p></o:p></span></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal" style="margin-left:65.2pt"><span lang="EN-US">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
<a href="https://github.com/karsar/urweb-examples/blob/master/SVGTest/SVG.urs">https://github.com/karsar/urweb-examples/blob/master/SVGTest/SVG.urs</a></span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:65.2pt"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:65.2pt"><span lang="EN-US">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</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:65.2pt"><span lang="EN-US">Can't unify record constructors”. My hypothesis is that there is some problem between html and SVG.</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:65.2pt"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:65.2pt"><span lang="EN-US">An excerpt of the error messages sis:</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:65.2pt"><span lang="EN-US">/home/a/SVGTest5/SVGTest.ur:57:3: (to 58:8) Error in final record unification</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:65.2pt"><span lang="EN-US">Can't unify record constructors</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:65.2pt"><span lang="EN-US">Have: <UNIF:U571::{Unit}> ++ [Dyn = ()]</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:65.2pt"><span lang="EN-US">Need: [Svg = ()]</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:65.2pt"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:65.2pt"><span lang="EN-US">===== CODE =====</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:65.2pt"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:SV">[...]
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:65.2pt"><span lang="EN-US"> <circle cx={show ((fst x')-60)} cy={show ((snd x')-100)} r="10" stroke="red" fill="blue"/></span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:65.2pt"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:SV">[...]
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:65.2pt"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:65.2pt"><span lang="EN-US">and show' (pl : plist) : signal xsvg =</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:65.2pt"><span lang="EN-US"> case pl of</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:65.2pt"><span lang="EN-US"> Nil => return <xml/></span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:65.2pt"><span lang="EN-US"> | Cons {Point = p, Tail = t } => return <xml></span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:65.2pt"><span lang="EN-US"> <dyn signal={circleDraw p}/></span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:65.2pt"><span lang="EN-US"> </xml></span><o:p></o:p></p>
</blockquote>
<p class="MsoNormal" style="margin-left:65.2pt"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:SV"><o:p> </o:p></span></p>
</div>
</body>
</html>