Skip to content

Allocations#310

Open
jverzani wants to merge 5 commits intosymengine:masterfrom
jverzani:allocations
Open

Allocations#310
jverzani wants to merge 5 commits intosymengine:masterfrom
jverzani:allocations

Conversation

@jverzani
Copy link
Contributor

@jverzani jverzani commented Jan 28, 2026

A few small adjustments

  • added const to several constant variables

  • allow TermInterface.operation to work with SymFunction objects

  • add nameof method for SymFunction objects

  • Conversion of :ℯ (\euler) (Fixes bug)

  • add unwrap_const to mirror SymbolicUtils behaviour (no error)

  • add iseven and isodd; add tests (allocate due to conversion to Integer)

  • adjust behavior of _convert for expressions (Really want to avoid this, but somehow writing convert(Expr, x) and getting a symbol seems wrong. Add test for behaviour.

src/mathfuns.jl Outdated
Comment on lines 192 to 193
Base.Symbol(s::SymFunction) = Symbol(s.name)
Base.nameof(s::SymFunction) = Symbol(s)
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't these be flipped?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I got cute? They could both resolve to Symbol(s.name). (I was looking for a generic that would give the symbol and not the general symbol for SymFunction and wasn't sure which should be preferred for generic programming.)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants