jd-boyd/sexpdata

[Feature Request] Infix operators

lenianiva opened this issue · 3 comments

Would it fit the theme of this package to have infix operators? For example, suppose I want the operator -> to act as an infix operator:

class Implies(Infix):
    op = '->'
parse("a -> b -> c") == Infix([Symbol("a"), Symbol("b"), Symbol("c")])

This could be done immediately upon finishing parsing a list, for example.

I'm fairly dubious about this one? Where is there an existing SEXP like data format where this would be relevent?

I'm fairly dubious about this one? Where is there an existing SEXP like data format where this would be relevent?

I was thinking about Lean expressions of this form, but this is a fairly niche use case

(f1 a1 b1) -> (f2 ...) -> cond

Until better documentation is provided about this (plus more justification on why it should be supported), I'm going to close this.