Implement an calculator (64 bit Binary Multiplication) application using concurrent lisp
defvar a)
(defvar b)
(defvar c)
(defvar d)
(write-line " enter two numbers")
(setf a(read))
(setf b(read))
(sb-thread:make-thread(lambda()(progn(sleep 0)
(setf c(+ a b))
(print"addition")
(print c))))
(sb-thread:make-thread(lambda()(progn(sleep 0)
(setf c(- a b))
(print"Subtraction")
(print c))))
(sb-thread:make-thread(lambda()(progn(sleep 0)
(setf c(* a b))
(print"Multiplication ")
(print c))))
(sb-thread:make-thread(lambda()(progn(sleep 0)
(setf c(/ a b))
(print"Division")
(print c))))
---------------------------------------------O/P-------------------------------------------------------
pg@pg-17:~$ sbcl
This is SBCL 1.1.14.debian, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.
SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
* (load "calci.lisp")
enter two numbers
2347686465465
5675677667576
"addition"
8023364133041
"Subtraction"
-3327991202111
"Multiplication "
13324711642510134674262840
T
*
"Division"
No comments:
Post a Comment