# ----
#
# Test for recursive evaluation
#

a=a*2
a
# >> a*2
Clear(a)

# ----
#
# Test for parameter expression assignations in lazy function evaluations
#

f(x)=x
g(x)=f(x)
g(y)
#    >> f(y)
# or >> y
  
g(1)
# >> 1
  
# ----
#
# Test for matrix extractions on lazy functions
#
  
f(x)=[1,2,x]
f(x)[0]
# >> 1
f(y)[2]
# >> y

# ----
#
# Test for parameter evaluation correctness
#
f(x,y)=x+y
f(a,1+x)
#  >> a+1+x
#
# The Variable::noSubstitute member is there to check against
f(y,1)
# being evaluated as 2 instead of  
#  >> y+1

# ----
#
# Test for Operator::simplify
# The purpose of this test is see what does Operator do when it
# can simplify tree1 but it can't simplify tree2
#
  
f(x)=Sin(x)/2
f(0)
# >> shouldn't crash :-)
  
#----
#
#
# "Simply tests" (not "simple" in any way :) )
# ----

3x
# >> 3*x
x=2
f(x)=x+1
f(3x)
# >> 7
Clear(x)

# ----

f(x)=Cos(3*x)
f(2y)
g(x)=f(35+Sin(x))
g(z)
# >> f(35+Sin(z))
g(2+x)
# >> f(35+Sin(2+x))
g(1)
# >> 0.758191

# ----

g(x,y)=f(x)[y]
f(x)=[1,2,3,x,5,6,7,2*x,8,9]
g(x,y)
f(x)[y]
g(1,3)
# >> 1
g(y,7)
# >> 2*y
g(x,y)=f(x/4)[y+1]
g(1,2)
# >> 0.25
g(y,6)
#  >> 2*y/4
g(3z,6)
#  >> 2*3*z/4
