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

Path context for consult #4

Closed
kenbowen opened this issue Nov 7, 2015 · 1 comment
Closed

Path context for consult #4

kenbowen opened this issue Nov 7, 2015 · 1 comment

Comments

@kenbowen
Copy link
Member

kenbowen commented Nov 7, 2015

  • consult/1 call consult/2 by consult(FF) iff consult(FF, '');
    consult(FF, P) iff P is a path and:
    1. if FF is a bare file, then consult(F, P) attempts to load P/F
    2. if FF is a file A with a path prefix Q, consult(F, P) iff consult(A, P/Q)
    3. if FF = [A,B,...], consult(FF, P) iff consult(A,P) & consult(B, P) & ...
    4. consult( :- consult(FF, Q), P) iff consult(FF, P/Q)
    5. consult( :- [A, B, ...], P) iff consult(A, P) & consult(B, P) & ...
  • Add a dynamic prolog flag cp (consult path) such that consult(FF) iff consult(FF, cp).
@kenbowen
Copy link
Member Author

The most important parts of this enhancement request are items i) - iii). These can be achieved by making use of consult/2 with the search_path option in the second argument,
as follows:

i) consult('id.pro', [search_path('examples/als')]).

ii) consult('als/id.pro', [search_path('examples/')]).

iii) consult(['id.pro', 'hickory.pro'], [search_path('examples/als')]).

@chuckhoupt chuckhoupt modified the milestones: 3.X.X Release, Wish List Mar 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants