Exemplo n.º 1
0
def test_1():
    code = '''\
    (+jojo c :x!
      `(a (@ :x :x mul) b (@ :x :x mul) c))
    (+jojo t 4 c list->vect vect-spread)
    '''
    sexp_vect = jojo.parse_sexp_vect(jojo.code_scan(code))
    module = jojo.compile_module(__name__ + 'test_1', sexp_vect)
    vm = jojo.VM([], [jojo.RP(module.t)])
    vm = vm.exe()
    assert vm.ds == ["a", 16, "b", 16, "c"]
Exemplo n.º 2
0
def test_1():
    code = '''\
    (+jojo c
      (list 1 2 add dup))
    (+jojo t
      c list->vect vect-spread)
    '''
    sexp_vect = jojo.parse_sexp_vect(jojo.code_scan(code))
    module = jojo.compile_module(__name__ + 'test_1', sexp_vect)
    vm = jojo.VM([], [jojo.RP(module.t)])
    vm = vm.exe()
    assert vm.ds == [3, 3]