On Tue, Aug 18, 2009 at 9:56 PM, rjf<fate...@gmail.com> wrote: > > Let's see, in sage then you have the following syntax. > (x,y) means a list > f(x,y) means a function application > (x+y) means grouping for arithmetic. > RationalField(x) means, uh, sortof "in indeterminate..." > Integer(4) means, uh, set the type? force a coercion? > > Are there any other distinct uses of ()? > > Mathematica uses > {} for lists > [] for function arguments (in SMP these were called projections) > () for grouping > > Maxima uses > (a,b,c) as meaning something like begin a; b; c end > [] for lists and array subscripting > () for grouping and function calls. > > So it seems that you have a choice. > > > However, the Sage choice is kind of confusing. > x //a variable > (x ) // a list of one item or a group consisting of x alone, hence x. > ((x)) // a list of one item, grouped alone. Or a list of a list of > one item. Or just x. > > That is, if (a+1,a+2) is a list of 2 items, is (a+1) not a list of > one item?
yeah, (x) is the same as x, use (x, ) to have a tuple of one element "x". Ondrej --~--~---------~--~----~------------~-------~--~----~ 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 URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---