G
Guest
Hi again,
I've been coding in vb .Net on my most recent project and during a debug
session I noticed that VB .Net hasn't got lazy evaluation... WHY?! I love
lazy evaluation and actually count on it.
In my current application there is data that may or may not exist depending
on a certain value. It's a set of rules that may or may not apply.
At a certain time in the code, there is the following (alike anyhow) statment.
If ((objectA.HasRule4 AND objectB.FailsRule4(params))
OR (objectA.HasRule5 AND objectB.FailsRule5(otherparams))
OR (not objectA.Property.Value.equals(objectB.Property.Value)) then
collectionOfObjectB.Remove(objectB)
else
objectB.Calculatespecialfield()
end if
When I write this code I expect the run to check on objectA.Hasrule4 if that
is false it should move on to the next or-statement.
Is there any possibility to tell VB .Net (or rather VS 2003) to apply lazy
evaluation for conditional statements?
As usual many thanks in advance, and enjoy your holidays
I've been coding in vb .Net on my most recent project and during a debug
session I noticed that VB .Net hasn't got lazy evaluation... WHY?! I love
lazy evaluation and actually count on it.
In my current application there is data that may or may not exist depending
on a certain value. It's a set of rules that may or may not apply.
At a certain time in the code, there is the following (alike anyhow) statment.
If ((objectA.HasRule4 AND objectB.FailsRule4(params))
OR (objectA.HasRule5 AND objectB.FailsRule5(otherparams))
OR (not objectA.Property.Value.equals(objectB.Property.Value)) then
collectionOfObjectB.Remove(objectB)
else
objectB.Calculatespecialfield()
end if
When I write this code I expect the run to check on objectA.Hasrule4 if that
is false it should move on to the next or-statement.
Is there any possibility to tell VB .Net (or rather VS 2003) to apply lazy
evaluation for conditional statements?
As usual many thanks in advance, and enjoy your holidays