diff options
-rw-r--r-- | full-parse.rkt | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/full-parse.rkt b/full-parse.rkt index df1118c..a20583c 100644 --- a/full-parse.rkt +++ b/full-parse.rkt @@ -44,6 +44,13 @@ string->number string->symbol) (string c))) + ; goes from a list of chars to a number + ; returns #f if conversion is not possible + (define (make-number expr) + (if (list? expr) + (string->number (list->string expr)) + expr)) + ; creates a fucntion for the current operator, ; with a function call for the next operatior as a parameter (define (create-trace expr ops) @@ -51,7 +58,7 @@ ;(display expr) (newline) (get-general expr (car ops) (if (null? (cdr ops)) - (lambda (x) x) + (lambda (x) (make-number x)) (create-trace expr (cdr ops)))))) ; start the function, with the operations |