Re:Clean – A functional programming language
by Someone on Saturday December 16, 2017 @03:45AM
(#15938534)
Is it a closed definition? The equivalent in Mathematica would allow one to add things whenever one wants, for example to add definitions for fac for negative integers, or to hard-code the value of fac 100.
If clean has a REPL (which I couldn’t easily find out from its web page) I expect it to have that, too.
Re:Clean – A functional programming language
by willtim on Saturday December 16, 2017 @04:11AM
(#15938604)
In Haskell it certainly is a closed definition, you would get a "multiple declarations" syntax error if you tried to split the definition up. I would assume the same for Clean also.
In the Haskell REPL, you would need to enter the definitions together.
In Haskell you could always avoid that style and use the case syntax (or for this example guard syntax) instead. All varieties eventually desugar to a case analysis anyway. Haskell even added curly braces as an alternate to indentation!