Fix #13: math: Use a math.* namespace#30
Open
leftibot wants to merge 2 commits intoChaiScript:masterfrom
Open
Conversation
…functions Register all math functions under a `math` namespace object using ChaiScript's Dynamic_Object system via Module::eval. Functions remain accessible as bare names (e.g., `cos(0.5)`) for backward compatibility, and are now also accessible as `math.cos(0.5)`, similar to Lua's math library. Also fixes Catch2 SIGSTKSZ compatibility with newer glibc. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Member
|
@leftibot update this to actually use namespaces instead of some global math object |
Upgrade ChaiScript from 5.8.6 to 6.1.0 to use its native namespace
support. Replace the Dynamic_Object/math_type class hack with proper
namespace("math") + function assignment, which is the idiomatic way
to create namespaces in ChaiScript 6.x. Update test files for the
6.x ChaiScript constructor API (stdlib is now included by default).
Requested by @lefticus in PR ChaiScript#30 review.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
|
Addressed review feedback from @lefticus. New commits: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated fix by @leftibot.
What changed
Files
Closes #13
Triggered by @lefticus.