From: Oleh Krehel <ohwoeowho@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: monnier@IRO.UMontreal.CA, emacs-devel@gnu.org
Subject: Re: Is it time to remove INTERNAL_FIELD?
Date: Thu, 23 Apr 2015 19:09:24 +0200 [thread overview]
Message-ID: <87fv7q4vqz.fsf@gmail.com> (raw)
In-Reply-To: <83618m230d.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 23 Apr 2015 20:00:50 +0300")
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Oleh Krehel <ohwoeowho@gmail.com>
>> Cc: monnier@IRO.UMontreal.CA, emacs-devel@gnu.org
>> Date: Thu, 23 Apr 2015 18:32:17 +0200
>>
>> Why is it preferred to type BVAR (foo, name) instead of foo->name?
>
> Because it will then be easy to change the definition of BVAR into
> something less trivial. E.g., imagine this alternative:
>
> #define BVAR(buf, field) ((buf)->thread_storage (current_thread)->(field))
>
> Or whatever, I hope you get the point.
OK, fine. At least it's possible to cook up a viable heuristic for
completing BVAR with Semantic, because it has the semantics of accessing
the buffer object. INTERNAL_FIELD is just mental arithmetic, it doesn't
do anything. It's possible to make a heuristic for it as well, but I
like to see it removed instead.
>> This confuses me, because I can't use Semantic to assist me in what I'm
>> doing. For instance, starting with:
>>
>> kb->Vw
>>
>> Semantic can tell me that the only possible completions are Vwindow_list
>> and Vwindow_system. This is great for someone who's new, because I see
>> what options are available to me. This is also great for someone who's
>> experienced, because it still acts as a spell checker and speeds up
>> coding. I can't get the same benefits for:
>>
>> kb->INTERNAL_FIELD (Vwindow_system) = val;
>>
>> The first variant of the code feels like I'm in control of the code, and
>> I'm actually dealing with code.
>
> Using accessors has its downsides, yes. It makes the object more
> opaque. Perhaps Semantic should become smarter about this. But you
> aren't saying that accessors should not be used, are you?
I like accessors for C++, but I'm not really familiar with large scale C
programming. Are macros really the state-of-the-art for making
accessors?
Oleh
next prev parent reply other threads:[~2015-04-23 17:09 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-23 9:55 Is it time to remove INTERNAL_FIELD? Oleh Krehel
2015-04-23 10:08 ` Paul Eggert
2015-04-23 10:10 ` Oleh Krehel
2015-04-23 10:17 ` Paul Eggert
2015-04-23 10:56 ` Eli Zaretskii
2015-04-23 10:56 ` Oleh Krehel
2015-04-23 11:17 ` Eli Zaretskii
2015-04-23 11:32 ` Oleh Krehel
2015-04-23 12:01 ` Eli Zaretskii
2015-04-23 12:05 ` Oleh Krehel
2015-04-23 12:37 ` Eli Zaretskii
2015-04-25 10:57 ` Oleh Krehel
2015-04-25 11:28 ` Eli Zaretskii
2015-04-25 14:28 ` Stefan Monnier
2015-04-25 14:41 ` Eli Zaretskii
2015-04-28 7:39 ` Oleh Krehel
2015-04-28 13:20 ` Stefan Monnier
2015-04-28 15:07 ` Eli Zaretskii
2015-04-28 15:11 ` Oleh Krehel
2015-04-28 15:23 ` Eli Zaretskii
2015-04-28 18:58 ` Oleh Krehel
2015-04-28 19:21 ` Eli Zaretskii
2015-04-23 11:00 ` Eli Zaretskii
2015-04-23 13:24 ` Stefan Monnier
2015-04-23 13:30 ` Oleh Krehel
2015-04-23 13:53 ` Eli Zaretskii
2015-04-23 14:07 ` Oleh Krehel
2015-04-23 14:50 ` Nicolas Richard
2015-04-23 15:34 ` Eli Zaretskii
2015-04-24 10:44 ` Nicolas Richard
2015-04-23 15:29 ` Eli Zaretskii
2015-04-23 16:32 ` Oleh Krehel
2015-04-23 17:00 ` Eli Zaretskii
2015-04-23 17:09 ` Oleh Krehel [this message]
2015-04-23 17:29 ` Eli Zaretskii
2015-04-23 17:14 ` Stefan Monnier
2015-04-23 17:31 ` Eli Zaretskii
2015-04-23 13:30 ` Stefan Monnier
2015-04-23 13:33 ` Oleh Krehel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87fv7q4vqz.fsf@gmail.com \
--to=ohwoeowho@gmail.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=monnier@IRO.UMontreal.CA \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).