l-lang-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[L-lang-devel] Expander support


From: Matthieu Lemerre
Subject: [L-lang-devel] Expander support
Date: Sun, 25 Mar 2007 20:52:49 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Even if I don't send regular mails anymore (partly because I had quite
a lot of work lately, and partly because I try to have the new
concepts easily undererstandable by the test/example files), L
development is still alive. New upcoming features are really pending.


A new point has been reached in L usability: the definition of
expanders from L.  Let's see the example file:


expander my_assert( form)
{
  let condition = form.form_list.head;
  Form( if( $condition$ == cast( Bool, 0))
          {
            print( "Testing Assertion ");
            print_form( Form( $condition$));
            print( " failed, so this worked.\n");
            //exit( 3)
          })
}

expander my_log( form)
{
  Form( print( "logging: ", address@hidden)
        //exit( 3)
        )
}

Void
test()
{
 foreach (let i in list (1, 0))
  {
    my_assert( i == 0);
  }

 let j = 3;
 my_log( "Testing j = ", j, "\nSeems to work\n");
 
}


L already has the advantage of outputing correct assert failures when
using macros ( contrary to C because of the preprocessor).  

L is already usable, but is on the way to be pleasant to program with!

Matthieu





reply via email to

[Prev in Thread] Current Thread [Next in Thread]