mirror of
https://github.com/peklaiho/madlisp.git
synced 2024-11-22 21:35:03 +00:00
fix autoloading, add quickstart to readme
This commit is contained in:
parent
bdb024df0b
commit
c35134245c
32
README.md
32
README.md
@ -8,10 +8,40 @@ The project requires PHP 7.4 or newer and [Composer](https://getcomposer.org/).
|
|||||||
|
|
||||||
## Quickstart
|
## Quickstart
|
||||||
|
|
||||||
|
Create a new directory and require the project using composer:
|
||||||
|
|
||||||
|
```text
|
||||||
|
$ mkdir mylisp
|
||||||
|
$ cd mylisp
|
||||||
|
$ composer require "maddy83/madlisp dev-master"
|
||||||
|
```
|
||||||
|
|
||||||
|
Use the `vendor/bin/madlisp` executable to start the interpreter. Start the REPL with the `-r` option:
|
||||||
|
|
||||||
|
```text
|
||||||
|
$ vendor/bin/madlisp -r
|
||||||
|
>
|
||||||
|
```
|
||||||
|
|
||||||
|
You can evaluate Lisp code interactively inside the REPL:
|
||||||
|
|
||||||
|
```text
|
||||||
|
> (+ 1 2 3)
|
||||||
|
6
|
||||||
|
```
|
||||||
|
|
||||||
|
Alternatively you can evaluate a file that contains Lisp code:
|
||||||
|
|
||||||
|
```text
|
||||||
|
$ echo "(+ 1 2 3)" > mylisp.mad
|
||||||
|
$ vendor/bin/madlisp mylisp.mad
|
||||||
|
6
|
||||||
|
```
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
The full [documentation](http://madlisp.com/) is available on the project website.
|
The full [documentation](http://madlisp.com/) is available on the project website.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
[MIT](LICENSE)
|
[MIT](https://bitbucket.org/maddy83/madlisp/src/master/LICENSE)
|
||||||
|
@ -2,7 +2,13 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$autoload = null;
|
$autoload = null;
|
||||||
foreach ([__DIR__ . '/../../autoload.php', __DIR__ . '/../vendor/autoload.php', __DIR__ . '/vendor/autoload.php'] as $file) {
|
$autoloadLocations = [
|
||||||
|
__DIR__ . '/vendor/autoload.php',
|
||||||
|
__DIR__ . '/../vendor/autoload.php',
|
||||||
|
__DIR__ . '/../../../autoload.php'
|
||||||
|
];
|
||||||
|
|
||||||
|
foreach ($autoloadLocations as $file) {
|
||||||
if (file_exists($file)) {
|
if (file_exists($file)) {
|
||||||
$autoload = $file;
|
$autoload = $file;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user