a5d10ace51 2010-11-09 kinaba: # a5d10ace51 2010-11-09 kinaba: # Not at all a good example of the usage of layers, but anyway... a5d10ace51 2010-11-09 kinaba: # a5d10ace51 2010-11-09 kinaba: # after implementing layered parameters, this may be improved. a5d10ace51 2010-11-09 kinaba: # (though still not a good example...) a5d10ace51 2010-11-09 kinaba: # a5d10ace51 2010-11-09 kinaba: a5d10ace51 2010-11-09 kinaba: @ 3 print(x) { @v(print("Fizz")) }; a5d10ace51 2010-11-09 kinaba: @ 5 print(x) { @v(print("Buzz")) }; a5d10ace51 2010-11-09 kinaba: @15 print(x) { @v(print("FizzBuzz")) }; a5d10ace51 2010-11-09 kinaba: a5d10ace51 2010-11-09 kinaba: def fb(n, q3, q5, q15) { a5d10ace51 2010-11-09 kinaba: if( q15 < 1 ) { a5d10ace51 2010-11-09 kinaba: @15(print) a5d10ace51 2010-11-09 kinaba: } else { a5d10ace51 2010-11-09 kinaba: if( q5 < 1 ) { a5d10ace51 2010-11-09 kinaba: @5(print) a5d10ace51 2010-11-09 kinaba: } else { a5d10ace51 2010-11-09 kinaba: if( q3 < 1 ) { a5d10ace51 2010-11-09 kinaba: @3(print) a5d10ace51 2010-11-09 kinaba: } else { a5d10ace51 2010-11-09 kinaba: @v(print) a5d10ace51 2010-11-09 kinaba: } a5d10ace51 2010-11-09 kinaba: } a5d10ace51 2010-11-09 kinaba: }(n); a5d10ace51 2010-11-09 kinaba: let q3 = q3+1; a5d10ace51 2010-11-09 kinaba: let q5 = q5+1; a5d10ace51 2010-11-09 kinaba: let q15 = q15+1; a5d10ace51 2010-11-09 kinaba: a5d10ace51 2010-11-09 kinaba: fb( a5d10ace51 2010-11-09 kinaba: n+1, a5d10ace51 2010-11-09 kinaba: if(q3<3){q3}else{0}, a5d10ace51 2010-11-09 kinaba: if(q5<5){q5}else{0}, a5d10ace51 2010-11-09 kinaba: if(q15<15){q15}else{0} a5d10ace51 2010-11-09 kinaba: ) a5d10ace51 2010-11-09 kinaba: }; a5d10ace51 2010-11-09 kinaba: a5d10ace51 2010-11-09 kinaba: fb(0,0,0,0)