On May 21, 2007, at 11:05 PM, William Stein wrote:

> On 5/21/07, Robert Bradshaw <[EMAIL PROTECTED]> wrote:
>> Global namespace pollution? Would the (implicit) target audience of
>> degree-based trig know to look for sindeg, etc.? Would it work like
>>
>> sage: cosdeg(45)
>> cos(pi/4)
>>
>> It's much better than a global state tough.
>
> -1 to extra functions like this:
>    * Maple and Mathematica don't do this
>    * namespace polution
>    * people probably (a) wouldn't know to use those functions
>    * there are a dozen or so trig functions, and for all of them
>      we would have to have extra functions.  Do you want to
>      have acscdeg(), etc.
>
> By the way, here is what Mathematica does:
>
> In[7]:= N[Sin[10 Degree]]
> Out[7]= 0.173648
>
> I am in favor of something more like that, though I *loathe* adding
> anything further to the preparser.  Maybe this is more pythonic:
>
>    sage: sin(10 * degrees)
>
> i.e., degrees would be a Python object that represent 1 degree.
> The resulting object 10 * degrees would be a number with units.

I think this is much more pythonic. Not sure how it would propagate  
through maxima, etc.

> I would be interested in a general units package.

I don't think one could do it (in general) without invoking the  
preparer. I think the preparsing could be rather simple--i.e.  
"literal_number alpha_numeric" -> "literal_number * alpha_numeric"


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to