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

Explicitly typed symbols do not have base functions associated with them #117

Closed
leios opened this issue Jul 21, 2020 · 3 comments
Closed

Comments

@leios
Copy link

leios commented Jul 21, 2020

The type Array is expected to have some functions available like length(...) or reshape!(...), but when trying to build a symbolic tree, these functions are not available.

Here, I tried to create 2 arrays (x, and y) and add length(y) to x.

julia> using SymbolicUtils

julia> @syms x::Array y::Array
(x, y)

julia> z = x^2 .+ length(y)
ERROR: MethodError: no method matching length(::SymbolicUtils.Sym{Array})
Closest candidates are:
  length(::Core.SimpleVector) at essentials.jl:596
  length(::Base.MethodList) at reflection.jl:852
  length(::Core.MethodTable) at reflection.jl:938
  ...
Stacktrace:
 [1] top-level scope at REPL[5]:1

@shashi
Copy link
Member

shashi commented Aug 15, 2020

We still have to define methods on array typed variables.

We got started on this in https://github.com/JuliaSymbolics/SymbolicUtils.jl/tree/s/new-array but haven't yet got around to it. Let me know if you need it.

@shashi
Copy link
Member

shashi commented Aug 16, 2020

rebased, also thinking about a composable metadata system. #123

@shashi
Copy link
Member

shashi commented Aug 16, 2020

I'll close this for now as a duplicate of #16

maybe the documentation should be made clearer about ::T though.

@shashi shashi closed this as completed Aug 16, 2020
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

No branches or pull requests

2 participants