From 5831d02aa5224ed0b0af20b31540077b95668c82 Mon Sep 17 00:00:00 2001 From: pavelyakov Date: Fri, 7 Dec 2018 11:40:32 +0000 Subject: [PATCH] Lisp v1.3 new example git-svn-id: svn://kolibrios.org@7566 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/lisp/lisp.c | 15 +++------------ programs/cmm/lisp/stdcall.h | 5 ++++- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/programs/cmm/lisp/lisp.c b/programs/cmm/lisp/lisp.c index fc7a9169e1..344cb75b6a 100644 --- a/programs/cmm/lisp/lisp.c +++ b/programs/cmm/lisp/lisp.c @@ -165,7 +165,7 @@ void main() { dword brainFuckCode = 0; word maxLoop = 1000; - dword txt = "(print (input \"test:\"))"; + dword txt = "(set name (input \"Enter you name: \"))(print \"You name \" (get name))"; buffer = malloc(bufferSize); memory = malloc(memoryBrainfuck); @@ -178,16 +178,7 @@ void main() IF(io.read(I_Param)) { code = EAX; - loop() - { - WHILE(DSBYTE[code] == ' ') code++; - IF(DSBYTE[code]!='(') BREAK; - ELSE code++; - evalLisp(); - code--; - IF(DSBYTE[code]!=')') BREAK; - ELSE code++; - } + evalLisp(); } } else @@ -199,7 +190,7 @@ void main() con_printf stdcall ("\r\n\r\nEnter code: "); con_gets stdcall(buffer, bufferSize); code = EAX; - //code = txt; + code = txt; con_printf stdcall ("Output: "); evalLisp(); maxLoop--; diff --git a/programs/cmm/lisp/stdcall.h b/programs/cmm/lisp/stdcall.h index c3bea536af..d424aa3ff7 100644 --- a/programs/cmm/lisp/stdcall.h +++ b/programs/cmm/lisp/stdcall.h @@ -65,9 +65,11 @@ :dword std_print(dword count, args) { dword ret = 0; + consoleInit(); WHILE(count) { - con_printf stdcall (DSDWORD[args]); + IF(!DSDWORD[args]) con_printf stdcall ("nil"); + ELSE con_printf stdcall (DSDWORD[args]); args+=4; count--; } @@ -77,6 +79,7 @@ :dword std_input(dword count, args) { dword buf = 0; + consoleInit(); buf = malloc(100); WHILE(count) {