Rahul Kumar Saurabh

A function in LISP that evaluate a fully parenthesized infix arithmetic expression.

Programs in lisp with output

Q. Write a function in LISP that evaluate a fully parenthesized infix arithmetic  expression.


SOFTWARE USED:  LispWorks 6.1

THEORY:-

INFIX   EXPRESSIONS
Infix notation is the common arithmetic and logical formula notation, in which operators are written infix-style between the operands.
Example-
                       ( 2 + 3 )=5
PREFIX   EXPRESSIONS
Prefix notation is written in the form as the operator is placed before the operands.
Example-
                      ( + 2 3 )=5
In LISP programming we always write our code in prefix expression.
Example-
                      ( - 9 5 ) =4

SOURCE CODE ( IF INCLUDED )
( + 6 5 )
11

RESULT:-



CONCLUSION:-
We learned about writing the function to evaluate a fully parenthesized infix arithmetic expression.