Browse Source

Doc updates

Ben Simms 1 year ago
parent
commit
299c945edb
1 changed files with 7 additions and 6 deletions
  1. 7 6
      examples/numbat_syntax.nbt

+ 7 - 6
examples/numbat_syntax.nbt

@@ -111,14 +111,15 @@ assert_eq(1 yd, 1 m, 10 cm)      # Assert that two quantities are equal, up to
 type(2 m/s)                      # Print the type of an expression
 type(2 m/s)                      # Print the type of an expression
 
 
 
 
-# 9. Structs
+# 10. Structs
 
 
-# defining a struct
-struct Foo { foo: Current, bar: Scalar }
+struct Foo {                        # defining a struct
+  foo: Current,
+  bar: Scalar
+}
 
 
-# Constructing a struct
-Foo {foo: 1A, bar: pi}
+Foo {foo: 1A, bar: pi}              # constructing a struct
 
 
 let r: Foo = Foo {foo: 1A, bar: pi}
 let r: Foo = Foo {foo: 1A, bar: pi}
 
 
-r.foo  # Field access is performed with `.field` notation
+r.foo                               # Field access is performed with `.field` notation