<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="margin: 0px; line-height: normal; font-family: 'Arial Black'; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">Dynamic Class/Struct Definition At Run Time&nbsp;</span></div><div style="margin: 0px; line-height: normal; font-family: 'Avenir Next'; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 16px;" class=""><span style="font-kerning: none" class=""></span><br class=""></div><div style="margin: 0px; line-height: normal; font-family: 'Avenir Next'; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">At the time of this writing, 11 October 2016, it is not possible to define arbitrary&nbsp;</span></div><div style="margin: 0px; line-height: normal; font-family: 'Avenir Next'; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">classes, structs&nbsp;</span><span style="-webkit-text-stroke-width: initial;" class="">and maybe other entities dynamically at run time in Swift.&nbsp;</span></div><div style="margin: 0px; line-height: normal; font-family: 'Avenir Next'; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="-webkit-text-stroke-width: initial;" class="">I have some idea about it, expressed in this message.</span></div><div style="margin: 0px; line-height: normal; font-family: 'Avenir Next'; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 16px;" class=""><span style="font-kerning: none" class=""></span><br class=""></div><div style="margin: 0px; line-height: normal; font-family: 'Avenir Next'; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">Creating class and other types dynamically should be as simple and as easy to understand&nbsp;</span></div><div style="margin: 0px; line-height: normal; font-family: 'Avenir Next'; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">as possible, preferably with nearly the same style and syntax as the "regular" declarations,</span></div><div style="margin: 0px; line-height: normal; font-family: 'Avenir Next'; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp;leaving things like "Meta""Type" T.Self etc. as transparent as possible.&nbsp;</span></div><div style="margin: 0px; line-height: normal; font-family: 'Avenir Next'; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">That should in this context be "under the hood", as it is also the case&nbsp;</span></div><div style="margin: 0px; line-height: normal; font-family: 'Avenir Next'; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">when defining static classes.&nbsp;</span></div><div style="margin: 0px; line-height: normal; font-family: 'Avenir Next'; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 16px;" class=""><span style="font-kerning: none" class=""></span><br class=""></div><div style="margin: 0px; line-height: normal; font-family: 'Avenir Next'; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">I have constructed the following (hypothetical) example code,</span></div><div style="margin: 0px; line-height: normal; font-family: 'Avenir Next'; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp;which serves as just a "thinking model", so to speak.</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 14px;" class=""><span style="font-kerning: none" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="-webkit-font-kerning: none; color: rgb(0, 0, 0); -webkit-text-stroke-color: rgb(0, 0, 0);" class="">&nbsp; &nbsp;&nbsp;</span><span style="font-kerning: none" class="">// In this example we dynamically create and use&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; // an example class named "Monolith"</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; // First, we declare an "empty dynamic class"</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; // (a slot) at compile time, that is later defined at run time.</span></div><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp;</span><br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(186, 45, 162); -webkit-text-stroke-color: rgb(186, 45, 162); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; dynamic class</span><span style="-webkit-font-kerning: none; color: rgb(0, 0, 0); -webkit-text-stroke-color: rgb(0, 0, 0);" class=""> Monolith </span><span style="color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0);" class="">// defined later just this line.</span></div><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp;&nbsp; &nbsp;</span></p><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; // Use a constructor that accepts&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; // a string which contains a class definition,&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; // exactly like one would define a class in Swift statically.&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; // with the exception that name of the class is not specified.&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; // It is replaced by placeholder, an underscore, because&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; // the class name itself is inferred when declaring it.&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; // Specifying the class name will throw an error.</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-kerning: none" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(64, 64, 64); -webkit-text-stroke-color: rgb(64, 64, 64); -webkit-text-stroke-width: initial;" class=""><span style="-webkit-font-kerning: none; color: rgb(209, 47, 27); -webkit-text-stroke-color: rgb(0, 0, 0);" class="">&nbsp; &nbsp; </span><span style="-webkit-font-kerning: none; color: rgb(186, 45, 162); -webkit-text-stroke-color: rgb(186, 45, 162);" class="">var</span><span style="-webkit-font-kerning: none; color: rgb(209, 47, 27); -webkit-text-stroke-color: rgb(0, 0, 0);" class=""> </span><span style="font-kerning: none" class="">classDefStr</span><span style="-webkit-font-kerning: none; color: rgb(0, 0, 0); -webkit-text-stroke-color: rgb(0, 0, 0);" class=""> =&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(255, 45, 33); -webkit-text-stroke-color: rgb(255, 45, 33); -webkit-text-stroke-width: initial;" class=""><span style="-webkit-font-kerning: none; color: rgb(0, 0, 0); -webkit-text-stroke-color: rgb(0, 0, 0);" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-kerning: none" class="">"class _ :SCNNode, AnInterface, AnotherInterface "</span><span style="-webkit-font-kerning: none; color: rgb(0, 0, 0); -webkit-text-stroke-color: rgb(0, 0, 0);" class="">+</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(255, 38, 0); -webkit-text-stroke-color: rgb(255, 38, 0); -webkit-text-stroke-width: initial;" class=""><span style="-webkit-font-kerning: none; color: rgb(209, 47, 27); -webkit-text-stroke-color: rgb(0, 0, 0);" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-kerning: none" class="">"{var l = 9.0; var h = 4.0; var&nbsp; w = 1.0; " &nbsp; &nbsp; </span><span style="-webkit-font-kerning: none; color: rgb(0, 0, 0); -webkit-text-stroke-color: rgb(0, 0, 0);" class="">+</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(255, 38, 0); -webkit-text-stroke-color: rgb(255, 38, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "var color = UIColor.blue;"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="-webkit-font-kerning: none; color: rgb(0, 0, 0); -webkit-text-stroke-color: rgb(0, 0, 0);" class="">+</span><span style="font-kerning: none" class="">&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(255, 38, 0); -webkit-text-stroke-color: rgb(255, 38, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "func volume() -&gt; Double { return l * w * h} “</span><span style="-webkit-font-kerning: none; color: rgb(0, 0, 0); -webkit-text-stroke-color: rgb(0, 0, 0);" class=""> +</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="-webkit-font-kerning: none; color: rgb(209, 47, 27); -webkit-text-stroke-color: rgb(209, 47, 27);" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-kerning: none" class="">aStringWithAdditionalComponentDefinitions + </span><span style="-webkit-font-kerning: none; color: rgb(255, 45, 33); -webkit-text-stroke-color: rgb(255, 45, 33);" class="">"}"</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-kerning: none" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(87, 135, 38); -webkit-text-stroke-color: rgb(87, 135, 38); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; // Of course, this class definition string can also be assembled</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(87, 135, 38); -webkit-text-stroke-color: rgb(87, 135, 38); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; // completely programatically, read from a file or database, etc.&nbsp;</span></div><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-kerning: none" class="">&nbsp;&nbsp; &nbsp;</span><br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp;&nbsp;</span><span style="-webkit-font-kerning: none; color: rgb(186, 45, 162); -webkit-text-stroke-color: rgb(186, 45, 162);" class="">func</span><span style="font-kerning: none" class=""> defMonolithClass()</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="-webkit-font-kerning: none; -webkit-text-stroke-color: rgb(0, 0, 0);" class="">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="-webkit-font-kerning: none; color: rgb(186, 45, 162); -webkit-text-stroke-color: rgb(186, 45, 162);" class="">do</span><span style="-webkit-font-kerning: none; -webkit-text-stroke-color: rgb(0, 0, 0);" class="">&nbsp; </span><span style="font-kerning: none" class="">// try to define a class, NOT an instance.</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="-webkit-font-kerning: none; color: rgb(186, 45, 162); -webkit-text-stroke-color: rgb(186, 45, 162);" class="">try</span><span style="font-kerning: none" class=""> Monolith =&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="-webkit-font-kerning: none; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255);" class="">Meta.defineClass</span><span style="font-kerning: none" class="">(withString: classDefStr)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="-webkit-font-kerning: none; color: rgb(0, 0, 0); -webkit-text-stroke-color: rgb(0, 0, 0);" class="">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="-webkit-font-kerning: none; color: rgb(186, 45, 162); -webkit-text-stroke-color: rgb(186, 45, 162);" class="">catch</span><span style="-webkit-font-kerning: none; color: rgb(0, 0, 0); -webkit-text-stroke-color: rgb(0, 0, 0);" class=""> </span><span style="font-kerning: none" class="">Meta.classDefinitionError</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="-webkit-font-kerning: none; -webkit-text-stroke-color: rgb(0, 0, 0);" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-kerning: none" class="">// handle a possible class dynamic compilation errors</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // e.g. syntax errors. symbols not found etc. &nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="-webkit-font-kerning: none; color: rgb(0, 0, 0); -webkit-text-stroke-color: rgb(0, 0, 0);" class="">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="-webkit-font-kerning: none; color: rgb(186, 45, 162); -webkit-text-stroke-color: rgb(186, 45, 162);" class="">catch</span><span style="-webkit-font-kerning: none; color: rgb(0, 0, 0); -webkit-text-stroke-color: rgb(0, 0, 0);" class=""> </span><span style="font-kerning: none" class="">Meta.classCreationConflict</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="-webkit-font-kerning: none; -webkit-text-stroke-color: rgb(0, 0, 0);" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-kerning: none" class="">// class cannot be redefined&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // when instances of Monolith still exist.</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // This restriction is probably necessary.</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Also, static classes defined at compile time</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // cannot be redefined</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-kerning: none" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(87, 135, 38); -webkit-text-stroke-color: rgb(87, 135, 38); -webkit-text-stroke-width: initial;" class=""><span style="-webkit-font-kerning: none; color: rgb(0, 0, 0); -webkit-text-stroke-color: rgb(0, 0, 0);" class="">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-kerning: none" class="">// After successfully declaring our dynamic class,</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(87, 135, 38); -webkit-text-stroke-color: rgb(87, 135, 38); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; // we can now add more features to it, like&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(87, 135, 38); -webkit-text-stroke-color: rgb(87, 135, 38); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; // properties and dynamic extensions. (It is not</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(87, 135, 38); -webkit-text-stroke-color: rgb(87, 135, 38); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; // possible of course to add statically defined extensions</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(87, 135, 38); -webkit-text-stroke-color: rgb(87, 135, 38); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span><span style="-webkit-text-stroke-width: initial;" class="">// and protocols to a non-existing dynamic class at compile time.</span></div><p style="-webkit-text-stroke-width: initial; margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); min-height: 13px;" class=""><span style="-webkit-font-kerning: none;" class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span><span style="color: rgb(87, 135, 38); -webkit-text-stroke-color: rgb(87, 135, 38); -webkit-text-stroke-width: initial;" class="">// neither is it possible to do this at run time.)</span></p><p style="-webkit-text-stroke-width: initial; margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); min-height: 13px;" class=""><span style="-webkit-font-kerning: none;" class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span><br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="-webkit-font-kerning: none; color: rgb(186, 45, 162); -webkit-text-stroke-color: rgb(186, 45, 162);" class="">do</span><span style="font-kerning: none" class="">&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="-webkit-font-kerning: none; color: rgb(0, 0, 0); -webkit-text-stroke-color: rgb(0, 0, 0);" class="">{</span><span style="font-kerning: none" class=""> &nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="-webkit-font-kerning: none; color: rgb(186, 45, 162); -webkit-text-stroke-color: rgb(186, 45, 162);" class="">try</span><span style="font-kerning: none" class=""> </span><span style="-webkit-font-kerning: none; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255);" class="">Meta.addPropertyTo</span><span style="font-kerning: none" class="">(Monolith,</span><span style="-webkit-font-kerning: none; color: rgb(209, 47, 27); -webkit-text-stroke-color: rgb(209, 47, 27);" class="">"mass"</span><span style="font-kerning: none" class="">,&nbsp; &nbsp; </span><span style="-webkit-font-kerning: none; color: rgb(39, 42, 216); -webkit-text-stroke-color: rgb(39, 42, 216);" class="">3.4</span><span style="font-kerning: none" class="">)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="-webkit-font-kerning: none; color: rgb(186, 45, 162); -webkit-text-stroke-color: rgb(186, 45, 162);" class="">try</span><span style="font-kerning: none" class=""> </span><span style="-webkit-font-kerning: none; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255);" class="">Meta.addPropertyTo</span><span style="font-kerning: none" class="">(Monolith,</span><span style="-webkit-font-kerning: none; color: rgb(209, 47, 27); -webkit-text-stroke-color: rgb(209, 47, 27);" class="">"physics"</span><span style="font-kerning: none" class="">, PhysicsBody)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="-webkit-font-kerning: none; color: rgb(186, 45, 162); -webkit-text-stroke-color: rgb(186, 45, 162);" class="">try</span><span style="font-kerning: none" class=""> </span><span style="-webkit-font-kerning: none; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255);" class="">Meta.addExtensionTo</span><span style="font-kerning: none" class="">(Monolith, someExtensionDefStr)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="-webkit-font-kerning: none; color: rgb(0, 0, 0); -webkit-text-stroke-color: rgb(0, 0, 0);" class="">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="-webkit-font-kerning: none; color: rgb(186, 45, 162); -webkit-text-stroke-color: rgb(186, 45, 162);" class="">catch</span><span style="-webkit-font-kerning: none; color: rgb(0, 0, 0); -webkit-text-stroke-color: rgb(0, 0, 0);" class=""> </span><span style="font-kerning: none" class="">Meta.classExtenderError</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="-webkit-font-kerning: none; -webkit-text-stroke-color: rgb(0, 0, 0);" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-kerning: none" class="">// handle the error</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="-webkit-font-kerning: none; color: rgb(0, 0, 0); -webkit-text-stroke-color: rgb(0, 0, 0);" class="">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="-webkit-font-kerning: none; color: rgb(186, 45, 162); -webkit-text-stroke-color: rgb(186, 45, 162);" class="">catch</span><span style="-webkit-font-kerning: none; color: rgb(0, 0, 0); -webkit-text-stroke-color: rgb(0, 0, 0);" class=""> </span><span style="font-kerning: none" class="">Meta.classCreationConflict</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="-webkit-font-kerning: none; -webkit-text-stroke-color: rgb(0, 0, 0);" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-kerning: none" class="">// class definition cannot be altered&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // when instances of Monolith (still) exist.</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // This restriction seems to be necessary.</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Also, static classes defined at compile time</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // cannot be extended dynamically.&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; }</span></div><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp;&nbsp; &nbsp;</span></p><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; ...</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-kerning: none" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; defMonolithClass()</span></div><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp;&nbsp; &nbsp;</span></p><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="-webkit-font-kerning: none; -webkit-text-stroke-color: rgb(0, 0, 0);" class="">&nbsp; &nbsp; </span><span style="font-kerning: none" class="">// After having dynamically declared the example class,</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; // we can produce instances of it, like with any&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; // other class. It throws an error</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; // when the dynamic class has not been defined.&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-kerning: none" class=""></span><br class=""></div><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-kerning: none" class="">&nbsp;&nbsp; &nbsp;</span><br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; public&nbsp;</span><span style="-webkit-font-kerning: none; color: rgb(186, 45, 162); -webkit-text-stroke-color: rgb(186, 45, 162);" class="">let</span><span style="font-kerning: none" class=""> monolith = Monolith()&nbsp;</span></div><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp;&nbsp; &nbsp;</span></p><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; </span><span style="-webkit-font-kerning: none; color: rgb(186, 45, 162); -webkit-text-stroke-color: rgb(186, 45, 162);" class="">let</span><span style="font-kerning: none" class=""> vol = monolith.volume</span></div><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp;&nbsp; &nbsp;</span></p><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="-webkit-font-kerning: none; color: rgb(0, 0, 0); -webkit-text-stroke-color: rgb(0, 0, 0);" class="">&nbsp; &nbsp; monolith = </span><span style="-webkit-font-kerning: none; color: rgb(186, 45, 162); -webkit-text-stroke-color: rgb(186, 45, 162);" class="">nil</span><span style="-webkit-font-kerning: none; color: rgb(0, 0, 0); -webkit-text-stroke-color: rgb(0, 0, 0);" class=""> &nbsp;</span><span style="font-kerning: none" class="">// remove instance(s), pre ARC when we wish to&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // redefine it.&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-kerning: none" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="-webkit-font-kerning: none; color: rgb(0, 0, 0); -webkit-text-stroke-color: rgb(0, 0, 0);" class="">&nbsp; &nbsp; defMonolithClass() &nbsp;</span><span style="font-kerning: none" class="">// redefine it, possibly with other definition parameters as in the first definition in this example.</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-kerning: none" class=""></span><br class=""></div><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp;</span></p><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-kerning: none" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">Some examples for additional functionality</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-kerning: none" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(112, 61, 170); -webkit-text-stroke-color: rgb(112, 61, 170); -webkit-text-stroke-width: initial;" class=""><span style="-webkit-font-kerning: none; color: rgb(186, 45, 162); -webkit-text-stroke-color: rgb(186, 45, 162);" class="">let</span><span style="-webkit-font-kerning: none; color: rgb(0, 0, 0); -webkit-text-stroke-color: rgb(0, 0, 0);" class=""> Bird: </span><span style="font-kerning: none" class="">DynamicClass</span><span style="-webkit-font-kerning: none; color: rgb(0, 0, 0); -webkit-text-stroke-color: rgb(0, 0, 0);" class="">?</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-kerning: none" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); -webkit-text-stroke-color: rgb(0, 132, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-kerning: none" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="-webkit-font-kerning: none; color: rgb(0, 0, 0); -webkit-text-stroke-color: rgb(0, 0, 0);" class="">Bird = </span><span style="font-kerning: none" class="">Meta.defineClass</span><span style="-webkit-font-kerning: none; color: rgb(0, 0, 0); -webkit-text-stroke-color: rgb(0, 0, 0);" class="">(</span><span style="font-kerning: none" class="">withString</span><span style="-webkit-font-kerning: none; color: rgb(0, 0, 0); -webkit-text-stroke-color: rgb(0, 0, 0);" class="">: classDefStr)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-kerning: none" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">Bird = </span><span style="-webkit-font-kerning: none; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255);" class="">Meta.defineClass</span><span style="font-kerning: none" class="">(</span><span style="-webkit-font-kerning: none; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255);" class="">superClass</span><span style="font-kerning: none" class="">: StaticClass | DynamicClass,</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="-webkit-font-kerning: none; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255);" class="">interfaces</span><span style="font-kerning: none" class="">: [Protocol],</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="-webkit-font-kerning: none; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255);" class="">definitionString</span><span style="font-kerning: none" class="">: classItemsDefStr)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-kerning: none" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">Bird = </span><span style="-webkit-font-kerning: none; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255);" class="">Meta.defineCopyOfClass</span><span style="font-kerning: none" class="">(</span><span style="-webkit-font-kerning: none; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255);" class="">class</span><span style="font-kerning: none" class="">: StaticClass| DynamicClass,</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="-webkit-font-kerning: none; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255);" class="">append</span><span style="font-kerning: none" class="">: classItemsDefString)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-kerning: none" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-kerning: none" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-kerning: none" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">Meta.addpropertyTo</span><span style="-webkit-font-kerning: none; color: rgb(0, 0, 0); -webkit-text-stroke-color: rgb(0, 0, 0);" class="">(Monolith,&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="-webkit-font-kerning: none; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255);" class="">name</span><span style="font-kerning: none" class="">:</span><span style="-webkit-font-kerning: none; color: rgb(209, 47, 27); -webkit-text-stroke-color: rgb(209, 47, 27);" class="">"mass"</span><span style="font-kerning: none" class="">,</span><span style="-webkit-font-kerning: none; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255);" class="">initializeWith</span><span style="font-kerning: none" class="">: </span><span style="-webkit-font-kerning: none; color: rgb(39, 42, 216); -webkit-text-stroke-color: rgb(39, 42, 216);" class="">3.4, type: Float</span><span style="font-kerning: none" class="">)&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-kerning: none" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">Meta.addPropertyTo</span><span style="-webkit-font-kerning: none; color: rgb(0, 0, 0); -webkit-text-stroke-color: rgb(0, 0, 0);" class="">(Monolith,</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name </span><span style="-webkit-font-kerning: none; color: rgb(209, 47, 27); -webkit-text-stroke-color: rgb(209, 47, 27);" class="">"Person"</span><span style="font-kerning: none" class="">,initializeWith: someValue</span><span style="-webkit-font-kerning: none; color: rgb(39, 42, 216); -webkit-text-stroke-color: rgb(39, 42, 216);" class="">, type: Inferred</span><span style="font-kerning: none" class="">)&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-kerning: none" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">Meta.addConstantPropertyTo</span><span style="-webkit-font-kerning: none; color: rgb(0, 0, 0); -webkit-text-stroke-color: rgb(0, 0, 0);" class="">(Monolith,</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name </span><span style="-webkit-font-kerning: none; color: rgb(209, 47, 27); -webkit-text-stroke-color: rgb(209, 47, 27);" class="">"cow"</span><span style="font-kerning: none" class="">,initializeWithString: aString</span><span style="-webkit-font-kerning: none; color: rgb(39, 42, 216); -webkit-text-stroke-color: rgb(39, 42, 216);" class="">,&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(39, 42, 216); -webkit-text-stroke-color: rgb(39, 42, 216); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; type: FourLeggedAnimal</span><span style="-webkit-font-kerning: none; color: rgb(0, 0, 0); -webkit-text-stroke-color: rgb(0, 0, 0);" class="">)&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-kerning: none" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-kerning: none" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-kerning: none" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-kerning: none" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">In principle, variants of this could be used to define structs as well.</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-kerning: none" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">While Swift is mainly a statically typed language, recompilation or additional&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">compilation and somehow link it al together is obviously necessary at run time,&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">each time a dynamic structure is defined.&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">Because of this, it will most probably have performance drawbacks&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">at run time, but there are applications where that is acceptable.</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">Also, there many applications where dynamic entities are not needed,&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">and therefore relying only on statically defined objects, which run as fast as usual.</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-kerning: none" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">I haven't thought (yet) very much about possible side effects and conflicts.&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">One of the restrictions probably is that one cannot or should not, alter the&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">class definition (hierarchy) as long as instances of it exist.</span></div><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-kerning: none" class="">&nbsp;&nbsp;</span><br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">How to implement this and can it be done? I know almost nothing about&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">compiler design and construction I assume that it is very complicated,&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">but if it can be done it would be great, making Swift even more powerful&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">than it already is.&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-kerning: none" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">Interesting?&nbsp;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">Of course, there might be better ways to do this, it's just a (my) start of thinking.</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">Highly appreciate in feedback about this.</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">This currently is not in a time frame or meant as base for a proposal,</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-kerning: none" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">Kind Regards</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-kerning: none" class="">Tedvg</span></div><div class=""><span style="font-kerning: none" class=""><br class=""></span></div></body></html>