Lisp Emulator - Version 1.0.2
-----------------------------
About Lisp
--------------
Lisp is a functional programming language, first introduced in
the end of the 1950's, by John Mcarthy, who was a renowned computer
scientist. 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 environment
which 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 inside
paranthesis.
- Like Lisp, this implementation isn't case sensitive.
Arithmetic Operators
------------------------
+ , - , * , / - Addition, Subtraction, Multiplication, Division
Those 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 )
3
Output
-----------------
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 NIL
EVENP - evaluates to T if the number is odd, else to NIL
ODDP - evaluates to T if the number is even, else to NIL
LESSP - evaluates to T if the first value is smaller than the other
GREATERP - evaluates to T if the first value is bigger than the other
NUMBERP - evaluates to T if the value is a number, else to NIL
STRINGP - evaluates to T if the value is string ( by the double quotation ".." mark )
else, to NIL
Equality Operation
-----------------------------
Equality can be performed via the = operator that can receive
an 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 represents
approximately 3.1415926535.
E Constant - E is a global constant, and represents approximately
2.71828182846.
Trigonometric operations - handled in radians
-----------------------------------------------
SIN- receives a parameter and returns its sine
for example:
>>> ( sin ( / PI 2 ) )
1.0
COS - receives a parameter and returns its cosine
TAN - receives a parameter and returns its tangent
ASIN - The reverse operation of SIN.
receives a parameter within range of -1 and 1 and
returns 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 and
returns 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 and
returns the angle that the result of its tangent operation equals to the parameter (in radians)
SINH - Hyperbolic sine
COSH - Hyperbolic cosine
TANH - Hyperbolic tangent
ASINH - The reverse operation of SINH
ACOSH - The reverse operation of COSH
ATANH - The reverse operation of TANH
Other mathematical operations
----------------------------------
SQRT - receives a parameter and returns its square root
EXPT - receives two parameters and returns the power of the first
parameter by the second.
EXP - receives one parameter and returns the
power 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 Common
Denominator 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 )
12
Conditionals
---------------------------
Conditions are created via IF expressions
String 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
Metadata
Release files for lisp-emulator 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lisp_emulator-1.0.3.tar.gz | 14.3 kB | Without provenance | Details for lisp_emulator-1.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lisp_emulator-1.0.3-py3-none-any.whl | Python 3 | none | any | Details for lisp_emulator-1.0.3-py3-none-any.whl |
Total release size: 26.9 kB
Release files / lisp_emulator-1.0.3.tar.gz
| Download URL | lisp_emulator-1.0.3.tar.gz |
|---|---|
| Size | 14.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
33b135dd93d49b31ed8ef998a22e6f98c76151e5570767a75230e3bb8805a6aa
|
|
BLAKE2b-256 checksum How to use checksums |
7a78d6bc449f933c2b0a81fbe3397e1ae667f87567caf32f0b68d0e4a3c073e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.2
|
Release files / lisp_emulator-1.0.3-py3-none-any.whl
| Download URL | lisp_emulator-1.0.3-py3-none-any.whl |
|---|---|
| Size | 12.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2e6489c9680844731ccf460c235568bf5818cbff786762f5942c3427e19658b1
|
|
BLAKE2b-256 checksum How to use checksums |
e06f8387eb1f9d2926fb86f0abd0f3dd4702e38935bf407490e53c2805efd48e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.2
|
Security for lisp-emulator 1.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.