label .label1 -text "Sum of"
entry .a -width 6 -relief sunken -textvariable a
entry .b -width 6 -relief sunken -textvariable b
label .label2 -text "Result"
label .s -textvariable s
pack .label1 .a .b .label2 .s -side left -padx 1m -pady 2m
bind .a {set s [callLisp sum $a $b]}
bind .b {set s [callLisp sum $a $b]}])
(defun sum (a b)
(+ a b))
when I type in number 1 in entry and press Enter this happens
The value
"1"
is not of type
NUMBER
[Condition of type TYPE-ERROR]
tcl treats everything like strings but how to convert it to number for function sum, any ideas.
Regards
Hello there
Today I try cltcl, looks fine when you run following code
(in-package "CL-USER")
(defun window (&KEY (INTERPRETER CLTCL:INTERPRETER) OPTIONS) "Runs the Common Lisp window." (cltcl:event-loop (viewer) :interpreter interpreter :options options))
(defun viewer ()
TCL[
package require Tk namespace import ::cltcl::callLisp
label .label1 -text "Sum of" entry .a -width 6 -relief sunken -textvariable a entry .b -width 6 -relief sunken -textvariable b label .label2 -text "Result" label .s -textvariable s pack .label1 .a .b .label2 .s -side left -padx 1m -pady 2m bind .a {set s [callLisp sum $a $b]}
bind .b {set s [callLisp sum $a $b]}])
(defun sum (a b) (+ a b))
when I type in number 1 in entry and press Enter this happens The value "1" is not of type NUMBER [Condition of type TYPE-ERROR] tcl treats everything like strings but how to convert it to number for function sum, any ideas. Regards