Re: What happened to the is_<type> family of functions proposal?

Поиск
Список
Период
Сортировка
Искать
От
Darren Duncan
Тема
Re: What happened to the is_<type> family of functions proposal?
Дата
Msg-id
4C9D71CC.1060900@darrenduncan.net
Ответ на
Список
Дерево обсуждения
What happened to the is_<type> family of functions proposal? "Colin 't Hart" <colinthart@gmail.com>
Re: What happened to the is_<type> family of functions proposal? Andrew Dunstan <andrew@dunslane.net>
Re: What happened to the is_<type> family of functions proposal? "Colin 't Hart" <colinthart@gmail.com>
Re: What happened to the is_<type> family of functions proposal? Robert Haas <robertmhaas@gmail.com>
Re: What happened to the is_<type> family of functions proposal? Tom Lane <tgl@sss.pgh.pa.us>
Re: What happened to the is_<type> family of functions proposal? Robert Haas <robertmhaas@gmail.com>
Re: What happened to the is_<type> family of functions proposal? Alvaro Herrera <alvherre@commandprompt.com>
Re: What happened to the is_<type> family of functions proposal? Tom Lane <tgl@sss.pgh.pa.us>
Re: What happened to the is_<type> family of functions proposal? Alvaro Herrera <alvherre@commandprompt.com>
Re: What happened to the is_<type> family of functions proposal? Tom Lane <tgl@sss.pgh.pa.us>
Re: What happened to the is_<type> family of functions proposal? Greg Stark <gsstark@mit.edu>
Re: What happened to the is_<type> family of functions proposal? Robert Haas <robertmhaas@gmail.com>
Re: What happened to the is_<type> family of functions proposal? Tom Lane <tgl@sss.pgh.pa.us>
Re: What happened to the is_<type> family of functions proposal? Andres Freund <andres@anarazel.de>
Re: What happened to the is_<type> family of functions proposal? Tom Lane <tgl@sss.pgh.pa.us>
Re: What happened to the is_<type> family of functions proposal? Robert Haas <robertmhaas@gmail.com>
Re: What happened to the is_<type> family of functions proposal? Jeff Davis <pgsql@j-davis.com>
Re: What happened to the is_<type> family of functions proposal? Bruce Momjian <bruce@momjian.us>
Re: What happened to the is_<type> family of functions proposal? Tom Lane <tgl@sss.pgh.pa.us>
Re: What happened to the is_<type> family of functions proposal? Robert Haas <robertmhaas@gmail.com>
Re: What happened to the is_<type> family of functions proposal? Gurjeet Singh <singh.gurjeet@gmail.com>
Re: What happened to the is_<type> family of functions proposal? Tom Lane <tgl@sss.pgh.pa.us>
Re: What happened to the is_<type> family of functions proposal? Robert Haas <robertmhaas@gmail.com>
Re: What happened to the is_<type> family of functions proposal? Darren Duncan <darren@darrenduncan.net>
Re: What happened to the is_<type> family of functions proposal? Craig Ringer <craig@postnewspapers.com.au>
Re: What happened to the is_<type> family of functions proposal? Darren Duncan <darren@darrenduncan.net>
Colin 't Hart wrote:
> The fact that this wraps would seem to me to make the implementation of 
> is_date() difficult.

Having separate is_foo() syntax per type is a bad design idea, same as having a 
different equality test like eq_int() or assignment syntax like assign_str() per 
type.

There should just be a single syntax that works for all types, in the general 
case, for testing whether a value is a member of that type, or alternately 
whether a value can be cast to a particular type.

For example, one could say "is_type( ,  )" or it could be 
spelled "isa()" or if you wanted to be more ambitious it could be an infix op, 
like " isa " to test when a value is of a type already.

Pg already gets it right in this regard by having a single general syntax for 
type casting, the "::" and value membership of a type should 
be likewise.

Maybe to test if a value can be cast as a type, you can continue the :: 
mnemonic, say adding a "?" for yes and a "!" for no.

For example, "?::" tests if the value can be cast as the type 
and "!::" or "not ?::" tests the opposite. 
An expression like this results in a boolean.

-- Darren Duncan

В списке pgsql-hackers по дате отправления
От: Craig Ringer
Дата:
От: Craig Ringer
Дата:
FAQ