Open HuseyinSimsek7904 opened 6 months ago
A similar keyword to the const
keyword from Porth programming language may also be implemented.
Would proper sum types be a good fit for Corth instead of C-style enumerations? Take a look at Rust's enums.
Take a look at this piece of code:
This code could be rewritten using
enum
s (andnamespace
s). For example:In this example,
namespace
keyword is used to prepend every name withKEYWORD:
andenum
is used to repeatedly and easily define macros that expend to a single integer that is different every time.This new code is much easier to write and read. Adding the
enum
keyword will improve the readability of the code.