short-circuiting

new topic     » topic index » view thread      » older message » newer message

I haven't used euphoria for a while, and have just got back into it. Quick
question about short-circuiting a function:
from memory euphoria allowed this to short-circuit...? but does not work however


function test(object whatever)

	return (sequence(whatever) and (length(whatever) = 4))
	
end function

test(0) errors because it goes on to call length(), however this code:


int test(int whatever) {
	if ((++whatever == 1) && (++whatever == 2)) {
	}
	return whatever;
}

prints 1 as expected.

so how do I achieve the same logic in euphoria?



-- 
+64 (03) 3522885

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu