Re: generic builtin functions - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: generic builtin functions
Date
Msg-id 4373B116.5000100@dunslane.net
Whole thread Raw
In response to Re: generic builtin functions  (Greg Stark <gsstark@mit.edu>)
Responses Re: generic builtin functions
List 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 by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: generic builtin functions
Next
From: Greg Stark
Date:
Subject: Re: generic builtin functions