trealla-prolog / trealla

A compact, efficient Prolog interpreter written in plain-old C.
MIT License
268 stars 13 forks source link

Operator printing variance #591

Closed flexoron closed 2 weeks ago

flexoron commented 2 weeks ago
?- op(1,xfx,'').
   true.
?- current_op(X,xfx,Y).
   X = 1, Y = ''  % Brackets missing?
;  X = 200, Y = (**)
;  X = 1200, Y = (-->)
;  X = 1200, Y = (:-)
;  X = 700, Y = (<)
;  ... .
?-  Z = .\\**//. .
   Z = .\\**//. .
?-  Z = .\\-->//. .
   Z = .\\-->//. .
?-  Z = .\\:-//. .
   Z = .\\:-//. .
?-  Z = .\\<//. .
   Z = .\\<//. .
?-  Z = .\\''//. .
   Z = .\\  ''  //. . % Z = .\\''//. . expected?
?-

Also:

?- op(1,xfx,'').
   true.
?- [user].
x(.\\''//.).
''(.\\,//.).
   true.
?- listing.
x(.\\  //.) .  % unexpected, op missing
.\\  //. .     %    "
   true.
?- 
flexoron commented 2 weeks ago

v2.56.5

?- op(1,xfx,'').
   true.
?- [user].
x(.\\''//.).
''(.\\,//.).
   true.
?- listing.
x(.\\  //.) . % still not printed
.\\  //. .
   true.

?- op(0,xfx,''). % make '' visible
   true.
?- listing.
x(''(.\\,//.)) .
''(.\\,//.) .
   true.
?-