Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>New WHILE statement</strong></p> <p>Your language designer <em>forgot</em> a WHILE statement. You've mailed him several times. No success. You've waited from language version 2.5, 2.6 to 3.0. Nothing happened...</p> <p>In Lisp:</p> <p>(defmacro while ... insert your while implementation here ...)</p> <p>Done.</p> <p>The trivial implementation using LOOP takes a minute.</p> <p><strong>Code generation from specifications</strong></p> <p>Then you may want to parse call detail records (CDRs). You have record names with field descriptions. Now I can write classes and methods for each of those. I could also invent some configuration format, parse a configuration file and create the classes. In Lisp I would write a macro that generates the code from a compact description.</p> <p>See <a href="https://vimeo.com/77280671" rel="nofollow noreferrer">Domain Specific Languages in Lisp</a>, a screencast showing a typical development cycle from a working sketch to a simple macro based generalization.</p> <p><strong>Code rewriting</strong></p> <p>Imagine that you have to access slots of objects using getter functions. Now imagine that you need to access some objects multiple times in some code region. For some reason using temporary variables is no solution.</p> <pre><code>... ... (database-last-user database) ... ... </code></pre> <p>Now you could write a macro WITH-GETTER which introduces a symbol for the getter expression.</p> <pre><code>(with-getters (database (last-user database-last-user)) ... ... last-user ...) </code></pre> <p>The macro would rewrite the source inside the enclosed block and replace all specified symbols with the getter expression.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload