fork download
  1. (defun read-int-and-echo (label)
  2. (format t "Enter ~A: " label)
  3. (finish-output)
  4. (let* ((line (read-line))
  5. (n (parse-integer line :junk-allowed t)))
  6. (format t "~D~%" n)
  7. n))
  8.  
  9. (let* ((a (read-int-and-echo "A"))
  10. (b (read-int-and-echo "B")))
  11. (format t "~D + ~D = ~D~%" a b (+ a b)))
Success #stdin #stdout 0.02s 28772KB
stdin
2
2
stdout
Enter A: 2
Enter B: 2
2 + 2 = 4