-
Notifications
You must be signed in to change notification settings - Fork 13
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
Imperfection of creating operators #596
Comments
Logtalk iso_op_3_10 needs to be changed to add Trealla to the conditional test @pmoura |
ECLiPSe, Who else? SWI
Also
|
Yes, the change to allow both postfix & infix needs a tad more work.
…On Thu, Sep 19, 2024 at 11:30 AM flexoron ***@***.***> wrote:
ECLiPSe, Who else?
$ eclipse
[eclipse 1]: op(1,fy,&).
[eclipse 2]: op(1,yf,&).
[eclipse 3]: op(1,xfx,&).
[eclipse 4]: [user].
&(x).
&(x,x).
[eclipse 5]: X&, &Y, X&Y.
X = x
Y = x
[eclipse 7]: X& .
X = x
$ tpl
?- op(1,fy,&).
true.
?- op(1,yf,&).
true.
?- op(1,xfx,&).
true.
?- [user].
&(x).
&(x,x).
?- current_op(X,Y,&).
X = 1, Y = fy
; X = 1, Y = yf
; X = 1, Y = xfx.
?- X&, &Y, X&Y.
Error: syntax error, quotes needed around operator ',', user:1
?- X& .
Error: syntax error, missing operand to infix, user:1
—
Reply to this email directly, view it on GitHub
<#596 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFNKSEV6PZ6CYNJCUS6TECLZXISNBAVCNFSM6AAAAABOOXAXIKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJZG4ZTGNZVHA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
v2.56.14 Partial Result.
|
Hmm, you're right. But it's daft to have an operator be both prefix &
postfix.
…On Thu, Sep 19, 2024 at 6:37 PM flexoron ***@***.***> wrote:
v2.56.14 Partial Result.
Only this works (a bit):
$ tpl
?- op(1,xfx,&).
true.
?- op(1,fy,&). % this first
true.
?- op(1,yf,&). % then this, otherwise non-functional
true.
?- [user]. &(x). &(x,x). end_of_file.
true.
?- X& .
X = x.
?- (X&),true. % brackets additionally required
X = x.
?- &X,(Y&),X&Y.
X = x, Y = x.
?- (Y&),&X,X&Y.
Y = x, X = x.
?-
—
Reply to this email directly, view it on GitHub
<#596 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFNKSEWN3Y7W46CXY6WXRWLZXKELNAVCNFSM6AAAAABOOXAXIKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRQGM3TAOJRGQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
But not too bad. At least eclipse,swipl approached.
|
Left in tpl's 'issue' basket:
|
I think you should define the prefix op before defining it as postfix, it's the natural order of things ;-) |
|
v2.56.12
The text was updated successfully, but these errors were encountered: