1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-19 17:47:53 +03:00
mal/cpp
Nicolas Boulenguez e6d41de4d5 load-file: accept empty file or final comment, return nil
Let `load-file` append a new line in case last line contains a
comment.

Also append `nil` so that the return value is predictible. Remove the
existing explicit `nil` from existing sources.

Adapt documentation and tests.
2019-07-28 13:08:05 +02:00
..
tests Tests: move step5 non-TCO tests to per impl. 2016-03-14 23:39:21 -05:00
.gitignore c++11: step 0 2015-03-27 20:44:42 +11:00
Core.cpp C++ convert map from native to built-in 2019-05-08 03:13:47 +02:00
Debug.h Split ASSERT into ASSERT and MAL_CHECK/MAL_FAIL 2015-03-28 22:54:26 +11:00
docker.sh c++11: step 0 2015-03-27 20:44:42 +11:00
Dockerfile Travis: add C++(cpp), factor and julia. 2015-10-06 18:28:46 -05:00
Environment.cpp Split ASSERT into ASSERT and MAL_CHECK/MAL_FAIL 2015-03-28 22:54:26 +11:00
Environment.h c++11: step 6 2015-03-27 20:44:42 +11:00
Makefile Convert to loccount based stats calculation. 2019-03-20 23:34:21 -05:00
MAL.h Don't pass an env to apply 2015-12-15 11:22:25 +11:00
Reader.cpp Test uncaught throw, catchless try* . Fix 46 impls. 2018-12-12 14:18:26 -06:00
ReadLine.cpp c++11: step 0 2015-03-27 20:44:42 +11:00
ReadLine.h c++11: step 0 2015-03-27 20:44:42 +11:00
README.md Fix a number of typos in documentation/comments. 2017-09-15 20:00:15 +02:00
RefCountedPtr.h c++11: step 1 2015-03-27 20:44:42 +11:00
run Refactor to use run scripts, remove *_RUNSTEP 2016-05-18 22:29:18 -07:00
StaticList.h c++11: step 1 2015-03-27 20:44:42 +11:00
step0_repl.cpp c++11: step 0 2015-03-27 20:44:42 +11:00
step1_read_print.cpp Don't pass an env to apply 2015-12-15 11:22:25 +11:00
step2_eval.cpp Don't pass an env to apply 2015-12-15 11:22:25 +11:00
step3_env.cpp Don't pass an env to apply 2015-12-15 11:22:25 +11:00
step4_if_fn_do.cpp C++ Convert < > >= list from native to built-in. 2019-05-07 11:15:36 +02:00
step5_tco.cpp C++ Convert < > >= list from native to built-in. 2019-05-07 11:15:36 +02:00
step6_file.cpp load-file: accept empty file or final comment, return nil 2019-07-28 13:08:05 +02:00
step7_quote.cpp load-file: accept empty file or final comment, return nil 2019-07-28 13:08:05 +02:00
step8_macros.cpp load-file: accept empty file or final comment, return nil 2019-07-28 13:08:05 +02:00
step9_try.cpp load-file: accept empty file or final comment, return nil 2019-07-28 13:08:05 +02:00
stepA_mal.cpp load-file: accept empty file or final comment, return nil 2019-07-28 13:08:05 +02:00
String.cpp c++11: step 1 2015-03-27 20:44:42 +11:00
String.h c++11: step 0 2015-03-27 20:44:42 +11:00
Types.cpp cpp: Make integer values 64-bit so they can holds time-ms values 2016-05-11 15:52:55 -04:00
Types.h cpp: Make integer values 64-bit so they can holds time-ms values 2016-05-11 15:52:55 -04:00
Validation.cpp Split ASSERT into ASSERT and MAL_CHECK/MAL_FAIL 2015-03-28 22:54:26 +11:00
Validation.h Split ASSERT into ASSERT and MAL_CHECK/MAL_FAIL 2015-03-28 22:54:26 +11:00

Compilation notes

Mac OSX

This C++ implementation was developed on Mac OS X Yosemite, and uses the stock g++ compiler.

The only other requirement is GNU Readline, which I got from homebrew.

brew install readline

You may need to edit the READLINE path in the Makefile.

Ubuntu 14.10/15.04

This should compile on Ubuntu 14.10 and 15.04 with the following packages

apt-get install clang-3.5 libreadline-dev make

Docker

For everyone else, there is a Dockerfile and associated docker.sh script which can be used to make and run this implementation.

* build the docker image

    ./docker build

* make the MAL binaries:

    ./docker make

* run one of the implementations:

    ./docker run ./stepA_mal

* open a shell inside the docker container:

    ./docker run