MathGroup Archive 2005

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

Search the Archive

Re: extra data in expressions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg53375] Re: [mg53367] extra data in expressions
  • From: DrBob <drbob at bigfoot.com>
  • Date: Sat, 8 Jan 2005 23:02:35 -0500 (EST)
  • References: <200501080739.CAA17766@smc.vnet.net>
  • Reply-to: drbob at bigfoot.com
  • Sender: owner-wri-mathgroup at wolfram.com

>> Why does Head[String @@ 1] return Integer?

Because you can't replace the head of an "atomic" expression. ToString changes expressions to strings, if that's what you wanted to do.

>> What else could it possibly return?

Exactly.

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

Perhaps, but you haven't mentioned any so far.

Bobby

On Sat, 8 Jan 2005 02:39:36 -0500 (EST), <joshuahorowitz at comcast.net> wrote:

> 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.
>
>
>
>



-- 
DrBob at bigfoot.com
www.eclecticdreams.net


  • Prev by Date: Re: Plotting dates on the x-axis
  • Next by Date: Re: Converting between Spherical and Cartesian coordinates
  • Previous by thread: extra data in expressions
  • Next by thread: Re: extra data in expressions