I'd like to propose that certain special names should be protected so
that they could not become variable names (for example pi, e, and i)
if by accident you assign them like:
e=factorial(10)
and then you need to need to use e with it's standard meaning, like
e^100
you will have a very hard to spot error ( (factorial(10)^100).
In that occation I did not create a ticket, but now I have:
http://trac.sagemath.org/sage_trac/ticket/8317
and the thread is better placed in sage-support
thanks!
Oscar
-1
I've used pi for: partitions, p[i] where p is a list, etc.
e can be a small error term, a sign, an exponent
i is the best index variable name ever invented, hands down.
That said, I was opposed to implicit multiplication, too. If this is
made into a "mode", then that's fine by me.
> --
> To post to this group, send an email to sage-...@googlegroups.com
> To unsubscribe from this group, send an email to
> sage-devel+...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/sage-devel
> URL: http://www.sagemath.org
>
When I do want to have i^2=-1, I will write the code appropriately,
and if I manage to use the same name for two objects I am working with
- I think it is my fault, I should resolve it, and avoid repeating it
in the future.
Andrey
On Feb 20, 5:21 pm, Oscar Gerardo Lazo Arjona
<algebraicame...@gmail.com> wrote:
> Some time ago I suggested in sage-support
> (http://groups.google.com/group/sage-support/browse_thread/thread/b391...)
I thought it was obvious that this meant to be an optional feature.
Making this forceful would obviously break lot's of previous code. I
thought of it as somethig you could set for individual sage sessions
or for all of them *if you want to*...
thanks
Oscar
OK, I'm with you that this will not be on by default. As you suggest
below, this is something that can (and will) be made an optional mode.
We'll have several -- implicit multiplication, automatic variable
name creation, and protected names. Having them all on could be useful
for people teaching, e.g., calculus labs. This protected mode, by
the way, will in the long run use the same technique as automatic
variable name creation: replacing the globals() dictionary by a
customized wrapper. This has a slight performance penalty, so
definitely can't be the default. But it is a fine idea for an
optional mode.
--
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org
I personally think the default should be to protect certain names, as that will
reduce the chances of new users getting in a mess.
More experienced uses can then elect to unprotect these variables.
Dave
I'm all for a special mode, but to do this by default would be
backwards incompatible and yet another incompatibility from Python.
- Robert
Try to say all that w'out 'm.
On 21 Feb, 02:02, Robert Bradshaw <rober...@math.washington.edu>
wrote:
I'm -1 for a special mode, but I am +1 for keeping the default to be
like Python. Out of curiosity, does anyone use the special mode that
transforms "a b" -> "a*b"?
Nick
Oscar
I do. If you're typing in a bunch of formulas and working in an
"experimental mode (mood?)" it is *very* useful to be able to (1) have
variables automatically appear without predefining them, and (2) not
have to write *'s.
>
> Nick
I rewrote it in October so that it *does* work in the notebook now. Try it:
implicit_multiplication(True)
-- william
>
> On 20 feb, 21:40, Nick Alexander <ncalexan...@gmail.com> wrote:
>> > I'm all for a special mode, but to do this by default would be
>> > backwards incompatible and yet another incompatibility from Python.
>>
>> I'm -1 for a special mode, but I am +1 for keeping the default to be
>> like Python. Out of curiosity, does anyone use the special mode that
>> transforms "a b" -> "a*b"?
>>
>> Nick
>
Same here: +1 for special mode, -1 for making this default.
Maybe we could make a "New user" checkbox in the notebook like the
"Typeset" checkbox, which turns on protected mode, automatic variable
names, and implicit multiplication?
Jason
--
Jason Grout
On 23 Feb., 15:51, Jason Grout <jason-s...@creativetrax.com> wrote:
> Maybe we could make a "New user" checkbox in the notebook like the
> "Typeset" checkbox, which turns on protected mode, automatic variable
> names, and implicit multiplication?
But wouldn't this encourage new users to take protected mode,
automatic variable creation and implicit multiplication for granted?
Then, eventually, it would become a de-facto default for users, even
when it is not the "official" default. I wouldn't find that desirable
at all. Thus:
I am -1
Cheers,
Simon
I agree with Simon. But if we could have some kind of general
option-setting button where these things could easily be switched on
and off (a bit like the typesetting switch) that would make them
easier to find and use.
John
> Cheers,
> Simon