well, it can be made "static" with this:

import __builtin__

__builtin__._ = WhatEverYouWant()

cheers,

atir

On Apr 1, 4:35 pm, "Sebastian Haase" <[EMAIL PROTECTED]> wrote:
> On Tue, Apr 1, 2008 at 3:31 PM, Ondrej Certik <[EMAIL PROTECTED]> wrote:
>
> > On Tue, Apr 1, 2008 at 2:59 PM, atir ajnopse <[EMAIL PROTECTED]> wrote:
>
> > >  Hi.
>
> > >  I'm new to this list and was interested in sympy to use it to help
> > >  implement a DSL for audio synthesis.
>
> > >  I had a question: I would like to have a symbol, say "_" --without the
> > >  quotation marks ;-) , which creates unique copies of itself so that
> > >  the following is possible:
>
> > >  f = _ + _  -> would behave as f = x + y  (given x and y are Symbols),
> > >  a bit like it is used in many functional languages (and not like 2 *
> > >  _ )
>
> > >  It should also be possible to then substitute each symbol with a value
> > >  or with another symbol individually.
>
> > Yep, that is easy, just append this at the end of my script above:
>
> > print f.subs(Symbol("b"), 5)
>
> Please keep in mind thought that in Python "_" is commonly used to
> refer to the last return value. It is "quietly" overwritten when you
> use a (common) interactive shell.
> Like this:>>> 1.4*1024
> 1433.6
> >>> _/180
> 7.96444444444
> >>> _
>
> 7.96444444444
>
> I do see however that "_" would be nice for your porpuse --- is there
> maybe some other sign (i.e. valid var name) that could be used instead
> !?
>
> [[ Python 3.0 will support unicode var names, right ? ]]
>
> Regards,
> Sebastian
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sympy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sympy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to