Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #9798 > unrolled thread

is there internal variable like $0 in perl?

Started byTed Sariyski <tsariysk@craft-tech.com>
First post2012-04-26 09:29 +0000
Last post2012-04-27 10:50 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  is there internal variable like $0 in perl? Ted Sariyski <tsariysk@craft-tech.com> - 2012-04-26 09:29 +0000
    Re: is there internal variable like $0 in perl? A Retey <awnl@gmx-topmail.de> - 2012-04-27 10:50 +0000

#9798 — is there internal variable like $0 in perl?

FromTed Sariyski <tsariysk@craft-tech.com>
Date2012-04-26 09:29 +0000
Subjectis there internal variable like $0 in perl?
Message-ID<jnb4hb$5eu$1@smc.vnet.net>
Hi,

When I define a new function myFun in a package aaa` I define a variable 
me="aaa`myFun".

BeginPackage["aaa`"]
...
myFun[]:=Module[{..., me="aaa`myFun"},
...

I wonder Is there an automatic variable, like $0 in perl, which 
internally is assigned "aaa`myFun"?

Thanks in advance,
--Ted

[toc] | [next] | [standalone]


#9825

FromA Retey <awnl@gmx-topmail.de>
Date2012-04-27 10:50 +0000
Message-ID<jndtkv$jjr$1@smc.vnet.net>
In reply to#9798
Hi Ted,

> When I define a new function myFun in a package aaa` I define a variable
> me="aaa`myFun".
>
> BeginPackage["aaa`"]
> ...
> myFun[]:=Module[{..., me="aaa`myFun"},
> ...
>
> I wonder Is there an automatic variable, like $0 in perl, which
> internally is assigned "aaa`myFun"?

no, not AFAIK. What would you use it for? If you want, you can do 
something like:

BeginPackage["aaa`"];

myPublic;

Begin["`Private`"];

myPublic[x_] := myPrivate[x];

(me : myPrivate)[x_] := (Print[me]; x^2);

End[];

EndPackage[];

then evaluating myPublic[5] will show the information you want. Without 
knowing what you actually want to achieve I feel that this is probably 
not really what you need, though...

hth,

albert

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web