<html 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=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@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:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:865338312;
        mso-list-type:hybrid;
        mso-list-template-ids:1731363526 -1 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:\F0D8;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;
        mso-fareast-font-family:"Times New Roman";
        mso-bidi-font-family:"Times New Roman";}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style></head><body lang=EN-US link=blue vlink="#954F72"><div class=WordSection1><ul style='margin-top:0in' type=disc><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo1'>Also note that ProtoInstance is acceptable anywhere a node is acceptable, further type checking (i.e. is that an acceptable ProtoInstance?) has to occur in the library - usually the setter is a good place for that.</li></ul><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Important is that we are able to check types at authortime. With xml schema it is possible to do that for spec nodes using the spec schema. For prototype definitions it id desired that the xml authortime tool augment the spec schema by perhaps generating an equivalent prototpe instance schema for each prototype; for reuse validating the instance? </p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>It is not unusual to use several different prototypes and several instances of the same prototype. Anyway, It is nice to be able to troubleshoot some prototype instance placement in the hierarchy and simple checks for appropriate field values without having to run the things. Of course a dedicated author might do this manually, but it would also be handy to have this as some level of convenience for some level of authoring system.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal> I think this might also be a solution to the rather,  as I read it,  clumsy legacy appearing user code now required for xml prototype instances. If we have a schema instance for the proto instance, then we have complete authortime validation, at least. And, instance can then look like a usual node in the user code courtesy of the augmented schema. </p><p class=MsoNormal>Maybe a deep reason that html doesn’t know about structures like prototypes. Can’t allow a ‘live’ schema!</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks, </p><p class=MsoNormal>Joe<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='border:none;padding:0in'><b>From: </b><a href="mailto:brutzman@nps.edu">Don Brutzman</a><br><b>Sent: </b>Tuesday, June 16, 2020 6:37 PM<br><b>To: </b><a href="mailto:yottzumm@gmail.com">John Carlson</a><br><b>Cc: </b><a href="mailto:x3d-public@web3d.org">X3D Graphics public mailing list</a>; <a href="mailto:lepeitso@nps.edu">Peitso, Loren (CIV)</a><br><b>Subject: </b>Re: [x3d-public] Check parameters for range, enum,what else? TypeScript?</p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Yes stick with primary types first.  Then do Field types: SFFloat, SFVec3f, etc.  Then look at overloading with convenience methods/constructors, each programming language varies in that respect.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>On 6/15/2020 8:14 PM, John Carlson wrote:</p><p class=MsoNormal>> I am checking parameters for range, enum, length, not type(s) yet, ... what else is there for setter and constructor parameter checking?</p><p class=MsoNormal>> </p><p class=MsoNormal>> My first gulp would be to give parameters to their types, ala TypeScript.  That would be one way to solve the parameter type problem. Is it OK to convert my ES6 x3d.mjs module to TypeScript? Those who are against the coffee languages might approve.</p><p class=MsoNormal>> </p><p class=MsoNormal>> I can see that the X3DUOM supports multiple types for parameters.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>for most fields it actually is no, X3DUOM only gives a single primary type for basic (non-node) types.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>For content model, sometimes it is a mix of node types and nodes that are acceptable in an SFNode/MFNode field  Also note that ProtoInstance is acceptable anywhere a node is acceptable, further type checking (i.e. is that an acceptable ProtoInstance?) has to occur in the library - usually the setter is a good place for that.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Looking at X3DJSAIL Java (Javadoc or source) and x3d.py will give examples for each and every case that you can use as exemplars to check your patterns.  They will likely be the same, just expressed a bit differently in each language.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>> It looks like TypeScript allows overloading as well.</p><p class=MsoNormal>> </p><p class=MsoNormal>> Thanks,</p><p class=MsoNormal>> </p><p class=MsoNormal>> John</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Doing TypeScript as a more rigorous/debuggable path to get towards EcmaScript certainly sounds appealing, as Cecile describes.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Hope you aren't feeling faint of heart - but it does aggregate nicely as you produce autogeneration patterns.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Good luck out there!!  8)</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>all the best, Don</p><p class=MsoNormal>-- </p><p class=MsoNormal>Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman@nps.edu</p><p class=MsoNormal>Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149</p><p class=MsoNormal>X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>_______________________________________________</p><p class=MsoNormal>x3d-public mailing list</p><p class=MsoNormal>x3d-public@web3d.org</p><p class=MsoNormal>http://web3d.org/mailman/listinfo/x3d-public_web3d.org</p><p class=MsoNormal><o:p> </o:p></p></div></body></html>