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

From Chapman Flack
Subject Re: [HACKERS] [PATCH] Generic type subscripting
Date
Msg-id 5FDBD597.3010600@anastigmatix.net
Whole thread Raw
In response to Re: [HACKERS] [PATCH] Generic type subscripting  (Chapman Flack <chap@anastigmatix.net>)
List pgsql-hackers
On 12/17/20 16:56, Chapman Flack wrote:
>> that, it's called a cast.
> 
> I find them different; XQuery was the first language I had encountered
> that provides both (a cast in XQuery is spelled 'cast as', just as you'd
> expect), and the idea of an explicit operation that means "I am only
> asserting statically what type this will have at run time; do not ever
> perform any conversion or coercion, just give me an error if I'm wrong"
> seems to be a distinct and useful one.

I should have added: it may be an idea that never seemed important in
languages that mean to statically type everything, but it seems to arise
quite naturally for a language like XQuery (and arguably jsonpath) that
tries to do a useful amount of static typing while applied to data
structures like XML or JSON that don't come with ironclad guarantees.

Regards,
-Chap



pgsql-hackers by date:

Previous
From: Chapman Flack
Date:
Subject: Re: [HACKERS] [PATCH] Generic type subscripting
Next
From: Gilles Darold
Date:
Subject: Re: [UNVERIFIED SENDER] Re: [BUG] orphaned function