Re: embedded list v3

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: embedded list v3
Дата
Msg-id 27446.1349024252@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: embedded list v3  (Andres Freund <andres@2ndquadrant.com>)
Ответы Re: embedded list v3  (Andres Freund <andres@2ndquadrant.com>)
Список pgsql-hackers
Andres Freund <andres@2ndquadrant.com> writes:
> Patch 0001 contains a assert_compatible_types(a, b) and a 
> assert_compatible_types_bool(a, b) macro which I found very useful to make it
> harder to misuse the api. I think its generally useful and possibly should be
> used in more places.

This seems like basically a good idea, but the macro names are very
unfortunately chosen: they don't comport with our other names for
assertion macros, and they imply that the test is symmetric which it
isn't.  It's also unclear what the point of the _bool version is
(namely, to be used in expression contexts in macros).

I suggest instead
AssertVariableIsOfType(varname, typename)
AssertVariableIsOfTypeMacro(varname, typename)

Or possibly we should leave off the "Assert" prefix, since this will be
a compile-time-constant check and thus not really all that much like
the existing run-time Assert mechanism.  Or write "Check" instead of
"Assert", or some other verb.

Anybody got another color for this bikeshed?
        regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Question regarding Sync message and unnamed portal
Следующее
От: johnkn63
Дата:
Сообщение: Extending range of to_tsvector et al