Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1995

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

Search the Archive

Re: counting number of rules in rule base

  • To: mathgroup at
  • Subject: [mg1569] Re: counting number of rules in rule base
  • From: Count Dracula <lk3a at>
  • Date: Sun, 25 Jun 1995 02:49:46 -0400
  • Organization: University of Virginia

In Message-ID: <3sd94t$n5n at> 
Article 880 of comp.soft-sys.math.mathematica
gaylord at (richard j. gaylord) writes:

> without doing ?symb and then counting the number of rules that come up on
> my monitor screen [i keep losing count around 125 or so], how can i ask
> Mathematica for the number of rules associated with symb?

My previous message about this had a typographical error.
Two variable names, "f" and "symb", appeared in the
Module numrules, but only one name should have been used.
The Module should have read:

numrules[f_Symbol] :=
   inf = StringToStream[ToString[Definition[f]]];
   Length[Select[ReadList[inf, Record], StringMatchQ[#1, StringJoin[ToString[f], "[*"]]&]]

 Levent Kitis           lk3a at    lk3a at
 University of Virginia Department of Mechanical, Aerospace, and Nuclear Engineering  

  • Prev by Date: Comparison of MMA on Various Machines
  • Previous by thread: Re: counting number of rules in rule base
  • Next by thread: Re: Help with NDSolve