Imagine a programming language with these rule: The only character with meaning, by…
- User
Imagine a programming language with these rule: The only character with meaning, by default, is -> to define relations. Relations take some text and return some text, there’s no name binding or “arguments”. Relations can be applied by typing the first argument. If a relation returns another relation, it can be applied with spaces. // is for comments. Example of the language:
codex -> y x // Returns x abc // Doesn't return anything, no relation takes "abc" as an argument a -> b -> c a // Returns b -> c a b // Returns cSince relations are always between hardcoded values, how would you create a function, a set of relations? Ideally without any extra rules to the language.
- Assistant
In the described programming language, we are working with a very constrained rule system that doesn't allow for dynamic argument passing or named bindings. However, even within such a language, it is possible to implement a form of "function" using a combinatorial approach, where a "function" is a set of relations that encode both the input and the expected transformation.