Changeset 5993
- Timestamp:
- 02/02/08 00:00:57 (5 years ago)
- Location:
- lang/c/misc/mlisp
- Files:
-
- 3 modified
- 1 moved
-
mlisp.vcproj (modified) (2 diffs)
-
src/ml_builtin.h (moved) (moved from lang/c/misc/mlisp/inc/ml_builtin.h) (1 diff)
-
src/mlisp.cpp (modified) (1 diff)
-
test/main.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/c/misc/mlisp/mlisp.vcproj
r5975 r5993 33 33 <Tool 34 34 Name="VCLinkerTool" 35 OutputFile=" $(OutDir)/mlisp.exe"35 OutputFile="mlisp.exe" 36 36 LinkIncremental="2" 37 37 GenerateDebugInformation="TRUE" … … 79 79 <Tool 80 80 Name="VCLinkerTool" 81 OutputFile=" $(OutDir)/mlisp.exe"81 OutputFile="mlisp.exe" 82 82 LinkIncremental="1" 83 83 GenerateDebugInformation="TRUE" -
lang/c/misc/mlisp/src/ml_builtin.h
r5975 r5993 3 3 #include "mlisp.h" 4 4 5 #ifdef __cplusplus 6 extern "C" { 7 #endif 8 5 9 void ml_define_default_builtins(MLContext* ml); 10 11 #ifdef __cplusplus 12 } //extern "C" 13 #endif -
lang/c/misc/mlisp/src/mlisp.cpp
r5979 r5993 949 949 //============================================================================= 950 950 951 MLContext* ml_new(void) { return new MLContext; } 951 #include "ml_builtin.h" 952 953 MLContext* ml_new(void) 954 { 955 MLContext* ml = new MLContext; 956 ml_define_default_builtins(ml); 957 return ml; 958 } 952 959 void ml_delete(MLContext* ml) { delete ml; } 953 960 -
lang/c/misc/mlisp/test/main.c
r5975 r5993 2 2 #include <string.h> 3 3 #include "mlisp.h" 4 #include "ml_builtin.h"5 4 6 5 #ifndef FALSE … … 53 52 } 54 53 54 /// �Θb�� 55 int eval_file(MLContext* ml, const char* fn) 56 { 57 FILE* fp = fopen(fn, "r"); 58 if (fp == NULL) { 59 return FALSE; 60 } 61 62 for (;;) { 63 SExp r = ml_read(ml, fp); 64 if (r == cEOF) break; 65 if (r == cNL) continue; 66 67 ml_eval(ml, r); 68 } 69 70 return TRUE; 71 } 72 55 73 /// �G���g���|�C���g 56 74 int main(int argc, char* argv[]) … … 58 76 MLContext* ml = ml_new(); 59 77 60 ml_define_default_builtins(ml); 61 interact(ml, stdin, stdout); 78 if (argc < 2) { 79 interact(ml, stdin, stdout); 80 } else { 81 int i; 82 for (i=0; ++i<argc; ) { 83 const char* fn = argv[i]; 84 eval_file(ml, fn); 85 } 86 } 62 87 63 88 ml_delete(ml);
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)