Re: Mathematica Programmer vs. Programming in Mathematica/ functions and OOP
- To: mathgroup at smc.vnet.net
- Subject: [mg63439] Re: Mathematica Programmer vs. Programming in Mathematica/ functions and OOP
- From: "Richard Fateman" <fateman at cs.berkeley.edu>
- Date: Sat, 31 Dec 2005 06:40:37 -0500 (EST)
- References: <email@example.com> <firstname.lastname@example.org>
- Sender: owner-wri-mathgroup at wolfram.com
"Steven T. Hatton" <hattons at globalsymmetry.com> wrote in message news:dnrce6$kh1$1 at smc.vnet.net... .....<clipping out many things, mostly I agree with.... > > I'm not sure that OOP and functional programming paradigms are necessarily > at odd with oneanother. I believe it would require a very judicious use > of > the features of both paradigms to produce a beneficial integration of the > two. .... This is done in CLOS (Common Lisp Object System) which not only provides multiple type discrimination and multiple inheritance, but before/after/mixin methods and a "meta object protocol" for defining new versions of the object system. instead of (defun foo (x y z)(+ (* x y) z)) you use (defmethod foo ((x integer)(y integer)(z integer)) (+ (* x y) z)) (defmethod foo ((x double-float) ....... etc A nice explanation of how functional programming and OO are very nearly the same thing is in an appendix to P. Graham's ANSI Common Lisp book. > > At its core, Mathematica seems to be neither a functional nor a procedural > language. Quite true. ....snip > > I'm really not sure why some people are so averse to OOP. For all of its > detractors, it has the best track record of any particular programming > paradigm in common use. I don't know how to compare track records, or what it means for a kind of programming to become a "paradigm", but I would think that functional programming, systematic programming [without gotos!] and higher-level languages (e.g. not assembler), might also be counted. In case this last line sounds particularly foolish, some people remember when operating systems were written in assembly language. VAX VMS (circa 1978) was one such system, and it was considered revolutionary to write an operating system in a "high-level" language like C. RJF PS Have a happy new year!