Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>My recent (last 6 months) concrete example of code generation: </p> <ol> <li><p>I have an SQL Plus script that generates and then executes other SQL Plus scripts. The generates script runs queries against some tables that have time-stamp fields, and when I designed the script, it was impossible to know what time window to select. So, the main script does its work, and figures out what time ranges need to be in the sub scripts. Then it generates the subscripts by writing their code to file (and substituting placeholders for the actual start and end times). Finally it executes the subscript(s). I've used this trick for a few situations now (though often more complicated than this one) where the structure of the substeps depends on results of earlier steps.</p></li> <li><p>I once got a spreadsheet mapping elements from an XSD to table columns in a database. It was possible to generate XSL snippets and complete queries from the spreadsheet using macros and VBA. These snippets and queries were copied and pasted (mostly as-is with no neede changes) into the system that executed them and processed the results. Not a pretty solution but it certainly made a very tedious job a lot less tedious, and the code that resulted was probably a lot more consistent-looking than if I had spent a week or two writing it all by hand.</p></li> </ol> <p>SO list of examples of metaprogramming: <a href="https://stackoverflow.com/questions/237425/what-are-the-coolest-examples-of-metaprogramming-that-youve-seen-in-c">What are the coolest examples of metaprogramming that you&#39;ve seen in C++?</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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