<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 </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 </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 </span><span style="-webkit-text-stroke-width: initial;" class="">and maybe other entities dynamically at run time in Swift. </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 </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=""> leaving things like "Meta""Type" T.Self etc. as transparent as possible. </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 </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. </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=""> 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=""> </span><span style="font-kerning: none" class="">// In this example we dynamically create and use </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=""> // 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=""> // 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=""> // (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=""> </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=""> 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=""> </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=""> // Use a constructor that accepts </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=""> // a string which contains a class definition, </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=""> // exactly like one would define a class in Swift statically. </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=""> // with the exception that name of the class is not specified. </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=""> // It is replaced by placeholder, an underscore, because </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=""> // the class name itself is inferred when declaring it. </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=""> // 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=""> </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=""> = </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=""> </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=""> </span><span style="font-kerning: none" class="">"{var l = 9.0; var h = 4.0; var w = 1.0; " </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=""> "var color = UIColor.blue;" </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=""> </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=""> "func volume() -> 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=""> </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=""> // 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=""> // completely programatically, read from a file or database, etc. </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=""> </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=""> </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=""> {</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=""> </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=""> </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=""> {</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=""> </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 = </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=""> </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=""> }</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=""> </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=""> {</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=""> </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=""> // e.g. syntax errors. symbols not found etc. </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=""> }</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=""> </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=""> {</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=""> </span><span style="font-kerning: none" class="">// class cannot be redefined </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=""> // 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=""> // 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=""> // 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=""> // 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=""> }</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=""> </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=""> // we can now add more features to it, like </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=""> // 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=""> // 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=""> </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=""> </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=""> </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=""> </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=""> </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=""> </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=""> </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=""> </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="">, </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=""> </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=""> </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=""> }</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=""> </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=""> {</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=""> </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=""> }</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=""> </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=""> {</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=""> </span><span style="font-kerning: none" class="">// class definition cannot be altered </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=""> // 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=""> // 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=""> // 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=""> // cannot be extended dynamically. </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=""> }</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=""> }</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=""> </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=""> ...</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=""> 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=""> </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=""> </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=""> // we can produce instances of it, like with any </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=""> // 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=""> // when the dynamic class has not been defined. </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=""> </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=""> public </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() </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=""> </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=""> </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=""> </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=""> 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=""> </span><span style="font-kerning: none" class="">// remove instance(s), pre ARC when we wish to </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=""> // redefine it. </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=""> defMonolithClass() </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=""> </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=""> </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=""> </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=""> </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, </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=""> </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="">) </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=""> 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="">) </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=""> 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="">, </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=""> type: FourLeggedAnimal</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; 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 </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, </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. </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 </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, </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. </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 </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=""> </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 </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, </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 </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. </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? </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>