[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is it time to remove INTERNAL_FIELD?

From: Oleh Krehel
Subject: Re: Is it time to remove INTERNAL_FIELD?
Date: Thu, 23 Apr 2015 15:30:26 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>> This macro looks to me as more confusing than useful:
> It's there to make sure people don't write code which accesses the
> field directly by accident.  It seems harmless and occasionally
> marginally useful.
> Why does it bother you, exactly?

I'm not very experienced in C, more in C++.  I really like to know the
types of the data structures that I'm accessing.

It's hard to see the structure past the macros, so I think if a macro
doesn't provide a clear advantage it should be removed.

>> Can I remove it?
> I guess it's OK to remove it, tho I fail to see the harm in keeping it.

As I'm new to the Emacs C code base, it's easier for me to look at it
without this macro. If you want to make C sources easier to read for new
people, we should remove the macros that don't do anything.

As for accidental access, I'm sure these rare errors will be caught by
the code review / test suite.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]