HuoLanguage / huo

interpreted language written in C
MIT License
212 stars 21 forks source link

Execution bundle causes depth bug #50

Closed TheLoneWolfling closed 8 years ago

TheLoneWolfling commented 8 years ago

When you replaced the arguments with a bundle, you caused an interesting regression.

Previously, depth was pass-by-value. So if you have a tree of a (calling b calling c and d) (calling e calling f and g), depth at a would be 500, depth at b would be 499, depth at c and d would be 498, depth at e would be 499, depth at f and g would be 498. Essentially, only recursive calls decrease the depth limit.

But not depth is pass-by-reference. Which means that it goes depth at a is 500, depth at b is 499, depth at c is 498, depth at d is 497, depth at e is 496, depth at f is 495, depth at g is 494.

In other words, "depth" is currently acting as a straight counter.

This is why strings isn't working properly. Currently, "depth" effectively imposes a limit on the length of the program.

TheLoneWolfling commented 8 years ago

Didn't realize you had already fixed this.