File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818
1919
2020(define (app-calc )
21- (let ((exp " " ) (exp2 " " ))
21+ (let ((exp " " ) (clear #t ))
2222 (glut-init)
2323 (imgui-init)
2424 ; (android)
5555
5656 (if (imgui-button " C" (imgui-make-vec2 88.0 40.0 ) )
5757 (set! exp " " )
58+ (set! clear #t )
5859 )
5960 ; ;(imgui-same-line)
6061 ; ;(if (imgui-button "+/-" (imgui-make-vec2 80.0 40.0) )
125126 )
126127
127128 (imgui-same-line)
128- (if (imgui-button " =" (imgui-make-vec2 40.0 40.0 ) )
129+ (if (and ( imgui-button " =" (imgui-make-vec2 40.0 40.0 ) ) clear ( > (string-length exp) 0 ) )
129130 ; ;(glut-log (infix-prefix (read (open-input-string exp))))
130- (set! exp (string-append exp (format " = ~a" (eval
131- (infix-prefix
132- (read (open-input-string
133- (string-append (string-append " (" exp) " )" ))))))))
131+ (begin
132+ (set! exp (string-append exp (format " = ~a" (eval
133+ (infix-prefix
134+ (read (open-input-string
135+ (string-append (string-append " (" exp) " )" ))))))))
136+ (set! clear #f ) )
137+
134138 )
135139
136140 (imgui-end)
You can’t perform that action at this time.
0 commit comments