From: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
---|---|
To: | Greg Stark <gsstark(at)mit(dot)edu> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: generic builtin functions |
Date: | 2005-11-10 20:44:06 |
Message-ID: | 4373B116.5000100@dunslane.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Greg Stark | 2005-11-10 21:05:40 | Re: generic builtin functions |
Previous Message | Martijn van Oosterhout | 2005-11-10 20:42:39 | Re: generic builtin functions |