EVOLUTION-MANAGER
Edit File: forceAndCall.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Call a function with Some Arguments Forced</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for forceAndCall {base}"><tr><td>forceAndCall {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Call a function with Some Arguments Forced</h2> <h3>Description</h3> <p>Call a function with a specified number of leading arguments forced before the call if the function is a closure. </p> <h3>Usage</h3> <pre> forceAndCall(n, FUN, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>n</code></td> <td> <p>number of leading arguments to force.</p> </td></tr> <tr valign="top"><td><code>FUN</code></td> <td> <p>function to call.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>arguments to <code>FUN</code>.</p> </td></tr> </table> <h3>Details</h3> <p><code>forceAndCall</code> calls the function <code>FUN</code> with arguments specified in <code>...</code>. If the value of <code>FUN</code> is a closure then the first <code>n</code> arguments to the function are evaluated (i.e. their delayed evaluation promises are forced) before executing the function body. If the value of <code>FUN</code> is a primitive then the call <code>FUN(...)</code> is evaluated in the usual way. </p> <p><code>forceAndCall</code> is intended to help defining higher order functions like <code><a href="apply.html">apply</a></code> to behave more reasonably when the result returned by the function applied is a closure that captured its arguments. </p> <h3>See Also</h3> <p><code><a href="force.html">force</a></code>, <code><a href="delayedAssign.html">promise</a></code>, <code><a href="function.html">closure</a></code>. </p> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>