| The languageWhat does an Eliza program look like?
Its efficiency can be shown with a simple example.It demonstrates how easily problems can be translated
into a sequencial Eliza program which solves them. Task: Sum up all the odd numbers between 1 and 10 and print the result.
In a C program you need two variables for the calculation. The corresponding Eliza program doesn't need any. The pipes pass the result arguments to the next function. The function "+" is a concentrator, which collects all the numbers it gets. Once there are no more values delivered from "do", the concentrator does no longer backtrack, but hands the result over to the next function, to "println". Although both programs solve the same problem, they do it in very different ways. The Eliza program looks simple and quite easy to understand while the C program seems to do a lot more. This comparison is of course a bit unfair. The purposes of C and Eliza are different. By the way: The result is 25. |
||||
| © MH, 2008-02-06 |
