Artifact 8661e409b04a8eb64ce3bc1aac8d2639e6613cced334eedfc852664f8f0b192f:
- File
psl-1983/emode/example-ool.sl
— part of check-in
[eb17ceb7f6]
at
2020-04-21 19:40:01
on branch master
— Add Reduce 3.0 to the historical section of the archive, and some more
files relating to version sof PSL from the early 1980s. Thanks are due to
Paul McJones and Nelson Beebe for these, as well as to all the original
authors.git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/historical@5328 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 907) [annotate] [blame] [check-ins using] [more...]
% % EXAMPLE-OOL.SL - Examples of the usage of OOL.SL, an "object oriented % language". % % Author: William F. Galway % Symbolic Computation Group % Computer Science Dept. % University of Utah % Date: 24 July 1982 % Copyright (c) 1982 University of Utah % (setf generic-number (create_class (value NIL) % Local state is a "value", initially NIL. % Message table ( ((gets x) (setf value x)) % Assign argument to local state ((value) value) % Return the local value % Raise to a power ((to-power n) (let ((p 1)) (for (from i 1 n 1) % Repeatedly send a "times" message to our "value". (do (setf p (send_msg value `(times ,p)))) p)))))) (setf complex-number (create_class (real-part 0 imag-part 0) % Message dictionary ((times y) ....???