> experience is consistent with the initial experience, at the cost of
> some possible developer confusion since the default value isn't really
> Integers(3)(2), but rather sage_eval(repr(Integers(3)(2))).
>

I hope others have some input on this one, which I think is the only
really controversial part.  Given the purpose of interacts, I find it
hard to imagine that a developer would have sent something like the
original example to someone who didn't know what they were doing.
Explicit is better than implicit, right...?  But I could imagine some
problems.  For instance, what if the Sage object didn't have a repr
that was sage_eval-able?  (A common critique of sage vis-a-vis other
systems, IIRC.)

> Proposed: The default value is sent through repr, then through the
> default adapter, so prints ABCDE initially and shows 'ABCDE' in the
> input box (note the quotes).  If the user modifies the input box,
> hopefully they see that quotes are needed to make it a valid string, so
> they modify it to be 'ABCDEF', and then the interact prints ABCDEF
>

Seems plausible.  Would the interact documentation make the first,
most obvious way to do strings be the shortcut below?  That would cut
down on this.

> @interact
> def _(n="ABCDE"):
>      print n
>
> work the same as before---in both cases, the input is always treated as
> a string, so n will always be a string, and *not* run through sage_eval.

Yes, this had better work the same as before.  I would imagine that
most people who want to use a string would do this.

>
> Adapter applied to all inputs
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I've never used this part (the type= business) but these seem very
reasonable, if not even a bug in the old dispensation.  Maybe others
have counterexamples, though.

Listen, anything that allows a Sage cell interact implementation with
nested interacts to finally make it into Sage is probably worth minor
backward-incompatibility in these areas.  How many people are using
all of the bells and whistles of the 'type', as opposed to all the
more fun bells and whistles like color_picker? :)

- kcrisman

-- 
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