A new symbol to "inherit" the definitions from an existing symbol?
- To: mathgroup at smc.vnet.net
- Subject: [mg17464] A new symbol to "inherit" the definitions from an existing symbol?
- From: Dr Phillip Kent <p.kent at ic.ac.uk>
- Date: Sun, 9 May 1999 04:44:00 -0400
- Organization: Imperial College
- Sender: owner-wri-mathgroup at wolfram.com
A colleague just put this to me, and it seems such an obvious thing to do but neither of us know how to do it... I have a fairly complex (mathematical) function set up in terms of definitions, up values, down values, attributes, etc etc. All of these are directly visible with FullDefinition[]. All I want to do is to create a new function that immediately takes on all the definitions from a given function. Granted that this may be ill-defined in general, but let's assume that I'm going to take responsibility for the self-consistency of the operation. Well, I can see it's not too hard to Save[] the definitions for a symbol, Read[] them back in using Hold[]'s, do a substitution rule and release the Holds. Or, take the output cell containing the FullDefinition[], copy it to an input cell and process that expression. But, these are both bizarre procedures. Suggestions? -Phillip ----------------------------------+---------------------------- Dr Phillip Kent | tel: +44 (0)171 594 8503 The METRIC Project | fax: +44 (0)171 594 8517 Mathematics Department | Imperial College | p.kent at ic.ac.uk London SW7 2BZ, U.K. | http://metric.ma.ic.ac.uk/ ----------------------------------+---------------------------- "Ask not what you can do TO your data structures, Ask what your data structures can do FOR you."