doc/tutorial/basics: add basics tutorial
Change-Id: I350244d6db5e20be4ab3913dc864f61923b2738f
diff --git a/doc/tutorial/basics/fieldcomp.md b/doc/tutorial/basics/fieldcomp.md
new file mode 100644
index 0000000..1c39f05
--- /dev/null
+++ b/doc/tutorial/basics/fieldcomp.md
@@ -0,0 +1,42 @@
+[TOC](Readme.md) [Prev](listcomp.md) [Next](conditional.md)
+
+# Field Comprehensions
+
+CUE also supports comprehensions for fields.
+
+One cannot refer to generated fields with references.
+Instead, one must use indexing.
+
+<!-- CUE editor -->
+```
+import "strings"
+
+a: [ "Barcelona", "Shanghai", "Munich" ]
+
+{
+ "\( strings.ToLower(v) )": {
+ pos: k
+ name: v
+ nameLen: len(v)
+ } for k, v in a
+}
+```
+
+<!-- result -->
+```
+barcelona: {
+ pos: 1
+ name: "Barcelona"
+ nameLen: 9
+}
+shanghai: {
+ pos: 2
+ name: "Shanghai"
+ nameLen: 9
+}
+munich: {
+ pos: 3
+ name: "Munich"
+ nameLen: 9
+}
+```
\ No newline at end of file