Package: lisp-emulator
Lisp Emulator - Version 1.0.2-----------------------------About Lisp--------------Lisp is a functional programming language, first introduced inthe end of the 1950's, by John Mcarthy, who was a renowned computerscientist. Since then, many dozens of dialects of lisp have been developed.The main dialects of nowadays are Common Lisp and Scheme.About the project------------------The project focuses on emulating a very basic environment of an environmentwhich resembles common-lisp syntax and other compatiable older versions.All of the code is written in python.List of all of the basic methods which is introduced in the release:Side Notes:--------------Lisp is written in a prefix notation, and the code is insideparanthesis.- Like Lisp, this implementation isn't case sensitive.Arithmetic Operators------------------------+ , - , * , / - Addition, Subtraction, Multiplication, DivisionThose operators can receive an "infinite" number of parameters.Examples:>>> ( + 5 6 8 )19>>> ( - 8 2 1 )5>>> ( + 6 4 ( - 5 2 ) )13>>> ( * 7 3 )21>>> ( / 6 2 )3Output-----------------PRINT or WRITE, for example:>>> ( print "hello" )"HELLO"Predicates---------------------predicates return a boolean-like value - T ( for true ), and NIL ( the equivalent of false ).ZEROP - evaluates to T if the number is 0, else to NILEVENP - evaluates to T if the number is odd, else to NILODDP - evaluates to T if the number is even, else to NILLESSP - evaluates to T if the first value is smaller than the otherGREATERP - evaluates to T if the first value is bigger than the otherNUMBERP - evaluates to T if the value is a number, else to NILSTRINGP - evaluates to T if the value is string ( by the double quotation ".." mark )else, to NILEquality Operation-----------------------------Equality can be performed via the = operator that can receivean indefinite number of parameters or the EQ method that receives only 2 parameters.Those methods return T if all the expressions are equal, else NIL.Mathematical Operations And Constants---------------------------PI Constant - PI is a global constant, and representsapproximately 3.1415926535.E Constant - E is a global constant, and represents approximately2.71828182846.Trigonometric operations - handled in radians-----------------------------------------------SIN- receives a parameter and returns its sinefor example:>>> ( sin ( / PI 2 ) )1.0COS - receives a parameter and returns its cosineTAN - receives a parameter and returns its tangentASIN - The reverse operation of SIN.receives a parameter within range of -1 and 1 andreturns the angle that its sine equals to the parameter (in radians)ACOS - The reverse operation of COS.receives a parameter within range of -1 and 1 andreturns the angle that its cosine equals to the parameter (in radians)ATAN- The reverse operation of TAN.receives a parameter within range of -1 and 1 andreturns the angle that the result of its tangent operation equals to the parameter (in radians)SINH - Hyperbolic sineCOSH - Hyperbolic cosineTANH - Hyperbolic tangentASINH - The reverse operation of SINHACOSH - The reverse operation of COSHATANH - The reverse operation of TANHOther mathematical operations----------------------------------SQRT - receives a parameter and returns its square rootEXPT - receives two parameters and returns the power of the firstparameter by the second.EXP - receives one parameter and returns thepower of E ( 2.71828182846 ) by that number.MAX - receives N parameters and return the value of the biggest.MIN - receives N parameters and return the value of the smallest.GCD - receives N parameters and returns their Greatest CommonDenominator Operation.ABS - receives a parameter, and returns its absolute value.Creating Variables--------------------------------You can define new variables via the SET and SETQ methods( defvar, defparameter are not implemented yet )for example:>>> ( setq number 5 )5>>> ( + 3 number 4 )12Conditionals---------------------------Conditions are created via IF expressionsString Operations--------------------------------------Concatenate - receives N strings and evaluates to their concatenation.For example,DATA TYPES-----------------------str - strings. A sequence of characters, sorrounded by double quotes.for example: "hello" , "world".int - integers. for example: 6, -3 ,2.dec - decimal numbers