comparison src/core_env.sml @ 642:4a125bbc602d

Conversion of functions to CPS, to facilitate ServerCall
author Adam Chlipala <adamc@hcoop.net>
date Sun, 08 Mar 2009 20:34:21 -0400
parents 230654093b51
children 70cbdcf5989b
comparison
equal deleted inserted replaced
641:b98f547a6a45 642:4a125bbc602d
340 | PPrim _ => env 340 | PPrim _ => env
341 | PCon (_, _, _, NONE) => env 341 | PCon (_, _, _, NONE) => env
342 | PCon (_, _, _, SOME p) => patBinds env p 342 | PCon (_, _, _, SOME p) => patBinds env p
343 | PRecord xps => foldl (fn ((_, p, _), env) => patBinds env p) env xps 343 | PRecord xps => foldl (fn ((_, p, _), env) => patBinds env p) env xps
344 344
345 fun patBindsN (p, loc) =
346 case p of
347 PWild => 0
348 | PVar _ => 1
349 | PPrim _ => 0
350 | PCon (_, _, _, NONE) => 0
351 | PCon (_, _, _, SOME p) => patBindsN p
352 | PRecord xps => foldl (fn ((_, p, _), count) => count + patBindsN p) 0 xps
353
345 end 354 end