All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Remove outdated Doxygen configuration options (issue #34).
- Update the minimum required CMake version to 3.10.0 due to deprecation (issue #33).
- Update the minimum required CMake version to 3.5.0 due to deprecation (issue #32).
- Fix the
DOWNLOAD_EXTRACT_TIMESTAMPCMake warning (see datatype99/issues/15).
- Fix C++ compilation for
ML99_INTRODUCE_VAR_TO_STMTandML99_INTRODUCE_NON_NULL_PTR_TO_STMT(issue #25).
- Specify
Cas the project language inCMakeLists.txt. Previously, CMake detected C++ and required a C++ compiler to compile the project.
- Add the root
CMakeLists.txtto be able to use CMake withFetchContentoradd_subdirectory(PR #20). list.h:ML99_listFilterMapto filter a list with a maybe-returning function.
- Deprecate
ML99_catEvalbecause there were no use cases over time.
choice.h:ML99_choiceData,ML99_CHOICE_DATAto extract a choice value data.
gen.h:- Add
ML99_fnPtr(Stmt)to generate a function pointer.
- Add
- New module
stmt.h:- Take
ML99_INTRODUCE_VAR_TO_STMT,ML99_INTRODUCE_NON_NULL_PTR_TO_STMT,ML99_CHAIN_EXPR_STMT,ML99_CHAIN_EXPR_STMT_AFTER, andML99_SUPPRESS_UNUSED_BEFORE_STMTfromgen.h.
- Take
choice.h:- Define the representation of choice types as
(tag, ...).
- Define the representation of choice types as
tuple.h:- Emit a fatal error in
ML99_untupleif an argument is not a tuple.
- Emit a fatal error in
gen.h:- Move all statement chaining macros to
stmt.h(see above). - Move
ML99_GEN_SYMandML99_TRAILING_SEMICOLONtoutil.h.
- Move all statement chaining macros to
tuple.h:ML99_untupleCheckedbecause it is the same asML99_untuple.ML99_tupleEval,ML99_untupleEvalbecause there were no use cases over time.
logical.h:- Move all functions to
bool.h.
- Move all functions to
control.h:- Move
ML99_OVERLOADtovariadics.h. - Move
ML99_if,ML99_IFtobool.h. - Move
ML99_repeat,ML99_timestogen.h.
- Move
- New module
seq.h:ML99_seqIsEmpty,ML99_SEQ_IS_EMPTYto check for the empty sequence.ML99_seqGet,ML99_SEQ_GETto get ani-indexed element.ML99_seqTail,ML99_SEQ_TAILto get a tail.ML99_seqForEach(I)to iterate through each element.
logical.h:ML99_boolMatch(WithArgs)to perform pattern matching on a boolean value.
list.h,variadics.h:- Remove the requirement that
ML99_listFromTuplesandML99_variadicsForEach(I)can accept at most 63 arguments.
- Remove the requirement that
util.h:ML99_COMMAthat expands to a single comma.
util.h:ML99_(L|R)PARENbecause they result in code that is difficult to reason about.
metalang99.h:ML99_VERSION_COMPATIBLEto check for a SemVer-compatible version.ML99_VERSION_EQto check for an exact version.
ident.h:ML99_charLit,ML99_CHAR_LITto convert a Metalang99 character to a C character literal.
assert.h:- Generate
_Static_assertfrom the assertion macros if compiling on C11.
- Generate
- Tuple counterparts of variadics (
tuple.h):ML99_tupleCount,ML99_TUPLE_COUNT.ML99_tupleIsSingle,ML99_TUPLE_IS_SINGLE.ML99_tupleForEach(I).
util.h:ML99_cat3&ML99_cat4to desugar to themselves instead ofML99_cat.
variadics.h:- Make
variadics.hwork without includingnat.h&util.h.
- Make
ML99_assignInitializerList(Stmt)asML99_assign(Stmt)counterparts for initializer lists.
- Invalid C11 standard detection for
_Static_assert(issue #15). - Invalid C11 standard detection for
_Static_asserton MSVC (issue #16).
ML99_ALLOW_POOR_DIAGNOSTICS: if your compiler does not support decent diagnostic messages, Metalang99 will emit an error that can be suppressed by defining this macro.
- Emit
_Static_assertfor diagnostics where possible:- C11.
- Clang if
__has_extension(c_static_assert). - GCC if newer than 4.6.
util.h:ML99_todo(WithMsg)andML99_unimplemented(WithMsg)to indicate unimplemented functionality.
- Handle the
(...) (...) ...form inML99_isUntuple:- All the dependent public functions inherit this ability too:
ML99_isTuple,ML99_untupleChecked, andML99_listFromTuples. - Now the interpreter is able to emit a syntax error for
v(123) v(456).
- All the dependent public functions inherit this ability too:
- Emit syntax errors and errors from
ML99_fatalright to a console if compiling on GCC.
list.h:ML99_listFromTuplesto transform comma-separated tuples into a list.
util.h:ML99_(L|R)PARENthat expand to an opening/closing parenthesis.
tuple.h:ML99_untupleCheckedto emit a fatal error if a provided argument is not a tuple.
- New module
ident.h:- Migrate
ML99_detectIdent,ML99_identEq,ML99_DETECT_IDENT,ML99_IDENT_EQ,ML99_C_KEYWORD_DETECTOR,ML99_UNDERSCORE_DETECTORfromutil.h. ML99_(LOWER|UPPER)CASE_DETECTORto detect lower/uppercase characters.ML99_DIGIT_DETECTORto detect digits.ML99_char_eq,ML99_CHAR_EQto compare two characters.ML99_is(Lower|Upper)case,ML99_IS_(LOWER|UPPER)CASEto check whether a letter is lower/uppercased.ML99_isDigit,ML99_IS_DIGITto check whether a character is digit.ML99_isChar,ML99_IS_CHARto check whether an identifier is a character.ML99_(LOWER|UPPER)CASE_CHARSthat expands to all comma-separated lower/uppercase characters.ML99_DIGITSthat expands to all comma-separated digits.
- Migrate
util.h:- Automatically include
ident.hfor backwards compatibility.
- Automatically include
- Make Metalang99 work on TCC (see datatype99/issues/10).
gen.h:- Statement chaining macros:
ML99_CHAIN_EXPR_STMTto execute a statement before the next statement.ML99_CHAIN_EXPR_STMT_AFTERto execute a statement afterwards.ML99_INTRODUCE_NON_NULL_PTR_TO_STMTto introduce a non-null pointer to a statement.
- Other:
ML99_GEN_SYMto generate unique identifiers.ML99_TRAILING_SEMICOLONto force a trailing semicolon.ML99_semicolonedthat puts a semicolon after its argument.ML99_assignto assign something to something.ML99_assignStmtto generate an assignment statement.ML99_invoketo invoke a macro/function.ML99_invokeStmtto generate a macro/function invocation statement.ML99_prefixedBlockto generateprefix { code }.
- Statement chaining macros:
util.h:- Dealing with identifiers:
ML99_detectIdent.ML99_identEq,ML99_IDENT_EQto compare two identifiers.ML99_C_KEYWORD_DETECTORto detect the C11 keywords.ML99_UNDERSCORE_DETECTORto detect the underscore character (_).
- Other:
ML99_uncommato evaluate terms with the space-separator.ML99_reifyto reify a macro/function to a Metalang99-compliant metafunction.ML99_cat3,ML99_CAT3,ML99_CAT3_PRIMITIVE.ML99_cat4,ML99_CAT4,ML99_CAT4_PRIMITIVE.
- Dealing with identifiers:
assert.h:ML99_assert,ML99_assertEq.
variadics.h:ML99_variadicsIsSingle,ML99_VARIADICS_IS_SINGLE.
- Built-in data type assertion macros:
tuple.h:ML99_assertIsTuple.nat.h:ML99_assertIsNat.
assert.h:- Parenthesize expressions passed to
ML99_ASSERT,ML99_ASSERT_EQ.
- Parenthesize expressions passed to
gen.h:ML99_INTRODUCE_VAR_TO_STMTcan deal with several variables.
gen.h:ML99_SUPPRESS_UNUSED_BEFORE_STMT(useML99_CHAIN_EXPR_STMT((void)expr)instead).
ML99_QUOTE.
ML99_consume,ML99_CONSUME.
- Move
ML99_TERMSfromutil.htolang.h. - Return a list of tuples from
ML99_listZip, accept a list of tuples inML99_listUnzip, return a tuple of lists fromML99_listPartition. ML99_listEval=>ML99_LIST_EVAL,ML99_listEvalCommaSep=>ML99_LIST_EVAL_COMMA_SEP.- Accept ignored variadics in
ML99_nil,ML99_empty,ML99_true,ML99_false,ML99_nothing(and their plain versions).
- Emit the correct metafunction name in case of an error in
ML99_listGet. - Remove a precondition that metafunctions passed to
ML99_listFoldl,ML99_listFolr,ML99_listFoldl1,ML99_listMap,ML99_listMapI,ML99_listFor,ML99_listMapInitLast, andML99_listForInitLastmust evaluate to a single term.
ML99_SUPPRESS_UNUSED_BEFORE_STMT.ML99_tupleGet,ML99_variadicsGet,ML99_TUPLE_GET,ML99_VARIADICS_GET.ML99_tupleAppend,ML99_tuplePrepend.ML99_indexedArgs.ML99_appl4.ML99_times.ML99_TRUE,ML99_FALSE.ML99_LEFT,ML99_RIGHT,ML99_IS_LEFT,ML99_IS_RIGHT.ML99_JUST,ML99_NOTHING,ML99_IS_JUST,ML99_IS_NOTHING.ML99_NAT_MAX,ML99_DIV_CHECKED.gen.h.
M_choiceEmpty(Plain)(this allows a more optimal choice representation).M_semicolon(this macro turned out to be dangerous).M_tupleHead,M_variadicsHead.M_overload.M_when(Plain),M_whenLazy(Plain).M_putBefore,M_putAfter,M_putBetween.M_leftUnderscored,M_rightUnderscored.misc.h,eval.h.
- Do not guarantee the exact number of available reduction steps, instead keep it "reasonable" for the practical needs.
- Amalgamate
lang.hwitheval.h. - Employ the
SCREAMING_CASEnaming convention for plain macros. - All macros are prefixed with
ML99_, unconditionally. - Accept a number as a first argument and a function as the second in
ML99_repeat. M_get=>ML99_listGet.M_overloadPlain=>ML99_OVERLOAD.M_eval=>ML99_EVAL.M_callTrivial=>ML99_callUneval.- Move
ML99_repeatfrommisc.htocontrol.h. - Move
ML99_indexed(Params, Fields, InitializerList, Args)frommisc.htogen.h. - Move
ML99_braced,ML99_typedef,ML99_struct,ML99_anonStruct,ML99_union,ML99_anonUnion,ML99_enum,ML99_anonEnumfromutil.htogen.h. M_assertPlain=>ML99_ASSERT_UNEVAL,M_assertEmptyPlain=>ML99_ASSERT_EMPTY_UNEVAL.- Rename "unsigned integers" to "natural numbers":
uint.h=>nat.h.M_uintMatch(WithArgs)=>ML99_natMatch(WithArgs).M_uintEq=>ML99_natEq.M_uintNeq=>ML99_natNeq.
- Emit a compile-time error if
/Zc:preprocessor(MSVC) was not specified. - Allow branches in
ML99_IFexpand to commas.
METALANG99_MAJOR,METALANG99_MINOR,METALANG99_PATCH.M_union,M_anonUnion,M_enum,M_anonEnum.METALANG99_GCC_PRAGMA,METALANG99_CLANG_PRAGMA.
- Suppress Clang's
-Wshadowfor a variable produced byM_INTRODUCE_VAR_TO_STMT.
M_DETECT_IDENTM_choicePlain,M_choiceEmptyPlain,M_consPlain,M_nilPlain.M_listMapInPlace,M_listMapInPlaceI.
- Increase the maximum arity from 16 to 255.
- Specify the exact number of commas produced by
M_indexedInitializerList.
- Initialize variables produced by
M_semicolonandM_assertPlainto suppress warnings.
tuple.h:M_tuple(Plain),M_tupleEval,M_untuple(Plain),M_untupleEval,M_isTuple(Plain),M_isUntuple(Plain),M_tupleHead(Plain),M_tupleTail(Plain).
- Move the corresponding functions from
util.handvariadics.htotuple.h.
M_when,M_whenPlain,M_whenLazy,M_whenLazyPlain.M_leftUnderscored,M_rightUnderscored.M_INTRODUCE_VAR_TO_STMT.M_terms.M_tupleHead,M_tupleHeadPlain,M_tupleTail,M_tupleTailPlain.M_indexedParams,M_indexedFields,M_indexedInitializerList.M_typedef,M_struct,M_anonStruct.M_choiceTag,M_choiceTagPlain,M_isNilPlain,M_isCons,M_isConsPlain.
- Make
M_variadicsHeadaccept a single argument too. - Now at most 63 variadic arguments are acceptable by
M_list,M_variadicsCount, andM_variadicsCountPlain. - Terms now need to be separated by commas, e.g. instead of
v(1) M_call(F, v(2)) v(3), writev(1), M_call(F, v(2)), v(3)orM_terms(v(1), M_call(F, v(2)), v(3). - The empty sequence is prohibited by
M_eval,M_callandM_abort. - Use American style endings (because it is prevalent):
M_(un)parenthesise(Eval)=>M_(un)tuple(Eval).M_isParenthesised=>M_isTuple.M_isUnparenthesised=>M_isUntuple.M_parenthesisedVariadics(Head|Tail)=>M_tuple(Head|Tail).
- Shorten functions on unsigned integers:
M_uintInc(Plain)=>M_inc(Plain).M_uintDec(Plain)=>M_dec(Plain).M_uintAdd(3)=>M_add(3).M_uintSub(3)=>M_sub(3).M_uintMul(3)=>M_mul(3).M_uintDiv(3)=>M_div(3).M_uintDivChecked=>M_divChecked.M_uintLesser(Eq)=>M_lesser(Eq).M_uintGreater(Eq)=>M_greater(Eq).M_uintMod=>M_mod.M_uintMin=>M_min.M_uintMax=>M_max.
M_variadicsMap=>M_variadicsForEach,M_variadicsMapI=>M_variadicsForEachI.
aux.*=>util.*for compatibility with Windows.
M_variadicsMapCommaSep,M_variadicsMapICommaSep(better use lists).M_const2,M_const3.
- The project name
Epilepsy=>Metalang99(more neutral).
- Reporting about syntactic mismatches.
- This excellent project.