summaryrefslogtreecommitdiffstats
path: root/gensym.sml
diff options
context:
space:
mode:
authorRose Hogenson <rhogenson@posteo.net>2023-02-10 15:06:47 -0800
committerRose Hogenson <rhogenson@posteo.net>2023-02-10 15:06:47 -0800
commitb3f2fd686bc781996687deaadbe721b3300e4aba (patch)
tree7420e4c04fac7ad522a8ee6edc9c2d224958cd87 /gensym.sml
parentd61fa242bdd71a9f535e65b96ed5407769cc792f (diff)
downloadsml-b3f2fd686bc781996687deaadbe721b3300e4aba.tar.zst
Write a first draft of the compiler.
Sorry I haven't been better about these commit messages. You're not my mom.
Diffstat (limited to 'gensym.sml')
-rw-r--r--gensym.sml5
1 files changed, 5 insertions, 0 deletions
diff --git a/gensym.sml b/gensym.sml
new file mode 100644
index 0000000..7a5f123
--- /dev/null
+++ b/gensym.sml
@@ -0,0 +1,5 @@
+structure Gensym =
+struct
+ val counter : int ref = ref 0
+ fun new () : int = (counter := (!counter + 1) ; !counter)
+end