Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news4.ner.bbnplanet.net!news3.near.net!paperboy.wellfleet.com!news-feed-1.peachnet.edu!pirates!cssun.mathcs.emory.edu!swrinde!howland.reston.ans.net!nntp.crl.com!pacbell.com!amdahl.com!amd!amd.com!txnews.amd.com!news
From: "Paul G. Schaaf, Jr." <paul.schaaf@amd.com>
Subject: Re: Smalltalk-80: The Language
Content-Type: text/plain; charset=us-ascii
Message-ID: <30CE2997.3C4@amd.com>
Sender: news@txnews.amd.com
Nntp-Posting-Host: hqsp86
Content-Transfer-Encoding: 7bit
Organization: Advanced Micro Devices
References: <4a86l7$af9@newsbf02.news.aol.com> <4acnfc$n10$3@mhadg.production.compuserve.com> <30CDEEF3.66E4@amd.com>
Mime-Version: 1.0
Date: Wed, 13 Dec 1995 01:17:11 GMT
X-Mailer: Mozilla 2.0b3 (Win16; I)
Lines: 116

Eric Clayberg wrote:
> Balloon subclass: #PcgBaloon
>   instanceVariableNames:
>     'flameSetting maliciousnessLevel ignoranceLevel credentials'
>   classVariableNames:
>     'Current' "<--Thank god there's only one!"
>   poolDictionaries:
>     'StandardBoorishBehaviorConstants PseudoExpertConstants'
>
> !PcgBaloon class methods !
> phrasesToUseWhenTryingToMakeFriendsAndInfluencePeople
>     ^#('shameless lies' 'very ignorant' 'dishonest insinuation'
>        'malicious misrepresentation' 'malicious insinuations'
>        'arrogantly self assured' 'inanities' 'sleaze'
>        'imbecilities' 'incompetence' 'squalid' 'stupid')! !
>
> !PcgBaloon methods !
> initialize
>     flameSetting := maliciousnessLevel := ignoranceLevel := 100.
>     credentials := #()!
> -Eric <g> 
Paul G. Schaaf, Jr. (I) wrote: 
>   type
>       "Since types are equivalent to classes ;>"
>       ^self class!
> 
>   hasClass
>       "Answer whether the receiver's type has any class."
>       ^false! !

What follows is a more complete implementation of the Balloon pattern:

!PcgBalloon class methodsFor: 'denying reality'!

   assignSuperclass: aClass
      Class nilSuperclassSignal 
         handle: [:empiricalEvidence | empiricalEvidence reject]
         do: [aClass mustNotBeNil.
	      superclass := aClass]! !

!PcgBalloon methodsFor: 'Eliza'!

   beConvincedBySuperiorArgument: anArgument
       self notYetImplemented!

   isRefutedByOnesOwnCitations
       ^true!

   deliveredSystems
       ^#()!

   generateArgumentFromFalsePremises
       | aStream |
       aStream := String new writeStream.
       self whileMissingThePointDo: [
          (ComputerScienceLiterature 
              select: [:each | each isOutOfDate 
                  or: [(each domain includes: #OOP) not]
              ]
          ) do: [:quote | 
              aStream
                  nextPutAll: 
                      self 
standardDisclaimerToAvoidProvidingGroundsForRefutation;
                  nextPutAll: quote;
                  nextPutAll: (quote constructInterpretationAgreeableTo: 
self).
          ]
       ].
       ^aStream contents!

   generateSlanderOfAuthorOf: article
       | aStream |
       aStream := (String new: Usenet maxArticleLength) writeStream.
       article statementsMostDamagingToSelfDo: [:each |
           | phrases |
           phrases := self generateStatementsFromPhraseList: 
               self class 
phrasesToUseWhenTryingToMakeFriendsAndInfluencePeople.
           aStream nextPutAll: (
               self 
                   generateNonSequiturResponseTo: each 
                   usingPhrases: phrases
           ).
       ].
       ^aStream contents!


   activityLoop
	"Main loop of Eliza algorithm attempting to simulate 
        intelligent postings (Alpha 1)."
        [self hasInsight or: [self hasWisdom]] 
            whileFalse: [
                (Usenet newsGroupNamed: 'comp.lang.smalltalk')
                    post: self generateArgumentFromFalsePremises
                    respondToFollowups: [:article | 
                        self increaseParanoiaLevelBy: 
                            100.0 - (article distanceFrom: 
FundamentalTruth).
                        article postFollowup: 
                            (self generateSlanderOfAuthorOf: article).
                    ]
	    ]!

    doesNotUnderstand: aSmalltalkMessage
        ^true! !

"Unimplemented messages are left as an exercise for the reader.
Hint: You can add them dynamically at run time."

-----------------------------------------------------------------
Paul.Schaaf@AMD.Com         Advanced Micro Devices, Sunnyvale, CA
I do not speak for my company                  http://www.amd.com

"In theory, there is no difference between theory and practice, 
but in practice, there is." - unknown
