From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Ben Bacarisse Newsgroups: gmane.emacs.help Subject: Re: Emacs documentation is bad Date: Sun, 09 Sep 2018 22:10:42 +0100 Organization: A noiseless patient Spider Message-ID: <8736uie5rh.fsf@bsb.me.uk> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1536527606 28849 195.159.176.226 (9 Sep 2018 21:13:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 9 Sep 2018 21:13:26 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Sep 09 23:13:22 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fz71D-0007M3-Au for geh-help-gnu-emacs@m.gmane.org; Sun, 09 Sep 2018 23:13:19 +0200 Original-Received: from localhost ([::1]:48750 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fz73J-0006TD-PA for geh-help-gnu-emacs@m.gmane.org; Sun, 09 Sep 2018 17:15:29 -0400 Original-Path: usenet.stanford.edu!goblin2!goblin.stu.neva.ru!aioe.org!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 51 Original-Injection-Info: reader02.eternal-september.org; posting-host="8d7a3fc74df6d3e9a04bc138155bf675"; logging-data="4239"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19iA2GGUcArVp/9j46ayZFmQKdrGnM+3P8=" Cancel-Lock: sha1:6oyxoOm8G9Wp0qiy30phC4ad8dI= sha1:6I5qUyiVvhVocsz1sfkUdyccIZs= X-BSB-Auth: 1.cb74b50df0cf3fcdc92c.20180909221042BST.8736uie5rh.fsf@bsb.me.uk Original-Xref: usenet.stanford.edu gnu.emacs.help:223723 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:117848 Archived-At: John Stone writes: > lambda expression is a function which can appear wherever a function name > can appear? bullshit, delete the lies from the manual I don't think they are lies. I think you are a (rude) Scheme programmer who does not know that traditional Lisps like Common Lisp and Emacs Lisp can't call closures without funcall (or apply). This: >> ( >> ( >> (lambda (f) >> (lambda (x) >> (list f x))) >> 'g >> ) >> 'y >> ) evaluates to '(g y) in Scheme but it ill-formed in Common Lisp and Emacs Lisp. In Common Lisp you would write (funcall ((lambda (f) (lambda (x) (list f x))) 'g) 'y) but in in Emacs Lisp you also have to have lexical binding on in the buffer: (setq lexical-binding t) (funcall ((lambda (f) (lambda (x) (list f x))) 'g) 'y) The fact that you need funcall to call a closure does not contradict the statement in manual. The same is true if we use a named function: (defun named (f) (lambda (x) (list f x))) (funcall (named 'g) 'y) Using ((named 'g) 'y) will not work but notice how in the funcall version the function name can indeed be replaced by the lambda equivalent. >>> this crashes emacs but try to figure out why from docs and you're shit >>> out of luck and just wasted half a fucking day I get the feeling you don't really want an explanation! But I decided to post this anyway because other reader might be interested and it helps to keep the archive clear on unanswered questions. -- Ben.