From 73c2b4c02121dcf27889642ce4ff0f888119347b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Fri, 20 Oct 2017 21:35:01 +0200 Subject: made code work standalone in guile --- math-parser.scm | 7 +++++++ 1 file changed, 7 insertions(+) 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) -- cgit v1.2.3