trivial tests for t language

classic and sexpression for t language, pass some trivial tests.
bug fix: getvalue of recursive object

when getvalue of recursive object, infinite recursive call to getvalue, fix it by using memo.
figthing with the bug in passing DummyVar as function's arguments

bug with closure var and is_?
solution: don't pass value by DummyVar, some(statement(_stmt), _stmt, stmt_list)
    if isinstance(exps[0] , DummyVar):
      yield argument_cont, exps[0]
    else: yield solver.cont(exps[0], argument_cont), True
now another bug: DummyVar bring same value out every time?
  def test_Case1(self):
    x = preparse(v.x)
    eq_(preparse(case(x).of(1)[prin(1)].of(2,3)[prin(4)].els[prin(5)]),
        special.CaseForm(x,{1:(prin(1),), 2:(prin(4),), 3:(prin(4),)}, (prin(5),)))
fix the bug in passing DummyVar as function's arguments

bug with closure var and is_, which is from passing DummyVar as function's arguments, see previous commit message for more informations.
solution: pass BuiltinPredicate by DummarVar itself, pass BuiltinFunction by value of DummyVar.
dinpy/samples become tests

dinpy/samples: hello.py, interactive.py, parse_interactive.py, sample.py become tests in testdinpy.py
add NullVar

add NullVar, which do nothing and always succeed when unify.
binary expression 1+1, fix some bugs

classic grammar, binary expression: 1+1 passed

fix bug: change the __repr__ of Var by mistake when adding NullVar.
fix bug: the warnings: GeneratorExit ignored
fix bug: in make_rules, the index of arity2signatures is wrong
bug fix: memo result don't meme fail of rules; t\operator.py bad mistake

bug fix: memo result don't meme fail of rules.
    if len(sign_state2cont)==1:
      for c, v in self.apply(solver, memo_result_cont, values, signatures):
        yield c, v
      if not have_result[0]:   # update 2011-11-15 14:35:26
        solver.sign_state2results[sign_state] = []

t\operator.py bad mistake: solver.parse_state mispelled: solver.parser_state
binary expression 1+2*3 passed tests. save env and values in memo result.

save values in memo result
bug fix: Var:: deref(self, env)
remove Var.new()
bug fix: not_p restore solver.parse_state when fail.
bug fix: save env in memo sign_state2cont.insert(i, (solver.call_path, cont, **solver.env**))
bug fix: classic.py: identifier use terminal.uLetterdigitString by mistake. add termial.identifier.
print statement and let statement

let statement: let bindings do statement
print statement: print expression
if-elif-else, case, {}, loop-times statement

loop-times statement: get_label, push_label, pop_label
case statement
if-elif-else statement

add statement_sequence function

split classic.py to two module: classic and classic_utils
loop-until statement

loop-until statement
modify:
  get_label(solver, cont),
  push_label(solver, cont, control_struct_type, label),
  pop_label(solver, cont, control_struct_type)
  identifier: don't use keyword as identifier
some frequent used terminals relating to char and space

char2, ch, chs0, chs,
space, tab, tabspace, whitespace, newline,
spaces0, tabs0, tabspaces0, whitespaces0, newlines0,
spaces, tabs, tabspaces, whitespaces, newlines.
while loop, loop while passed tests. fix a bug in Command.run relating to env.

loop-while tests failed for the bug below, passed after fix it:
bug fix:
	--- solver = env.extend({}) ---
        ===>
        solver.env = env
        env.bindings = old_bindings.copy()
        --- #env.bindings.update(memo) ---
        for _ in unify_list(vals, result_head, solver.env):
          yield c, value
        env.bindings = old_bindings
block, redo, break, pass, error, pad_tabspaces, tabspaces_if_needed

block statement, redo statement
break statement
pass statement

builtin error for debug
fun macro grammar and other stuffs, not finished.

fun and macro grammar, indent, comment, some related builtins. not finished and not tested. old tests corrupted.

will make a new dao compiler branch
some experiment for compiler

some tests for builtin function, predicate, macro, set, begin, define, quote, and so on.
use double continuations, pass many tests

use double continuations, pass many tests: integer, begin, quote, set, eval_, if_, let, letr, function, builtin.function, builtin.predicate, and so on.
all tests in testeval.py except testcut passed.

pytry. eachform, loop form pass tests.
builtins\control.py, builtins\arith.py pass tests, refactor builtin's signature to remove argument cont

builtins\control.py, builtins\arith.py is modified for double continuations
refactor builtin's signature, the_builtin(solver, cont, ...) becomes the_builtin.py(solver, ...)
unify, unify_list is ready for double continuations
fix a bug in some fconts: solver.scont = old_fcont; instead of solver.fcont = old_fcont