summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2012-06-30 17:25:18 -0400
committerOri Bernstein <ori@eigenstate.org>2012-06-30 17:25:18 -0400
commit4df17d13933cf5d70cedfc62eee17f52fbaf08d5 (patch)
tree6432c5ddf900122441e68670fc3615d295b40b67 /doc
parent1e8a7b492adbf99def7348f6161f5fdbdc18801a (diff)
downloadmc-4df17d13933cf5d70cedfc62eee17f52fbaf08d5.tar.gz
More work on the docs
Diffstat (limited to 'doc')
-rw-r--r--doc/lang.txt57
1 files changed, 54 insertions, 3 deletions
diff --git a/doc/lang.txt b/doc/lang.txt
index 27b4c3e..dd9eea2 100644
--- a/doc/lang.txt
+++ b/doc/lang.txt
@@ -138,13 +138,64 @@ Types:
Floating-point types. The exact semantics are yet to be
defined.
- @<ident>
+ @<name>
A generic type. This is only allowed in the scope of 'generic'
constants.
It also allows composite types to be defined. These are listed below:
- @a
+ <type>*
+
+ A pointer to a type This type does not support C-style pointer
+ arithmetic, indexing, or any other such manipulation. However,
+ slices of it can be taken, which subsumes the majority of uses
+ for pointer arithmetic. The pointer is passed by value, but as
+ expected, the pointed to value is not.
+
+ <type>[,]
+
+ A slice of a type. Slices point to a number of objects. They
+ can be indexed, sliced, and assigned. They carry their range,
+ and can in principle be bounds-checked (although the compiler
+ currently does not do this, due to the lack of a runtime library
+ that will allow a 'panic' function to be called).
+
+ <type>[size]
+
+ An array of <type>. Unlike most languages other than Pascal, the
+ size of the array is a part of it's type, and arrays of
+ different sizes may not be assigned between each other. Arrays
+ are passed by value, and copied when assigned.
+
+ <type0>,<type1>,...,<typeN>
+
+ A tuple of type t0, t1, t2, ....
+
+ Finally, there are aggregate types that can be defined:
+
+ struct
+
+ union
+
+ Any of these types can be given a name. This naming defines a completely
+ new incompatible type
+
+Type Constraints
+
+
+Literals:
+
+ character
+ bool
+ int
+ float
+ func
+ sequence
+
+Symbols
+
+Imports
+
+Exports
-Constants: