emacs-devel
[Top][All Lists]
Advanced

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

Re: Emacs rewrite in a maintainable language


From: Eli Zaretskii
Subject: Re: Emacs rewrite in a maintainable language
Date: Mon, 12 Oct 2015 19:29:25 +0300

> From: Oleh Krehel <address@hidden>
> Date: Mon, 12 Oct 2015 17:17:52 +0200
> Cc: Óscar Fuentes <address@hidden>, address@hidden
> 
>     # define MIN(a,b) ((a) < (b) ? (a) : (b))
>     #define streq(X, Y) (*(X) == *(Y) && strcmp ((X) + 1, (Y) + 1) == 0)
>     #define SET_FLAG(F, FLAG) ((F) |= (FLAG))
>     #define HAS_FLAG(F, FLAG) (((F) & (FLAG)) != 0)
>     #define xnew(n, Type)      ((Type *) xmalloc ((n) * sizeof (Type)))
>     #define xrnew(op, n, Type) ((op) = (Type *) xrealloc (op, (n) * sizeof 
> (Type)))
>     #define switch_line_buffers() (curndx = 1 - curndx)
>     #define curlinepos (lbs[curndx].linepos)
>     #define BVAR(buf, field) ((buf)->field ## _)
> 
> Some of these can be replaced with plain type checked C++
> functions. Others can be replaced with templated C++ functions, that are
> still type checked. Still others with public getters and setters.

Yes, but why should they be replaced?  Isn't it clear what SET_FLAG
does, just from its name?




reply via email to

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