CL's apply, funcall and its parameters

2011-01-04  来源:本站原创  分类:Tech  人气:84 

apply / funcall function & rest args +

apply can accept multiple parameters, but the last argument must be a list, where each element is a function of the parameters

funcall can accept multiple parameters, are the function of the parameters for the length of the known parameters of the situation

Relationship:

(funcall function arg1 arg2 ...)
 ==  (apply function arg1 arg2 ... nil)
 ==  (apply function (list arg1 arg2 ...))

Their first argument must be a function, not a macro, and special operators.

For example and / or, on the one hand they are macro, on the other hand is calculated by using short circuiting, which met the first nil / T to get the results, which

apply / funcall does not match the evaluation process. Because apply / funcall are ordinary functions, you must first find the values of all parameters let function processing.

Used in the apply and / or an alternative is to use function EVERY and SOME, such as (apply # 'and * list *) can be written as follows: (every #' identity * list *)

相关文章
  • CL's apply, funcall and its parameters 2011-01-04

    apply / funcall function & rest args + apply can accept multiple parameters, but the last argument must be a list, where each element is a function of the parameters funcall can accept multiple parameters, are the function of the parameters for the l

  • javascript function method call () and apply () to switch 2010-03-17

    call () and apply () of the first parameter is the function to be called an object, in the function body of this parameter is the value of this keyword. call () the remaining parameters are passed to the value of the function to call. Is structured a

  • apply, call usage and the difference between 2010-03-17

    The same point: the role of the two methods produce exactly the same Differences: different methods of passing parameters In JavaScript, the code always has a context object within the code to handle the object. Context object is reflected by this va

  • (Transfer) JavaScript call and apply methods of 2010-04-25

    LastUpdate 2009-9-12 1.call official method (JavaScript manual): Call an object a method to replace the current object to another object. call ([thisObj [, arg1 [, arg2 [, [,. argN ]]]]]) Parameter thisObj optional. Will be used as the object of the

  • Javascript call & apply 2010-06-05

    call and apply can call the method and change its scope. function test(){ alert(this.toString()); } //window test(); //window test.call(); //object test.call(new test()); //object test.apply(new test()); Their difference is: call (obeject, arg1, arg2

  • Runtime: block memory copy, Part 2 2010-08-06

    My previous column focused on the 16-MB of memory block, this time I will discuss the size range of 4 bytes to 64 MB of memory blocks between. Previously, I tested a variety of delivery methods and the implementation of memory using the system to det

  • JavaScript object models - Execution Model (Note 3) 2010-12-10

    Execution Model Execution context (Execution Context) Introduction JavaScript code to run there where the execution context, it is a concept, a mechanism used to complete the JavaScript runtime scope, survival and other aspects of treatment. Executio

  • JavaScript object model - Implementation Model (Note 3) 2010-12-10

    Execution Model Execution context (Execution Context) Introduction JavaScript code to run there where the execution context, it is a concept, a mechanism used to complete the JavaScript runtime scope, survival and other aspects of treatment. Executio

  • Detailed stored procedures [Reserved] 2010-12-12

    Stored procedure can make the management of the database, and display user information on the database and its work much easier. A stored procedure is SQL statements and optional control-flow statements of pre-compiled collection, to a name stored an

  • Extended Ext newbie tutorial 2010-12-15

    Generally you will want to use class (class) to interpret the surface of any object of thought. Some reasons mentioned in the tutorial point also reflects this thinking. Class reuse Sometimes you want to generate a number of configuration options wit

  • Linux kernel traffic control (14) 2011-01-10

    Copyleft this document owned by yfydz all, the use of GPL, free to copy, reprint, reproduced keep the documents for completeness, for any commercial purposes is strictly prohibited. msn: [email protected] Source: http://yfydz.cublog.cn 5.14 CBQ(C

  • Linux kernel traffic control (16) 2011-01-10

    Copyleft this document owned by yfydz all, the use of GPL, free to copy, reprint, reproduced keep the documents for completeness, for any commercial purposes is strictly prohibited. msn: [email protected] Source: http://yfydz.cublog.cn 6. Class a

  • PL \ SQL User's Guide and reference 8 reproduced 2011-04-22

    Chapter VIII of PL / SQL routines First, what is the subroutine Subroutine is able to accept the argument was the naming of other programs can call PL / SQL block. PL / SQL routines, there are two types of procedures and functions. In general, the pr

  • spring的jdbctemplate的crud的基类dao 2014-06-18

    本文主要介绍了使用spring的jdbctemplate进行增删改查的基类Dao的简单写法,需要的朋友可以参考下 import java.util.List; /*** * 基本接口 * * @author xyq * @param <T> * */ public interface BaseDaoInf<T> { /*** * 查询接口 * * @return */ public List<T> find(String sql, Object[] parameters

  • IBM语音技术API说明,比较锻炼英文能力 2012-03-09

    SMAPI (Speech Manager Application Programming Interface) Reference IBM ViaVoice. SDK for Windowsa Printed in the USA Note Before using this information and the product it supports, be sure to read the general information under Appendix D "Notices&quo

  • Common Lisp 高阶函数学习笔记: function, funcall 和 apply... 2013-07-30

    Common Lisp 高阶函数学习笔记: function, funcall 和 apply 的用法 目录 0 概述 1 函数 function 的用法 2 函数 funcall 的用法 3 函数 apply 的用法 0 概述 高阶函数是 Lisp 的一大特色, 所谓的高阶函数就是把一个函数当做另一个函数的参数来用, 如果把普通的函数调用看做是在二维平面上的活动, 那么高阶函数就相当于增加了一个维度:可以把高阶函数看做在三维立体空间的活动. 一般来说, 编程语言需要这种机制, 因为这样可以为开

  • js call apply 2009-03-12

    1) no doubt about call, the simplest explanation is that: the hidden parameters of the first. Because usually a function (Function) call, there will be an extra hidden parameter is the function (Function) object belongs (if not the specific, compared

  • JavaScript in call usage and apply the meaning and the difference between 2009-06-03

    JavaScript, there is a call and apply methods, its role is basically the same, but there is a slight difference. JS first take a look at the manual's explanation of the call: call an object method call a method to replace the current object to anothe

  • EffectiveJava-variable parameters of Article 42 be used with caution 2010-03-29

    (1) The variable parameters allow you to pass multiple parameters, or 0, and sometimes lead to confusion static int sum(int... args) { int sum = 0; for (int arg : args) sum += arg; return sum; } System.out.println(sum()); System.out.println(sum(10));

  • java request assignment to the object dynamic parameters 2010-04-12

    public class ParamUtil { private static String DATE_FORMAT_1 = "yyyy-MM-dd"; private static String DATE_FORMAT_2 = "yyyy-MM-dd HH:mm:ss"; private static String DATE_MATCHER_1 = "^\\d{4}(\\-)\\d{1,2}\\1\\d{1,2}$"; private stat