From e17aef048ef18f917d3294064c4b04be237ae648 Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Fri, 15 Sep 2017 00:00:23 -0500 Subject: [PATCH] Misc fixes and TODO updates. - Truncate ruby and python stacktraces since they can get very long in certain cases causing problems. - Fix Clojure West example with proper escaping. --- .gitignore | 1 + docs/TODO | 39 +++++++++++++++++++----------------- examples/clojurewest2014.mal | 8 ++++---- process/guide.md | 1 + python/step5_tco.py | 2 +- ruby/step5_tco.rb | 2 +- runtest.py | 1 + 7 files changed, 30 insertions(+), 24 deletions(-) diff --git a/.gitignore b/.gitignore index 279cf5c9..887b03c3 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ .sbt .npm .node-gyp +.elm */experiments */node_modules *.o diff --git a/docs/TODO b/docs/TODO index ef3b531d..a273008f 100644 --- a/docs/TODO +++ b/docs/TODO @@ -7,17 +7,13 @@ General: ./core.mal to ./lib directory - Finish guide.md - - Refactor ./run: - - java: build step, don't use mvn to run - - plpgsql: maybe combine wrap.sh and run - - vhdl: combine run_vhdl.sh and run - - vimscript: combine run_vimscript.sh and run + - mention that identifier names are suggested. some have run + into collisions with READ,EVAL,PRINT in case insensitive + languages All Implementations: - regular expression matching in runtest - add re (use in rep) everywhere and use that (to avoid printing) - - per impl tests for step5_tco, or at least a better way of - enabling/disabling/tweaking per implementation - fix stepA soft failures: lua matlab miniMAL perl racket Other ideas for All: @@ -55,15 +51,11 @@ Bash: C: - come up with better way to do 20 vararg code - - GC: use http://www.hboehm.info/gc/ C#: - accumulates line breaks with mal/clojurewest2014.mal - interop: http://www.ckode.dk/programming/eval-in-c-yes-its-possible/ -Clojure: - - fix "\/" exception in mal/clojurewest2014.mal - CoffeeScript: - make target to compile to JS @@ -77,9 +69,9 @@ Haskell: - immediately exits mal/clojurewest2014.mal ("\/" exception) Java: + - build step, don't use mvn in run script - Use gradle instead of mvn http://blog.paralleluniverse.co/2014/05/01/modern-java/ - - MAL formatting is a bit off with mal/clojurewest2014.mal Javascript: - interop: adopt techniques from miniMAL @@ -87,9 +79,6 @@ Javascript: Make: - allow '_' in make variable names - hash-map with space in key string - - Fix: make -f stepA_mal.mk ../mal/step6_file.mal - (slurp "../tests/incA.mal") - (read-string "(+ 2 3)") - errors should propagate up from within load-file - GC: expore using "undefined" directive in Make 3.82 @@ -97,9 +86,6 @@ Mal: - line numbers in errors - step5_tco -MATLAB: - - Port to support both GNU Octave and MATLAB - miniMAL: - figure out why {} literals are "static"/persistent @@ -107,6 +93,9 @@ ObjPascal: - verify that GC/reference counting works - fix comment by itself error at REPL +plpgsql: + - maybe combine wrap.sh and run + Perl: - fix metadata on native functions - fix extra line breaks at REPL @@ -116,6 +105,14 @@ Postscript: - fix blank line after comments - fix command line arg processing (doesn't run file specified) +Powershell: + - convert function with "abc_def" to "abc-def" + - remove extraneous return statements at end of functions + - remove unnecessary semi-colons + - use ArrayList instead of Array for performance + - new test to test Keys/keys as hash-map key + - test *? predicates with nil + R: - tracebacks in errors - fix running from different directory @@ -129,3 +126,9 @@ Rust: Scala - readline - fix exception when finished running something on command line + +VHDL: + - combine run_vhdl.sh and run + +vimscript: + - combine run_vimscript.sh and run diff --git a/examples/clojurewest2014.mal b/examples/clojurewest2014.mal index 2b5be9c6..98fcf17f 100755 --- a/examples/clojurewest2014.mal +++ b/examples/clojurewest2014.mal @@ -25,10 +25,10 @@ (list (list (title2 " __ __ _ _") - (title2 "| \/ | / \ | |") - (title2 "| |\/| | / _ \ | | ") - (title2 "| | | |/ ___ \| |___ ") - (title2 "|_| |_/_/ \_\_____|")) + (title2 "| \\/ | / \\ | |") + (title2 "| |\\/| | / _ \\ | | ") + (title2 "| | | |/ ___ \\| |___ ") + (title2 "|_| |_/_/ \\_\\_____|")) (list (title "gherkin") "- a lisp1 written in bash4") diff --git a/process/guide.md b/process/guide.md index cd17969b..2da87827 100644 --- a/process/guide.md +++ b/process/guide.md @@ -1329,6 +1329,7 @@ implementation. Let us continue! * In the main program, use the `rep` function to define two new control structures macros. Here are the string arguments for `rep` to define these macros: + * TODO: note throw is not present until step9 * `cond`: "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))" * `or`: "(defmacro! or (fn* (& xs) (if (empty? xs) nil (if (= 1 (count xs)) (first xs) `(let* (or_FIXME ~(first xs)) (if or_FIXME or_FIXME (or ~@(rest xs))))))))" diff --git a/python/step5_tco.py b/python/step5_tco.py index da338d41..8b714cef 100644 --- a/python/step5_tco.py +++ b/python/step5_tco.py @@ -97,4 +97,4 @@ while True: print(REP(line)) except reader.Blank: continue except Exception as e: - print("".join(traceback.format_exception(*sys.exc_info()))) + print("".join(traceback.format_exception(*sys.exc_info())[0:100])) diff --git a/ruby/step5_tco.rb b/ruby/step5_tco.rb index a6a82d46..059bb55a 100644 --- a/ruby/step5_tco.rb +++ b/ruby/step5_tco.rb @@ -103,6 +103,6 @@ while line = _readline("user> ") puts REP[line] rescue Exception => e puts "Error: #{e}" - puts "\t#{e.backtrace.join("\n\t")}" + puts "\t#{e.backtrace[0..100].join("\n\t")}" end end diff --git a/runtest.py b/runtest.py index c3735ade..1930b62c 100755 --- a/runtest.py +++ b/runtest.py @@ -127,6 +127,7 @@ class Runner(): new_data = new_data.decode("utf-8") if IS_PY_3 else new_data #print("new_data: '%s'" % new_data) debug(new_data) + # Perform newline cleanup if self.no_pty: self.buf += new_data.replace("\n", "\r\n") else: -- 2.20.1