Hi, it looks like Vik Fearing's patch does not apply anymore, because there are many conflicts with recent changes, fixed patch attached.
I am interested in reviewing and testing it for the next commitfest, if it's design and implementation is found to be acceptable.
Additionally, if it is also acceptable, I can add support for handling negative indexes for nth_value(), to be able to reverse order from first/from last for the window frame.