Editing Applejack's Hat 0 You are not logged in. The rich text editor does not work with JavaScript switched off. Please either enable it in your browser options, or visit your preferences to switch to the old MediaWiki editor The '''Applejack's Hat''' scenario is one that was used to work out how variables should work in FiM++ when it was first being proposed. This particular phrase was used because it represents several decisions about how the language, as a whole, should work. == Challenges == * "{{code|variable|Applejack's Hat}}" must be used as a variable name, as it is mundane enough that users of the language will expect it to be valid * It contains [[whitespace]], something most other programming languages prohibit in keywords. * It contains both lower- and upper-case letters. * It contains an apostrophe === Resolutions === The following were changes made to the language to accommodate for Applejack's hat. These affect how character literals are defined, what is valid punctuation, and what is a valid variable, class, and paragraph name. * Names may contain any UTF-8 character that does not conflict with other restrictions * Names may contain any whitespace character, and variable declaration ends when a [[keyword]] or [[punctuation]] is encountered * Names are case-sensitive * Names may contain [[operators]] and [[literals]] as long as they are ''after'' the first character of the word. == Other similar propositional variable names == === Valid names === These were also used as examples for what must be a valid variable name: * {{code|class|how to add all the Numbers from 1 to 100}} ** Contains an alternate capitalization of the "{{code|type|the numbers}}" reserved keyword, as well as two number literals * {{code|variable|Somepony’s true identity}} ** Contains an apostrophe and a Boolean literal * {{code|variable|Team Fortress 2}} ** Contains a number literal === Invalid Names === These were used as examples for what might seem like valid variable names, but are not. * {{code|variable|Twilight's favorite {{codeerror|number}}}} ** Contains a reserved keyword phrase * {{code|paragraph|{{codeerror|99}} Jugs of Cider}} ** Contains a literal at the beginning == See Also == * [[99 Jugs of Cider]] Loading editor Below are some commonly used wiki markup codes. Simply click on what you want to use and it will appear in the edit box above. Insert: – — … ° ≈ ≠ ≤ ≥ ± − × ÷ ← → · § Sign your username: ~~~~ Wiki markup: {{}} | [] [[]] [[Category:]] #REDIRECT [[]] <s></s> <sup></sup> <sub></sub> <code></code> <blockquote></blockquote> <ref></ref> {{Reflist}} <references/> <includeonly></includeonly> <noinclude></noinclude> {{DEFAULTSORT:}} <nowiki></nowiki> <!-- --> <span class="plainlinks"></span> Symbols: ~ | ¡ ¿ † ‡ ↔ ↑ ↓ • ¶ # ¹ ² ³ ½ ⅓ ⅔ ¼ ¾ ⅛ ⅜ ⅝ ⅞ ∞ ‘ “ ’ ” «» ¤ ₳ ฿ ₵ ¢ ₡ ₢ $ ₫ ₯ € ₠ ₣ ƒ ₴ ₭ ₤ ℳ ₥ ₦ № ₧ ₰ £ ៛ ₨ ₪ ৳ ₮ ₩ ¥ ♠ ♣ ♥ ♦ View this template This field is a spam trap. DO NOT fill it in! Edit summary Preview Mobile Desktop Show changes