def main () : "get S expressions and evaluate them. Print the results" global Alist while 1 : try : s = lispio.getSexp() except : break try : print lispio.putSexp(eval(s ,Alist)) except : print '???'
def POST(self): Alist=lisp.Alist global data1 form = my_form() form.validates() #f = open('test.txt','w') data1 = form.value['textfield'] #f.write(str(data1)) try: s=lispio.getSexp() except: return "Invalid Input" #f.write(str(s)) #f.close() try: list1=lispio.putSexp(eval(s,Alist)) #return str(list1) return str(list1) except: return "???"
#define analyse def define_analyser(exp): name = def_var(exp) par = def_par(exp) body = def_body(exp) if name in identifiers: print "identifier defined earlier:",name else: identifiers.append(name) if issymbol(exp[1:][0]): to_py_decl(exp[1:][0],exp[1:][1:][0]) else: to_py_def(name,par,body) #to_py_array def to_py_array(l): print "[", arg_list(l) print "]" while 1: try: s_exp_list = lispio.getSexp() except: break try: analyse(s_exp_list) except: print '???'