Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1996
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*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 smc.vnet.net
  • Subject: [mg4173] Re: Problem with condition in function definition !
  • From: roth at sunny.mpimf-heidelberg.mpg.de (Arnd Roth)
  • Date: Tue, 11 Jun 1996 00:52:26 -0400
  • Organization: Max-Planck-Institut fuer Medizinische Forschung
  • Sender: owner-wri-mathgroup at wolfram.com

In article <4p5s5n$ff2 at dragonfly.wolfram.com>
a_kowald at chemie.fu-berlin.de (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
Global`bla

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

Sincerely,

Arnd Roth
Abteilung Zellphysiologie
Max-Planck-Insitut fuer Medizinische Forschung
Postfach 10 38 20, D-69028 Heidelberg, Germany
http://sunny.mpimf-heidelberg.mpg.de/people/roth/ArndRoth.html

==== [MESSAGE SEPARATOR] ====


  • 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 !