Skip to content
This repository has been archived by the owner on Nov 3, 2020. It is now read-only.

Refactor examples/ircbot.ps #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Refactor examples/ircbot.ps #3

wants to merge 3 commits into from

Conversation

bl0ckeduser
Copy link
Contributor

Refactored code, added more comments.

@darkf
Copy link
Owner

darkf commented Jan 3, 2013

I think this should come after either I re-implement streams/IO in neu or after a complete rewrite. The IRC bot should be pretty modular, commands should be implemented as functions and stored in a command map. The main part should just consist of

defun mainloop is
    readIO
    processMessages
end

defun processMessage msg is
    define split string-split msg " "
    define command car split
     if map-exists? commands msg
          define f map-get commands msg
           f cdr split
     end
 end

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants