Metasymbols

From Schmid.wiki
Jump to: navigation, search

Contents

Notes

This is very much a work in progres, please don't comment it yet.

Abstract

Problem

Hypothesis

Metasymbols are '''evil':

  • They hinder readability of the source
  • They take time to learn and experience to use effectively
  • They often introduce lots of errors in the early coding stages

MediaWiki Example

This is a very basic example that illustrates the problem. To write the hypothesis above, I wrote the code:

 '''Metasymbols are ''''''''evil'''''':

Well, it is not pretty, but it is not too bad. On the other hand, the source to show the code for the hypothesis is:

<pre><nowiki>
 '''Metasymbols are ''''''''evil'''''':
</nowiki></pre>

We see the XML tags <pre> and <nowiki> in use to inhibit the Mediawiki interpretation of the quotes. Now, if I want to view the source for showing the code for displaying the source for the hypothesis, we cannot write the text </nowiki> inside the <nowiki> tag, so we'll use the HTML ampersand notation for the '<' symbol:

<pre><nowiki>
<pre><nowiki>
 '''Metasymbols are ''''''''evil'''''':
&lt;/nowiki>&lt;/pre>
</nowiki></pre>

Moreover, if we would like to see the code for viewing the source for showing the code for displaying the source for the hypothesis, the HTML ampersand notation cannot be written as text, so we'll use the 'The HTML Coded Character Set' value for the ampersand character:

<pre><nowiki>
<pre><nowiki>
<pre><nowiki>
 '''Metasymbols are ''''''''evil'''''':
&#38;lt;/nowiki>&#38;lt;/pre>
&lt;/nowiki>&lt;/pre>
</nowiki></pre>

... not to mention the source for that.

Math Example

The most compact and the easiest readable form of a mathematical construction is almost always the mathematical symbolic notation:

<math>\int_{-\infty}^{\infty} e^{-x^2}\,dx = \sqrt{\pi}</math>

Another way of unambigously describing a mathematical construction:

The integral from minus infinity to infinity, with respect to x, of e raised to the power of minus x squared is equal to the square root of pi.

The LaTeX version:

\int_{-\infty}^{\infty} e^{-x^2}\,dx = \sqrt{\pi}

Escaping Example

Prose Example

If I want to describe this text, I'll just write 'the text'. For instance, the text is not completely finished yet. If, on the other hand, I want to describe the words 'the text', I'll have to quote them. Furthermore, if I want to explain about the words 'the text' and the surrounding quotes, I will have to mention the text 'the text' as well as "it's surrounding quotes" (notice the use of double quotes, because I wanted to use the single quote "'" in the contraction "it's" inside the quotes (also notice the use of parentheses to signify a comment (fortunately, we can nest parentheses indefinitely, without the need for metaparenthesis characters (of course, if we want to talk about the parenthesis characters themselves, we will have to describe them with the word 'parenthesis' or quote them (like this: '(' and ')') to avoid confusion with the actual parentheses)))). I cannot just quote the text and the quotes, because people could misinterpret them as double quotes, which means something else. If I want to quote the text above, I'll could use some typographical trick, like this:

If I want to describe this text, I'll just write 'the text'. For instance, the text is not completely finished yet. If, on the other hand, I want to describe the words 'the text', I'll have to quote them. Furthermore,...


Quines

b='\\';g='"';p='%';s="b='%s%s';g='%s';p='%s';s=%s%s%s;print s%s(b,b,g,p,g,s,g,p)";print s%(b,b,g,p,g,s,g,p)

Solution

Colouring

Encoding to ASCII (or whatever)

References

Personal tools