Lecture overview -- Keyboard shortcut: 'u'  Previous page: Property lists -- Keyboard shortcut: 'p'  Next page: Programs represented as lists -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Help page about these notes  Alphabetic index  Course home    Lecture 2 - Page 24 : 46
Functional Programming in Scheme
Expressions, Types, and Functions
Tables as lists of rows

It is natural to represent tables as lists of rows, and to represent a row as a list

Tables play an important roles in many web documents

LAML has a strong support of tables

Expression

Value

tab1
(("This" "is" "first" "row")
 ("This" "is" "second" "row")
 ("This" "is" "third" "row")
 ("This" "is" "fourth" "row")
)
(show-table tab1)
Thisisfirstrow
Thisissecondrow
Thisisthirdrow
Thisisfourthrow
(show-table (transpose-1 tab1))
ThisThisThisThis
isisisis
firstsecondthirdfourth
rowrowrowrow
(show-table (eliminate-row 2 tab1))
Thisisfirstrow
Thisisthirdrow
Thisisfourthrow
(show-table (eliminate-column 4 tab1))
Thisisfirst
Thisissecond
Thisisthird
Thisisfourth

Examples of table transposing, row elimination, and column elimination. We will program and illustrate these functions in a later exercise of this material. The function show-table is similar to table-0 from a LAML convenience library. Using higher-order functions it is rather easy to program the show-table function. We will come back to this later in these notes.

Later in this material we will study possible implementations of the function show-table