[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [WIP-PATCHES] Lisp (and Scheme) jump format specifier and ngettext
From: |
Miguel Ángel Arruga Vivas |
Subject: |
Re: [WIP-PATCHES] Lisp (and Scheme) jump format specifier and ngettext |
Date: |
Fri, 27 Nov 2020 15:00:29 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
After sending the message I think I should have given a longer explanation.
The patch checks that the msgstr format specifier is a subset of the
msgid format specifier, therefore the length may be smaller or equal and
the elements must be compatible with the types recursively.
The switch code for Lisp is this:
-------------------------------------------------------------------------
+ case FAT_LIST:
+ return (right->type == FAT_LIST && subset_list (left->list,
+ right->list));
+ /* Allow wider types in addition to equality. */
+ case FAT_OBJECT:
+ return true;
+ case FAT_CHARACTER_INTEGER_NULL:
+ return (right->type == FAT_CHARACTER_NULL
+ || right->type == FAT_INTEGER_NULL);
+ case FAT_CHARACTER_NULL:
+ return right->type == FAT_CHARACTER;
+ case FAT_INTEGER_NULL:
+ case FAT_REAL:
+ return right->type == FAT_INTEGER;
-------------------------------------------------------------------------
Scheme format includes a case for FAT_COMPLEX too, but it is mostly the
same. I hope this clarifies a bit the patch, because it includes the
refactor... Should I split that into two patches?
Best regards,
Miguel