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: da7559b744 2010-11-21 kinaba: @@3(x){x}; da7559b744 2010-11-21 kinaba: @@5(x){x}; da7559b744 2010-11-21 kinaba: @@15(x){x}; da7559b744 2010-11-21 kinaba: def incr(x) { x+1 }; da7559b744 2010-11-21 kinaba: @ 3 incr(x) {@value( if(@ 3(x)+1< 3){@ 3(x)+1}else{0} )}; da7559b744 2010-11-21 kinaba: @ 5 incr(x) {@value( if(@ 5(x)+1< 5){@ 5(x)+1}else{0} )}; da7559b744 2010-11-21 kinaba: @15 incr(x) {@value( if(@15(x)+1<15){@15(x)+1}else{0} )}; a5d10ace51 2010-11-09 kinaba: da7559b744 2010-11-21 kinaba: def fb(n @value @3 @5 @15) { da7559b744 2010-11-21 kinaba: print( da7559b744 2010-11-21 kinaba: if( @15(n) ) { if( @5(n) ) { if( @3(n) ) { n } else { "Fizz" } } else { "Buzz" } } else { "FizzBuzz" } da7559b744 2010-11-21 kinaba: ); da7559b744 2010-11-21 kinaba: fb(incr(n)) a5d10ace51 2010-11-09 kinaba: }; a5d10ace51 2010-11-09 kinaba: da7559b744 2010-11-21 kinaba: fb(0)