fix autoloading, add quickstart to readme

This commit is contained in:
Pekka Laiho 2020-12-20 10:01:42 +07:00
parent bdb024df0b
commit c35134245c
2 changed files with 38 additions and 2 deletions

View File

@ -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)

View File

@ -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;