FelixBrendel 6 лет назад
Родитель
Сommit
f34c111c2d
5 измененных файлов: 29 добавлений и 16 удалений
  1. +1
    -1
      3rd/ftb
  2. +13
    -0
      bin/tests/modules.slime
  3. +1
    -4
      src/eval.cpp
  4. +1
    -1
      src/memory.cpp
  5. +13
    -10
      src/testing.cpp

+ 1
- 1
3rd/ftb

@@ -1 +1 @@
Subproject commit 7b128b33c97060bb5a76be8d969d5318fb2cf65c
Subproject commit 60e32530367957861d503d2b6228d650d7f3b6ac

+ 13
- 0
bin/tests/modules.slime Просмотреть файл

@@ -0,0 +1,13 @@
;; (define-module math
;; :exports
;; (pi tau pow sqrt)

;; (define pi 3.1415)
;; (define tau (* 2 pi))
;; (define (pow a b) (** a b))
;; (define (sqrt a) (** a 0.5)))

;; (assert (= math::pi 3.1415))
;; (assert (= math::tau (* 2 math::tau)))

(1 2 3)

+ 1
- 4
src/eval.cpp Просмотреть файл

@@ -18,9 +18,6 @@ namespace Slime {
// - setting the parent environment // - setting the parent environment
// - setting the arg_spec // - setting the arg_spec
// - potentially evaluating the arguments // - potentially evaluating the arguments
if (arg_count == 0) {
return new_env;
}


// NOTE(Felix): Even though we will return the environment at the // NOTE(Felix): Even though we will return the environment at the
// end, for defining symbols here for the parameters, it has to be // end, for defining symbols here for the parameters, it has to be
@@ -691,7 +688,7 @@ namespace Slime {
for (auto am : ams) { for (auto am : ams) {
printf("%d\n ", am); printf("%d\n ", am);
} }
pause();
// pause();
}; };


proc push_pc_on_cs = [&] { proc push_pc_on_cs = [&] {


+ 1
- 1
src/memory.cpp Просмотреть файл

@@ -500,7 +500,7 @@ namespace Slime::Memory {
}; };


try load_built_ins_into_environment(); try load_built_ins_into_environment();
// try built_in_load(Memory::create_string("pre.slime"));
try built_in_load(Memory::create_string("pre.slime"));
return ret; return ret;
} }




+ 13
- 10
src/testing.cpp Просмотреть файл

@@ -620,17 +620,20 @@ namespace Slime {
// pop_environment(); // pop_environment();
printf("\n-- Test Files --\n"); printf("\n-- Test Files --\n");


invoke_test_script("evaluation_of_default_args");
invoke_test_script("alists");
invoke_test_script("case_and_cond");
invoke_test_script("lexical_scope");
// invoke_test_script("evaluation_of_default_args");
// invoke_test_script("case_and_cond");
// invoke_test_script("lexical_scope");
// invoke_test_script("singular_imports");
// invoke_test_script("hashmaps");
// invoke_test_script("import_and_load");
// invoke_test_script("macro_expand");
// invoke_test_script("sicp");
invoke_test_script("modules");


invoke_test_script("class_macro"); invoke_test_script("class_macro");
invoke_test_script("import_and_load");
invoke_test_script("macro_expand");
invoke_test_script("automata");
invoke_test_script("sicp");
invoke_test_script("hashmaps");
invoke_test_script("singular_imports");
// invoke_test_script("automata");
// invoke_test_script("alists");


return result; return result;
} }


Загрузка…
Отмена
Сохранить