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

Force focus on MAIN when loading file #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cx_plugins/executive_plugin/clips/time.clp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
; See the License for the specific language governing permissions and
; limitations under the License.

(defmodule MAIN (export deftemplate time))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this necessary?

Shouldn't this be up to the user (e.g., to re-define the main module once and then exporting whatever is necessary)?

I have not worked with modules yet, but it seems if this export here is necessary, then this needs to be a policy across all plugins.

(defglobal
?*PRIORITY-TIME-RETRACT* = -10000
)
Expand Down
2 changes: 2 additions & 0 deletions cx_plugins/file_load_plugin/src/file_load_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ bool FileLoadPlugin::clips_env_init(LockSharedPtr<clips::Environment> &env) {
context->env_name_.c_str());
for (const auto &f : init_files_) {

clips::Defmodule *main_module = clips::FindDefmodule(env.get_obj().get(), "MAIN");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clips::Focus(main_module);
if (clips::EE_NO_ERROR != clips::Eval(env.get_obj().get(),
std::format("(load* {})", f).c_str(),
NULL)) {
Expand Down
Loading