Changeset 1758 for lang/unlambda
- Timestamp:
- 11/19/07 00:45:44 (12 months ago)
- Files:
-
- 1 copied
-
lang/unlambda/impl/in_python/unlambda_lambda.py (copied) (copied from lang/unlambda/impl/in_python/unlambda.py) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/unlambda/impl/in_python/unlambda_lambda.py
r1757 r1758 52 52 def run(): 53 53 if Debug.show_node: print node 54 return node .eval(cont)54 return node(cont) 55 55 return run 56 56 … … 69 69 def __str__(self): 70 70 return "I" 71 def eval(self, cont):71 def __call__(self, cont): 72 72 def I0(X, cont): 73 73 return cont(X) … … 80 80 def __str__(self): 81 81 return "(print %r)" % self.c 82 def eval(self, cont):82 def __call__(self, cont): 83 83 def Dot0(X, cont): 84 84 import sys … … 95 95 def __str__(self): 96 96 return "(apply %s %s)" % (self.nX, self.nY) 97 def eval(self, cont):97 def __call__(self, cont): 98 98 nY = self.nY 99 99 def next(X): … … 107 107 return X(Y, cont) 108 108 return cont(Promise1) 109 return nY .eval(next)109 return nY(next) 110 110 return cont(Promise0) 111 111 … … 115 115 return X(Y, cont) 116 116 return _App2 117 return nY .eval(next)117 return nY(next) 118 118 return _App1 119 119 return EvalTask(self.nX, next) … … 123 123 def __str__(self): 124 124 return "D" 125 def eval(self, cont):125 def __call__(self, cont): 126 126 return cont(self) 127 127 … … 131 131 def __str__(self): 132 132 return "C" 133 def eval(self, cont):133 def __call__(self, cont): 134 134 def C0(Y, cont): 135 135 def C1(func, new_cont): … … 147 147 def __str__(self): 148 148 return "V" 149 def eval(self, cont):149 def __call__(self, cont): 150 150 def V0(X, cont): 151 151 return cont(V0) … … 156 156 def __str__(self): 157 157 return "K" 158 def eval(self, cont):158 def __call__(self, cont): 159 159 def K0(X, cont): 160 160 def K1(Y, cont): … … 167 167 def __str__(self): 168 168 return "S" 169 def eval(self, cont):169 def __call__(self, cont): 170 170 def S0(X, cont): 171 171 def S1(Y, cont): … … 183 183 def __init__(self, f): 184 184 self.f = f 185 def eval(self, cont):185 def __call__(self, cont): 186 186 return cont(self.f) 187 187 188 188 class At(Node): 189 189 def __str__(self): return "At" 190 def eval(self, cont):190 def __call__(self, cont): 191 191 def At0(X, cont): 192 192 import sys … … 210 210 self.c = c 211 211 212 def eval(self, cont):212 def __call__(self, cont): 213 213 def Qu0(X, cont): 214 214 if At.c == self.c: … … 221 221 222 222 class Pipe(Node): 223 def eval(self, cont):223 def __call__(self, cont): 224 224 def Pipe0(X, cont): 225 225 if At.c != -1: … … 232 232 233 233 class E(Node): 234 def eval(self, cont):234 def __call__(self, cont): 235 235 def E0(X, cont): 236 236 return FinalTask(X)
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)