Skip to content

Commit

Permalink
use load_text/2
Browse files Browse the repository at this point in the history
  • Loading branch information
guregu committed Sep 1, 2024
1 parent 96f13a9 commit bc83696
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions trealla/library.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ func http_consult_1(_ Prolog, _ Subquery, goal Term) Term {
return resourceError(Atom(err.Error()), piTerm("http_consult", 1))
}

// call(URL:'$load_chars'(Text)).
return Atom("call").Of(Atom(":").Of(module, Atom("$load_chars").Of(buf.String())))
// call(load_text(Text, module(URL))).
return Atom("call").Of(Atom("load_text").Of(buf.String(), []Term{Atom("module").Of(module)}))
}

func crypto_data_hash_3(pl Prolog, _ Subquery, goal Term) Term {
Expand Down
Binary file modified trealla/libtpl.wasm
Binary file not shown.
4 changes: 2 additions & 2 deletions trealla/prolog.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,8 @@ func (pl *prolog) ConsultText(ctx context.Context, module, text string) error {
}

func (pl *prolog) consultText(ctx context.Context, module, text string) error {
// Module:'$load_chars'(Text).
goal := Atom(":").Of(Atom(module), Atom("$load_chars").Of(text))
// load_text(Text, [module(Module)]).
goal := Atom("load_text").Of(text, []Term{Atom("module").Of(Atom(module))})
_, err := pl.queryOnce(ctx, goal.String())
if err != nil {
err = fmt.Errorf("trealla: consult text failed: %w", err)
Expand Down

0 comments on commit bc83696

Please sign in to comment.