MathGroup Archive 2010

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

Search the Archive

Re: Function argument types

  • To: mathgroup at smc.vnet.net
  • Subject: [mg112960] Re: Function argument types
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Thu, 7 Oct 2010 03:39:16 -0400 (EDT)

_h is a pattern for an expression with head h

http://reference.wolfram.com/mathematica/ref/Blank.html

pattern?test applies a function test to the whole expression matched by pattern to determine whether there is a match.

http://reference.wolfram.com/mathematica/tutorial/PuttingConstraintsOnPatterns.html

You would need to use f[n_?IntegerQ] rather than what you wrote.


Bob Hanlon


---- Sam Takoy <sam.takoy at yahoo.com> wrote: 

=============
Hi,

I can't see to find the answer to this basic question:

What's the difference between

f[n_?Integer]:=

and

f[n_Integer]:=

I would be happy to read more about this, but what's the keyword?

Thanks,

Pavel



  • Prev by Date: Re: used by LogLogPlot?
  • Next by Date: A list based table join?
  • Previous by thread: Re: Function argument types
  • Next by thread: Re: Function argument types