Skip to content
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

Meta-predicates not exported in html_write.pl #150

Open
rrooij opened this issue Jan 31, 2022 · 2 comments
Open

Meta-predicates not exported in html_write.pl #150

rrooij opened this issue Jan 31, 2022 · 2 comments

Comments

@rrooij
Copy link
Contributor

rrooij commented Jan 31, 2022

Certain meta-predicates like page/4 are defined in html_write.pl and used elsewhere (for instance, in http_header.pl). They are explicitly imported in http_head but not exported in html_write.

This results in socket connection errors when you run in a server in SWI Prolog with autoloading disabled:

ERROR: [Thread httpd@6363_4] http_header:status_page_hook/3: Unknown procedure: http_header:page/4
@JanWielemaker
Copy link
Member

!? From html_write.pl:

:- module(html_write,
          [ reply_html_page/2,          % :Head, :Body
            reply_html_page/3,          % +Style, :Head, :Body

                                        % Basic output routines
            page//1,                    % :Content
            page//2,                    % :Head, :Body
            ...

In html_header.pl:

:- autoload(html_write,
	    [ print_html/2, print_html/1, page/4, html/3,
	      html_print_length/2
	    ]).

page//2 is the same as page/4. Ok, it would be more elegant to use page//2 consistently but that is detail. The imports are generated automatically and this code doesn't yet handle DCGs separately.

Note that autoload/2 is interpreted as use_module/2 if autoloading is disabled.

@rrooij
Copy link
Contributor Author

rrooij commented Feb 1, 2022

Thanks for explaining this. I didn't know about the two slashes. 😄

The error still remains a mystery though! I'm trying to make a reproducible small example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants