Skip to content

Commit

Permalink
Add complex predicate
Browse files Browse the repository at this point in the history
  • Loading branch information
WyattBlue committed Sep 29, 2023
1 parent 27e2450 commit ef08114
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions auto_editor/lang/palet.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,8 @@ def __init__(
self.arity = len(parms), len(parms)

def __call__(self, *args: Any) -> Any:
check_args(self.name, args, self.arity, self.contracts)

if self.arity[1] is None:
args = tuple(
list(args[: len(self.parms) - 1]) + [list(args[len(self.parms) - 1 :])]
Expand Down Expand Up @@ -1407,10 +1409,11 @@ def my_eval(env: Env, node: object) -> Any:
"number?": is_num,
"real?": is_real,
"int?": is_int,
"nat?": is_nat,
"nat1?": is_nat1,
"float?": is_float,
"frac?": is_frac,
"complex?": Contract("complex?", lambda v: type(v) is complex),
"nat?": is_nat,
"nat1?": is_nat1,
"threshold?": is_threshold,
"any": any_p,
"bool?": is_bool,
Expand Down

0 comments on commit ef08114

Please sign in to comment.