summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2017-10-20 21:35:01 +0200
committerHugo Hörnquist <hugo@hornquist.se>2017-10-20 21:35:01 +0200
commit73c2b4c02121dcf27889642ce4ff0f888119347b (patch)
tree9678d4f2214737f075bfcbbd7884623931c3b05f
parentadded small comment about what an invalid expression is (diff)
downloadmath-parse-73c2b4c02121dcf27889642ce4ff0f888119347b.tar.gz
math-parse-73c2b4c02121dcf27889642ce4ff0f888119347b.tar.xz
made code work standalone in guile
-rw-r--r--math-parser.scm7
1 files changed, 7 insertions, 0 deletions
diff --git a/math-parser.scm b/math-parser.scm
index 1006926..826c9bd 100644
--- a/math-parser.scm
+++ b/math-parser.scm
@@ -1,3 +1,10 @@
+(use-modules (srfi srfi-1))
+
+(define (contains-false? list)
+ (fold (lambda (item prev)
+ (if prev #t (eqv? item #f)))
+ #f list))
+
; parses a function written in mathematical notation to lisp notation
; currently handles (+ - * / ^). It does respect the order of operations
(define (parse-math str)