You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@josd I just tried to implement a generic image generator but doing
importSWIPL,{SWIPLModule}from'./swipl/swipl-bundle';exportasyncfunctiongenerateImage(prolog: string): Promise<Uint8Array>{constModule=awaitSWIPL({arguments: ['-q','-f','prolog.pl'],// @ts-ignorepreRun: (module: SWIPLModule)=>module.FS.writeFile('prolog.pl',prolog),});Module.prolog.query("main(['--image', 'image.pvm'])").once();// return Module.FS.readFile('image.pvm')returnnewUint8Array()}asyncfunctionmain(){constresult=awaitimage.generateImage(` find_max(X, Y, X) :- X >= Y, !. find_max(X, Y, Y) :- X < Y. find_min(X, Y, X) :- X =< Y, !. find_min(X, Y, Y) :- X > Y. `);console.log(result)}main();
Results in the error
wasm:wasm_call_string/3: Unknown procedure: main/1
However, there are definitions for:
main/0
Uint8Array(0) []
Which makes me think that this image generation functionality in this script is specific to eye; is that correct?
This issue is simply to track this comment SWI-Prolog/swipl-devel#1108 (comment)
The text was updated successfully, but these errors were encountered: