redefining macro as a function?



--- Robert Dodier  wrote:

> --- C Y  wrote:
> 
> > [...] Anyway, regardless, the point is I'm not proposing
> > this just because of the unit code, but because I think
> > it is a good idea generally to have this functionality. 
> 
> Well, the only rationale offered for changing toplevel-macsyma-eval
> is that it would make the units code easier.

I would say instead that that is the only example that has been offered
- the "rationale" is that it would provide the functionality for anyone
who cares to use it.  Right now only my version of the unit package
needs it, I'll grant you.  If there is serious opposition to this
change I will not insist on it and look for some other solution, but
surely it won't cause that much trouble?
 
> > > In particular, I really don't see the
> > > need for a units package to replace core functions.
> > 
> > It has to if, say, the : operator is going to check for dimensional
> > consistency for (say) a case like x[time] : 3*sec (valid) and 
> > x[time] : 2*m (error). 
> 
> Checking assigned values can be accomplished via an
> existing mechanism, namely the ASSIGN property, 
> which MSET tests for. define_variable can establish the
> ASSIGN property, although it is a little clumsy.
> About define_variable see "Definitions for Function Definition" at
> http://maxima.sf.net/docs/original/maxima_toc.html .

OK, I'll check that out!  Thanks!

> > There are other cases where core code will need updating,
> > plot2d and plot3d being definite canditates.
> 
> Makes sense to me.  

Just curious - what would your reaction be to Wolfgang's proposal to
add hooks to the code, which would allow a package to effectively
redefine macsyma-eval on a per package basis?  Would that be a little
less intrusive?  My concern is loading multiple packages would then of
necessity wipe out earlier changes, barring careful protective
mechanisms and/or user coding, but I'm willing to give it a try if the
majority agrees this is a prefered way.

Cheers,
CY


		
__________________________________ 
Discover Yahoo! 
Stay in touch with email, IM, photo sharing and more. Check it out! 
http://discover.yahoo.com/stayintouch.html