Dirty_Programmer
Dirty_Programmer

Reputation: 107

Whats 'T' at the end in SBCL

I am new at SBCL programming and I ran a simple Addition program:

    (defvar a)
    (defvar b)
    (defvar c)
    (defvar d)
    (write-line "Enter A:")
    (setf a (read))
    (write-line "Enter B:")
    (setf b (read))
    (format t "~D + ~D = ~D~%" a b (+ a b))

Output:

    * (load "lisp_calculator.lisp")
    Enter A:
    12
    Enter B:
    12
    A + B = 24
    T   <--------- Whats This
    *

That 'T' is no any trouble to me but i am just curious.

I was thinking to make a multi threading program which will parallely do arithmetic operations so i am using SBCL and not CLISP. am on Kali Linux 2.0

Upvotes: 1

Views: 194

Answers (1)

alpert
alpert

Reputation: 4655

In Lisp every function returns/evaluates to a value. T here is the return value of load and it generally indicates true.

From Common Lisp the Language:

Any data object other than nil is construed to be Boolean 'not false', that is, 'true'. The symbol t is conventionally used to mean 'true' when no other value is more appropriate. When a function is said to 'return false' or to 'be false' in some circumstance, this means that it returns nil. However, when a function is said to 'return true' or to 'be true'' in some circumstance, this means that it returns some value other than nil, but not necessarily t.

Upvotes: 4

Related Questions