Code:
e = [ 0, 2, 4, 6 ]
r = [ 0, 1, 2, 3, 4, 5 ]
def cond(i, e):
return i in e
x = [ i for i in r if cond(i, e) ]
Last lines are expanded as:
function cond(){
document.$func_info=["__main__","cond"]
try{
$ns=$MakeArgs("cond",arguments,['i','e'],{},null,null)
for($var in $ns){eval("var "+$var+"=$ns[$var]")}
document.$line_info=[5,"__main__"]
return i.__in__(e)
}catch(err0){$raise(err0.name,err0.message)}
}
window.cond=cond
document.$line_info=[7,"__main__"]
x =$list_comp([["i","r"]],"i","cond(i,e)",['r',r])
But console complains with:
ExecutionError: cond is not a function
Same issue if function is named 'expr', 'env'
suggesting some issue with the parameter names of $list_comp()
function $list_comp(loops,expr,cond,env){ ... }
Works fine with function named 'condsomething'...
Original issue reported on code.google.com by pedro.ro...@gmail.com on 5 Jan 2013 at 1:30
Original issue reported on code.google.com by
pedro.ro...@gmail.com
on 5 Jan 2013 at 1:30