aboutsummaryrefslogtreecommitdiff
path: root/notes/stanza-cheatsheet.txt
diff options
context:
space:
mode:
authorazidar2015-02-19 10:13:51 -0800
committerazidar2015-02-19 10:13:51 -0800
commit8299c2ecae1701fa6060185a8aed25543e201eba (patch)
treec300fa62654fb2233a0f8199b3c2ad83a8b5eb59 /notes/stanza-cheatsheet.txt
parent8c1c4225c340dc658f7d0956e8b231050c122abc (diff)
Re-implemented resolve-kinds, passes preliminary test.
Updated notes and TODO list, and started basic stanza-cheatsheet.
Diffstat (limited to 'notes/stanza-cheatsheet.txt')
-rw-r--r--notes/stanza-cheatsheet.txt48
1 files changed, 48 insertions, 0 deletions
diff --git a/notes/stanza-cheatsheet.txt b/notes/stanza-cheatsheet.txt
new file mode 100644
index 00000000..d8f5c070
--- /dev/null
+++ b/notes/stanza-cheatsheet.txt
@@ -0,0 +1,48 @@
+Functions (defn) have (1) a static type signature and (2) an implementation
+You can define them seperately
+ type signature -> defmulti
+ implementation -> defmethod
+
+Thus, you can have multiple defmethods per defmulti.
+However, you cannot have:
+ defmulti a(x:?) -> ?
+ defn a(x:Int) -> Int
+because it is unclear which to call (2 matching static type signatures)
+
+; [a b c] <- a tuple
+;
+; val rest = List(1,2,3)
+; val b = List(0,rest) --> (0,1,2,3)
+; val c = list(0,rest) --> (0,(1,2,3))
+
+; label<Int> myret :
+; for i in 0 to 10 do :
+; if i == 5:
+; myret(i)
+; 0
+
+; val v = Vector<Int>()
+; add(v,10)
+; add(v,20)
+; add(v,32)
+; for x in v do :
+; println(x)
+
+
+1. explain curly braces in
+ print{o, _} $
+ match(k) :
+ (k:RegKind) : "reg:"
+ My guess is you are passing in a different function depending on the type of k, so you need to lazily evaluate the print, which signifies the {}'s.
+2. explain where in
+ Circuit(modules*, main(c)) where :
+ val modules* =
+ for m in modules(c) map :
+ Module(name(m), ports(m), to-command(body(m)))
+ My guess is you are again evaluating modules* before Circuit, so you are passing in modules lazily?
+3. difference between defn and defmethod?
+
+a typeof T
+a and b
+a or b
+a as T