From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Karan Ahlawat Newsgroups: gmane.emacs.help Subject: Re: apply function Date: Mon, 7 Aug 2023 11:42:09 +0530 Message-ID: <7bea436f-42ab-4fa4-9b28-e5fe34776691@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8871"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 07 08:12:58 2023 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qStU9-00029J-Hp for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 07 Aug 2023 08:12:57 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qStTY-00054O-Lm; Mon, 07 Aug 2023 02:12:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qStTX-00053n-A7 for help-gnu-emacs@gnu.org; Mon, 07 Aug 2023 02:12:19 -0400 Original-Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qStTV-0007uB-1Z for help-gnu-emacs@gnu.org; Mon, 07 Aug 2023 02:12:18 -0400 Original-Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-6873a30d02eso2590745b3a.3 for ; Sun, 06 Aug 2023 23:12:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691388733; x=1691993533; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=S4JnrXD/RV0BEVOADvRc0jektwovCaVf3XLHHrfdB04=; b=YzSiYnXmMpk01t/skXz4fzyTEEw/6GjlCCxL0P+wUq9qHa1rPUIeioQI+NqwACmFhr 2b1agYgFocI08LIr8yBbQ8KGmSM6PvysaiVhqFe9Cq2c1TDMjrbz0Bh86W7AGa5ZyHJU opwVvyZqapbHPSd9EuMa9VYhLqhI+eEBb1Oa2VpJIBsO96PXBmDokncy2tRT5wkdvqMy J0/k4tRTYDxCQPvw07o3F1BaS6P2irGeLG7gFYD1XEF1Lv2rFmonzgo5BJ8F39pIBO32 3/u3yR3cMiNsJM/ZNs+beUHgYAvvsqBC7TAXwI4TajhCGlpuMeMjj8n2h1dserQYGX/7 44ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691388733; x=1691993533; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=S4JnrXD/RV0BEVOADvRc0jektwovCaVf3XLHHrfdB04=; b=Lh2IQOJNTwbnC9HDbCt9R/pngvDhrr4lXYbymqrcEhWHXZ43EWz0xtXzK2GqLwn5tG 7tSiDHOmvtqBc1tito5vyf9gI1YFBYj9U+cCyxgcjLwNqrVwwMToJVqJ5T3wv4QZLB1S +rYEtiUeGiCh87Ika47x67To657v4wQKVDVIzRvgi5s1L/IZL7oQx2tQq6HGQDljLnAz oTKxeNr4NhbH8sxXaw/zMKxYFDpjJBhhUsHFS4LYD1TvepfC8yzk4XlkgwouuPZOoFv8 smEEzz1NDZZnOSPB3YA0ZboVLgdKbb132+kEnabSr+kfZgGO5hkkAN69CSJ/4w9CUI1Z zwBw== X-Gm-Message-State: AOJu0YxADAnWlVSSmtMOWe7LzN0QCSA6uSLkQAPNKG8GG7XDg1a96nZB sx+fm5O+xZMKa7DIxQDEsJyM5B8VBsrq+kUPDA8= X-Google-Smtp-Source: AGHT+IGCsmKNolOTAnim+hmn7W5PKK3kW++WJyddiehcETNRU2vIbTXDXg80PdYrMiwQlUR+wabviA== X-Received: by 2002:a05:6a00:23c5:b0:686:bd88:6062 with SMTP id g5-20020a056a0023c500b00686bd886062mr7920465pfc.24.1691388733197; Sun, 06 Aug 2023 23:12:13 -0700 (PDT) Original-Received: from [192.168.1.9] ([103.62.92.74]) by smtp.gmail.com with ESMTPSA id x19-20020a62fb13000000b00686c77a2905sm5257814pfm.20.2023.08.06.23.12.11 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 06 Aug 2023 23:12:12 -0700 (PDT) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=ahlawatkaran12@gmail.com; helo=mail-pf1-x434.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:144656 Archived-At: On 07/08/23 11:15, Heime wrote: > I have seem code that calls a function in the following way > > (apply 'nemboss-estring (pp-to-string object) bfname)) > > than the usual > > (emboss-estring (pp-to-string object) bfname) > > What might be the reasons for doing so ? The most common use case I've seen for this is that apply can take in a list as the arguments to the function, where a list would not work, and then spread the elements of the list as individual arguments. So     (+ (list 1 2 3)) doesn't work, but doing     (apply #'+ (list 1 2 3)) ; outputs 6 does work, since it essentially reduces it to (+ 1 2 3)