diff --git a/quick-help.html b/quick-help.html index 4bdace6..7253431 100644 --- a/quick-help.html +++ b/quick-help.html @@ -4,12 +4,17 @@
A list can be created directly by wrapping a series of comma-separated expressions between brackets:
[1, 4, 9, 16]
-
+
["apple", "banana", "pear"]
[]
@@ -338,7 +343,7 @@ Forms
Links provides two special attributes for programming with HTML forms: l:name
, which binds the value of an input field to a variable, and l:onsubmit
, with which you can supply an expression to be evaluated when the form is submitted.
<form l:onsubmit="{say_hello(personName)}">
- What is your name?
+ What is your name?
<input l:name="{personName}"/>
</form>
@@ -466,7 +471,7 @@ Functions
fun foo(x, y, z)
{
- # ... body
+ # ... body
}
Anonymous functions just omit the name: fun (x) { x + 1 }
is an expression that evaluates to an anonymous function value.
@@ -627,7 +632,7 @@ Database access
For example, to create a handle to the table ice_cream
with fields i
and f
both of type Int
associated with the database db
, and bind it to the variable fac_table
, use:
- var parlors = table "ice_cream_parlors"
+ var parlors = table "ice_cream_parlors"
with (name : String, fans : Int) from db;
The variable parlors
then has type TableHandle((name : String, fans : Int), (name : String, fans : Int), (name : String, fans : Int))
. The three arguments to the TableHandle
type constructor together identify the type of a row and its constraints (See "Table constraints").
@@ -638,7 +643,7 @@ Using tables
Since a table-handle in Links is different from a list, we cannot simply draw elements directly from a table as we draw them from a list. But a special form of generator accepts a table-handle as its source:
- var parlors = table "ice_cream_parlors"
+ var parlors = table "ice_cream_parlors"
with (name : String, fans : Int) from db;
for (p <-- parlors)
where (p.flavors > 1)
@@ -713,7 +718,7 @@ Table constraints
To enable these special features on a table field, add a where
clause to the table expression that lists field names with the corresponding keyword. For example:
- table "people" with (id:Int, name:String, nationality:String)
+ table "people" with (id:Int, name:String, nationality:String)
where id readonly, nationality default from db
This returns a table handle for the table people
with fields id
and nationality
, where the id
field cannot be modified through this handle, and nationality
has a default value so giving a value is optional when modifying the table.
@@ -721,9 +726,9 @@ Table constraints
The type assigned by Links to a table handle has three fields, indicating the readable fields, the writeable fields and the needed fields, in that order:
links>
- var t = table "people" with (id:Int, name:String, nationality:String)
+ var t = table "people" with (id:Int, name:String, nationality:String)
where id readonly, nationality default from db;
- t = (table people) :
+ t = (table people) :
TableHandle((id:Int,name:String,nationality:String),
(name:String,nationality:String),
(name:String))
@@ -888,7 +893,7 @@ Types in Links
links> [(42, "The answer"),
(7, "The number of wonders of the world")];
- [(42, "The answer"), (7, "The number of wonders of the world")]
+ [(42, "The answer"), (7, "The number of wonders of the world")]
: [(Int, String)]
Note that the type of an integer is Int, and the type of a string is String. The pair (42, "The answer")
has a type that indicates the first part of the pair is an Int
and the second part is a String
; this type is written (Int, String)
.
@@ -2024,7 +2029,7 @@ Configuration settings
The available settings can be discovered in the interactive loop using the @settings
directive:
links> @settings;
-
+
User settings
show_unification false
show_typechecking false
@@ -2049,5 +2054,3 @@ Configuration settings