dominikh changed the topic of #cinch to: The IRC Framework | Latest version: Cinch 2.1.0
Azure has joined #cinch
britneywright has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
britneywright has joined #cinch
Azure has quit [Quit: Blue Sky Fish]
britneywright has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Azure has joined #cinch
frdmn_ has quit [Ping timeout: 252 seconds]
frdmn has joined #cinch
thews_ has joined #cinch
thews has quit [Ping timeout: 252 seconds]
FIQ has quit [Excess Flood]
FIQ has joined #cinch
Azure has quit [Quit: Blue Sky Fish]
Azure has joined #cinch
blindsight has quit [Ping timeout: 258 seconds]
blindsight has joined #cinch
blindsight is now known as Guest22903
Guest22903 has joined #cinch
Guest22903 has quit [Changing host]
Guest22903 is now known as blindsight
Lirion has quit [Ping timeout: 244 seconds]
Lirion has joined #cinch
Azure has quit [Quit: My MBP went to sleep.]
frog|OFF has quit [Ping timeout: 258 seconds]
frog|OFF has joined #cinch
frog|OFF is now known as green-big-frog
CM-Punk has joined #cinch
<CM-Punk> Is there any way to use a 'gets' like function in a channel or PM?
|jemc| has joined #cinch
|jemc| has left #cinch ["WeeChat 1.0.1"]
wmoxam has joined #cinch
<CM-Punk> Hey wmoxam
<wmoxam> hey
<leftylink> CM-Punk: oh by that you want a thread to block until you get a message? if I really wanted to do such a thing I'd use a http://ruby-doc.org/stdlib-2.0/libdoc/thread/rdoc/ConditionVariable.html
<leftylink> though I would note that most times I would just store my state and have another handler do things when receive the message
<leftylink> rather than block a thread for a long time
<dominikh> yeah, with Cinch, it's essentially a lot of callback and per-user state. one of its design flaws
<CM-Punk> leftylink, what I was hoping to do was do like a "first run wizard" and have the bot say something like "What is your password?"
<CM-Punk> After you type !FirstRun
<dominikh> but yeah, what you want is a simple state machine for each user
<CM-Punk> Then it will wait....until the password is given
<dominikh> really not that difficult. record in which state a user is, see if a command is valid to change to another state
<dominikh> and each command is a method/handler
<CM-Punk> Okay, I'll have to do some research into that because I didn't understand most of that.
<leftylink> well from your point of view, all you care about is... when I trigger the first run, I move to step 1 of the setup and you send me the corresponding message. when I provide my password, the bot proceeds with step 2. well ok, so in the context of what has been discussed here... when I give you my password, am I on step 1? if so, great proceed to step 2, otherwise do nothing
<leftylink> the condition variable could work and it's be interesting to keep the entire flow in one method, but not strictly necessary
<dominikh> also, considering how easy it is to get CVs wrong…
<leftylink> that's an interesting question because I took a class that went to great pains to tell us bout semaphores and condition variables, but I have not used them too much and meanwhile languages are moving toward other paradigms
<CM-Punk> leftylink is right
<dominikh> leftylink: won't get around learning semaphores, but yeah, CVs are less interesting with other paradigms
<leftylink> like go building in channels and erlang's had actors for a while. I just feel like that instructor puts in some wasted effort
<CM-Punk> Triggering first run would move to Step 1 of the Wizard, the Eve-Bot would ask for the password, and then wait for it. When that user messages the bot again, it will record that message as the password and ask the question in Step 2.
postmodern has joined #cinch
<dominikh> leftylink: well, guess which constructs the people who implement Go and erlang use ;)
<dominikh> every channel is an implied mutex, e.g.
<dominikh> s/is/has
<leftylink> the word is clearly moving in other directions, and I wonder whether the course's instructor will have to update the course material sometime soon
<leftylink> s/word/world/
<leftylink> s/other directions/directions other than semaphores and CVs/
<dominikh> (also, there is a lot of code in Go that is a lot cleaner when using mutexes; and a semaphore implemented with channels is still a semaphore :>)
<dominikh> he may need to add new stuff, sure, but it's always wrong to stop teaching old methods
<dominikh> as they're the ones that make machines actually work
<leftylink> ok, I can see that
<dominikh> like they do in some courses, where the first thing they teach is Java and nobody even knows what a stack and a heap are
Azure has joined #cinch
Gizmokid2005 is now known as Goldmokid2005
Goldmokid2005 is now known as Gizmokid2005