Allow users to pass in custom variable / function resolving
Created by: huntergoldstein
This could be seen as an extension of #1 (closed): have the parser emit a new token, Atom(String)
, which contains any variable like sequence, for example:
3 + log 7 => [Token::Number(3), Token::Plus, Token::Atom(log), Token::Number(3)]
The user can then provide a mapping from atoms to their meaning.
- How would this work in practice? For numeric variables its simple: create a new intermediate result, but what about for functions? They would be taking in a set of tokens and returning...something? More tokens?