diff --git a/.gitignore b/.gitignore index 9628118d8..ce0ee6f47 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ basis/src build +document include/meevax/unicode src/kernel/version.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 1679c8721..3e92ccc68 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,6 +59,7 @@ file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/include/${PROJECT_NAME}/unicode/upcase.hp string(TOLOWER ${CMAKE_SYSTEM_NAME} ${PROJECT_NAME}_SYSTEM_NAME) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure/Doxyfile ${CMAKE_CURRENT_SOURCE_DIR}/document/Doxyfile) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure/README.md ${CMAKE_CURRENT_SOURCE_DIR}/README.md) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure/version.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/kernel/version.cpp) @@ -208,6 +209,18 @@ foreach(EACH IN LISTS ${PROJECT_NAME}_TEST_CPP) ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_${FILENAME}) endforeach() +file(GLOB ${PROJECT_NAME}_TEST_SH ${CMAKE_CURRENT_SOURCE_DIR}/test/*.sh) + +foreach(EACH IN LISTS ${PROJECT_NAME}_TEST_SH) + get_filename_component(FILENAME ${EACH} NAME_WE) + add_test( + NAME ${FILENAME} + COMMAND ${${PROJECT_NAME}_MEMORY_CHECK_COMMAND} + ${${PROJECT_NAME}_MEMORY_CHECK_OPTIONS} + ${EACH} + ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/meevax) +endforeach() + # ---- Additional Targets ------------------------------------------------------ execute_process(COMMAND nproc OUTPUT_VARIABLE ${PROJECT_NAME}_NPROC) diff --git a/README.md b/README.md index 4e48960f2..f7f5f8796 100644 --- a/README.md +++ b/README.md @@ -21,24 +21,23 @@ Latest release is [here](https://github.com/yamacir-kit/meevax/releases). ### Features -- Traditional SECD machine [[Landin 1964](#Landin-1964)]. -- Low-level hygienic macro system, known as *syntactic closures* [[Bawden and - Rees 1988](#Bawden-and-Rees-1988); [Hanson 1991](#Hanson-1991)] and *explicit - renaming* [[Clinger 1991](#Clinger-1991)]. For these, the well-known macro - transformers `sc-macro-transformer`, `rsc-macro-transformer` and - `er-macro-transformer` from the library [`(meevax - macro-transformer)`](./basis/meevax.ss) are provided. Note that these are - non-Scheme standards. -- C++ friendly precise garbage collection [[Kempf 2001a](#Kempf-2001a); [Kempf - 2001b](#Kempf-2001b)] +- Traditional SECD machine [[2](#Landin-1964)]. +- Low-level hygienic macro system, known as *syntactic closures* + [[4](#Bawden-and-Rees-1988), [6](#Hanson-1991)] and *explicit renaming* + [[5](#Clinger-1991)]. For these, the well-known macro transformers + `sc-macro-transformer`, `rsc-macro-transformer` and `er-macro-transformer` + from the library [`(meevax macro-transformer)`](./basis/meevax.ss) are + provided. Note that these are non-Scheme standards. +- C++ friendly precise garbage collection [[10](#Kempf-2001a), + [11](#Kempf-2001b)] ### Standards Meevax can be used as an interpreter that supports the Scheme standard specified by the following report: -- Revised4 Report on the Algorithmic Language Scheme (R4RS) [[Clinger and Rees 1991a](#Clinger-and-Rees-1991a)] -- Revised5 Report on the Algorithmic Language Scheme (R5RS) [[Kelsey, Clinger and Rees 1998](#Kelsey-Clinger-and-Rees-1998)] -- Revised7 Report on the Algorithmic Language Scheme (R7RS) [[Shinn, Cowan and Gleckler 2013](#Shinn-Cowan-and-Gleckler-2013)] +- Revised4 Report on the Algorithmic Language Scheme (R4RS) [[5](#Clinger-and-Rees-1991a)] +- Revised5 Report on the Algorithmic Language Scheme (R5RS) [[9](#Kelsey-Clinger-and-Rees-1998)] +- Revised7 Report on the Algorithmic Language Scheme (R7RS) [[13](#Shinn-Cowan-and-Gleckler-2013)] Procedures for each standard are provided by the following R7RS-style libraries: @@ -91,7 +90,7 @@ Procedures for each standard are provided by the following R7RS-style libraries: cmake -B build -DCMAKE_BUILD_TYPE=Release cd build make package -sudo apt install build/meevax_0.5.164_amd64.deb +sudo apt install build/meevax_0.5.221_amd64.deb ``` or @@ -123,9 +122,9 @@ sudo rm -rf /usr/local/share/meevax | Target Name | Description |-------------|------------- -| `all` | Build shared-library `libmeevax.0.5.164.so` and executable `meevax` +| `all` | Build shared-library `libmeevax.0.5.221.so` and executable `meevax` | `test` | Test executable `meevax` -| `package` | Generate debian package `meevax_0.5.164_amd64.deb` +| `package` | Generate debian package `meevax_0.5.221_amd64.deb` | `install` | Copy files into `/usr/local` directly ## Usage @@ -149,18 +148,52 @@ See [LICENSE](./LICENSE). ## References -| Authors | Year | Title | Journal Title / Publisher | Pages | -|--------------------------------------------------------------------------------------------------------|:----:|-------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------:| -| John McCarthy | 1960 | [Recursive functions of symbolic expressions and their computation by machine, Part I](https://dl.acm.org/doi/10.1145/367177.367199) | [Communications of the ACM, Volume 3, Issue 4](https://dl.acm.org/toc/cacm/1960/3/4) | 184‑195 | -| P. J. Landin | 1964 | [The Mechanical Evaluation of Expressions](https://academic.oup.com/comjnl/article/6/4/308/375725) | [The Computor Journal, Volume 6, Issue 4](https://academic.oup.com/comjnl/issue/6/4) | 308‑320 | -| Peter Henderson | 1980 | [Functional Programming: Application and Implementation](https://archive.org/details/functionalprogra0000hend/mode/2up) | Prentice Hall | | -| Alan Bawden and Jonathan Rees | 1988 | [Syntactic Closures](https://dl.acm.org/doi/10.1145/62678.62687) | [LFP '88: Proceedings of the 1988 ACM Conference on LISP and Functional Programming](https://dl.acm.org/doi/proceedings/10.1145/62678) | 86‑95 | -| William Clinger and Jonathan Rees (Editors) | 1991 | [Revised4 Report on the Algorithmic Language Scheme](https://dl.acm.org/doi/10.1145/382130.382133) | [ACM SIGPLAN LISP Pointers, Volume IV, Issue 3](https://dl.acm.org/toc/sigplan-lisppointers/1991/IV/3) | 1‑55 | -| Chris Hanson | 1991 | [A Syntactic Closures Macro Facility](https://dl.acm.org/doi/10.1145/1317265.1317267) | [ACM SIGPLAN LISP Pointers, Volume IV, Issue 4](https://dl.acm.org/toc/sigplan-lisppointers/1991/IV/4) | 9‑16 | -| William Clinger | 1991 | [Hygienic Macros Through Explicit Renaming](https://dl.acm.org/doi/10.1145/1317265.1317269) | [ACM SIGPLAN LISP Pointers, Volume IV, Issue 4](https://dl.acm.org/toc/sigplan-lisppointers/1991/IV/4) | 25‑28 | -| William Clinger and Jonathan Rees | 1991 | [Macros That Work](https://dl.acm.org/doi/10.1145/99583.99607) | [POPL '91: Proceedings of the 18th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages](https://dl.acm.org/doi/proceedings/10.1145/99583) | 155‑162 | -| Rechard Kelsey, William Clinger and Jonathan Rees (Editors) | 1998 | [Revised5 Report on the Algorithmic Language Scheme](https://dl.acm.org/doi/10.1145/290229.290234) | [ACM SIGPLAN Notices, Volume 33, Issue 9](https://dl.acm.org/toc/sigplan/1998/33/9) | 26‑76 | -| William E. Kempf | 2001 | [A garbage collection framework for C++](https://www.codeproject.com/Articles/912/A-garbage-collection-framework-for-C) | https://www.codeproject.com/Articles/912/A-garbage-collection-framework-for-C | | -| William E. Kempf | 2001 | [A garbage collection framework for C++ - Part II](https://www.codeproject.com/Articles/938/A-garbage-collection-framework-for-C-Part-II) | https://www.codeproject.com/Articles/938/A-garbage-collection-framework-for-C-Part-II | | -| Michael D. Adams and R. Kent Dybvig | 2008 | [Efficient Nondestructive Equality Checking for Trees and Graphs](https://dl.acm.org/doi/10.1145/1411204.1411230) | [ICFP '08: Proceedings of the 13th ACM SIGPLAN International Conference on Functional Programming](https://dl.acm.org/doi/proceedings/10.1145/1411204) | 179‑188 | -| Alex Shinn, John Cowan and Arthur A. Gleckler (Editors) | 2013 | [Revised7 Report on the Algorithmic Language Scheme](https://standards.scheme.org/official/r7rs.pdf) | http://www.scheme-reports.org/ | | +[1] John McCarthy. +Recursive functions of symbolic expressions and their computation by machine, Part I. +Communications of the ACM, 3(4):184--195, 1960. + +[2] Peter J. Landin. +The Mechanical Evaluation of Expressions. +The Computor Journal, 6(4):308--320, 1964. + +[3] Peter Henderson. +Functional Programming: Application and Implementation. +Prentice Hall, 1980. + +[4] Alan Bawden and Jonathan Rees. +Syntactic Closures. +In LFP '88: Proceedings of the 1988 ACM Conference on LISP and Functional Programming, pages 86--95, 1988. + +[5] William Clinger and Jonathan Rees (Editors). +Revised4 Report on the Algorithmic Language Scheme. +ACM SIGPLAN LISP Pointers, IV(3):1--55, 1991. + +[6] Chris Hanson. +A Syntactic Closures Macro Facility. +ACM SIGPLAN LISP Pointers, IV(4):9--16, 1991. + +[7] William Clinger. +Hygienic Macros Through Explicit Renaming. +ACM SIGPLAN LISP Pointers, IV(4):25--28, 1991. + +[8] William Clinger and Jonathan Rees. +Macros That Work. +In POPL '91: Proceedings of the 18th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 155--162, 1991. + +[9] Rechard Kelsey, William Clinger, and Jonathan Rees (Editors). +Revised5 Report on the Algorithmic Language Scheme. +ACM SIGPLAN Notices, 33(9):26--76, 1998. + +[10] William E. Kempf. +A garbage collection framework for C++, 2001. + +[11] William E. Kempf. +A garbage collection framework for C++ - Part II, 2001. + +[12] Michael D. Adams and R. Kent Dybvig. +Efficient Nondestructive Equality Checking for Trees and Graphs. +In ICFP '08: Proceedings of the 13th ACM SIGPLAN International Conference on Functional Programming, pages 179--188, 2008. + +[13] Alex Shinn, John Cowan, and Arthur A. Gleckler (Editors). +Revised7 Report on the Algorithmic Language Scheme. +Technical report, http://www.scheme-reports.org/, 2013. diff --git a/VERSION b/VERSION index bcf6eee0e..2a10df863 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.5.164 +0.5.221 diff --git a/basis/srfi-0.ss b/basis/srfi-0.ss index c0adc68d4..51d67709f 100644 --- a/basis/srfi-0.ss +++ b/basis/srfi-0.ss @@ -1,3 +1,3 @@ (define-library (srfi 0) - (import (only (meevax core) implementation-dependent)) - (export (rename implementation-dependent cond-expand))) + (import (only (meevax core) conditional-expand)) + (export (rename conditional-expand cond-expand))) diff --git a/configure/Doxyfile b/configure/Doxyfile new file mode 100644 index 000000000..11db08adf --- /dev/null +++ b/configure/Doxyfile @@ -0,0 +1,47 @@ +PROJECT_NAME = ${PROJECT_NAME} +PROJECT_NUMBER = ${CURRENT_VERSION} +OUTPUT_DIRECTORY = ${CMAKE_CURRENT_SOURCE_DIR}/document +CREATE_SUBDIRS = YES +INLINE_INHERITED_MEMB = YES +STRIP_FROM_PATH = ${CMAKE_CURRENT_SOURCE_DIR}/basis/include \ + ${CMAKE_CURRENT_SOURCE_DIR}/basis/src \ + ${CMAKE_CURRENT_SOURCE_DIR}/include \ + ${CMAKE_CURRENT_SOURCE_DIR}/src +TAB_SIZE = 2 +BUILTIN_STL_SUPPORT = YES +INLINE_SIMPLE_STRUCTS = YES + +EXTRACT_ALL = YES +EXTRACT_STATIC = YES +SORT_MEMBERS_CTORS_1ST = YES +SORT_BY_SCOPE_NAME = YES + +QUIET = YES +INPUT = ${CMAKE_CURRENT_SOURCE_DIR}/README.md \ + ${CMAKE_CURRENT_SOURCE_DIR}/basis/include \ + ${CMAKE_CURRENT_SOURCE_DIR}/basis/src \ + ${CMAKE_CURRENT_SOURCE_DIR}/include \ + ${CMAKE_CURRENT_SOURCE_DIR}/src +RECURSIVE = YES +EXCLUDE = ${CMAKE_CURRENT_SOURCE_DIR}/include/meevax/unicode +USE_MDFILE_AS_MAINPAGE = ${CMAKE_CURRENT_SOURCE_DIR}/README.md + +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES + +HTML_TIMESTAMP = YES +HTML_DYNAMIC_SECTIONS = YES +HTML_INDEX_NUM_ENTRIES = 1000 +SEARCHENGINE = NO + +GENERATE_LATEX = NO + +MACRO_EXPANSION = YES +PREDEFINED = NDEBUG + +UML_LOOK = YES +UML_LIMIT_NUM_FIELDS = 100 +TEMPLATE_RELATIONS = YES +CALL_GRAPH = YES +INTERACTIVE_SVG = YES +DOT_GRAPH_MAX_NODES = 1000 diff --git a/configure/README.md b/configure/README.md index 41ccda9b2..ecad4d688 100644 --- a/configure/README.md +++ b/configure/README.md @@ -21,24 +21,23 @@ Latest release is [here](https://github.com/yamacir-kit/meevax/releases). ### Features -- Traditional SECD machine [[Landin 1964](#Landin-1964)]. -- Low-level hygienic macro system, known as *syntactic closures* [[Bawden and - Rees 1988](#Bawden-and-Rees-1988); [Hanson 1991](#Hanson-1991)] and *explicit - renaming* [[Clinger 1991](#Clinger-1991)]. For these, the well-known macro - transformers `sc-macro-transformer`, `rsc-macro-transformer` and - `er-macro-transformer` from the library [`(meevax - macro-transformer)`](./basis/meevax.ss) are provided. Note that these are - non-Scheme standards. -- C++ friendly precise garbage collection [[Kempf 2001a](#Kempf-2001a); [Kempf - 2001b](#Kempf-2001b)] +- Traditional SECD machine [[2](#Landin-1964)]. +- Low-level hygienic macro system, known as *syntactic closures* + [[4](#Bawden-and-Rees-1988), [6](#Hanson-1991)] and *explicit renaming* + [[5](#Clinger-1991)]. For these, the well-known macro transformers + `sc-macro-transformer`, `rsc-macro-transformer` and `er-macro-transformer` + from the library [`(meevax macro-transformer)`](./basis/meevax.ss) are + provided. Note that these are non-Scheme standards. +- C++ friendly precise garbage collection [[10](#Kempf-2001a), + [11](#Kempf-2001b)] ### Standards Meevax can be used as an interpreter that supports the Scheme standard specified by the following report: -- Revised4 Report on the Algorithmic Language Scheme (R4RS) [[Clinger and Rees 1991a](#Clinger-and-Rees-1991a)] -- Revised5 Report on the Algorithmic Language Scheme (R5RS) [[Kelsey, Clinger and Rees 1998](#Kelsey-Clinger-and-Rees-1998)] -- Revised7 Report on the Algorithmic Language Scheme (R7RS) [[Shinn, Cowan and Gleckler 2013](#Shinn-Cowan-and-Gleckler-2013)] +- Revised4 Report on the Algorithmic Language Scheme (R4RS) [[5](#Clinger-and-Rees-1991a)] +- Revised5 Report on the Algorithmic Language Scheme (R5RS) [[9](#Kelsey-Clinger-and-Rees-1998)] +- Revised7 Report on the Algorithmic Language Scheme (R7RS) [[13](#Shinn-Cowan-and-Gleckler-2013)] Procedures for each standard are provided by the following R7RS-style libraries: @@ -140,18 +139,52 @@ See [LICENSE](./LICENSE). ## References -| Authors | Year | Title | Journal Title / Publisher | Pages | -|--------------------------------------------------------------------------------------------------------|:----:|-------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------:| -| John McCarthy | 1960 | [Recursive functions of symbolic expressions and their computation by machine, Part I](https://dl.acm.org/doi/10.1145/367177.367199) | [Communications of the ACM, Volume 3, Issue 4](https://dl.acm.org/toc/cacm/1960/3/4) | 184‑195 | -| P. J. Landin | 1964 | [The Mechanical Evaluation of Expressions](https://academic.oup.com/comjnl/article/6/4/308/375725) | [The Computor Journal, Volume 6, Issue 4](https://academic.oup.com/comjnl/issue/6/4) | 308‑320 | -| Peter Henderson | 1980 | [Functional Programming: Application and Implementation](https://archive.org/details/functionalprogra0000hend/mode/2up) | Prentice Hall | | -| Alan Bawden and Jonathan Rees | 1988 | [Syntactic Closures](https://dl.acm.org/doi/10.1145/62678.62687) | [LFP '88: Proceedings of the 1988 ACM Conference on LISP and Functional Programming](https://dl.acm.org/doi/proceedings/10.1145/62678) | 86‑95 | -| William Clinger and Jonathan Rees (Editors) | 1991 | [Revised4 Report on the Algorithmic Language Scheme](https://dl.acm.org/doi/10.1145/382130.382133) | [ACM SIGPLAN LISP Pointers, Volume IV, Issue 3](https://dl.acm.org/toc/sigplan-lisppointers/1991/IV/3) | 1‑55 | -| Chris Hanson | 1991 | [A Syntactic Closures Macro Facility](https://dl.acm.org/doi/10.1145/1317265.1317267) | [ACM SIGPLAN LISP Pointers, Volume IV, Issue 4](https://dl.acm.org/toc/sigplan-lisppointers/1991/IV/4) | 9‑16 | -| William Clinger | 1991 | [Hygienic Macros Through Explicit Renaming](https://dl.acm.org/doi/10.1145/1317265.1317269) | [ACM SIGPLAN LISP Pointers, Volume IV, Issue 4](https://dl.acm.org/toc/sigplan-lisppointers/1991/IV/4) | 25‑28 | -| William Clinger and Jonathan Rees | 1991 | [Macros That Work](https://dl.acm.org/doi/10.1145/99583.99607) | [POPL '91: Proceedings of the 18th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages](https://dl.acm.org/doi/proceedings/10.1145/99583) | 155‑162 | -| Rechard Kelsey, William Clinger and Jonathan Rees (Editors) | 1998 | [Revised5 Report on the Algorithmic Language Scheme](https://dl.acm.org/doi/10.1145/290229.290234) | [ACM SIGPLAN Notices, Volume 33, Issue 9](https://dl.acm.org/toc/sigplan/1998/33/9) | 26‑76 | -| William E. Kempf | 2001 | [A garbage collection framework for C++](https://www.codeproject.com/Articles/912/A-garbage-collection-framework-for-C) | https://www.codeproject.com/Articles/912/A-garbage-collection-framework-for-C | | -| William E. Kempf | 2001 | [A garbage collection framework for C++ - Part II](https://www.codeproject.com/Articles/938/A-garbage-collection-framework-for-C-Part-II) | https://www.codeproject.com/Articles/938/A-garbage-collection-framework-for-C-Part-II | | -| Michael D. Adams and R. Kent Dybvig | 2008 | [Efficient Nondestructive Equality Checking for Trees and Graphs](https://dl.acm.org/doi/10.1145/1411204.1411230) | [ICFP '08: Proceedings of the 13th ACM SIGPLAN International Conference on Functional Programming](https://dl.acm.org/doi/proceedings/10.1145/1411204) | 179‑188 | -| Alex Shinn, John Cowan and Arthur A. Gleckler (Editors) | 2013 | [Revised7 Report on the Algorithmic Language Scheme](https://standards.scheme.org/official/r7rs.pdf) | http://www.scheme-reports.org/ | | +[1] John McCarthy. +Recursive functions of symbolic expressions and their computation by machine, Part I. +Communications of the ACM, 3(4):184--195, 1960. + +[2] Peter J. Landin. +The Mechanical Evaluation of Expressions. +The Computor Journal, 6(4):308--320, 1964. + +[3] Peter Henderson. +Functional Programming: Application and Implementation. +Prentice Hall, 1980. + +[4] Alan Bawden and Jonathan Rees. +Syntactic Closures. +In LFP '88: Proceedings of the 1988 ACM Conference on LISP and Functional Programming, pages 86--95, 1988. + +[5] William Clinger and Jonathan Rees (Editors). +Revised4 Report on the Algorithmic Language Scheme. +ACM SIGPLAN LISP Pointers, IV(3):1--55, 1991. + +[6] Chris Hanson. +A Syntactic Closures Macro Facility. +ACM SIGPLAN LISP Pointers, IV(4):9--16, 1991. + +[7] William Clinger. +Hygienic Macros Through Explicit Renaming. +ACM SIGPLAN LISP Pointers, IV(4):25--28, 1991. + +[8] William Clinger and Jonathan Rees. +Macros That Work. +In POPL '91: Proceedings of the 18th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 155--162, 1991. + +[9] Rechard Kelsey, William Clinger, and Jonathan Rees (Editors). +Revised5 Report on the Algorithmic Language Scheme. +ACM SIGPLAN Notices, 33(9):26--76, 1998. + +[10] William E. Kempf. +A garbage collection framework for C++, 2001. + +[11] William E. Kempf. +A garbage collection framework for C++ - Part II, 2001. + +[12] Michael D. Adams and R. Kent Dybvig. +Efficient Nondestructive Equality Checking for Trees and Graphs. +In ICFP '08: Proceedings of the 13th ACM SIGPLAN International Conference on Functional Programming, pages 179--188, 2008. + +[13] Alex Shinn, John Cowan, and Arthur A. Gleckler (Editors). +Revised7 Report on the Algorithmic Language Scheme. +Technical report, http://www.scheme-reports.org/, 2013. diff --git a/configure/references.bib b/configure/references.bib new file mode 100644 index 000000000..5888b76a0 --- /dev/null +++ b/configure/references.bib @@ -0,0 +1,97 @@ +@ARTICLE {McCarthy-1960, + author = "John McCarthy", + title = "\href{https://dl.acm.org/doi/10.1145/367177.367199}{Recursive functions of symbolic expressions and their computation by machine, Part I}", + journal = "\href{https://dl.acm.org/toc/cacm/1960/3/4}{Communications of the ACM}", + year = "1960", + volume = "3", + number = "4", + pages = "184-195" +} +@ARTICLE {Landin-1964, + author = "Peter J. Landin", + title = "\href{https://academic.oup.com/comjnl/article/6/4/308/375725}{The Mechanical Evaluation of Expressions}", + journal = "\href{https://academic.oup.com/comjnl/issue/6/4}{The Computor Journal}", + year = "1964", + volume = "6", + number = "4", + pages = "308-320" +} +@BOOK {Henderson-1980, + author = "Peter Henderson", + title = "\href{https://archive.org/details/functionalprogra0000hend/mode/2up}{Functional Programming: Application and Implementation}", + publisher = "Prentice Hall", + year = "1980" +} +@INPROCEEDINGS {Bawden-and-Rees-1988, + author = "Alan Bawden and Jonathan Rees", + title = "\href{https://dl.acm.org/doi/10.1145/62678.62687}{Syntactic Closures}", + booktitle = "\href{https://dl.acm.org/doi/proceedings/10.1145/62678}{LFP '88: Proceedings of the 1988 ACM Conference on LISP and Functional Programming}", + year = "1988", + pages = "86-95" +} +@ARTICLE {Clinger-and-Rees-1991a, + author = "William Clinger and Jonathan Rees (Editors)", + title = "\href{https://dl.acm.org/doi/10.1145/382130.382133}{Revised$^4$ Report on the Algorithmic Language Scheme}", + journal = "\href{https://dl.acm.org/toc/sigplan-lisppointers/1991/IV/3}{ACM SIGPLAN LISP Pointers}", + year = "1991", + volume = "IV", + number = "3", + pages = "1-55" +} +@ARTICLE {Hanson-1991, + author = "Chris Hanson", + title = "\href{https://dl.acm.org/doi/10.1145/1317265.1317267}{A Syntactic Closures Macro Facility}", + journal = "\href{https://dl.acm.org/toc/sigplan-lisppointers/1991/IV/4}{ACM SIGPLAN LISP Pointers}", + year = "1991", + volume = "IV", + number = "4", + pages = "9-16" +} +@ARTICLE {Clinger-1991, + author = "William Clinger", + title = "\href{https://dl.acm.org/doi/10.1145/1317265.1317269}{Hygienic Macros Through Explicit Renaming}", + journal = "\href{https://dl.acm.org/toc/sigplan-lisppointers/1991/IV/4}{ACM SIGPLAN LISP Pointers}", + year = "1991", + volume = "IV", + number = "4", + pages = "25-28" +} +@INPROCEEDINGS {Clinger-and-Rees-1991b, + author = "William Clinger and Jonathan Rees", + title = "\href{https://dl.acm.org/doi/10.1145/99583.99607}{Macros That Work}", + booktitle = "\href{https://dl.acm.org/doi/proceedings/10.1145/99583}{POPL '91: Proceedings of the 18th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages}", + year = "1991", + pages = "155-162" +} +@ARTICLE {Kelsey-Clinger-and-Rees-1998, + author = "Rechard Kelsey and William Clinger and Jonathan Rees (Editors)", + title = "\href{https://dl.acm.org/doi/10.1145/290229.290234}{Revised$^5$ Report on the Algorithmic Language Scheme}", + journal = "\href{https://dl.acm.org/toc/sigplan/1998/33/9}{ACM SIGPLAN Notices}", + year = "1998", + volume = "33", + number = "9", + pages = "26-76" +} +@ONLINE {Kempf-2001a, + author = "William E. Kempf", + title = "\href{https://www.codeproject.com/Articles/912/A-garbage-collection-framework-for-C}{A garbage collection framework for C++}", + year = "2001" +} +@MISC {Kempf-2001b, + author = "William E. Kempf", + title = "\href{https://www.codeproject.com/Articles/938/A-garbage-collection-framework-for-C-Part-II}{A garbage collection framework for C++ - Part II}", + year = "2001" +} +@INPROCEEDINGS {Adams-and-Dybvig-2008, + author = "Michael D. Adams and R. Kent Dybvig", + title = "\href{https://dl.acm.org/doi/10.1145/1411204.1411230}{Efficient Nondestructive Equality Checking for Trees and Graphs}", + booktitle = "\href{https://dl.acm.org/doi/proceedings/10.1145/1411204}{ICFP '08: Proceedings of the 13th ACM SIGPLAN International Conference on Functional Programming}", + year = "2008", + pages = "179-188" +} +@TECHREPORT {Shinn-Cowan-and-Gleckler-2013, + author = "Alex Shinn and John Cowan and Arthur A. Gleckler (Editors)", + title = "\href{https://standards.scheme.org/official/r7rs.pdf}{Revised$^7$ Report on the Algorithmic Language Scheme}", + institution = "http://www.scheme-reports.org/", + year = "2013" +} diff --git a/include/meevax/bit/bit_cast.hpp b/include/meevax/bit/bit_cast.hpp index 43108b9c2..09f16f66d 100644 --- a/include/meevax/bit/bit_cast.hpp +++ b/include/meevax/bit/bit_cast.hpp @@ -18,8 +18,7 @@ #define INCLUDED_MEEVAX_BIT_BIT_CAST_HPP #include - -#include +#include namespace meevax { @@ -27,10 +26,10 @@ inline namespace bit { template , - std::is_trivially_copyable, - std::is_trivially_copyable, - std::is_trivially_constructible)> + typename = std::enable_if_t, + std::is_trivially_copyable, + std::is_trivially_copyable, + std::is_trivially_constructible>>> auto bit_cast(From const& from) noexcept { To to; diff --git a/include/meevax/iterator/index_iterator.hpp b/include/meevax/iterator/index_iterator.hpp index ff367ad65..b75bb3bbc 100644 --- a/include/meevax/iterator/index_iterator.hpp +++ b/include/meevax/iterator/index_iterator.hpp @@ -17,6 +17,7 @@ #ifndef INCLUDED_MEEVAX_ITERATOR_INDEX_ITERATOR_HPP #define INCLUDED_MEEVAX_ITERATOR_INDEX_ITERATOR_HPP +#include #include #include #include diff --git a/include/meevax/kernel/character.hpp b/include/meevax/kernel/character.hpp index 59533cc1a..7ab3721a7 100644 --- a/include/meevax/kernel/character.hpp +++ b/include/meevax/kernel/character.hpp @@ -17,6 +17,7 @@ #ifndef INCLUDED_MEEVAX_KERNEL_CHARACTER_HPP #define INCLUDED_MEEVAX_KERNEL_CHARACTER_HPP +#include // CHAR_BIT #include #include #include @@ -31,11 +32,9 @@ inline namespace kernel using int_type = std::char_traits::int_type; - /* - 21 <= sizeof(int_type) * 8 is a request from the maximum Unicode code - point 0x10FFFF. sizeof(int_type) < 6 is a requirement from nan-boxing. - */ - static_assert(21 <= sizeof(int_type) * 8 and sizeof(int_type) <= 6); + static_assert(21 <= sizeof(int_type) * CHAR_BIT); // is a requirement from the maximum Unicode code point 0x10FFFF. + + static_assert(sizeof(int_type) <= 6); // is a requirement from nan-boxing. int_type codepoint; @@ -75,18 +74,20 @@ inline namespace kernel Zs, // Separator, Space } value; - constexpr property_code(value_type value) - : value { value } + constexpr property_code(int_type codepoint) + : value { to_value_type(codepoint) } {} - static constexpr auto from(int_type codepoint) + static constexpr auto to_value_type(int_type codepoint) noexcept -> value_type { switch (codepoint) { + #if __has_include() #include + #endif default: - return Cc; + return Cn; } } @@ -122,9 +123,9 @@ inline namespace kernel } }; - explicit character() = default; + character() = default; - explicit constexpr character(int_type const& codepoint) + explicit constexpr character(int_type codepoint) : codepoint { codepoint } {} @@ -147,7 +148,9 @@ inline namespace kernel { switch (codepoint) { + #if __has_include() #include + #endif default: return std::nullopt; @@ -158,7 +161,9 @@ inline namespace kernel { switch (codepoint) { + #if __has_include() #include + #endif default: return codepoint; @@ -175,16 +180,23 @@ inline namespace kernel return eq(eof(), c); } + constexpr auto is_eof() const noexcept + { + return is_eof(codepoint); + } + constexpr auto property() const noexcept -> property_code { - return property_code::from(codepoint); + return codepoint; } constexpr auto upcase() const noexcept { switch (codepoint) { + #if __has_include() #include + #endif default: return codepoint; diff --git a/include/meevax/kernel/implementation_dependent.hpp b/include/meevax/kernel/conditional_expand.hpp similarity index 75% rename from include/meevax/kernel/implementation_dependent.hpp rename to include/meevax/kernel/conditional_expand.hpp index 1d65f4ee0..b213e0e55 100644 --- a/include/meevax/kernel/implementation_dependent.hpp +++ b/include/meevax/kernel/conditional_expand.hpp @@ -14,8 +14,8 @@ limitations under the License. */ -#ifndef INCLUDED_MEEVAX_KERNEL_IMPLEMENTATION_DEPENDENT_HPP -#define INCLUDED_MEEVAX_KERNEL_IMPLEMENTATION_DEPENDENT_HPP +#ifndef INCLUDED_MEEVAX_KERNEL_CONDITIONAL_EXPAND_HPP +#define INCLUDED_MEEVAX_KERNEL_CONDITIONAL_EXPAND_HPP #include @@ -23,8 +23,8 @@ namespace meevax { inline namespace kernel { - auto implementation_dependent(object const&) -> object; + auto conditional_expand(object const&) -> object; } // namespace kernel } // namespace meevax -#endif // INCLUDED_MEEVAX_KERNEL_IMPLEMENTATION_DEPENDENT_HPP +#endif // INCLUDED_MEEVAX_KERNEL_CONDITIONAL_EXPAND_HPP diff --git a/include/meevax/kernel/configurator.hpp b/include/meevax/kernel/configurator.hpp index 4255e5d1d..252456a71 100644 --- a/include/meevax/kernel/configurator.hpp +++ b/include/meevax/kernel/configurator.hpp @@ -35,12 +35,12 @@ inline namespace kernel { std::regex const pattern; - std::function const&)> build; + std::function object> const&) -> void> evaluate; template explicit option(S&& s, F&& f) - : pattern { std::forward(s) } - , build { std::forward(f) } + : pattern { std::forward(s) } + , evaluate { std::forward(f) } {} }; @@ -48,7 +48,7 @@ inline namespace kernel std::vector command_line; - auto configure(const int argc, char const* const* const argv) + auto configure(int const argc, char const* const* const argv) { for (auto i = 0; i < argc; ++i) { @@ -60,71 +60,44 @@ inline namespace kernel auto configure(std::vector const& args) -> void { - static std::regex const pattern { R"(--(\w[-\w]+)(=(.*))?|-([\w]+))" }; + auto const static pattern = std::regex(R"(--(\w[-\w]+)(=(.*))?|-([\w]+))"); - std::vector