trueagi-io / metta-wam

A Hyperon MeTTa Interpreter/Transpilier that targets the Warren Abstract Machine
10 stars 11 forks source link

max-time! only returns first result #129

Closed AdrickTench closed 1 month ago

AdrickTench commented 1 month ago

max-time! only returns the first result but should return all (assuming it completes with the time limit). For example

metta+>!(max-time! 1 (superpose (a b c)))
[a]

should return [a, b, c]

AdrickTench commented 1 month ago

Interesting to consider how we should handle getting some results before timing out. Do we throw time_limit_exceeded and discard results? Or can we somehow throw without losing the incremental results?

TeamSPoon commented 1 month ago

secretly my intent was to give results up until the time.. sicne we are using a lazy iterator... they already have the answers (we canty take them back if we wanted to)

then at timeout should they get an exception, they can catch,? and if they want they can continue to get more?

TeamSPoon commented 1 month ago
metta+>!(max-time! 1 (superpose (a b c)))
[a

, b

, c]