'$Revision:$' ' Copyright 1992-2009 AUTHORS, Sun Microsystems, Inc. and Stanford University. See the LICENSE file for license information. ' '-- Module body' bootstrap addSlotsTo: bootstrap stub -> 'globals' -> () From: ( | { 'Category: applications\x7fModuleInfo: Module: ircBot InitialContents: FollowSlot\x7fVisibility: public' ircBot = bootstrap setObjectAnnotationOf: bootstrap stub -> 'globals' -> 'ircBot' -> () From: ( | {} = 'ModuleInfo: Creator: globals ircBot. '. | ) . } | ) bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'ircBot' -> () From: ( | { 'ModuleInfo: Module: ircBot InitialContents: InitializeToExpression: (nil)\x7fVisibility: private' lines. } | ) bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'ircBot' -> () From: ( | { 'ModuleInfo: Module: ircBot InitialContents: InitializeToExpression: (nil)\x7fVisibility: private' linesLock. } | ) bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'ircBot' -> () From: ( | { 'ModuleInfo: Module: ircBot InitialContents: InitializeToExpression: (\'selfbot\')\x7fVisibility: public' nick <- 'selfbot'. } | ) bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'ircBot' -> () From: ( | { 'ModuleInfo: Module: ircBot InitialContents: FollowSlot' parent* = bootstrap setObjectAnnotationOf: bootstrap stub -> 'globals' -> 'ircBot' -> 'parent' -> () From: ( | {} = 'ModuleInfo: Creator: globals ircBot parent. '. | ) . } | ) bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'ircBot' -> 'parent' -> () From: ( | { 'Comment: Connect to the IRC server\x7fModuleInfo: Module: ircBot InitialContents: FollowSlot\x7fVisibility: public' connect = ( | | socket: os_file openTCPHost: server Port: port. writeNick. writeStatus. startReader. self). } | ) bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'ircBot' -> 'parent' -> () From: ( | { 'ModuleInfo: Module: ircBot InitialContents: FollowSlot\x7fVisibility: public' disconnect = ( | | socket close. socket: nil). } | ) bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'ircBot' -> 'parent' -> () From: ( | { 'ModuleInfo: Module: ircBot InitialContents: FollowSlot\x7fVisibility: public' join: channel = ( | | writeLine: 'JOIN ',channel). } | ) bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'ircBot' -> 'parent' -> () From: ( | { 'ModuleInfo: Module: ircBot InitialContents: FollowSlot' parent* = bootstrap stub -> 'traits' -> 'clonable' -> (). } | ) bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'ircBot' -> 'parent' -> () From: ( | { 'ModuleInfo: Module: ircBot InitialContents: FollowSlot\x7fVisibility: private' readLine = ( | line. | line: socket readLine. line copySize: (line size-1)). } | ) bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'ircBot' -> 'parent' -> () From: ( | { 'ModuleInfo: Module: ircBot InitialContents: FollowSlot\x7fVisibility: private' readLines = ( | | [ socket atEOF not ] whileTrue: [ | line. | line: readLine. linesLock protect: [ lines addLast: line ]. ]). } | ) bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'ircBot' -> 'parent' -> () From: ( | { 'ModuleInfo: Module: ircBot InitialContents: FollowSlot\x7fVisibility: public' say: msg To: channel = ( | | writeLine: 'PRIVMSG ',channel,' :',msg). } | ) bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'ircBot' -> 'parent' -> () From: ( | { 'ModuleInfo: Module: ircBot InitialContents: FollowSlot\x7fVisibility: private' startReader = ( | | linesLock: lock copy. lines: list copy. (message copy receiver: self Selector: 'readLines') fork). } | ) bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'ircBot' -> 'parent' -> () From: ( | { 'ModuleInfo: Module: ircBot InitialContents: FollowSlot\x7fVisibility: private' writeLine: line = ( | | socket writeLine: (line,'\r')). } | ) bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'ircBot' -> 'parent' -> () From: ( | { 'ModuleInfo: Module: ircBot InitialContents: FollowSlot\x7fVisibility: private' writeNick = ( | | writeLine: 'NICK ',nick). } | ) bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'ircBot' -> 'parent' -> () From: ( | { 'ModuleInfo: Module: ircBot InitialContents: FollowSlot\x7fVisibility: private' writeStatus = ( | | writeLine: 'USER ',nick,' +iw ',nick,' :',nick). } | ) bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'ircBot' -> () From: ( | { 'ModuleInfo: Module: ircBot InitialContents: InitializeToExpression: (6667)\x7fVisibility: public' port <- 6667. } | ) bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'ircBot' -> () From: ( | { 'ModuleInfo: Module: ircBot InitialContents: InitializeToExpression: (\'irc.freenode.net\')\x7fVisibility: public' server <- 'irc.freenode.net'. } | ) bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'ircBot' -> () From: ( | { 'ModuleInfo: Module: ircBot InitialContents: InitializeToExpression: (nil)\x7fVisibility: private' socket. } | ) bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'modules' -> () From: ( | { 'ModuleInfo: Module: ircBot InitialContents: FollowSlot' ircBot = bootstrap define: bootstrap stub -> 'globals' -> 'modules' -> 'ircBot' -> () ToBe: bootstrap addSlotsTo: ( bootstrap remove: 'directory' From: bootstrap remove: 'fileInTimeString' From: bootstrap remove: 'myComment' From: bootstrap remove: 'postFileIn' From: bootstrap remove: 'revision' From: bootstrap remove: 'subpartNames' From: globals modules init copy ) From: bootstrap setObjectAnnotationOf: bootstrap stub -> 'globals' -> 'modules' -> 'ircBot' -> () From: ( | {} = 'ModuleInfo: Creator: globals modules ircBot. CopyDowns: globals modules init. copy SlotsToOmit: directory fileInTimeString myComment postFileIn revision subpartNames. \x7fIsComplete: '. | ) . } | ) bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'modules' -> 'ircBot' -> () From: ( | { 'ModuleInfo: Module: ircBot InitialContents: FollowSlot\x7fVisibility: public' directory <- 'applications'. } | ) bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'modules' -> 'ircBot' -> () From: ( | { 'ModuleInfo: Module: ircBot InitialContents: InitializeToExpression: (_CurrentTimeString)\x7fVisibility: public' fileInTimeString <- _CurrentTimeString. } | ) bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'modules' -> 'ircBot' -> () From: ( | { 'ModuleInfo: Module: ircBot InitialContents: FollowSlot' myComment <- ''. } | ) bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'modules' -> 'ircBot' -> () From: ( | { 'ModuleInfo: Module: ircBot InitialContents: FollowSlot' postFileIn = ( | | resend.postFileIn). } | ) bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'modules' -> 'ircBot' -> () From: ( | { 'ModuleInfo: Module: ircBot InitialContents: FollowSlot\x7fVisibility: public' revision <- '$Revision:$'. } | ) bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'modules' -> 'ircBot' -> () From: ( | { 'ModuleInfo: Module: ircBot InitialContents: FollowSlot\x7fVisibility: private' subpartNames <- ''. } | ) '-- Side effects' globals modules ircBot postFileIn