Code Monkey home page Code Monkey logo

Comments (3)

kenbowen avatar kenbowen commented on June 12, 2024

-s switches are accumulated in the CLInfo structure during ss_parse_command_line.

Then later
setup_search_dirs(CLInfo)
:-
arg(6, CLInfo, RevCmdLineSearch),
dreverse(RevCmdLineSearch, CmdLineSearch),
ss_init_searchdir(CmdLineSearch).
ss_init_searchdir(CmdLineList)::
ss_init_searchdir0([Path | Paths])
:-
assertz(searchdir(Path)),
ss_init_searchdir0(Paths).

The alspro files-on-commandline code eventually comes down to:

load_cl_files(CLInfo)
:-
arg(3, CLInfo, Files),
pbi_write(load_cl_files=Files),pbi_nl,
ss_load_files(Files).

The pbi_write (for the example with queens and a -s) shows:

load_cl_files=[queens.pro]

THEN:

ss_load_files([F | T])
:-
% catch( reconsult(F),
catch( simple_load(user, F),
Reason,
shell_exception(Reason)
),
ss_load_files(T).

Examining the code for simple_load, it makes no use of any searchdir assertions, but it does handle the no -s switch, but ‘<path-to….>/queens.pro’ case.

Of course, there’s no doc lying around for the change from

% catch( reconsult(F),

to

catch( simple_load(user, F),

On darwin, if I invert the % comment so that reconsult is used, the example with queens and a -s works correctly. I haven’t tried to check ubuntu or win32 yet.

I haven’t been able to imagine the reason for a change like this (probably in the 90’s), particularly for (sloppily) making such a change and not removing -s from the manual.

from alsprolog.

kenbowen avatar kenbowen commented on June 12, 2024

Note that the following works:

KB-SSD > alspro -s '/Users/ken/ALS/GitHub/ALSProlog/examples/als'
ALS Prolog (Threaded) Version v3.1.24-263-g234b474-dirty [darwin]
Copyright (c) 1987-2015 Applied Logic Systems, Inc.

?- [queens].
Attempting to consult queens...
... consulted /Users/ken/ALS/GitHub/ALSProlog/examples/als/queens.pro

yes.

from alsprolog.

kenbowen avatar kenbowen commented on June 12, 2024

Examining the old commit establishing % catch( reconsult(F), as well as surrounding commits (in time), doesn't reveal anything meaningful. Moreover, switching the % from the reconsult line to the simple_load line, makes things work ok (i.e., as desired) in all of darwin/linux/win32. So I'm going to enable the reconsult line and delete the simple_load line.

from alsprolog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.