[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cc-mode Objective C method names
From: |
Stefan Monnier |
Subject: |
Re: cc-mode Objective C method names |
Date: |
Wed, 01 Jan 2020 10:29:42 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> And I think the methods’ names should be written something like:
>
> -[ClassName doSomething]
> -[ClassName doSomethingTo:with:]
These names look very odd to me (as a non-ObjC coder, I find the
brackets rather ugly and useless for example), but if they're the
"normal" way to refer to them, then I guess it's fine.
> The ‘-’ means it’s an instance method and a ‘+’ would mean it was a
> class method.
Might be best not to include it: how often do you have both a class
method and an instance method with the same name?
[ E.g. in Elisp we use the function names and variable names as is,
without clarifying if it's a function name or a variable name. ]
> It appears to work for me, but I’m not great at Emacs lisp so I
> thought it best to run this by the mailing list in case I’ve made any
> boneheaded errors.
This is the code of the other Alan and I'm not very familiar with this
part of CC-mode, so don't take my opinion too seriously, but it looks
acceptable to me.
> + (if (looking-at "(")
> + (c-forward-token-2 2 t)
> + (c-forward-token-2 1 t))
AKA
(c-forward-token-2 (if (looking-at "(") 2 1) t)
-- Stefan