Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Support Prolog Style op/3 User Defined Operators #885

Open
peter-wasilko opened this issue Jan 6, 2024 · 0 comments
Open

Comments

@peter-wasilko
Copy link

One of my all time favorite language features is the ability to define new operators and override the definitions of existing ones.

It makes creating minimally verbose DSLs in a base language significantly easier and it is probably the next best thing to providing full support for hygienic macros. See: #153

Here are few links to discussions of the topic :

https://www.swi-prolog.org/pldoc/man?section=operators
https://www3.cs.stonybrook.edu/~sbprolog/manual1/node45.html
https://cs.union.edu/~striegnk/learn-prolog-now/html/node84.html

And Gunnar Gotshalks' "Defining Binary & Unary Operators" provides an extended treatment of the feature in a slide deck at:

https://www.eecs.yorku.ca/course_archive/2008-09/S/3401/calendar/24%20prolog%20-%20operators%20.pdf

Pereira and Shieber "Prolog and Natural-Language Analysis" (ISBN 0-937073-18-0) leans on this language feature in defining a meta-circular interpreter.

Section "5.5 Declaring Operators" in Clocksin, W.F., and Mellish C.S. "Programming in Prolog" first introduced this concept to Prolog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant