Added upstream from http://ftp.icm.edu.pl/pub/loglan/
[loglan.git] / HTML / MicroMan / FormalTy.htm
1 <!doctype html public "-//IETF//DTD HTML//EN">\r
2 <HTML>\r
3 \r
4 <HEAD>\r
5 \r
6 <TITLE>Formal types</TITLE>\r
7 \r
8 <META NAME="GENERATOR" CONTENT="Internet Assistant for Word 1.0Z">\r
9 <META NAME="AUTHOR" CONTENT="NOM">\r
10 </HEAD>\r
11 \r
12 <BODY>\r
13 \r
14 <P>\r
15 <U><I>Loglan 82, A micro-manual of the programming language -\r
16 Basic constructs and facilities</I></U> \r
17 <H1><IMG ALIGN=MIDDLE SRC="gifs/logo2.gif"> 9) Formal types</H1>\r
18 <HR>\r
19 \r
20 <P>\r
21 Formal types serve for unit parametrization with respect to any\r
22 non-primitive type.\r
23 <P>\r
24 Example:\r
25 <P>\r
26 <IMG SRC="gifs/ft01.gif"> \r
27 <P>\r
28 Procedure Gsort (the generalization of procedure sort from p.4)\r
29 has type parameter T. A corresponding actual parameter may be\r
30 an arbitrary non-primitive type. An actual parameter corresponding\r
31 to A should be an array of elements of the actual type T. Function\r
32 less should define the linear ordering on the domain T.\r
33 <P>\r
34 For instance, the array A of type bill (cf p.7) may be sorted\r
35 with respect to attribute dollars , if the function:\r
36 <P>\r
37 <IMG SRC="gifs/ft02.gif"> \r
38 <P>\r
39 is used as an actual parameter:\r
40 <P>\r
41 <IMG SRC="gifs/ft03.gif"> \r
42 <P>\r
43 If the user desires to sort A with respect to date, it is sufficient\r
44 to declare :\r
45 <P>\r
46 <IMG SRC="gifs/ft04.gif"> \r
47 <P>\r
48 and to call: <B>call</B> Gsort(bill,A,earlier); <HR>\r
49 \r
50 <P><hr>\r
51 <A HREF="Prefixin.htm"><IMG SRC="gifs/PrevPage.gif"></A> \r
52 <A HREF="homepage.htm"><IMG SRC="gifs/HomePage.gif"></A> \r
53 <A HREF="Protecti.htm"><IMG SRC="gifs/NextPage.gif"></A> <HR>\r
54 \r
55 <ADDRESS>\r
56 Last update 02/07/95 \r
57 </ADDRESS>\r
58 \r
59 <ADDRESS>\r
60 Comments, suggestions and critiques are welcome to : <A HREF="mailto:linfo062@crisv2.univ-pau.fr">linfo062@crisv2.univ-pau.fr</A>\r
61 \r
62 </ADDRESS>\r
63 \r
64 </BODY>\r
65 \r
66 </HTML>\r