Glossary

Every word in Common (CL), A to Z, with its one form and an example. Generated by the interpreter from its own dictionary.

command

Starts a line and does something

Seventeen words can begin a line. Each one is a complete instruction.

show "Hello"
set price to 4.5
if age is at least 18
value

Gives you something, used inside a line

Every other word. It never stands alone: put it after a command, or in brackets inside text.

set total to count of fruits
show "Today is [today]"
if email contains "@"

The one rule: a line is one command, and everything after its first word is values.

A C D E F G H I L M N O P Q R S T U Y [ ]

A

add command
add VALUE to LIST

put a value at the end of a list

add "cherry" to fruits
  

E

end command
end

close an if, for each, repeat, to, send email, record or text block

repeat 3 times
  show "hip"
end
  

F

for command
for each NAME in LIST

run the lines below once for every item

for each fruit in fruits
  show "<li>[fruit]</li>"
end
  
forget command
forget "name" / forget everything

drop a remembered value, or all of them (sign out)

forget everything
  

G

give command
give VALUE

inside a verb: hand this value back and finish. A verb that gives can be used wherever a value goes

to slug_of heading
  give replace " " with "-" in lowercase of heading
end

show "[slug_of title]"
  
go command
go to "/page.html"

send the visitor to another page and stop

go to "/thanks"
  

I

if command
if CONDITION

run the lines below when the condition is yes

if age is at least 18
  show "Welcome"
end
  
include command
include "file.html"

insert another page here

include "header.html"
  

O

open command
open database "file.db"

open a SQLite file next to the page, or a Postgres server with postgres://user:password@host/dbname

open database "site.db"
  
otherwise command
otherwise [if CONDITION]

what to run when the condition above was no

if paid
  show "Thanks"
otherwise
  show "Pay first"
end
  

R

remember command
remember "name" as VALUE

keep a value for this visitor until they forget it (a signed cookie)

remember "user" as name
  
repeat command
repeat NUMBER times [until CONDITION]

run the lines below that many times, or fewer with 'until CONDITION': stop as soon as it is yes

repeat 5 times
  show "★"
end
  

S

send command
send email to "you@site.com" then subject:, body:, reply to:, from: lines, then end

send an email to an address you wrote yourself (never a visitor's). While developing it is saved in the private outbox/ folder; behind a web server it goes through sendmail. At most 3 per page and 20 an hour

send email to "owner@example.com"
  subject: "Message from [name]"
  reply to: email
  body: message
end
  
set command
set NAME to VALUE

create or replace a variable; VALUE, VALUE makes a list. 'set COLUMN of RECORD to VALUE' changes one column

set price to 4.5
  
show command
show VALUE / show ... end

show a value on the page (visitor text is made safe). On its own, show opens a block of text that runs until a line saying end

show "Hello, [name]!"
  

T

tell command
tell database "SQL" with VALUE, ...

run SQL that changes the database (insert, update, delete)

tell database "insert into notes (text) values (?)" with note
  
to command
to NAME ARG ... then lines, then end

define a verb: your own command. Call it by name with one value per ARG. Inside, 'give VALUE' hands a value back

to greet someone
  show "<p>Hello, [someone]!</p>"
end

greet "Ada"
  

17 words shown. Show all.

This page, more or less
for each entry in dictionary
  show "<h3>[word of entry]</h3>"
  show "<code>[form of entry]</code>"
  show "<p>[meaning of entry]</p>"
  show code example of entry
end

dictionary is a list of records with the columns word, form, meaning, example and command. It is the same table that cl words prints.