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 1994

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

Search the Archive

Re: function definition

  • To: mathgroup at
  • Subject: Re: function definition
  • From: wself at (Will Self)
  • Date: Sun, 23 Oct 94 18:08:48 -0600

Concerning defining functions, Richard Mercer writes:

>y_ is considered to be different than x_. This is useful e.g. if you have
>f[x_Rational]:= and f[y_Integer]:=
>as then you can define different behaviors for different inputs, i.e.  
>"overload" the symbol f.

That's not really useful at all.  One can accomplish exactly the
same thing with

f[x_Rational]:= and f[x_Integer]:=

So Richard's explanation doesn't explain anything.  I'm inclined to
go along with the attitude mainly expressed so far on this question--
it really shouldn't work the way it does.  Maybe someone should send
a bug report to Wolfram and see what they reply...

Will Self
Billings, Montana

  • Prev by Date: notebooks from MathSource
  • Next by Date: Re: function definition
  • Previous by thread: Re: function definition
  • Next by thread: Re: function definition