[clean-list] Help Please: Beginner to Clean.. Console I/O

RT Happe rthappe at web.de
Thu May 5 00:42:45 MEST 2011


Khurram Khan wrote:

> We were thinking if its possible for you to translate this simple code of C++ in Clean and provide some comments on it as well. We are certain that it will help solve I/O dilemma for us, and we are deeply thankful for the time you take out to help us.
> 
> /* Just a simple program performing input/output to user console and performing a calculation*/


Hello, I think you will fare better when you postpone console I/O and interaction a bit and get familiar with the basic features of Clean (everyday types, local binding forms, patterns, guards), most conveniently by writing and running simple programs such as the example below. [That's basically your C++ example but with hard-coded input and automatic display: Clean will display the value of START in  a console window. (This works better with mundane types such as Real or [Int] instead of the whole world.)]

Best wishes; rt
__

module foo

import StdEnv


Start :: Real
Start = (a+b+c)/3.0
where
	a = 12.3
	b = -1.4
	c = 23.1


More information about the clean-list mailing list