Path: utzoo!attcan!telly!lethe!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!samsung!dali.cs.montana.edu!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!chalmers.se!mathrt0.math.chalmers.se!augustss From: augustss@cs.chalmers.se (Lennart Augustsson) Newsgroups: comp.lang.misc Subject: Re: Complexity of syntax Message-ID: <1990Dec19.222059.6878@mathrt0.math.chalmers.se> Date: 19 Dec 90 22:20:59 GMT References: <9012061208.AA08577@decpa.pa.dec.com> <1990Dec9.013923.14456@cs.umn.edu> <20@garth.UUCP> <27534.276e5bd3@kuhub.cc.ukans.edu> Sender: news@mathrt0.math.chalmers.se (Evald Nyhetsson) Organization: Dept. of CS, Chalmers, Sweden Lines: 26 In article <27534.276e5bd3@kuhub.cc.ukans.edu> kinnersley@kuhub.cc.ukans.edu (Bill Kinnersley) writes: > ..., rather than languages with power. If you want a language with > >1) Functions as first-class data (most applicative languages) > >2) Arrays (mostly imperative languages) > >3) Strong type system > >there's nothing left but Algol-68 and C. > C does not have functions as first class data, you can only use functions pointers as data. To see the difference just try to write a function that does function composition. For simplicity assume that all functions take and return int, i.e. write an int (*compose(f, g))() int (*f)(); int (*g)(); (ANSI-fy if you like) so that (*compose(f,g))(x) == f(g(x)). I claim that this is impossible to do in a portable way. -- Lennart Augustsson Email: augustss@cs.chalmers.se