Merge branch 'master' of http://gitea.stocksriddle.one/vaclavt/mlisp
This commit is contained in:
commit
e5b6f52569
|
|
@ -5,3 +5,4 @@ ml
|
|||
.DS_Store
|
||||
CMakeFiles
|
||||
Testing
|
||||
.cache
|
||||
|
|
|
|||
2
ml.cpp
2
ml.cpp
|
|
@ -2225,7 +2225,7 @@ std::map <const std::string, Builtin> 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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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 "<body" 0))
|
||||
(define web2 (string-substr web pos 1000000))
|
||||
|
||||
; remove scripts
|
||||
(define web3 (string-replace web2 "<script(.*?)>((.|\r?\n)*?)</script>" ""))
|
||||
|
||||
; extract tables
|
||||
|
||||
(print web3)
|
||||
Loading…
Reference in New Issue