RE: [Aimmath-developers] [ aimmath-Bugs-772556 ] function in map becomes a t
Brought to you by:
gustav_delius,
npstrick
|
From: Greg G. <gr...@ma...> - 2003-07-18 06:25:16
|
On Thursday, 17 July 2003 3:32 AM, Gustav wrote: > Bugs item #772556, was opened at 2003-07-16 19:31 > Category: None > Group: None > Status: Open > Resolution: None > Priority: 5 > Submitted By: Gustav W Delius (gustav_delius) > Assigned to: Nobody/Anonymous (nobody) > Summary: function in map becomes a t > > Initial Comment: > The following will print [1,4,9] > > h> f := x->x^2;; > b :=eval(map(f,[1,2,3])); > t> $$@b@$$ > a>1 > end> > > This is expected. > But the following will print [ t(1), t(2), t(3)] > > h> b := eval(map(x->x^2,[1,2,3])); > t> $$@b@$$ > a>1 > end> > > Why? Where did the t come from? Hi Gustav, I would say that the t was a local variable generated by the codegen Maple package. Occasionally, I have found that t has been assigned to 1 and just recently E was set to 0 for a quiz. I believe these are all codegen bugs, nothing to do with the AIM code. In many contexts the arrow notation fails to work in a quiz question and you need to use the proc() end; syntax. If you want to use an anonymous function in b use unapply, e.g. h> b := eval(map(unapply(x^2, x), [1,2,3])); Unfortunately, these bugs will remain I suspect until the usage of codegen is replaced by CodeGeneration. Anyway, when Neil gets back, he may be able to elaborate. Regards, Greg |