MathGroup Archive 2005

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

Search the Archive

extra data in expressions

  • To: mathgroup at
  • Subject: [mg53367] extra data in expressions
  • From: joshuahorowitz at
  • Date: Sat, 8 Jan 2005 02:39:36 -0500 (EST)
  • Sender: owner-wri-mathgroup at

Here's a rather abstract foundations question:

I once unthinkingly assumed that an expression was determined by its
head and parts. This is of course very wrong: any two expressions with
head Real, no matter how different, have head Real and no parts. Same
goes for Symbol, Integer, String, and all other "atomic" expression
heads. This means that certain expressions can (and must) hold hidden
extra data.

My question is whether there are any consistent, logical semantics for
this extra data. Can an expression contain both parts AND extra data?
Which built-in symbols (or rather, expressions with head one of these
built-in symbols) contain extra data; is there a list somewhere? Can
user-defined symbols contain user-defined extra data? Why does
Head[String @@ 1] return Integer? What else could it possibly return?

I'm starting to suspect that "everything is an expression" involves
some pretty ugly exceptions.

  • Prev by Date: Re: logical indexing using more than one variable in a pure function
  • Next by Date: Plotting dates on the x-axis
  • Previous by thread: Re: Special Prime Product
  • Next by thread: Re: extra data in expressions