Guest
Public paste!

Feather

By: a guest | Feb 9th, 2010 | Syntax: None | Size: 0.48 KB | Hits: 10 | Expires: Never
This paste has a previous version, view the difference. Copy text to clipboard
  1. <?DEFMACRO OPERATOR ...
  2.    PARAM from ASSUME LITERAL
  3.    PARAM to ASSUME LITERAL
  4.    INTEGER ARRAY ret
  5.    DO #[
  6.       for (integer it = $from; it != $to; (it > $from ? it-- : it++)){
  7.          $ret[] = it; // se usa $ para informar de que es del preprocesador
  8.       }
  9.    ]# // el preprocesador ejecuta este codigo en tiempo de compilacion
  10.    EVAL VALUE ret // devuelve la matriz rellenada
  11. ?>
  12.  
  13. integer myArray[] = 1...10; // equivale a: integer myArray[] = {1, 2, 3, 4, 5, 6, 7, 8, 9}