Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2001
*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 2001

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

Search the Archive

Head found ;-)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg29838] Head found ;-)
  • From: "Orestis Vantzos" <atelesforos at hotmail.com>
  • Date: Fri, 13 Jul 2001 04:19:18 -0400 (EDT)
  • Organization: National Technical University of Athens, Greece
  • References: <9ijhmt$rhn$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Major mistake ahead:
Symbols don't have Head! They are "terminal symbols" of the Mathematica
language and therefore they have no internal structure per se.
Now I suppose you want to check the Head of the ownvalue of the symbols.
This function returns a List of the names of the wanted symbols:

checkHeads[contxt_String, theHead_]:=
Select[Names[contxt<>"*"],Head[Symbol@#]===theHead&]

The output is a list of Strings (the names of the symbols).
Map the function Symbol to this List to get the Symbols.
Orestis

"Antoine Zahnd" <antoine.zahnd at iprolink.ch> wrote in message
news:9ijhmt$rhn$1 at smc.vnet.net...
> Hi,
>
> How is it possible to return all the symbols ( belonging to the current
> context ),  having a prescribed Head ?
>
> Thank you very much for your help.
>
> antoine.zahnd at iprolink.ch
>
>
>
>




  • Prev by Date: Re: Clearing cache
  • Next by Date: Re: Naming pieces of patterns
  • Previous by thread: Re: Printing Large Base-n Numbers
  • Next by thread: Re: Head found ;-)