From owner-freebsd-chat Sun Jul 26 23:05:07 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id XAA16089 for freebsd-chat-outgoing; Sun, 26 Jul 1998 23:05:07 -0700 (PDT) (envelope-from owner-freebsd-chat@FreeBSD.ORG) Received: from lariat.lariat.org (ppp1000.lariat.org@[206.100.185.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA16081 for ; Sun, 26 Jul 1998 23:05:04 -0700 (PDT) (envelope-from brett@lariat.org) Received: (from brett@localhost) by lariat.lariat.org (8.8.8/8.8.8) id AAA15298; Mon, 27 Jul 1998 00:04:32 -0600 (MDT) Message-Id: <199807270604.AAA15298@lariat.lariat.org> X-Sender: brett@mail.lariat.org X-Mailer: QUALCOMM Windows Eudora Pro Version 4.0.1 Date: Mon, 27 Jul 1998 00:04:25 -0600 To: chat@FreeBSD.ORG From: Brett Glass Subject: Object-oriented chickens Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I once supplied the following Object Pascal program to a magazine in response to the question "why did the (object-oriented) chicken cross the road?" --Brett Glass program KFC; uses Salt, Pepper, Flour, HotOil, Poultry, MackTruck; const MPH = 90; var {Don't reference your chickens before they're declared!} Chicken : Poultry.Fowl; Truck : MackTruck.EighteenWheeler; begin Chicken.Hatch; {Constructor} Truck.Start; {Constructor} Truck.Rev(MPH); Chicken.Cross(Road); Truck.Horn.Honk; Truck.Brake := TRUE; Truck.Tires.PutStr('Screeeeeeeeeeeeeeeeeeee...'); Chicken.PutStr('Scra-daaaaaaaaaaaaaawk!'); Stop; Look; Listen; if Chicken.Flat then Output(Colonel,Chicken); end. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message