[plt-scheme] suggestions and commendations for exercise 2.21

From: ifconfig (nslookupifconfig at hotmail.com)
Date: Tue Mar 30 05:29:16 EST 2004

> -----Original Message-----
> From: plt-scheme-admin at list.cs.brown.edu [mailto:plt-scheme-
> admin at list.cs.brown.edu] On Behalf Of Terrence Brannon
> Sent: Tuesday, March 30, 2004 11:08 AM
> To: plt-scheme at list.cs.brown.edu
> Subject: [plt-scheme] suggestions and commendations for exercise 2.21
> 
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> 
> First of all, convert-gui() and convert-repl() are awesome... now for my
> suggestions:
> 
> [1] convert-repl should take an optional argument serving as the escape
> string. This is useful if "x" needs to be tested as input to the program
> 
> [2] I had problems trying to use convert-file because I wanted to use a
> filename without specifying an absolute path, but did not know what my
> current working directory was. I therefore did not know where to place
> the input file or where to look for the output file.
> 
> At what language level and with what procedure, does one find one's
> current working directory?

I think it only exists in PLT languages (not HtDP) - (current-directory)

> 
> [3] Is convert.ss hardcoded to only work with the Fahrenheit to Celsius
> converter? The Help Desk certainly makes it seem so:

I believe it accepts any number conversion function; that would be both the
logical and the more "schemish" way to do it.

> 
> <quote>
> The teachpack convert.ss provides three functions:
> 
> * convert-gui, which consumes a conversion function from Fahrenheit to
> Celsius
> and creates a graphical user interface with two rulers, which users can
> use to
> convert temperatures according to the given temperature conversion
> function
> * convert-repl, which consumes a conversion function from Fahrenheit to
> Celsius
> and then starts a read-evaluate-print loop. The loop prompts users to
> enter a
> number and then converts the number according to the given temperature
> conversion function. A user can exit the loop by entering x.
> * convert-file; it consumes a file name in, a conversion function from
> Fahrenheit to Celsius, and a string out. The program then reads a number
> from
> in, converts it according to the given temperature conversion function,
> and
> prints the result to the newly created file out.
> Warning: If out already exists, it is deleted.
> 
> </quote>
> 
> 



Posted on the users mailing list.