Re: Re: Fyi, Listing of Mathematica 7
- To: mathgroup at smc.vnet.net
- Subject: [mg105033] Re: [mg105005] Re: [mg104952] Fyi, Listing of Mathematica 7
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Wed, 18 Nov 2009 07:00:31 -0500 (EST)
- Reply-to: hanlonr at cox.net
This would have to be defined inside the package for each function. Presumably something like this:
f[x_] := x^2
f /: SyntaxInformation[f] =
{ArgumentsPattern -> {_}};
SyntaxInformation[f]
{ArgumentsPattern->{_}}
?? f
Bob Hanlon
---- "Nasser M. Abbasi" <nma at 12000.org> wrote:
=============
ref (me)
>
> I did use SyntaxInformation[], which I did not know about, and it is much
> simpler.
Except I am finding that SyntaxInformation[] only works on functions in
System context. So I can't find it to determine which is a function and
which is not for functions in other packages (i.e. outside the kernel).
So I have to resort to the old method for determining which Symbol is a
function or not for those.
Compare the result for something not in the kernel with something outside:
Needs["Combinatorica`"]
SyntaxInformation[AddEdge]
{}
SyntaxInformation[Cos]
{ArgumentsPattern -> {_}}
Even though AddEdge IS a function, I was expecting it to return the
ArgumentPattern-> ..... list, but it did not.
Is SyntaxInformation[] only supported for kernel functions? (i.e. in
System`) (may be because those packages do not have support for it added?)
--Nasser