aboutsummaryrefslogtreecommitdiff
path: root/examples/uniq.fwd
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2026-05-01 22:43:13 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2026-05-01 22:43:13 +0300
commitdb3809488805fbdcd9d726d9ed45ad7335812bd1 (patch)
treedcf1ceb68a7d77733a474825a9804fe99d253b48 /examples/uniq.fwd
parentf1e9860ab638594e95db0ada848157b860eeb831 (diff)
downloadfwd-db3809488805fbdcd9d726d9ed45ad7335812bd1.tar.gz
fwd-db3809488805fbdcd9d726d9ed45ad7335812bd1.zip
remove examples in favour of testsHEADmaster
+ Might come up with proper examples at some point, but for now tests at least tell us if they're broken
Diffstat (limited to 'examples/uniq.fwd')
-rw-r--r--examples/uniq.fwd52
1 files changed, 0 insertions, 52 deletions
diff --git a/examples/uniq.fwd b/examples/uniq.fwd
deleted file mode 100644
index cc6e0af..0000000
--- a/examples/uniq.fwd
+++ /dev/null
@@ -1,52 +0,0 @@
-/* not entirely sure about the final syntax just yet but something like this */
-
-/* 'extern' functions (though some should probably be generic?) */
-fwd_getline(
- (optional![string]) next);
-
-fwd_some(optional![string] o,
- (string) something | () nothing);
-
-fwd_insert(unordered_set![string] set, string line,
- (unordered_set![string]) next);
-
-fwd_destroy(auto a);
-
-/* at some point I'll probably add in a type system as well, but for now let's
- * pretend we're static-dynamic (or dynamic at compiletime? dunno) */
-readlines(unordered_set![string] set, (unordered_set![string]) next)
-{
- fwd_getline() => optional![string] line;
- !> e {
- own set {fwd_destroy(set);}
- error e
- }
-
- fwd_some(line) => string line {
- /* we had something in our option */
- fwd_insert(set, line) => unordered_set![string] set;
-
- /* at the moment the only supported looping construct is
- * recursion */
- readlines(set, next);
- } => {
- /* option was illegal, we've read all input there is */
- next(set);
- }
-}
-
-fwd_foreach(unordered_set![string] set,
- (string) callback);
-
-fwd_println(string s);
-
-main()
-{
- /* fwdlib.hpp uses namespace std, not good practice but allows us to do
- * stuff like this without really caring about implementing "::" */
- unordered_set![string]{} => unordered_set![string] set;
- readlines(set) => unordered_set![string] set;
- fwd_foreach(set) => string node {
- fwd_println(node);
- }
-}