15 Commits

Author SHA1 Message Date
1a9a4494e0 Caller-relative imports; smart deduping in imports
All checks were successful
Test, Build, and Release / test (push) Successful in 1m35s
Test, Build, and Release / build (push) Successful in 1m13s
2025-01-30 17:56:46 -06:00
7d1b6a741d REPL import warning; version info in CLI
All checks were successful
Test, Build, and Release / test (push) Successful in 1m18s
Test, Build, and Release / build (push) Successful in 1m13s
Adds the ability to toggle result decoding in REPL. Adds several more
useful functions to the base library.
2025-01-30 16:33:36 -06:00
bf1000d174 Rework module system
All checks were successful
Test, Build, and Release / test (push) Successful in 1m37s
Test, Build, and Release / build (push) Successful in 1m14s
Don't require/allow naming a module, instead require that the importer
names it. Allow importing into the local scope with the name !Local.
Simplify namespacing logic. Updates all tests to reflect these changes.
2025-01-30 13:56:09 -06:00
4a4b09e898 # Modules
Basic implementation of a module system including tests.
2025-01-27 16:04:04 -06:00
c9d0d04630 # File eval mode now relies on main function
To encourage organizing code in a way that helps in understanding, I
have implemented the common idiom of requiring a `main` function. In
tricu and other functional languages, it is usually placed near the top
of the module. The evaluator gracefully handles the situation of passing
multiple files where the intermediary "library" files do not have main functions.
2025-01-26 15:33:12 -06:00
425489a73f Definition dependency analysis
tricu now allows defining terms in any order and will resolve
dependencies to ensure that they're evaluated in the right order.
Undefined terms are detected and throw errors during dependency
ordering.
For now we can't define top-level mutually recursive terms.
2025-01-26 14:50:39 -06:00
b0b0fb22b9 Allow lambda expressions without explicit paren 2025-01-26 08:52:28 -06:00
00cdeca280 Eval optimization! Tests for demos 2025-01-25 09:18:13 -06:00
3175132eec Immutable definitions and documentation updates 2025-01-24 16:14:33 -06:00
88b1c71695 Add size demo 2025-01-23 18:57:59 -06:00
10c7cc367d Some special characters in ids; new demos
Adds support for several special characters in identifiers. Adds a demo
for converting values to source code and another for checking equality.
Updates the existing demo and tests to reflect new names for functions
returning booleans.
2025-01-23 15:46:40 -06:00
3e3e5802fa Drop unreachable cases of updateDepth 2025-01-21 16:16:04 -06:00
83dad2c56b Add more explicit error handling for mismatched groupings 2025-01-21 16:06:10 -06:00
aac10d031d Actually readable Level Order Traversal 2025-01-20 20:10:14 -06:00
3fec1e0c68 Level Order Traversal demo 2025-01-03 12:00:06 -06:00