From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: ** X-Spam-Status: No, score=2.9 required=5.0 tests=BAYES_50,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10c949,38eaf2ac280788bb X-Google-Attributes: gid10c949,public X-Google-Thread: 109fba,38eaf2ac280788bb X-Google-Attributes: gid109fba,public X-Google-Thread: f6290,38eaf2ac280788bb X-Google-Attributes: gidf6290,public X-Google-Thread: fdb77,38eaf2ac280788bb X-Google-Attributes: gidfdb77,public X-Google-Thread: 114917,38eaf2ac280788bb X-Google-Attributes: gid114917,public X-Google-Thread: 103376,38eaf2ac280788bb X-Google-Attributes: gid103376,public X-Google-Thread: 1014db,38eaf2ac280788bb X-Google-Attributes: gid1014db,public X-Google-Thread: 10d15b,38eaf2ac280788bb X-Google-Attributes: gid10d15b,public From: Ken Tilton Subject: Re: 'Money wanted' algorithm (Lisp version) Date: 1996/12/30 Message-ID: <32C829CA.4DE4@bway.net>#1/1 X-Deja-AN: 206821979 references: <5a8h44$elt@news.inetdirect.net> <32c8f428.76407842@news.dwx.com> content-type: text/plain; charset=us-ascii organization: Missing Link Software mime-version: 1.0 reply-to: tilt@bway.net newsgroups: comp.lang.ada,comp.lang.asm.x86,comp.lang.basic.misc,comp.lang.c,comp.lang.c++,comp.lang.clipper,comp.lang.cobol,comp.lang.java.advocacy,comp.lang.pascal,comp.lang.perl.misc,comp.lang.smalltalk,comp.lang.tcl,comp.lang.lisp,comp.object x-mailer: Mozilla 3.01Gold (Macintosh; I; PPC) Date: 1996-12-30T00:00:00+00:00 List-Id: >>Program Make_Money; > >>Uses >> Nothing; > >>begin >> Repeat >> Find(EmptyCoffeeCup); >> Find(BusyStreet); >> Repeat >> Sit(MiddleOfStreet) >> Until Sun(Down) >> Until Hell(FrozenOver) >>end. Hmmm. (defparameter *self* (make-instance 'person))) (defparameter *sun* 'up) (defparameter *hell* 'hotter-n-blazes) (defparameter *cups* (list (make-instance 'cup :contents 'java) ...) (defparameter *corners* (make-instance 'corner :traffic 'light)...) (defun main () (do () ((eql *hell* 'frozen-over)) (let ((cup (find-if 'empty *cups* :key #'contents)) (corner (find-if 'heavyy *corners* :key #'traffic))) (sit *self* :where corner :with cup) (do () ((eql *sun* 'down)) (beg *self* "~&Buddy, can you spare a dime?")))) (defmethod sit ((who person) &key where with) (assert (and where with) "There's a hole in the spec!") (setf (butt person) where) (setf (hand person) with)) (defmethod beg ((who person) rap) (declare (ignore person)) (format t rap)) Yes, I have deviated from the spec. :) I'm a cowboy. And without a Lisp editor, I cannot guarantee the parens.