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

tab/1 is sandboxed and can't be run #119

Closed
balaziks opened this issue Jan 9, 2020 · 2 comments
Closed

tab/1 is sandboxed and can't be run #119

balaziks opened this issue Jan 9, 2020 · 2 comments

Comments

@balaziks
Copy link

balaziks commented Jan 9, 2020

Calling tab/1 leads to No permission to call sandboxed tab(_XXX)'`, which is weird since it only prints set number of spaces to the output (which can be simulated using write/1).

Is there something I am missing?

@balaziks
Copy link
Author

balaziks commented Jan 9, 2020

Workaround is to redefine tab/1 at the beginning of a program like so:

:- dynamic tab/1.
tab(0) :- !.
tab(X) :- X \== 0, write(' '), Y is X-1, tab(Y).

or with mitigation of #120

:- dynamic tab/1.
tab(0) :- !.
tab(X) :- X \== 0, write('\x2001'), Y is X-1, tab(Y).

'\x2001' is a different type of Unicode space, which isn't striped in the output.

@JanWielemaker
Copy link
Member

Added tab/1 to the Pengine I/O emulation library. The reason it doesn't work is that the normal I/O predicates are redefined in library(pengines_io) to emit HTML. Tab/1 was not and therefore you get the original I/O predicate that is protected. Now in the SWI-Prolog git. Should become available with the next release cycle.

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