3 ms·
Without having any idea of this, right now I'm facing the problem of making a PDDL compiler (which is basically Lisp) in C++ , and this was the way I took. List
by f1shy 4y ago
Without having any idea of this, right now I'm facing the problem of making a PDDL compiler (which is basically Lisp) in C++ , and this was the way I took. Lists are just std::vectors<std::variant>> and the variant can be a function, number (literal) or a variable.
- sillysaurusx 4y agoNo way! Is the code available anywhere? I was messing around with this idea too but didn't have the time. That's fantastic. :) std::variant is really tricky, mostly because of C++'s type system. I went with std::any. My attempt is here: https://gist.github.com/shawwn/63e0f010479efd95ebffdf2108645ad3#file-runtime-h-L428-L448 https://gist.github.com/shawwn/63e0f010479efd95ebffdf2108645... I'd love to see your code and compare notes! Mine is pretty crummy; I'm not sure there are any worthwhile ideas in it. Did you have much trouble with the std::variant route?
- f1shy 4y agoNot jet. I'm working with a friend. Even though the code is in github, is still private, until we have a first working version. What I'm doing is an extremely simple evaluator, which can do what is required for PDDL: basic arithmetic, logic operators and IF.