Pedagogically, that is unworkable. A user who has learned about functions would already know that a function can be defined inside another. If you are teaching the concept of classes to that user, either you must first lie and say that a class cannot be defined inside a function, or your student will naturally discover that in fact you can--but then potentially encounter behaviors that he or she cannot make sense of.<br><br>In any case, Robert&#39;s excellent analysis shows why this proposed feature would simply break Swift, so the pedagogical objection is not even foremost among issues.<br><div class="gmail_quote"><div dir="ltr">On Sat, Dec 24, 2016 at 03:46 Guillaume DIDIER &lt;<a href="mailto:guillaume.didier@polytechnique.edu">guillaume.didier@polytechnique.edu</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto" class="gmail_msg"><div class="gmail_msg">If I understand correctly we are speaking of class definitions inside functions, so this doesn&#39;t affect classes defined at the global scope, which are what the beginner will first be told. Teaching them about defining classes in other places would then wait until they know more about closure, scopes and variable capture.</div><div id="m_2574454514013899638AppleMailSignature" class="gmail_msg"><br class="gmail_msg"></div><div id="m_2574454514013899638AppleMailSignature" class="gmail_msg">I would suggest treating a class defined within a function body the same way a function defined within a function body would be.<br class="gmail_msg"><br class="gmail_msg"><div class="gmail_msg"><div style="word-wrap:break-word" class="gmail_msg"><div style="word-wrap:break-word" class="gmail_msg"><div style="margin:0px;line-height:normal" class="gmail_msg"><div style="color:rgb(7,55,99);font-family:Georgia;font-size:13px;margin:0px;line-height:normal" class="gmail_msg"><b class="gmail_msg">Guillaume DIDIER (ASP)</b></div><div style="color:rgb(0,0,0);font-family:Georgia;font-size:13px;margin:0px;line-height:normal" class="gmail_msg"><i class="gmail_msg"><font color="#073763" class="gmail_msg">Section Escrime, 3ème Compagnie, </font><br class="gmail_msg"><font color="#073763" class="gmail_msg">Promotion </font><font color="#ff2600" class="gmail_msg">X 2014</font></i></div><div style="color:rgb(0,0,0);font-family:Georgia;font-size:13px;margin:0px;line-height:normal" class="gmail_msg"><i class="gmail_msg"><font color="#ff2600" class="gmail_msg"><br class="gmail_msg"></font></i></div><div style="margin:0px;line-height:normal" class="gmail_msg"><br class="gmail_msg"></div><div style="color:rgb(7,55,99);font-family:&#39;Lucida Sans&#39;;font-size:12px;margin:0px;line-height:normal;min-height:15px" class="gmail_msg"><span style="font-family:&#39;Century Gothic&#39;;font-size:13px" class="gmail_msg">—</span><i class="gmail_msg"></i></div><div style="color:rgb(7,55,99);font-family:&#39;Century Gothic&#39;;font-size:11px;margin:0px;line-height:normal" class="gmail_msg"><b class="gmail_msg">ÉCOLE POLYTECHNIQUE</b></div><div style="color:rgb(7,55,99);font-family:&#39;Century Gothic&#39;;font-size:11px;margin:0px;line-height:normal" class="gmail_msg"><a dir="ltr" class="gmail_msg">91128 PALAISEAU CEDEX</a><br class="gmail_msg"><span style="color:rgb(30,73,125)" class="gmail_msg">M.</span> <span style="color:rgb(30,73,125)" class="gmail_msg"><a dir="ltr" href="tel:+33%207%C2%A070%2043%2018%2040" class="gmail_msg" target="_blank">+33 (</a></span><a dir="ltr" href="tel:+33%207%C2%A070%2043%2018%2040" class="gmail_msg" target="_blank">0</a><span style="color:rgb(30,73,125)" class="gmail_msg"><a dir="ltr" href="tel:+33%207%C2%A070%2043%2018%2040" class="gmail_msg" target="_blank">)7</a></span><a dir="ltr" href="tel:+33%207%C2%A070%2043%2018%2040" class="gmail_msg" target="_blank"> 70 43 18 40</a><br class="gmail_msg"><a href="mailto:guillaume.didier@polytechnique.edu?subject=" class="gmail_msg" target="_blank"><span style="line-height:normal" class="gmail_msg">guillaume.didier@polytechnique.edu</span></a></div><div style="color:rgb(71,135,255);font-family:&#39;Century Gothic&#39;;font-size:11px;margin:0px;line-height:normal" class="gmail_msg"><span style="text-decoration:underline" class="gmail_msg"><a href="http://www.polytechnique.edu/" class="gmail_msg" target="_blank">www.polytechnique.edu</a></span></div><div style="color:rgb(7,55,99);font-family:&#39;Century Gothic&#39;;font-size:13px;margin:0px;line-height:normal" class="gmail_msg">—</div></div></div></div></div></div></div><div dir="auto" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg">Le 23 déc. 2016 à 23:49, David Sweeris via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>&gt; a écrit :<br class="gmail_msg"><br class="gmail_msg"></div><blockquote type="cite" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg">On Dec 23, 2016, at 1:37 PM, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" class="gmail_msg" target="_blank">xiaodi.wu@gmail.com</a>&gt; wrote:</div><div class="gmail_msg"><div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">This has been an idea brought up in the distant past about other features. The core team has said very clearly that they do not want &quot;dialects&quot; of Swift.</div></div></div></div></div></blockquote><br class="gmail_msg"></div><div class="gmail_msg">That puts the nail on it for me… if it’s already been rejected, I don’t want to rehash it.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">- Dave Sweeris</div></div></blockquote></div><div dir="auto" class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg"><span class="gmail_msg">_______________________________________________</span></div></blockquote></div><div dir="auto" class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"><span class="gmail_msg">swift-evolution mailing list</span><br class="gmail_msg"><span class="gmail_msg"><a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a></span><br class="gmail_msg"><span class="gmail_msg"><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br class="gmail_msg"></div></blockquote></div></blockquote></div>