a Functional Object Oriented Programming (FOOP) example

Notices and updates
Locked
Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

a Functional Object Oriented Programming (FOOP) example

Post by Lutz »

This is the web- Mandelbrot as a FOOP application, using a Complex class to do complex arithmetik.

Adapted for the web from a program by Michael and Cormullion:

http://newlisp.org/complex.cgi

Lutz

ps: also linked from the Tips & Tricks page

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Post by cormullion »

Ah, I'd almost forgotten that! Actually, the story behind this is probably interesting too:

http://www.alh.net/newlisp/phpbb/viewtopic.php?t=1955

m i c h a e l
Posts: 394
Joined: Wed Apr 26, 2006 3:37 am
Location: Oregon, USA
Contact:

Post by m i c h a e l »

Hi Lutz!

Thank you for this practical demonstration of FOOP. Your code probably makes it easier for an experienced newLISPer to see how objects can be integrated into their existing way of programming. The videos, perhaps, focus too much on simulation.

Also, I like your use of the dotted notation in the naming of the Complex:mul locals:

Code: Select all

(let (a.re (a 1) a.im (a 2) b.re (b 1) b.im (b 2))
Very nice.

m i c h a e l

P.S. Did they discover Noah's boat (again)? I keep hearing discussions about "Arc" ;-)

Locked