Is the syntax for this class t = new_exp(SR, symbolic_expression)?
So that sage: t returns symbolic_expression? Second, I'm not entirely sure I understand how this patch was made, let alone how to install it. I skimmed over http://www.sagemath.org/doc/developer/patching_spkgs.html and http://www.sagemath.org/doc/developer/producing_spkgs.html#chapter-spkg but found the whole thing to be a bit over my head (I'm a newbie, sorry). Is there a series of instructions you could provide me for the installation of your patch? I'm sure you're very busy, so I really do appreciate the effort. Thanks, Steven On Jul 21, 6:37 am, Burcin Erocal <bur...@erocal.org> wrote: > Hi, > > On Wed, 20 Jul 2011 17:02:49 -0700 (PDT) > > Steven Pollack <stevenlawrencepoll...@gmail.com> wrote: > > I noticed that a thread was developed for this sort of thing (http:// > > groups.google.com/group/sage-support/browse_thread/thread/ > > d50dc3bc2bdbeab0/34798c0585fc034f?lnk=gst&q=nicolas&fwc=1#), but I'm a > > newbie, and a lot of it went over my head. > > > Is there a simple to create a subclass of > > sage.symbolic.expression.Expression? > > The main problem with subclassing Expression is that the result > returned from arithmetic is hardcoded to be an Expression again. > > I quickly did a search and replace in the sage/symbolics directory to > pass the new class as an argument to the fast expression constructor > new_Expression_from_GEx. Here is the patch: > > http://sage.math.washington.edu/home/burcin/subclass_expression.patch > > After applying the patch the following works: > > sage: class new_exp(Expression): > ....: pass > ....: > sage: t = new_exp(SR, x) > sage: t > x > sage: type(t) > <class '__main__.new_exp'> > sage: u = t*t > sage: type(u) > <class '__main__.new_exp'> > sage: u > x^2 > > Hope this helps. > > Burcin -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org