William Stein wrote:
> On Wed, Oct 21, 2009 at 11:54 AM, Jason Grout
> <jason-s...@creativetrax.com> wrote:
>> (Yet again) I tried to pull up an @interact from the wiki and it didn't
>> work because it had not been updated to keep up with the changes to
>> syntax in Sage.  Are there any objections to making a file of the
>> @interact examples so that it is easy to spot when they need to be
>> updated through normal doctesting?
> 
> How would it work?  What would you put in the file.
> 
> I think it would be much better to make a while directory in the main
> Sage tree of examples, along
> with an organized namespace, e.g., something like
> 
>     sage: interacts.<tab>
>     sage: interacts.calculus.<tab>
>     sage: interacts.calculus.derivative()
>     up pops the interact
> 
> Regarding doctesting, that may require some extension to how interact
> works?   I.e., some special function like
> 
>     sage: interacts.calculus.derivative.test()
> 
> that would do something clever.
> 


Nice idea!

As things are right now, if I define an interact function

interacts.calculus.vector_motion_2d

then someone could call it up by:

interact(interacts.calculus.vector_motion_2d)

(except that it would also then return the function object, which is 
kind of ugly at the end of the output)

I agree that having a function which tests interacts would be nice. 
Things could be automated a bit by having an interact control having a 
random_value method which generates a random value for the control. 
Then the interact_test function would just construct the appropriate 
interact control for each argument of a function, ask for a random 
value, and then pass those random values into the function.

I'm not sure exactly what your suggestion for a place for code was, but 
reading your answer above and replacing "while" with "whole", I agree 
that a new directory is called for.  Shall we call it "interacts", or a 
more general name like "examples"?

Thanks,

Jason


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to