-
Notifications
You must be signed in to change notification settings - Fork 41
prolog 'call' not working properly #59
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
Comments
Just tested this and #58 in an older Shen (19.2) to make sure that the bug was not introduced in newer versions (because some changes have been made to the prolog code since), but it was a bug back then too. This, along with #58 and #56 make me thing that SP has made a bunch of changes to the prolog code. The prolog part of Shen is probably what I'm least familiar with, I will see if I can figure out #59 and #58 which seem pretty specific, and then ask Mark about #56. |
Ok, I was playing with this a bit, and something I noticed is that the generated code invokes (defun shen.f1296 (ProcN Cont)
(let A (shen.newpv ProcN)
(let B (shen.newpv ProcN)
(let X (shen.newpv ProcN)
(do (shen.incinfs)
(bind X (cons test1 (cons 1 (cons (shen.deref A ProcN) (cons (shen.deref B ProcN) ()))))
ProcN
(freeze (call X ProcN Cont)))))))) \\ <---- here but the definition of (define call
[F | X] ProcessN Continuation
-> (call-help (function (lazyderef F ProcessN)) X ProcessN Continuation)
_ _ _ -> false) The generated code passes a prolog variable instead of something with the form Can you tell me thats the generated code for this in SP? (define something -> (prolog? (is X [test 1 A B]) (call X))) I get this in the OS version:
|
It's basically the same minus the extra function def. Maybe the implementation of call does the dereference in SP. |
Yes, thats what I was guessing, but wanted to be sure, thank you. |
Ok, it works with a modified
|
Nice job, thanks. |
Below is the output which fails under OS shen but works under PRO. The code generators for OS and Pro compile to the same code for 'test1'. I haven't looked closely at the code produced by test2, but they seem to be identical walls of text. Maybe lazyderef isn't working right?
Shen/OS
Shen/PRO
Code
The text was updated successfully, but these errors were encountered: