From 88fee2a2a269d9642aea94255dea3699def4896e Mon Sep 17 00:00:00 2001 From: VaclavT Date: Thu, 27 Jan 2022 00:00:18 +0100 Subject: [PATCH 1/5] typo fix --- ml.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ml.cpp b/ml.cpp index 3fa8a52..bae7d28 100644 --- a/ml.cpp +++ b/ml.cpp @@ -2225,7 +2225,7 @@ std::map builtin_funcs // Get the value associated with this name in this scope MlValue MlEnvironment::get(const std::string &name) const { // PERF, here can be a few of for fast access - if (name == "defe") return MlValue("def", builtin::define); + if (name == "def") return MlValue("def", builtin::define); if (name == "if") return MlValue("if", builtin::if_then_else); if (name == "lambda") return MlValue("lambda", builtin::lambda); From 198c4b2c4d5ebf34a9771559e8ef5be69eab7b7a Mon Sep 17 00:00:00 2001 From: VaclavT Date: Thu, 27 Jan 2022 00:01:45 +0100 Subject: [PATCH 2/5] nothing important --- .gitignore | 1 + tmp/html_scrap.lsp | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 tmp/html_scrap.lsp diff --git a/.gitignore b/.gitignore index ab21d4a..f6b9e46 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ ml .DS_Store CMakeFiles Testing +.cache diff --git a/tmp/html_scrap.lsp b/tmp/html_scrap.lsp new file mode 100644 index 0000000..9b631ef --- /dev/null +++ b/tmp/html_scrap.lsp @@ -0,0 +1,15 @@ + +;read file +(define web (read-file "/tmp/finviz_quote_syf.html")) +(print "file read") + +; remove head section +(define pos (string-find web "((.|\r?\n)*?)" "")) + +; extract tables + +(print web3) From c6bd4e519bb537ad43575a7e6d134f55ccb5cb17 Mon Sep 17 00:00:00 2001 From: vaclavt Date: Thu, 27 Jan 2022 00:15:55 +0100 Subject: [PATCH 3/5] better cmake --- utils/local_install.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/utils/local_install.sh b/utils/local_install.sh index bd31637..7752359 100755 --- a/utils/local_install.sh +++ b/utils/local_install.sh @@ -1,9 +1,10 @@ #!/bin/sh echo "cleaning" -cmake --build ./build --config Release --target clean -j 4 -- +cmake -DCMAKE_BUILD_TYPE=Release . +cmake --build ./ --target clean -j 4 -- echo "building ml" -cmake --build ./build --config Release --target all -j 4 -- +cmake --build ./ --target all -j 4 -- echo "" echo "copying lsp files" @@ -12,13 +13,13 @@ cp stdlib/*.lsp /usr/local/var/mlisp/ echo "copying doc files" cp doc/*.md /usr/local/var/mlisp/ echo "copying ml file" -cp ./build/ml /usr/local/bin/ml +mv ./ml /usr/local/bin/ml + + echo "" echo "if syntax has changed you may use" echo "cp utils/Lisp.tmLanguage ~/.vscode/extensions/mattn.lisp-0.1.12/syntaxes/" -echo "or" -echo "cp utils/Lisp.tmLanguage ~/.vscode/extensions/mattn.lisp-0.1.12/syntaxes/" echo "" ml -v From ba4f4e40ecaaabf841b90f6e613e578c370e4807 Mon Sep 17 00:00:00 2001 From: vaclavt Date: Thu, 27 Jan 2022 00:19:21 +0100 Subject: [PATCH 4/5] small fixed --- Readme.md | 2 +- stdlib/stdlib.lsp | 2 +- utils/Lisp.tmLanguage | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Readme.md b/Readme.md index 0ea34de..668bc5c 100644 --- a/Readme.md +++ b/Readme.md @@ -79,7 +79,7 @@ utils/local_install.sh - execute system command should capture stderr - add some mem stats to benchmark - order of arguments in functions like member and filter - filter swap lambda and list -- better output of !e in repl +- better output of !e in repl (resp !e !ee) #### Doc - fix man entry on (member) example and retval diff --git a/stdlib/stdlib.lsp b/stdlib/stdlib.lsp index 777aad7..e075b41 100644 --- a/stdlib/stdlib.lsp +++ b/stdlib/stdlib.lsp @@ -228,7 +228,7 @@ nil (do (def minn (index l 0)) - (def i 1) + (def i 1) (while (< i (len l)) (if (< (index l i) minn) (set! minn (index l i))) diff --git a/utils/Lisp.tmLanguage b/utils/Lisp.tmLanguage index d23942d..8666e2f 100644 --- a/utils/Lisp.tmLanguage +++ b/utils/Lisp.tmLanguage @@ -51,7 +51,7 @@ match - (?:\()((?i:defn|def|lambda)+) + (?:\()((?i:def|defn|lambda)+) name meta.function.lisp @@ -136,13 +136,13 @@ match - (?<=\()(?i:\*|\*\*|\*\*\*|\+|\+\+|\+\+\+|\-|/|//|///|/=|1\+|1\-|<|<=|=|>|>=|if|cond|do|for|while|scope|quote|defn|and|or|set!|eval|type|parse|list|insert|index|remove|len|push|pop|head|tail|first|last|range|map|filter|reduce|exit|quit|print|input|random|include|read-file|read-file-lines|write-file|read-url|system-cmd|ls-dir|is-file?|is-dir?|tcp-server|tcp-client|parse-csv|parse-json|get-universal-time|date-to-str|str-to-date|date-add|debug|sprintf|display|string-replace|string-replace-re|string-regex?|string-regex-list|string-split|string-pad|string-rltrim|string-case|string-len|string-substr|string-find|benchmark|thread-create|thread-under-lock|thread-sleep|threads-join|try|throw|usql|first|second|third|fourth|fifth|sixth|seventh|eight|nth|print|get-universal-time|not|is-pos?|is-neg?|neg|dec|inc|string-ltrim|string-rtrim|string-trim|string-rpad|string-lpad|string-upcase|string-downcase|string-join|itok|ktoi|sleep|get-env|member|make-list-of|make-list|empty-list?|uniq|flatten|quick-sort-by|quick-sort|quick-sort-reverse|start-of-day|end-of-day|start-of-month|start-of-next-month|end-of-next-month|end-of-month|start-of-prev-month|end-of-prev-month|start-of-year|end-of-year|make-csv)(?=\s+) + (?<=\()(?i:\*|\*\*|\*\*\*|\+|\+\+|\+\+\+|\-|/|//|///|/=|1\+|1\-|<|<=|=|>|>=|if|cond|do|for|while|scope|quote|and|or|set\!|eval|type|parse|list|insert|index|remove|len|push|pop|head|tail|first|last|range|map|filter|reduce|exit|quit|print|input|random|include|read-file|read-file-lines|write-file|read-url|system-cmd|ls-dir|is-file?|is-dir?|tcp-server|tcp-client|parse-csv|parse-json|get-universal-time|date-to-str|str-to-date|date-add|debug|sprintf|display|string-replace|string-replace-re|string-regex?|string-regex-list|string-split|string-pad|string-rltrim|string-case|string-len|string-substr|string-find|benchmark|thread-create|thread-under-lock|thread-sleep|threads-join|try|throw|usql|first|second|third|fourth|fifth|sixth|seventh|eight|nth|print|get-universal-time|not|is-pos?|is-neg?|neg|dec|inc|string-ltrim|string-rtrim|string-trim|string-rpad|string-lpad|string-upcase|string-downcase|string-join|itok|ktoi|sleep|get-env|member|make-list-of|make-list|empty-list?|uniq|flatten|quick-sort-by|quick-sort|quick-sort-reverse|start-of-day|end-of-day|start-of-month|start-of-next-month|end-of-next-month|end-of-month|start-of-prev-month|end-of-prev-month|start-of-year|end-of-year|make-csv)(?=\s+) name keyword.control.lisp match - (?<=^|\s|[()])(?i:nil|t)(?=$|\s|[()]) + (?<=^|\s|[()])(?i:nil|\#t)(?=$|\s|[()]) name constant.language.lisp From 88944ea33b3a191545069628f233d8e7db91f76f Mon Sep 17 00:00:00 2001 From: vaclavt Date: Thu, 27 Jan 2022 21:27:25 +0100 Subject: [PATCH 5/5] settings --- .vscode/settings.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 9d0daf7..4af29b7 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -74,5 +74,6 @@ "__functional_base_03": "cpp", "charconv": "cpp", "cinttypes": "cpp" - } + }, + "cmake.configureOnOpen": false } \ No newline at end of file