I see some functions like evil-change or evil-delete are take in the beginning and end of a visual region in evil-visual-state. I've looked at the source code in "evil-commands.el" of these functions but their 'beg' and 'end' parameters just seem to come out of nowhere. And some (such as the one below) aren't even interactive.
Why this is and how I can do the same thing in my own methods?
Below is just an example of one of the methods I looked at:
;; Defined in ~/.emacs.d/elpa/evil-20170712.2350/evil-commands.el
(evil-define-operator evil-invert-char (beg end type)
"Invert case of character."
:motion evil-forward-char
(if (eq type 'block)
(evil-apply-on-block #'evil-invert-case beg end nil)
(evil-invert-case beg end)
(when evil-this-motion
(goto-char end)
(when (and evil-cross-lines
evil-move-cursor-back
(not evil-move-beyond-eol)
(not (evil-visual-state-p))
(not (evil-operator-state-p))
(eolp) (not (eobp)) (not (bolp)))
(forward-char)))))