1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-19 17:47:53 +03:00
mal/impls/cpp
Joel Martin 7b23c7ed61 c.2/cpp/dart/swift5: fix try/TCO double eval bug
The try block needs to happen and be returned and not continue the TCO
loop. If it does then the successful result of a try block gets
evaluated an extra time so something like this `(try* (list 1) (catch*
e (prn :e e)))` will cause an exception. If an exception occurs, then
the catch block of a try/catch can loop/TCO without issue but not the
initial try form/block.
2024-08-18 15:27:51 -05:00
..
tests Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
.gitignore Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
Core.cpp cpp: allow keyword argument for keyword core function 2021-12-11 09:52:02 -06:00
Debug.h Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
docker.sh Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
Dockerfile dockerfiles: improve consistency, link python to python3 2024-08-05 17:02:34 -05:00
Environment.cpp Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
Environment.h Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
Makefile docker: update some dockerfiles 2024-08-05 17:00:24 -05:00
MAL.h Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
Reader.cpp Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
ReadLine.cpp cpp: Avoid readline memory leak 2021-02-14 11:58:33 +01:00
ReadLine.h Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
README.md [cpp] space change to test Github actions. 2021-04-21 13:42:51 -05:00
RefCountedPtr.h Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
run Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
StaticList.h Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
step0_repl.cpp Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
step1_read_print.cpp Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
step2_eval.cpp Merge eval-ast and macro expansion into EVAL, add DEBUG-EVAL 2024-08-05 11:40:49 -05:00
step3_env.cpp Merge eval-ast and macro expansion into EVAL, add DEBUG-EVAL 2024-08-05 11:40:49 -05:00
step4_if_fn_do.cpp Merge eval-ast and macro expansion into EVAL, add DEBUG-EVAL 2024-08-05 11:40:49 -05:00
step5_tco.cpp Merge eval-ast and macro expansion into EVAL, add DEBUG-EVAL 2024-08-05 11:40:49 -05:00
step6_file.cpp Merge eval-ast and macro expansion into EVAL, add DEBUG-EVAL 2024-08-05 11:40:49 -05:00
step7_quote.cpp Merge eval-ast and macro expansion into EVAL, add DEBUG-EVAL 2024-08-05 11:40:49 -05:00
step8_macros.cpp Merge eval-ast and macro expansion into EVAL, add DEBUG-EVAL 2024-08-05 11:40:49 -05:00
step9_try.cpp c.2/cpp/dart/swift5: fix try/TCO double eval bug 2024-08-18 15:27:51 -05:00
stepA_mal.cpp c.2/cpp/dart/swift5: fix try/TCO double eval bug 2024-08-18 15:27:51 -05:00
String.cpp Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
String.h Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
Types.cpp Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
Types.h Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
Validation.cpp Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
Validation.h Move implementations into impls/ dir 2020-02-10 23:50:16 -06: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