emacs-devel
[Top][All Lists]
Advanced

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

Re: User-defined record types, v2


From: Eli Zaretskii
Subject: Re: User-defined record types, v2
Date: Sat, 18 Mar 2017 19:35:24 +0200

> From: Lars Brinkhoff <address@hidden>
> Date: Sat, 18 Mar 2017 18:21:48 +0100
> 
> +static const char *old_struct_prefix = "cl-struct-";
> +static int old_struct_prefix_length;
> +
> +static int
> +vector_struct_p (Lisp_Object object)
> +{
> +  if (! old_struct_compat || ASIZE (object) < 1)
> +    return false;
> +
> +  Lisp_Object type = AREF (object, 0);
> +  return SYMBOLP (type)
> +    && strncmp (SDATA (SYMBOL_NAME (type)),
> +             old_struct_prefix,
> +             old_struct_prefix_length) == 0;

Why not make old_struct_prefix be an array, and then use sizeof
instead of computing the length of the string at dump time?

> +  DEFVAR_BOOL ("old-struct-compat", old_struct_compat,
> +            doc: /* Non-nil means hack for old structs is in effect.  */);

This doc string should explain more about the effect of this variable.

Thanks.



reply via email to

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