Exercise index of this lecture   Alphabetic index   Course home   

Exercises
LAML


1.1   A tabular function 

Make a WWW page with a table that maps n to fak(n), fib(n), or another similar function for n running from 1 to a constant N.

The WWW page should be generated from a Scheme program that uses LAML.

Use one of the existing LAML table functions from the HTML4.0 convenience library.

Example of a generated WWW page for fak between 1 and 20:

n(fak n)
11
22
36
424
5120
6720
75040
840320
9362880
103628800
1139916800
12479001600
136227020800
1487178291200
151307674368000
1620922789888000
17355687428096000
186402373705728000
19121645100408832000
202432902008176640000

 


1.2   A tabular list of input 

Read a linear list of data from a file. You can assume that the data is represented as a Lisp list.

Present the data on HTML page using a table in one of the following ways:

  • Each consequtive n elements from the list forms a table row.
  • Each consequtive n elements from the ist forms a table column.

You can assume that n is positive integer.

Example: If we input the list

   (1 2 3 4 5 6 7 8)

with n = 3 into columns we get the table

147
258
36

You can make your own table function, or you can use one of the table functions from LAML (in the convenience library).

The table functions typically require a list of rows. You can program your own functions that make these rows from your input list, or you can use the function sublist-by-rows and sublist-by-columns (from the general library).

 


Generated: Tuesday March 26, 2002, 12:46:28