Up

varIf

Call a function if the type of the given function is the good.

This function should be used by advanced developers only.

Prototype :

fun [S S fun [u0] u1 u0] u1

Return : u1 the return value of the function (if called), nil else (not called or error).

See also

varIfNot

varGet

Example

fun ifVar (p)=
	let p -> [arg nick] in
	if !strcmp arg nick then
		"Bob"
	else
		"Alice";;
	
fun anyFunction (arg)=
	_showconsole;
	_fooS strcat "name is " varIf "myVariable" "S" @ifVar [varGet "myVariable" nil "Bob"]; // Bob (or Alice)
	0;;