Variable argument list implementation

Xavier Oswald xoswald at gmail.com
Wed Aug 19 12:16:10 UTC 2009


Hi there,

We have worked with Benoit 10 hours yesterday to find the best way to have the
variable argument list feature in Lisaac.

So here is some example of code on how to use it.


- a:{INTEGER...} := {1,2,3,4,5};


- toto a:{INTEGER...} :{INTEGER...} <-
  ( + r:{INTEGER...};
    + z:INTEGER;

    a.foreach { val:INTEGER;
        z := z + val;
    };

    r := {1,2,3+1,z};
    
    r
  );


That some simple examples of using it.
So "..." is the way to express unknown number of values using blocks.

The foreach function will be part of the compiler for parsing the value list.

There will be more complex usage that I will explain in the reference manual
but here you have the basics.


Greetins,
-- 
  ,''`.  ** Xavier Oswald <xoswald at debian.org>                            
 : :' :  ** Research Engineer                                           
 `. `'   ** GNU/LINUX Debian Developer (http://debian.org)              
   `-    ** Isaac Project Developer (http://isaacproject.u-strasbg.fr/) 



More information about the Lisaac-devel mailing list