[linux-l] Ocml vs. Java
Volker Grabsch
vog at notjusthosting.com
So Okt 16 11:11:30 CEST 2005
On Sat, Oct 15, 2005 at 09:28:13PM +0200, Oliver Bandel wrote:
> On Sat, Sep 24, 2005 at 02:45:40AM +0200, Oliver Bandel wrote:
> [...]
> > Btw: Die Sache mit den Verschachtelungen sehe ich noch ein bischen
> > anders. Man kann sich auch Funktionen als composites erstellen.
> > In Haskell gibt es dafür sogar einen eigenen Operator (".").
> [...]
>
>
> "The direct combination of functions by means of the operator '.' which we
> have seen here is not possible in other programming paradigms, or at least
> it would be an 'advanced' aspect of the language, rather than appearing on
> page 11 of an introductory text."
> (Simon Thompson, "Haskell")
Naja ... also bei Ocaml bzw. Python bzw. Ruby ist es kein Ding, sowas
auch schnell selbst zu schreiben:
def wende_an(start,*funcs):
result = start
for func in funcs:
result = func(result)
return result
...
import math
# liefert 0.735052587145
print wende_an(1, math.cos, math.sqrt)
Aber gut, das ist eben der "funktionale" Teil von Python, von daher
widerspricht es obigem Zitat nicht wirklich. :-)
Viele Grüße,
Volker
--
Volker Grabsch
---<<(())>>---
Administrator
NotJustHosting GbR
Mehr Informationen über die Mailingliste linux-l