--* From postmaster%watson.vnet.ibm.com@yktvmv.watson.ibm.com  Fri Jun 10 12:01:23 1994
--* Received: from yktvmv-ob.watson.ibm.com by asharp.watson.ibm.com (AIX 3.2/UCB 5.64/930311)
--*           id AA28788; Fri, 10 Jun 1994 12:01:23 -0400
--* Received: from watson.vnet.ibm.com by yktvmv.watson.ibm.com (IBM VM SMTP V2R3)
--*    with BSMTP id 0547; Fri, 10 Jun 94 12:01:24 EDT
--* Received: from YKTVMV by watson.vnet.ibm.com with "VAGENT.V1.0"
--*           id <A.USER2.NOTE.YKTVMV.6343.Jun.10.12:01:23.-0400>
--*           for asbugs@watson; Fri, 10 Jun 94 12:01:24 -0400
--* Received: from caip.rutgers.edu by watson.ibm.com (IBM VM SMTP V2R3) with TCP;
--*    Fri, 10 Jun 94 12:01:23 EDT
--* Received: by caip.rutgers.edu (5.59/SMI4.0/RU1.5/3.08)
--* 	id AA02362; Fri, 10 Jun 94 12:01:21 EDT
--* Date: Fri, 10 Jun 94 12:01:21 EDT
--* From: user2@caip.rutgers.edu (Chris Whatley)
--* Message-Id: <9406101601.AA02362@caip.rutgers.edu>
--* To: asbugs@watson.ibm.com
--* Subject: [6] crash compiling file [ex02.as][0.35.0]

--@ Fixed  by:  PI   Tue Nov 8 11:24:47 EST 1994 
--@ Tested by:  none 
--@ Summary:    The bug no longer appears in v0.37.0. 

--+ -- Example 2.  Temperature conversion.
--+
--+ #include "aslib"
--+
--+ import from  Integer,Segment Integer,Float,Ratio Integer;
--+
--+ -- (a) Write a function c which converts
--+ --     degrees Fahrenheit to degrees Celsius.
--+ ftoc(f:Float): Float == (f - 32.0)*(9.0/5.0);
--+ -- (b) Write a function f which converts
--+ --     degrees Celsius to degrees Fahrenheit.
--+ ctof(f:Float):  Float == (f*5.0/9.0)+32.0;
--+ -- (c) Print a temperature scale showing the conversion
--+ --     of every ten degrees Fahrenheit to degrees Celsius.
--+ tab(f:(Float)->Float,g: Generator Float):() == {
--+ 	for i in g repeat
--+ 		print(f(i))();
--+ }
--+ -- (d) Print a temperature scale showing the conversion
--+ --     of every ten degrees Celsius to degrees Fahrenheit
--+ tabfc():() == { tab(ftoc,i for i:Float in 0..210 by 10) }
--+ tabcf():() == { tab(ctof,i for i:Float in  0..100 by 10) }
--+ tabfc();
-- Example 2.  Temperature conversion.

#include "aslib"

import from  Integer,Segment Integer,Float,Ratio Integer;

-- (a) Write a function c which converts
--     degrees Fahrenheit to degrees Celsius.
ftoc(f:Float): Float == (f - 32.0)*(9.0/5.0);
-- (b) Write a function f which converts
--     degrees Celsius to degrees Fahrenheit.
ctof(f:Float):  Float == (f*5.0/9.0)+32.0;
-- (c) Print a temperature scale showing the conversion
--     of every ten degrees Fahrenheit to degrees Celsius.
tab(f:(Float)->Float,g: Generator Float):() == {
	for i in g repeat
		print(f(i))();
}
-- (d) Print a temperature scale showing the conversion
--     of every ten degrees Celsius to degrees Fahrenheit
tabfc():() == { tab(ftoc,i for i:Float in 0..210 by 10) }
tabcf():() == { tab(ctof,i for i:Float in  0..100 by 10) }
tabfc();
 
