-
Notifications
You must be signed in to change notification settings - Fork 1
/
README-en-linux.template
130 lines (94 loc) · 2.35 KB
/
README-en-linux.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
[Русская версия](README-ru.md)
**VeLisp** is AutoLISP interpreter with DCL support.
The idea is to treat AutoLISP as a general purpose programming language.
The goal is to run AutoLISP programs outside of AutoCAD.
Why? To learn basic AutoLISP and DCL programming, to write shell scripts, to
run DCL dialogs just like regular applications on Windows, MacOS and Linux.
### Table of contents
- [Install](#install)
- [Usage](#usage)
- [License](#license)
### Install
You can find the latest release [here](https://github.com/ten0s/velisp/releases).
#### Download and unarchive
```
$ curl -LJO https://github.com/ten0s/velisp/releases/download/{{version}}/velisp-{{version}}-linux-x64.tar.xz
$ tar xfJ velisp-{{version}}-linux-x64.tar.xz
```
#### Add to ~/.bashrc
```
export PATH=<PATH_TO>/velisp-{{version}}-linux-x64:$PATH
```
### Usage
```
$ cd velisp-{{version}}-linux-x64
```
#### Run REPL (Read–Eval–Print Loop)
```
$ ./velisp
VeLisp {{version}} on Linux
Type ".license" or ".help" for more information
_$ (+ 1 2)
3
_$ (defun add (a b) (+ a b))
ADD
_$ (mapcar '(lambda (x y) (itoa (add x y))) '(1 2 3) '(9 8 7))
("10" "10" "10")
_$ (quit)
```
#### Run code from file
Calculate 10th (by default) Fibonacci number
```
$ ./velisp examples/fib.lsp
55
```
Calculate 11th Fibonacci number
```
$ ./velisp examples/fib.lsp 11
89
```
Run the Calculator example
```
$ ./velisp examples/calc.lsp
```
Run the Minesweeper example
```
$ ./velisp examples/mines.lsp
```
Run the Fifteen Puzzle example
```
$ ./velisp examples/fifteen.lsp
```
Run the Demo example
```
$ ./velisp examples/demo.lsp
```
Run the Slides example
```
$ ./velisp examples/slides.lsp
```
#### Run code from standard input
```
$ cat examples/fib.lsp | ./velisp
55
```
```
$ cat examples/fib.lsp | ./velisp -- 11
89
```
#### Run without DCL support (faster loading, good for scripting)
```
$ ./velisp --no-dcl examples/fib.lsp
55
```
### License
The project is licensed under the GNU General Public License v3.0 or later
with the exception below.
See [LICENSE](LICENSE) or
https://spdx.org/licenses/GPL-3.0-or-later.html
for full license information.
The files in the [examples/](examples/) and [lib/](lib/) directories
are licensed under the BSD Zero Clause License.
See [LICENSE](examples/LICENSE) or [LICENSE](lib/LICENSE) or
https://spdx.org/licenses/0BSD.html for full license
information.