Re: [HACKERS] [PATCH] Generic type subscripting - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] [PATCH] Generic type subscripting
Date
Msg-id 3161359.1607379941@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] [PATCH] Generic type subscripting  (Andres Freund <andres@anarazel.de>)
Responses Re: [HACKERS] [PATCH] Generic type subscripting
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2020-12-07 16:32:32 -0500, Tom Lane wrote:
>> What did you think of the idea of merging EEOP_SBSREF_OLD / ASSIGN / FETCH
>> into a single step type distinguished only by the callback function?

> I don't have a strong opinion on this. I guess find it a bit easier to
> understand the generated "program" if the opcodes are distinct (I've a
> pending patch printing the opcode sequence). Especially as the payload
> is just function pointers.
> So I think I'd just merge the *implementation* of the steps, but leave
> the different opcodes around?

Fair enough.  It wasn't entirely clear to me whether it'd be kosher to
write
        EEO_CASE(EEOP_SBSREF_OLD)
        EEO_CASE(EEOP_SBSREF_ASSIGN)
        EEO_CASE(EEOP_SBSREF_FETCH)
        {
            // do something
            EEO_NEXT();
        }

I can see that that should work for the two existing implementations
of EEO_CASE, but I wasn't sure if you wanted to wire in an assumption
that it'll always work.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [HACKERS] [PATCH] Generic type subscripting
Next
From: Andres Freund
Date:
Subject: Re: [HACKERS] [PATCH] Generic type subscripting