Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thedevtop/sdac
Software Defined Automatic Calculator
https://github.com/thedevtop/sdac
calculator rust s-expressions
Last synced: 2 months ago
JSON representation
Software Defined Automatic Calculator
- Host: GitHub
- URL: https://github.com/thedevtop/sdac
- Owner: TheDevtop
- License: mpl-2.0
- Created: 2023-10-15T07:57:03.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-26T08:29:30.000Z (about 1 year ago)
- Last Synced: 2023-10-26T09:31:51.818Z (about 1 year ago)
- Topics: calculator, rust, s-expressions
- Language: Rust
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SDAC
The **S**oftware **D**efined **A**utomatic **C**alculator, is a research project that aims to implement a programmable calculator with its own [LISP](https://en.wikipedia.org/wiki/Lisp_(programming_language)) dialect.
### Types
**Expressions** (exp): Things to be evaluated.
**Values** (val): Things that are evaluated.
### Keywords
| Keyword | Symbol | Description |
|:-------:|:------:|:----------------:|
| add | + | Addition |
| mul | * | Multiplication |
| sub | - | Subtraction |
| div | / | Division |
| mod | % | Modulus |
| and | & | AND |
| ior | \| | Inclusive OR |
| xor | ^ | Exclusive OR |
| eqa | = | Equality |
| neq | ! | Non Equality |
| min | < | Minimum |
| max | > | Maximum |
| eif | ? | Evaluate if true |### Example (The answer to everything)
**Input**
```lisp
(exp mul (val . 21) (exp add (val . 3) (val . -1)))
```
**Output**
```
+ 3 -1
* 21 2
: 42
```
For which ':' is the complete evaluation of the program.
Meaning that the answer to life, the universe, and everything is 42.