I'm having a (probably) dumb problem with Elisp. I want a function to return t or nil depending on a when condition. This is the code:
(defun tmr-active-timer-p
"Returns t or nil depending of if there's an active timer"
(progn
(if (not (file-exists-p tmr-file))
nil
; (... more code)
)
)
)
But I'm having an error. I'm not sure how to make a function return a value... I've read a function return the last expression result value but in this case, I wan't to make something like (PHP mess warning):
// code
if ($condition) {
return false;
}
// more code...
Maybe I'm missing the point and functional programming doesn't allow this approach?