Closed flexoron closed 2 months ago
Maybe it's a little too strict now? I think it was useful to be able to implicitly create modules with assertz or just loading a file. Scryer and SWI allow it.
% ./tpl
?- assertz(foo:bar).
true.
?- foo:bar.
throw(error(existence_error(module,foo),(:)/2)).
% scryer-prolog
?- [user].
foo:bar(123).
^D
?- foo:bar(X).
X = 123.
?- assertz(test:hello).
true.
?- test:hello.
true.
If you had a real need for it sure, but just using it for namespace sake seems overkill.
On Fri, 30 Aug 2024, 15:21 guregu, @.***> wrote:
Maybe it's a little too strict now? I think it was useful to be able to implicitly create modules with assertz or just loading a file. Scryer and SWI allow it.
% ./tpl?- assertz(foo:bar). true.?- foo:bar. throw(error(existence_error(module,foo),(:)/2)).
Scryer, for comparison
% scryer-prolog?- [user].foo:bar(123).^D?- foo:bar(X). X = 123.?- assertz(test:hello). true.?- test:hello. true.
— Reply to this email directly, view it on GitHub https://github.com/trealla-prolog/trealla/issues/581#issuecomment-2320090433, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFNKSEVNO7IW5WS3CK2PT7DZT76PPAVCNFSM6AAAAABNCQQAFGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRQGA4TANBTGM . You are receiving this because you commented.Message ID: @.***>
My main uses for it are pretty weird (and can be worked around). There's probably a better way so I'll make a new issue for it.
Still I've a problem with behaviour
$ tpl
?- [user].
m:x.
a :- m:b.
b.
b.
true.
?- a.
throw(error(existence_error(module,m),(:)/2)).
?- module(m).
Info: created module 'm'
true.
?- a.
true % this is b.
; true. % this is b.
?- [user].
m:b.
true.
?- a.
true. % this is m:b.? and b. is gone but why? It has been 'found' before? Overwritten?
?- b.
true
; true.
?-
cont. #584
v2.55.24