I agree with Roger that the zero-precedence `mixfix` system is a
really elegant middle-ground between Honu and a whole big language.
Something I really like about Pyret is that it doesn't have precedence
and requires parens for legibility.

--
Jay McCarthy
Associate Professor @ CS @ UMass Lowell
http://jeapostrophe.github.io
Vincit qui se vincit.

On Wed, Mar 24, 2021 at 1:03 PM Roger Keays <rac...@rogerkeays.com> wrote:
>
> Looks promising. The extra enforestation phase does add another layer of 
> complexity though. Also, operators don't use pattern matching, so I presume 
> to support Sorawee's example below, you'd have to parse the syntax after the 
> ? yourself.
>
> I think there is some value to considering zero-precendence 'mixfix' macros. 
> AFAICT, they wouldn't require the enforestation phase, which would make the 
> language model simpler. It does complicate the idea of an 'operator' though. 
> Matching them efficiently could also be a problem. Still, I'm happy to trade 
> operator precedence for simplicity.
>
> On Tue, Mar 23, 2021 at 09:16:55PM -0700, jackh...@gmail.com wrote:
> > Honu's enforestation is approximately this. See https://www.cs.utah.edu/plt/
> > publications/gpce12-rf.pdf. There's been some discussion about whether to 
> > base
> > rhombus on a similar approach.
> > On Tuesday, March 23, 2021 at 8:59:50 AM UTC-7 Roger Keays wrote:
> >
> >     From racket-news [1]:
> >
> >     mixfix (pkg/src) library allows users to define and use mixfix 
> > operators in
> >     Racket, by Sorawee Porncharoenwase.
> >
> >     From the mixfix docs [2]:
> >
> >     > (define-mixfix-rule (c {~datum ?} t {~datum :} e)
> >     (if c t e))
> >     > (#true ? 1 : 2)
> >     1
> >
> >     This is what I expected to be able to do when I first started 
> > experimenting
> >     with various LISPs and Schemes. Supporting only prefix macros seemed 
> > like a
> >     bit of limitation to me. If mixfix macros were supported out of the box
> >     rather than hacking #%app, it would be easier to combine syntax 
> > libraries.
> >     Possible for Racket 2?
> >
> >     [1] https://racket-news.com/2021/03/racket-news-issue-48.html
> >     [2] https://docs.racket-lang.org/mixfix/
> >
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email
> > to racket-users+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/
> > racket-users/198c4676-08de-4803-9a8b-719d9c298159n%40googlegroups.com.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/sigid.171729a446.20210324170310.GA6862%40papaya.papaya.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAJYbDanGm5dbx-rp%2B8E6sR%2BddJ13MubVnBOtYJiXDenwxR1hEw%40mail.gmail.com.

Reply via email to