Differences From Artifact [a38c7267da8f14a3]:
- File        
sample/macro.pmy
- 2010-11-21 08:18:05 - part of checkin [a5fe6233c1] on branch trunk - layered parameters implemented (user: kinaba) [annotate]
 
 
To Artifact [274d10aca22ce25f]:
- File        
sample/macro.pmy
- 2010-11-21 09:53:17 - part of checkin [435fa085ec] on branch trunk - refactored predefined layer names, and filled readme.txt. (user: kinaba) [annotate]
 
 
    7  def maxNormal(x,y) {                                                                   7  def maxNormal(x,y) {
    8    if(x<y){y}else{x}                                                                    8    if(x<y){y}else{x}
    9  };                                                                                     9  };
   10  @macro maxBad(x,y) {                                                                  10  @macro maxBad(x,y) {
   11    if(x<y){y}else{x}                                                                   11    if(x<y){y}else{x}
   12  };                                                                                    12  };
   13                                                                                        13  
   14  @macro LetItBe(x, y) {                                                           |    14  @macro LetItBe(x, y) { let it = x in y };
   15    let it = x in y                                                                <
   16  };                                                                               <
   17                                                                                        15  
   18  @macro pow10(x) {                                                                     16  @macro pow10(x) {
   19    @v(                                                                            |    17    @value(
   20      def pow(x, n) {                                                                   18      def pow(x, n) {
   21        if( n == 1 ) { x }                                                              19        if( n == 1 ) { x }
   22        else {                                                                          20        else {
   23          @macro( @v(x) * @v(pow(x,n-1)) )                                         |    21          @macro( @value(x) * @value(pow(x,n-1)) )
   24        }                                                                               22        }
   25      }                                                                                 23      }
   26      in                                                                                24      in
   27        pow(@macro(x),10)                                                               25        pow(@macro(x),10)
   28    )                                                                                   26    )
   29  };                                                                                    27  };
   30                                                                                        28