SRL Archive - Lape

Functionlist bug


Gu3st...

2015-06-07 23:55:02

The functionlist doesn't function properly when you place an assignment expression in an if-then.
if result := self.interception(L, t) then
Anything after this line is ignored, but the script compiles and runs just fine.

KeepBotting

2015-06-08 07:09:34

Try using
if result = self.interception(L, t) then
instead, I remember this being an issue with the "assignment" operator.

Gu3st...

2015-06-08 12:52:54

From: KeepBotting
Try using
if result = self.interception(L, t) then
instead, I remember this being an issue with the "assignment" operator.
That won't assign result as well as testing the equality, though.

Clarity

2015-06-08 13:42:49

It's fixed by putting ( ) around the assignment, although ideally this wouldn't be needed.
This was one of the reasons ogLib didn't support code hints. Additionally, the same bug occurs in case statements.

case x := y of breaks

case (x := y) of doesn't break

Gu3st...

2015-06-09 14:51:48

From: Clarity
It's fixed by putting ( ) around the assignment, although ideally this wouldn't be needed.
This was one of the reasons ogLib didn't support code hints. Additionally, the same bug occurs in case statements.

case x := y of breaks

case (x := y) of doesn't break
Cool, thanks :)