Replies: 2 comments
-
Personally, I tend to temporarily add a module prefix in such cases; we can invoke any predicate (i.e., also those that are not exported) by module-qualifying it. Example: ?- lists:with_var(X, Y). Y = X-_A. I am also interested to see if there are other suggestions. At least adding such module-qualifications is more localized than jumping around in the file and changing other parts. |
Beta Was this translation helpful? Give feedback.
0 replies
-
This proof-of-concept mod to (let ((start (if (and transient-mark-mode mark-active)
(region-beginning) (point-min)))
(end (if (and transient-mark-mode mark-active)
(region-end) (point-max))))
- (write-region start end ediprolog-temp-file nil 'silent))
+ (if new-process ; C-u C-u F10 ~~> intent to load module to 'user'
+ (let ((oldbuf (current-buffer)))
+ (with-temp-buffer
+ (insert-buffer-substring oldbuf start end)
+ (goto-char (point-min))
+ (when (re-search-forward "^:- module(\\w*[^[]*[[][^]]*])\\." nil t)
+ (replace-match "/*\\&*/")
+ (message "Commented module declaration for loading to user"))
+ (write-file ediprolog-temp-file)))
+ (write-region start end ediprolog-temp-file nil 'silent)))
(set-process-filter ediprolog-process 'ediprolog-consult-filter)
(ediprolog-remember-interruption
(ediprolog-wait-for-prompt-after
(ediprolog-send-string (format "['%s'].\n"
(if (fboundp 'file-local-name) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The interactive, inline testing supported by ediprolog helps me to work both faster and more safely. But when developing a module, to avoid
existence_error
s I find it necessary to comment-out the module declaration. (I suppose this makes the module look temporarily like a 'top-level script'?)Is this something inherent to Prolog modules, such that working around it would be considered harmful? Do other people have a smoother workaround? I can imagine a small change to
ediprolog
— when invokingC-u C-u F10
, strip out any module declaration before sending to Scryer — that would probably work great for me. But I want to hold off developing this, in case I am overlooking a better idea.Beta Was this translation helpful? Give feedback.
All reactions