summaryrefslogtreecommitdiff
path: root/ctoclean/square.icl
diff options
context:
space:
mode:
authorCamil Staps2016-01-26 16:21:28 +0100
committerCamil Staps2016-01-26 16:21:28 +0100
commitacf60ada87c70bc22adae5e760c354f1a7f33e6d (patch)
tree997356707af3f850d8974c328e2dfcd0ae471b2a /ctoclean/square.icl
parentMoving objectio tests (diff)
ctoclean
Diffstat (limited to 'ctoclean/square.icl')
-rw-r--r--ctoclean/square.icl15
1 files changed, 15 insertions, 0 deletions
diff --git a/ctoclean/square.icl b/ctoclean/square.icl
new file mode 100644
index 0000000..3fd9723
--- /dev/null
+++ b/ctoclean/square.icl
@@ -0,0 +1,15 @@
+implementation module square
+
+import StdEnv
+
+foreign export square
+square :: !Int -> Int
+square x = x * x
+
+call_square :: !Int -> Int
+call_square x = code {
+ ccall square "GI:I"
+};
+
+Start = map call_square [1..10]
+