On Sat, May 16, 2009 at 2:06 AM, Stephen J. Turnbull <stephen(a)xemacs.org> wrote:
I wouldn't go so far as say I detest it. Having accessors is
kind of
Lisp-y, although I think that the prevalence of allcaps identifiers is
ugly, and it's certainly a barrier to entry to new programmers.
Sure. The problem I have is macros that expand to macros that expand
to macros that ... I have no idea how complex of an expression I'm
going to get when all the expanding is done. Maybe there will be 15
pointer dereferences on top of solving a partial differential
equation. Maybe it will expand to a simple structure reference. I
don't know.
I wonder, given your statement that we always get error-checking in
an
error-checking build anyway, if it might be a good idea to take the
next step, and do away with the maybe-error-checking macros entirely,
and use an explicit check as we do in Lisp primitives.
Especially since that doesn't actually seem to be true, eg in this
hunk:
Oops. You're right. I'll work on that next week.
So I suggest the following form:
> diff -r c064d7197712 src/faces.c
> --- a/src/faces.c Sat Apr 18 03:24:48 2009 +0900
> +++ b/src/faces.c Fri May 15 14:20:28 2009 -0600
> @@ -1544,8 +1544,10 @@
> }
> cachel->display_table = Qunbound;
> cachel->background_pixmap = Qunbound;
> - FACE_CACHEL_FONT_SPECIFIED (cachel)->size =
sizeof(cachel->font_specified);
> - FACE_CACHEL_FONT_UPDATED (cachel)->size = sizeof(cachel->font_updated);
> + CHECK_FACE_CACHEL_FONT_SPECIFIED (cachel);
> + CHECK_FACE_CACHEL_FONT_UPDATED (cachel);
> + cachel->font_specified.size = sizeof(cachel->font_specified);
> + cachel->font_updated.size = sizeof(cachel->font_updated);
> }
I'm not sure that's the right name, maybe the checks should be
something like
> + CHECK_FACE_CACHEL_FONT (cachel->font_specified);
> + CHECK_FACE_CACHEL_FONT (cachel->font_updated);
or even just
> + CHECK_FACE_CACHEL (cachel);
and there are yet other possibilities depending on just what checks
are done, and how they tend to associate.
Good suggestions. Are you comfortable with the general direction I'm
taking here, though? I'd like to make our codebase alias analysis
safe.
--
Jerry James
http://www.jamezone.org/
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta