> h1[k](x):= subst(k,'kval,block([k:kval],...) > > then h1[99] returns lambda([x],block([k:99],...). That should be h1[k](x):= subst(k,'kval,'block([k:kval],...) Note quotation mark___________^