summaryrefslogtreecommitdiff
path: root/hs/notes.txt
diff options
context:
space:
mode:
Diffstat (limited to 'hs/notes.txt')
-rw-r--r--hs/notes.txt47
1 files changed, 47 insertions, 0 deletions
diff --git a/hs/notes.txt b/hs/notes.txt
new file mode 100644
index 0000000..e935e44
--- /dev/null
+++ b/hs/notes.txt
@@ -0,0 +1,47 @@
+// {
+// f := nil;
+// {
+// a := 1;
+// f = ??{
+// print(a);
+// };
+// f(); // print 1
+// a = 3;
+// f(); // print 3
+// };
+// f(); // print 3
+// a := 2;
+// f(); // print 3
+// }; // deref and delete f and a
+// print("done");
+
+
+// -- new snippet
+
+
+// f := ??{
+// print(a); // error: undefined variable 'a'
+// };
+// a := 1;
+// f();
+
+
+// -- new snippet
+
+
+{
+ a := 10; // 1
+ f := nil; // 2
+ {
+ a := 20; // 3
+ f = ??{
+ print(a);
+ g := ??{
+ print(a);
+ };
+ g();
+ };
+ f(); // -> 20 20 NOTE: the g is stored in 5 while 4 is available!
+ };
+ f(); // -> 20 20 of 20 10?
+};