From fe2be1bd8d3c9893108bb2562fb4830049738465 Mon Sep 17 00:00:00 2001 From: Manuel Eberhardinger Date: Wed, 5 Oct 2022 11:35:10 +0200 Subject: [PATCH] Update creating-new-domains.md fixed incr primitves to work with python and pypy solver --- docs/creating-new-domains.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/creating-new-domains.md b/docs/creating-new-domains.md index 483ae6907..4d075053b 100644 --- a/docs/creating-new-domains.md +++ b/docs/creating-new-domains.md @@ -72,8 +72,8 @@ We will create a list of primitives for our toy example next. Each member of our list must be an instance of the `Primitive` class where each primitive has a unique name that binds it to its corresponding OCaml code (discussed later), a type imported from `dreamcoder/type.py`, and a lambda function: `Primitive(name, type, func)`. ```python -def _incr(x): return lambda x: x + 1 -def _incr2(x): return lambda x: x + 2 +def _incr(x): return x + 1 +def _incr2(x): return x + 2 primitives = [ Primitive("incr", arrow(tint, tint), _incr), @@ -190,8 +190,8 @@ from dreamcoder.type import arrow, tint from dreamcoder.utilities import numberOfCPUs # Primitives -def _incr(x): return lambda x: x + 1 -def _incr2(x): return lambda x: x + 2 +def _incr(x): return x + 1 +def _incr2(x): return x + 2 def addN(n):