Skip to content

Commit c3d02f3

Browse files
committed
Started adding the basic functional constructs
1 parent ec9e106 commit c3d02f3

File tree

5 files changed

+49
-0
lines changed

5 files changed

+49
-0
lines changed

fassembly.fxl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
##########################################################
2+
## Standard FAssembly Library - Stage 1 - Fexl ##
3+
##########################################################
4+
# At this stage, we used the Fexl library to write #
5+
# the different functional programming function in Fexl. #
6+
##########################################################
7+
# Next stage: Compilation to C bytecode #
8+
##########################################################
9+
10+
\std=(extend std; use "src/identity.fxl")
11+
12+
13+
extend std
14+
\;
15+

src/identity.fxl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# identity = λx.x
2+
3+
\\identity=(\x x)
4+
5+
def "identity" identity;
6+
std

src/self_apply.fxl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# self_apply = λs.(s s)
2+
3+
\\self_apply=(\s (s s))
4+
5+
def "self_apply" self_apply;
6+
std

tests/identity_test.fxl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# identity = λx.x
2+
3+
\std=(extend std; use "../src/identity.fxl")
4+
extend std
5+
\;
6+
7+
# Todo: Use propertybased testing in identity_test
8+
9+
say ["identity 10 = " (identity 10)]
10+
say ["identity boo = " (identity "boo")]
11+

tests/self_apply_test.fxl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# identity = λx.x
2+
3+
\std=(extend std; use "../src/identity.fxl")
4+
extend std
5+
\;
6+
7+
# Todo: Use propertybased testing in identity_test
8+
9+
say ["identity 10 = " (identity 10)]
10+
say ["identity boo = " (identity "boo")]
11+

0 commit comments

Comments
 (0)