Skip to content
Merged
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion mathics/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def evaluate(self, str_expression, timeout=None, form=None):
)
if form is None:
form = self.form
self.last_result = expr.evaluate(self.evaluation)
self.last_result = expr.evaluate(self.evaluation) if expr else None
Copy link
Contributor

Choose a reason for hiding this comment

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

In WMA, an empty expression should result in Null (SymbolNull). I think that what we should do here instead is to check in line 147 if expr is None, and return SymbolNull.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks. I've updated the PR accordingly.

Copy link
Member

@rocky rocky Dec 19, 2025

Choose a reason for hiding this comment

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

Thanks. I've updated the PR accordingly.

Thanks. LGTM. (And thanks @mmatera for spotting.)

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM

return self.last_result

def evaluate_as_in_cli(self, str_expression, timeout=None, form=None, src_name=""):
Expand Down
Loading