Skip to content

Better messages from programmatically-injected code #10

Description

@rpgoldman

Is your feature request related to a problem? Please describe.

The problem is that messages are tailored for file-based loading and so do not provide assistance when Ergo code is added programmatically. This problem is exacerbated for code that is automatically generated. Here's an example of what I mean:

++Warning[Ergo]> singleton variable ?R in dynamically inserted rule on line <unknown> in file <unknown>

Describe the solution you'd like
One possibility, it seemed to me, would be to catch whatever warning is being generated here, and add more information (most likely just print the problematic rule). I am assuming that the above comes because code for reading rules from a file is being repurposed for use via pyergo. That's just an assumption, of course. A possible challenge would be if a number of rules are injected together. In that case the following alternative might be better:

Create a temp file from the inserted lines of Ergo code, print its location for the user, and issue warnings with line numbers relative to that file. That might be more difficult.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions