Godot Version
4.5.1
Question
So I’m learning about Expressions, and I’m having trouble coming up with use cases for it. The only thing I can think of is using it to create a dev console. In a lot of cases, it seems like it would just be easier to not use the Expression class at all.
For example:
#do this
var result = 20 + 10*2 - 5/2.0
#instead of
var expression = Expression.new()
expression.parse("20 + 10*2 - 5/2.0")
var result = expression.execute()
I mean obviously with something as simple as that, using the Expression class is overkill and unnecessary but you know what I mean.
I know that with Expression classes I can use a base instance’s methods, constants and member variables but still…
Other than a dev console, I can’t think of any situations where it’s ideal to use this class.