question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Odd existence error for the (;)/2 control construct

See original GitHub issue

With the following code (in a consulted source file):

logtalk_library_path(logtalk_home, '$LOGTALKHOME/').

% Logtalk user directory
logtalk_library_path(logtalk_user, '$LOGTALKUSER/').

% user home directory
logtalk_library_path(home, HOME) :-
	(	getenv('HOME', _) ->
		% likely a POSIX system but Windows users
		% may also define this environment variable
		HOME = '$HOME/'
	;	getenv('USERPROFILE', _) ->
		% Windows systems define this environment variable
		HOME = '$USERPROFILE/'
	;	fail
	).

And with the query:

logtalk_library_path(Library,_).

I get:

$ node ./tp.js 
Library = logtalk_home ;
Library = logtalk_user ;
uncaught exception: error(existence_error(procedure, /(;, 2)), /(logtalk_library_path, 2))
false.

The file compiles fine without any warnings or errors in the sandbox in the Tau Prolog website.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
pmouracommented, May 21, 2020

Found the cause. Changing the code above by commenting the last require:

//require("./node_modules/tau-prolog/modules/system.js")(pl);

Allows the query to give all expected answers.

0reactions
pmouracommented, May 21, 2020

Thanks for the quick reply. Closing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MySQL Stored Procedure - w3resource
In the following procedure, a user passes a number through IN parameter and make a sum of odd numbers between 1 and that...
Read more >
Auditing Standard No. 13 - PCAOB
Introduction. 1. This standard establishes requirements regarding designing and implementing appropriate responses to the risks of material misstatement.
Read more >
error 183 cannot create a file when that file already exists
S. delete sslcertWinerror 183 Cannot create a file when that file already exists. But getting error:- EXECUTE master. 1 EXECUTE master.
Read more >
GNU make
GNU make. This file documents the GNU make utility, which determines automatically which pieces of a large program need to be recompiled, ...
Read more >
Sample PL/SQL Programs
A Sample PL/SQL Programs. This appendix provides several PL/SQL programs to guide you in writing your own. The sample programs illustrate several important ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found