diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-03-08 20:34:21 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-03-08 20:34:21 -0400 |
commit | aed3aa32e62846a16da55fc7be4cecba92ed5e2b (patch) | |
tree | 8c31380919fec41eaf59c882a30eec7106838f6c /src/core_env.sml | |
parent | 5f77fc276c90321dec9e17ec483a1d8b11db3c96 (diff) |
Conversion of functions to CPS, to facilitate ServerCall
Diffstat (limited to 'src/core_env.sml')
-rw-r--r-- | src/core_env.sml | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core_env.sml b/src/core_env.sml index 2c100aa5..dd77e3fb 100644 --- a/src/core_env.sml +++ b/src/core_env.sml @@ -342,4 +342,13 @@ fun patBinds env (p, loc) = | PCon (_, _, _, SOME p) => patBinds env p | PRecord xps => foldl (fn ((_, p, _), env) => patBinds env p) env xps +fun patBindsN (p, loc) = + case p of + PWild => 0 + | PVar _ => 1 + | PPrim _ => 0 + | PCon (_, _, _, NONE) => 0 + | PCon (_, _, _, SOME p) => patBindsN p + | PRecord xps => foldl (fn ((_, p, _), count) => count + patBindsN p) 0 xps + end |