Re: generic builtin functions

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: generic builtin functions
Дата
Msg-id 4373B116.5000100@dunslane.net
обсуждение исходный текст
Ответ на Re: generic builtin functions  (Greg Stark <gsstark@mit.edu>)
Ответы Re: generic builtin functions  (Greg Stark <gsstark@mit.edu>)
Список pgsql-hackers

Greg Stark wrote:

>I know the tendency has been to want to discourage implicit casts, but I think
>this is a good use for them. The whole point of enums is to have syntactic
>sugar over integers that let you use nicer syntax but that imposes minimal
>additional complexity over simply using integers.
>
>Maybe my conception of enums is different from yours. My conception is
>basically that of C enums. Where they're purely a creature of the syntax and
>type system. At run-time they don't make any effort to prevent you from
>treating them as integers.
>
>  
>

Well, for one thing, I have no plan to allow explicit setting of the 
internal representational value, as one can do in C. And the fact that 
it's an int underneath is in implementation detail, IMNSHO. After all, 
KL just advised using a text domain with a check constraint for enums, 
so int storage is hardly a fundamental part of enum-ness.

Maybe this all just reflects my background in languages that are more 
strongly typed than C and have first class enums.

cheers

andrew






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

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: generic builtin functions
Следующее
От: Greg Stark
Дата:
Сообщение: Re: generic builtin functions