Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(48)  |  Call(46)  |  Derive(0)  |  Import(2)

src/d/i/diy-lisp-HEAD/tests/test_7_using_the_language.py   diy-lisp(Download)
from os.path import dirname, relpath, join
 
from diylisp.interpreter import interpret, interpret_file
from diylisp.types import Environment
 
def test_not():
    assert_equals("#t", interpret('(not #f)', env))
    assert_equals("#f", interpret('(not #t)', env))
 
 
def test_or():
    assert_equals("#f", interpret('(or #f #f)', env))
    assert_equals("#t", interpret('(or #t #f)', env))

src/d/i/diy-lisp-HEAD/tests/test_sanity_checks.py   diy-lisp(Download)
# -*- coding: utf-8 -*-
 
from nose.tools import assert_equals
 
from diylisp.interpreter import interpret
 
    env = Environment()
    interpret(program, env)
 
    assert_equals("6", interpret("(gcd 108 30)", env))
    assert_equals("1", interpret("(gcd 17 5)", env))