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 | 2b9a7afa2abf672396d5ee38d9301f88b9a06dff (patch) | |
tree | 8c31380919fec41eaf59c882a30eec7106838f6c /src/core_env.sml | |
parent | d8d9309a0242408460488de0c44029d74c7b3113 (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 |