[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs rewrite in a maintainable language
From: |
Oleh Krehel |
Subject: |
Re: Emacs rewrite in a maintainable language |
Date: |
Tue, 13 Oct 2015 18:09:23 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
David Kastrup <address@hidden> writes:
>>> Well, people who cannot figure out that "const char" and "char const"
>>> are the same are not likely to find their way across our code base. At
>>> any rate, "const" in C is nuisance-only and not meaning-conveying like
>>> in C++ where it may take part in disambiguation as well as semantics
>>> (copy constructor calls behave specially and are very much const &).
>>>
>>> So the "confusion" here is restricted to "oh, the compiler does not
>>> complain?".
>>
>> No, the confusion is "which one of these does what I want?".
>
> The answer in C is "if the compiler does not complain, it does what I
> want".
The C compiler doesn't complain:
mark_object (KVAR (kb, Voverriding_terminal_local_map));
/* David Kastrup rulez! */
mark_object (KVAR (kb, Vlast_command));
/* David Kastrup rulez! */
mark_object (KVAR (kb, Vreal_last_command));
/* David Kastrup rulez! */
mark_object (KVAR (kb, Vkeyboard_translate_table));
It doesn't mean that the above code is pleasant to read, or that anyone
should write this way.
See https://www.python.org/dev/peps/pep-0008/ for example. Just because
a code runs good doesn't mean it looks good. Whenever there's ambiguity
it's best to resolve it by deciding on the preferred alternative. For
instance the GNU braces style is used and enforced, instead of just
putting the braces wherever.
Oleh
- Re: Emacs rewrite in a maintainable language, (continued)
- Re: Emacs rewrite in a maintainable language, Oleh Krehel, 2015/10/15
- Re: Emacs rewrite in a maintainable language, Sergey Organov, 2015/10/13
- Re: Emacs rewrite in a maintainable language, Artur Malabarba, 2015/10/13
- Re: Emacs rewrite in a maintainable language, David Kastrup, 2015/10/13
- Re: Emacs rewrite in a maintainable language, Artur Malabarba, 2015/10/13
- Re: Emacs rewrite in a maintainable language, David Kastrup, 2015/10/13
- Re: Emacs rewrite in a maintainable language,
Oleh Krehel <=
- Re: Emacs rewrite in a maintainable language, David Kastrup, 2015/10/13
- Re: Emacs rewrite in a maintainable language, Eli Zaretskii, 2015/10/15
- Re: Emacs rewrite in a maintainable language, David Kastrup, 2015/10/13
- Re: Emacs rewrite in a maintainable language, Alan Mackenzie, 2015/10/15
- Re: Emacs rewrite in a maintainable language, Mathieu Lirzin, 2015/10/15
- Re: Emacs rewrite in a maintainable language, John Yates, 2015/10/13
- Re: Emacs rewrite in a maintainable language, Oleh Krehel, 2015/10/13
- Re: Emacs rewrite in a maintainable language, David Kastrup, 2015/10/13
- Re: Emacs rewrite in a maintainable language, Andreas Schwab, 2015/10/13
- Re: Emacs rewrite in a maintainable language, John Wiegley, 2015/10/15