Skip to content

Instantly share code, notes, and snippets.

@TelegramSam
Created April 7, 2011 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TelegramSam/908468 to your computer and use it in GitHub Desktop.
Save TelegramSam/908468 to your computer and use it in GitHub Desktop.
ruleset a8x153 {
meta {
name "recursive action without function"
description <<
Runs a recursive action without a function to create the recursive step.
Base case is handled by the nexta defaction conditional expression.
>>
author "Sam Curren"
logging off
}
dispatch {
}
global {
r = defaction(n){
effect = defaction(x){
notify("run", x);
};
nexta =
n > 0 =>
defaction(){ {effect(n); r(n-1);} } |
defaction(){ effect(n); };
nexta();
};
}
rule run {
select when pageview ".*" setting ()
r(3);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment