Differences From Artifact [996468a22f9d9a8e]:
- File
sample/macro.pmy
- 2010-11-25 03:32:41 - part of checkin [474c4facf0] on branch trunk - Introduced makefile to build documents. sample/macro.pmy is fully reformed. print(x) now returns x, not 0. (user: kinaba) [annotate]
To Artifact [b441073a5b98679b]:
- File
sample/macro.pmy
- 2010-11-26 05:03:10 - part of checkin [207cea338a] on branch trunk - changed hiding mechanizem of x in let x = ... for @macro layer. Old: set(x,ValueLayer,undefined) Nee: set(x,NoopLayer,null) (user: kinaba) [annotate]
34 print( maxGreat(print(1), print(2)) ); # 1 2 2 34 print( maxGreat(print(1), print(2)) ); # 1 2 2
35 print( maxGreat(print(2), print(1)) ); # 2 1 2 35 print( maxGreat(print(2), print(1)) ); # 2 1 2
36 36
37 ######################################## 37 ########################################
38 print("----------"); 38 print("----------");
39 39
40 # the variable "it" is inserted to the scope 40 # the variable "it" is inserted to the scope
41 @macro LetItBe(x, y) { let it = x in y }; | 41 @macro LetItBe(x, y) { var it = x; y };
42 print( LetItBe("myself", "when I find " ~ it ~ " in times of trouble") ); 42 print( LetItBe("myself", "when I find " ~ it ~ " in times of trouble") );
43 43
44 ######################################## 44 ########################################
45 print("----------"); 45 print("----------");
46 46
47 # layerd parameter can also be used for @macro 47 # layerd parameter can also be used for @macro
48 # you can mix @macro and normal parameters!! 48 # you can mix @macro and normal parameters!!