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 1996

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

Search the Archive

Re: Problem with condition in function definition !

  • To: mathgroup at
  • Subject: [mg4173] Re: Problem with condition in function definition !
  • From: roth at (Arnd Roth)
  • Date: Tue, 11 Jun 1996 00:52:26 -0400
  • Organization: Max-Planck-Institut fuer Medizinische Forschung
  • Sender: owner-wri-mathgroup at

In article <4p5s5n$ff2 at>
a_kowald at (Axel Kowald) writes:

> For some reason I'd like to define a function with condition in the following way:
> b=1
> bla[t_]/;(t<b) := {a,b,c}
> bla[0] gives {a,b,c}, fine. But now I want to clear b, Clear[b], and still get 
> the same result. So really I want to type 1 instead of b, but for some reason
> can't do it.
> Any idea what I have to do ?

How about this?

In[1]:= b = 1
Out[1]= 1

In[2]:= bla[t_] /; Evaluate[t < b] := {a, b, c}

In[3]:= bla[0]
Out[3]= {a, 1, c}

In[4]:= bla[1]
Out[4]= bla[1]

In[5]:= Clear[b]

In[6]:= bla[0]
Out[6]= {a, b, c}

In[7]:= bla[1]
Out[7]= bla[1]

In[8]:= ?bla

bla[t_] /; t < 1 := {a, b, c}


Arnd Roth
Abteilung Zellphysiologie
Max-Planck-Insitut fuer Medizinische Forschung
Postfach 10 38 20, D-69028 Heidelberg, Germany


  • Prev by Date: Re: (Q) Mathematica and Microsoft Equation Editor ?
  • Next by Date: Re: desperately seeking better minimax approximation package
  • Previous by thread: Problem with condition in function definition !
  • Next by thread: Re: Problem with condition in function definition !