On Tuesday, March 26, 2013 12:14:02 PM UTC-4, jason wrote:
>
> On 3/26/13 11:06 AM, kcrisman wrote: 
> > This is just a question mostly for Jason and William, who have both been 
> > reimplementing interacts. 
> > 
> > Could the following syntax be (fruitfully) made to work? 
> > 
> > @interact 
> > def _(x,y=2,1): 
> >      x,y=x*x+3*y*y,x*y+y*x 
> >      html("$%s^2-3\cdot%s^2=%s$"%(x,y,x^2-3*y^2)) 
> > 
> > It seems very "Pythonic" in some ways but I assume that Python functions 
> > in general don't accept this, so probably it's a bad idea to try to hack 
> > it in.  But I thought I'd put it out there and risk the ridicule :) 
> > 
>
> What are you thinking that the result should look like and how it should 
> behave? 
>

The same as  

@interact
def _(x=2,y=1):
    x,y=x*x+3*y*y,x*y+y*x
    html("$%s^2-3\cdot%s^2=%s$"%(x,y,x^2-3*y^2))

for now.  I suppose one could ask for it to look like a vector/tuple but 
that's probably asking for trouble, as is perhaps the entire idea since 
Python functions don't support this (right?)...

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to