Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2000
*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 2000

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

Search the Archive

List of patterns for which a function is defined?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg24378] List of patterns for which a function is defined?
  • From: "Roger Wilson" <roger.wilson at nomura.co.uk>
  • Date: Wed, 12 Jul 2000 23:13:18 -0400 (EDT)
  • Organization: Nomura
  • Sender: owner-wri-mathgroup at wolfram.com

I have a function b which I define explicitly for a set of input values.

a[1]=4; a[2]=5; a["cat"]="sam";

If I type ??a I get the usual listing of the definition of a but how do I
get a list of the values or patterns for which a is defined?

ListOfPatternsDefined[a]
{1,2,"cat"}

In python this would be a.keys() but in Mathematica I'm stuck?

Any ideas?

Roger.

---------------------------------------------------------------------
Roger Wilson, Quantitative Analysis Group | roger.wilson at nomura.co.uk
<mailto:roger.wilson at nomura.co.uk>
Nomura International plc, Nomura House | Phone: +44 020 7521 2373
1 St. Martin's-le-Grand, London EC1A 4NP | Fax:   +44 020 7521 3676
---------------------------------------------------------------------
Any views or opinions presented are solely those
of the author and do not necessarily represent those
of Nomura or any of its affiliates.
Nomura International PLC is a member of the
London Stock Exchange and is regulated by The Securities and
Futures Authority.
---------------------------------------------------------------------





  • Prev by Date: Coloring multiple graphs differently
  • Next by Date: Usage Messages Useful for the SHIFT+CONTROL+K Feature
  • Previous by thread: Re: Coloring multiple graphs differently
  • Next by thread: Re: List of patterns for which a function is defined?