From 7d282238bf5781f7ac8a17aa6b80e6e5a3e463aa Mon Sep 17 00:00:00 2001 From: Felix Brendel Date: Wed, 17 Jul 2019 00:43:20 +0200 Subject: [PATCH] things going well --- bin/test.slime | 3 ++- build.bat | 2 +- src/eval.cpp | 2 +- src/memory.cpp | 8 ++++---- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/bin/test.slime b/bin/test.slime index 77c6464..f338eb0 100644 --- a/bin/test.slime +++ b/bin/test.slime @@ -1,7 +1,7 @@ (import "alist.slime") (define-typed (tf n :number a :alist) - (printf n) + (printf :end " " "the number is" n "and the alist is") (pprint-alist a)) @@ -13,4 +13,5 @@ (define (test a b) (printf a b)) +(printf "addr-of test:" (addr-of test)) (test :ij :yes) diff --git a/build.bat b/build.bat index 2947668..0793b25 100644 --- a/build.bat +++ b/build.bat @@ -9,7 +9,7 @@ pushd bin taskkill /F /IM %exeName% > NUL 2> NUL echo ---------- Compiling ---------- -call timecmd cl ../src/main.cpp /std:c++latest /Fe%exeName% /W3 /Zi /nologo /EHsc /link /NODEFAULTLIB:libucrt libucrtd.lib +call ..\timecmd cl ../src/main.cpp /std:c++latest /Fe%exeName% /W3 /Zi /nologo /EHsc /link /NODEFAULTLIB:libucrt libucrtd.lib popd if %errorlevel% == 0 ( diff --git a/src/eval.cpp b/src/eval.cpp index 39ec11d..e19fb5e 100644 --- a/src/eval.cpp +++ b/src/eval.cpp @@ -427,7 +427,7 @@ proc eval_expr(Lisp_Object* node, Environment* env) -> Lisp_Object* { // is done at runtime...). That is why we sometimes have // stray macros fying around, in that case, we expand them // and bake them in, so they do not have to be expanded - // later again. + // later again. We will call this "lazy macro expansion" if (lispOperator->value.function.type == Function_Type::Macro) { *node = *result; try result = eval_expr(result, env); diff --git a/src/memory.cpp b/src/memory.cpp index 75c05d0..4bb7512 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -287,12 +287,12 @@ namespace Memory { // TODO(Felix): If argument is a list (pair), do a FULL copy, // we don't copy singleton objects - if ( - n == Memory::nil || n == Memory::t || + if (n == Memory::nil || n == Memory::t || Memory::get_type(n) == Lisp_Object_Type::Symbol || - Memory::get_type(n) == Lisp_Object_Type::Keyword - ) + Memory::get_type(n) == Lisp_Object_Type::Keyword) + { return n; + } Lisp_Object* target; try target = create_lisp_object();