[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.
- User-defined record types, v2, Lars Brinkhoff, 2017/03/18
- Re: User-defined record types, v2, Lars Brinkhoff, 2017/03/18
- Re: User-defined record types, v2, Lars Brinkhoff, 2017/03/18
- Re: User-defined record types, v2, Lars Brinkhoff, 2017/03/18
- Re: User-defined record types, v2, Lars Brinkhoff, 2017/03/18
- Re: User-defined record types, v2,
Eli Zaretskii <=
- Re: User-defined record types, v2, Lars Brinkhoff, 2017/03/18
- Re: User-defined record types, v2, Stefan Monnier, 2017/03/18
- Re: User-defined record types, v2, Lars Brinkhoff, 2017/03/19
- Re: User-defined record types, v2, Stefan Monnier, 2017/03/19
- Re: User-defined record types, v2, Eli Zaretskii, 2017/03/19
Re: User-defined record types, v2, Eli Zaretskii, 2017/03/18
Re: User-defined record types, v2, Lars Brinkhoff, 2017/03/19
Re: User-defined record types, v2, Lars Brinkhoff, 2017/03/21