You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying out some examples on https://wren.io/try/ and I came across a weird behaviour. I am not at all familiar with wren, I was just checking it out after seeing a Hacker News post. Below two functions look semantically identical to me and should give same output but they don't. But if I swap the last two print statements, I get the same output (i.e 144). I was just wondering if it is the expected behaviour or is it a bug.
var Fib1 =Fn.new {|n|
if (n <=2) {
return1
} else {
returnFib1.call(n-1) +Fib1.call(n-2)
}
}
var Fib2 =Fn.new {|n|
if (n <=2) {
return1
} else {
var left =Fib2.call(n-1)
var right =Fib2.call(n-2)
return left + right
}
}
System.print(Fib2.call(12))
System.print(Fib1.call(12))
The text was updated successfully, but these errors were encountered:
Using valgrind, I can relate this issue to the well-known stack
corruption issue.
It seems the original issue is gone but I revived it in with a test
case: #761
I'll add your testcase to it ASAP.
I was trying out some examples on https://wren.io/try/ and I came across a weird behaviour. I am not at all familiar with wren, I was just checking it out after seeing a Hacker News post. Below two functions look semantically identical to me and should give same output but they don't. But if I swap the last two print statements, I get the same output (
i.e 144
). I was just wondering if it is the expected behaviour or is it a bug.The text was updated successfully, but these errors were encountered: