We have not actually had any +1 votes for a new postfix ! operator, so
it's bit premature to criticise that decision be fore it hasn't been
made.  (William's +1 was for a different suggestion, that Sage's
symbolic variables should not be allowed to be wider than python's.
Again, keeping to python conventions if at all possible.

John
(a veteran Algol 68 programmer, though not Algol 60!)

2009/8/31 rjf <fate...@gmail.com>:
>
> You can either
> (a) adhere to Python syntax.
> (b) adhere to Python except for a few changes that are so subtle that
> no one would even notice.
> (c) adhere to Python except for a few more changes that you tell
> everyone about and hope that the discrepancy between Sage and Python
> (and Cython) will not be noticed by critics, and so you can continue
> to claim "Sage is just Python and everyone knows and loves Python".
> (d) use Python as a base, and add whatever you want, because you now
> have your own "pre"parser and can add, say, postfix "!".  And now you
> probably should tell your users that the Sage language is "python
> inspired".
> (e) use your own parser for your own made up language that looks like
> some mathematical notation.
>
> Maxima/Macsyma is in category (d) or (e):  it uses its own parser for
> Algol 60 as a base and added things to it, but also has a syntax-
> extension feature so that the parser can be changed by the user.  e.g.
> commands to add new post-fix operators etc.  (At run-time).
>
> One of the premises and alleged great advantages of Sage was, I
> thought, that it is "just Python", and you seem to be casually tossing
> that idea into the trash.
> (The idea that the user-language and the implementation-language for a
> computer algebra system has been a topic for discussion at least since
> the early 1970s, so the idea that all those clever people just missed
> the boat -- the solution is Python; Python does it all; seemed a bit
> simplistic.  So I'm not surprised at the slippage, to a "pre-parser"
> and Cython and now , oh, let's add a postfix "!".)
>
> But what I think is appropriate here is an explicit formulation about
> what you are doing, either (a)....(e)  or something else, and the
> consequences.
>
> RJF
>
>
>
>
>
> On Aug 29, 10:13 am, William Stein <wst...@gmail.com> wrote:
>> On Sat, Aug 29, 2009 at 10:10 AM, Jason Grout
>> <jason-s...@creativetrax.com>wrote:
>>
>>
>>
>>
>>
>> > Fredrik Johansson wrote:
>> > > Hi,
>>
>> > > How about supporting n! as a shortcut for factorial(n)? This syntax is
>> > > very convenient and makes a huge difference for combinatorial
>> > > expressions with many factorials. M&M (Maple & Mathematica) allow this
>> > > notation, as do many scientific calculators.
>>
>> > > Although Python doesn't have any other postfix operators, I don't
>> > > think there's any ambiguity as ! is unused in Python except for the !=
>> > > operator. The worst I can come up with is x!=y, but given that =
>> > > denotes assignment and not equality, this still only has one possible
>> > > meaning.
>>
>> > In an attempt to find places that "!" could be used, I found the
>> > following interesting thing.
>>
>> > sage: var('x!')
>> > x!
>> > sage: _^2
>> > x!^2
>> > sage: x!
>> > ------------------------------------------------------------
>> >    File "<ipython console>", line 1
>> >      x!
>> >       ^
>> > SyntaxError: invalid syntax
>>
>> > Maybe Sage symbolic variables should be restricted to identifiers that
>> > are legal in python...
>>
>> Yes, definitely +1 to that.  I think this used to be the case at some point.
>>
>> William
> >
>

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

Reply via email to