new file:   test_pattern
add extend_environment for apply
for apply lambda
need not use global environment.