by evanb · 8mo ago · 0 comments
This seems like a great attempt. I would be worried about how much parsing and backtracking might be required to infer the infix precedence in a totally general system (like garden-path sentences[1]) or actually ambiguous parse trees (which is cured by adopting some rule like right precedence and parens, but what rule you pick makes some 'natural language' constructions work over others).
2 `plus` 3
rather than plus 2 3 -- infix
select a <!!!> b;
-- prefix
select <||> a;
A lot of custom types end up using this [1]. select @-@ '[(0,0),(1,0),(1,1)]'::path;
-- 2
[0] https://www.postgresql.org/docs/current/sql-createoperator.h...
[1] https://www.postgresql.org/docs/current/functions-geometry.h...