heres some (all?) of the relevent things
/return
$isid
$result

As shown RETURN X returns to the caller X, this can be done if in a alias or identifier call, if as an alias $result contains the solution, $isid is $true or $false baed if the alias was called as an identifier.

alias times2 {
if ( $isid ) { echo -a BLAH }
return $calc( 2 * $1 )
}

//echo -a $times2(123)
BLAH
236

//times2 123 | echo -a $result
236