Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: how call a function by same name in 2 different contexts?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg56791] Re: [mg56715] how call a function by same name in 2 different contexts?
  • From: Omega Consulting <info at omegaconsultinggroup.com>
  • Date: Fri, 6 May 2005 03:00:00 -0400 (EDT)
  • References: <200505040434.AAA06268@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

On May 3, 2005, at 11:34 PM, steve wrote:
>
> I was expecting this output
>
>      Context["FourierTransform"]
>            SignalProcessing`Support`SigProc`
>            System`

Names["*`FourierTransform"]
or
?*`FourierTransform

>
> So that I can see where each function is and then call any one
> I want without ambiguity.
>
> Any idea how to handle all of this stuff? I do not think it is nice
> that one package hides away another function of the same name in
> different package. The whole idea of using packages is so that this
> sort of thing should not happen !

I cannot see a good way to avoid this. How is Mathematica supposed to 
know which function you want to use at any particular point?

What the package mechanism should ensure is that the packages aren't 
confused. That is if 2 packages have the same symbol, then package A 
should never use package B's symbol.

You can add new, unambiguous symbols that point to these definitions. 
Something like:

SigTransForm = SignalProcessing`Support`SigProc`FourierTransform
SysTransForm = System`FourierTransform

Ofcourse, all this does is save on typing.

> Is there a way to unload a specific package after loading it without
> having to restart Mathematica to clean things out?
>
> Thank you for any insight into this issue
> nma124

Perhaps http://library.wolfram.com/infocenter/MathSource/602/

----------------------------------------------
Omega Consulting
The final answer to your Mathematica needs.
http://omegaconsultinggroup.com


  • Prev by Date: Re: InitializationCell -> Toggle shortcut key
  • Next by Date: Re: Bug in Integrate in Version 5.1?
  • Previous by thread: Re: how call a function by same name in 2 different contexts?
  • Next by thread: Re: how call a function by same name in 2 different contexts?