Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think you mean:

(if (search "lisp" (submission-title submission)) (incf (submission-score submission)))



Oh dear, I hope axod wouldn't have used IF with a single then-form. That's just asking for trouble. :-)


Are you worried about the return value or something?


No. I'm worried somebody will add another form, without realizing it has the opposite meaning (i.e., else) from the INCF call. Traditionally, if you have only one then-form, you'd use WHEN.


Ah, fair point. I actually made that mistake a couple days ago, in fact.


I think you mean

if(strpos(strtolower($title.$body), 'lisp') !== false) ++$votes;

Oh wait, this is Hacker news. Apologies.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: