From 9d722a0b6138827de743f9fe4acbf3f2c1830bb0 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Mon, 6 Nov 2023 00:24:11 +0100 Subject: Started creating new docs with wiki --- docs/wiki_src/coding/prefix.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 docs/wiki_src/coding/prefix.md (limited to 'docs/wiki_src/coding/prefix.md') diff --git a/docs/wiki_src/coding/prefix.md b/docs/wiki_src/coding/prefix.md new file mode 100644 index 0000000..589e081 --- /dev/null +++ b/docs/wiki_src/coding/prefix.md @@ -0,0 +1,25 @@ +# Prefix + +Prefix functions are symbols written directly in front of another term +(without space). The term gets applied as an argument to the prefix +function. Use [mixfix functions](mixfix.md) if the function has more +than one argument. + +They are defined by the `‣`{.bruijn} suffix. + +Example: + +``` bruijn +# defines a negation prefix function called '-' +-‣ [(+0) - 0] + +# returns 0 - 10 = -10 +:test (-(+10)) ((-10)) +``` + +You can use them as normal functions by writing the identifier +literally: + +``` bruijn +:test (-‣ (+10)) ((-10)) +``` -- cgit v1.2.3