Skip to content

am I missing the way to return computed values as variable values #162

@pm100

Description

@pm100

I would like to expose variables (not functions) to the expressions that are not simple data items but I cannot find a way to do it .

Specifically - I am writing a 6502 emulator debugger. I want to expose the registers as variables in expressions. I can find no way to do it because of this signature:

fn get_value(&self, identifier: &str) -> Option<&Value>;

In the Context trait. It requires me to return a reference to a Value, if the value is looked up or computed in any way I cannot do that. I note that :

fn call_function(&self, identifier: &str, argument: &Value) -> EvalexprResult<Value>

returns the actual value not a reference. It would be a lot simpler if get_value did the same.. Is there some magic trick I am missing

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions