@@ -79,23 +79,13 @@ builtin_filter(self, args)
7979 if (!getargs (args , "(OO)" , & func , & seq ))
8080 return NULL ;
8181
82- if (is_stringobject (func )) {
83- if ((func = exec_eval (func , lambda_input )) == NULL )
84- return NULL ;
85- }
86- else {
87- INCREF (func );
88- }
89-
9082 if (is_stringobject (seq )) {
9183 object * r = filterstring (func , seq );
92- DECREF (func );
9384 return r ;
9485 }
9586
9687 if (is_tupleobject (seq )) {
9788 object * r = filtertuple (func , seq );
98- DECREF (func );
9989 return r ;
10090 }
10191
@@ -150,13 +140,11 @@ builtin_filter(self, args)
150140 if (setlistslice (result , j , len , NULL ) < 0 )
151141 goto Fail_1 ;
152142
153- DECREF (func );
154143 return result ;
155144
156145Fail_1 :
157146 DECREF (result );
158147Fail_2 :
159- DECREF (func );
160148 return NULL ;
161149}
162150
@@ -306,10 +294,10 @@ exec_eval(v, start)
306294 globals != NULL && !is_dictobject (globals ) ||
307295 locals != NULL && !is_dictobject (locals )) {
308296 err_setstr (TypeError ,
309- "eval/lambda arguments must be (string|code)[,dict[,dict]]" );
297+ "eval arguments must be (string|code)[,dict[,dict]]" );
310298 return NULL ;
311299 }
312- /* XXX The following is only correct for eval(), not for lambda() */
300+
313301 if (is_codeobject (str ))
314302 return eval_code ((codeobject * ) str , globals , locals ,
315303 (object * )NULL , (object * )NULL );
@@ -318,7 +306,7 @@ exec_eval(v, start)
318306 err_setstr (ValueError , "embedded '\\0' in string arg" );
319307 return NULL ;
320308 }
321- if (start == eval_input || start == lambda_input ) {
309+ if (start == eval_input ) {
322310 while (* s == ' ' || * s == '\t' )
323311 s ++ ;
324312 }
@@ -460,14 +448,6 @@ builtin_map(self, args)
460448 func = gettupleitem (args , 0 );
461449 n = gettuplesize (args ) - 1 ;
462450
463- if (is_stringobject (func )) {
464- if ((func = exec_eval (func , lambda_input )) == NULL )
465- return NULL ;
466- }
467- else {
468- INCREF (func );
469- }
470-
471451 if ((seqs = NEW (sequence , n )) == NULL ) {
472452 err_nomem ();
473453 goto Fail_2 ;
@@ -549,13 +529,11 @@ builtin_map(self, args)
549529 }
550530
551531 if (seqs ) DEL (seqs );
552- DECREF (func );
553532 return result ;
554533
555534Fail_1 :
556535 DECREF (result );
557536Fail_2 :
558- DECREF (func );
559537 if (seqs ) DEL (seqs );
560538 return NULL ;
561539}
@@ -638,14 +616,6 @@ builtin_int(self, v)
638616 return (* nb -> nb_int )(v );
639617}
640618
641- static object *
642- builtin_lambda (self , v )
643- object * self ;
644- object * v ;
645- {
646- return exec_eval (v , lambda_input );
647- }
648-
649619static object *
650620builtin_len (self , v )
651621 object * self ;
@@ -977,14 +947,6 @@ builtin_reduce(self, args)
977947 return NULL ;
978948 }
979949
980- if (is_stringobject (func )) {
981- if ((func = exec_eval (func , lambda_input )) == NULL )
982- return NULL ;
983- }
984- else {
985- INCREF (func );
986- }
987-
988950 if ((len = (* sqf -> sq_length )(seq )) < 0 )
989951 goto Fail_2 ;
990952
@@ -1025,7 +987,6 @@ builtin_reduce(self, args)
1025987 }
1026988
1027989 DECREF (args );
1028- DECREF (func );
1029990
1030991 return result ;
1031992
@@ -1035,7 +996,6 @@ builtin_reduce(self, args)
1035996Fail_1 :
1036997 DECREF (result );
1037998Fail_2 :
1038- DECREF (func );
1039999 return NULL ;
10401000}
10411001
@@ -1133,7 +1093,6 @@ static struct methodlist builtin_methods[] = {
11331093 {"id" , builtin_id },
11341094 {"input" , builtin_input },
11351095 {"int" , builtin_int },
1136- {"lambda" , builtin_lambda },
11371096 {"len" , builtin_len },
11381097 {"long" , builtin_long },
11391098 {"map" , builtin_map },
0 commit comments