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 2001

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

Search the Archive

Re: Head wanted

  • To: mathgroup at
  • Subject: [mg29835] Re: [mg29818] Head wanted
  • From: BobHanlon at
  • Date: Fri, 13 Jul 2001 04:19:16 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

In a message dated 2001/7/12 2:59:56 AM, antoine.zahnd at writes:

>How is it possible to return all the symbols ( belonging to the current
>context ),  having a prescribed Head ?

namesOfType[type_, context_:"Global"] := 
  Select[Names[context<>"`*"], Head[ToExpression[#]] == type&];

e = {a, b=5, c=3I, d = "string"};

namesOfType[#]& /@ {Symbol, String, Integer, Complex, List}

{{"a", "context", "namesOfType", 
   "type"}, {"d"}, {"b"}, {"c"}, 

Bob Hanlon
Chantilly, VA  USA

  • Prev by Date: Re: Voronoy Diagrams ?
  • Next by Date: Re: kernel problem for trigonometry
  • Previous by thread: Head wanted
  • Next by thread: Re: Head wanted