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 2005

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

Search the Archive

Re: Types in Mathematica

  • To: mathgroup at
  • Subject: [mg62878] Re: Types in Mathematica
  • From: Jon Harrop <usenet at>
  • Date: Tue, 6 Dec 2005 23:12:18 -0500 (EST)
  • References: <> <> <dl8s4g$n41$> <dl980q$r2a$> <> <dlc96b$m81$> <dlhibt$5ki$> <dlkc76$pq0$>
  • Sender: owner-wri-mathgroup at

John Doty wrote:
> In[10]:= x_[s] ^:= Sin[x]
> In[11]:= Pi[s]
> Out[11]= 0
> Try defining an "argument" that operates on its "function" in any other
> language. Of course few Mathematica programmers would do anything this
> silly, and the Mathematica kernel contains many "built in functions"
> that conform to the functional convention. Nevertheless, you can go off
> the functional/procedural path in all sorts of interesting ways in
> Mathematica, and these ways really don't have close analogs in other
> languages.

In OCaml, that could be written:

  let rewrite = function
      Apply(x, [Symbol "s"]) -> Apply(Sin, [x])

The difference is only that the underlying representation of an expression
is exposed:



  Apply(Symbol "f", [Symbol "x"])

Dr Jon D Harrop, Flying Frog Consultancy Ltd.

  • Prev by Date: Re: Types in Mathematica, a practical example
  • Next by Date: Re: Types in Mathematica thread
  • Previous by thread: Re: Types in Mathematica
  • Next by thread: Re: Types in Mathematica