From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry OReilly Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal Date: Mon, 26 Jan 2015 14:22:19 -0800 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1132ecee54682c050d959268 X-Trace: ger.gmane.org 1422310960 1700 80.91.229.3 (26 Jan 2015 22:22:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 26 Jan 2015 22:22:40 +0000 (UTC) Cc: emacs-devel@gnu.org To: stephen@xemacs.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 26 23:22:40 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YFs3K-0002vV-G3 for ged-emacs-devel@m.gmane.org; Mon, 26 Jan 2015 23:22:38 +0100 Original-Received: from localhost ([::1]:44358 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFs3J-0000aC-UB for ged-emacs-devel@m.gmane.org; Mon, 26 Jan 2015 17:22:37 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53985) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFs33-0000ZR-RD for emacs-devel@gnu.org; Mon, 26 Jan 2015 17:22:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YFs33-00072Q-12 for emacs-devel@gnu.org; Mon, 26 Jan 2015 17:22:21 -0500 Original-Received: from mail-qc0-x22c.google.com ([2607:f8b0:400d:c01::22c]:41238) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFs32-00072C-U3 for emacs-devel@gnu.org; Mon, 26 Jan 2015 17:22:20 -0500 Original-Received: by mail-qc0-f172.google.com with SMTP id i8so9395148qcq.3 for ; Mon, 26 Jan 2015 14:22:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=c8FHxqAgd92pbXbc/hcPIOZPqobIVhz7l8Rp2lzFvCg=; b=Y+Co+ZWWTCjBOHT1KDR96YyONdVfxzVu4BWKz4FyHAkMdvxC0zm/+TiRolN0zWbid+ tswZXqMtzHqd325d9UQR7y+RHo7ZQddMT+tXx7sHpjn1Z9qdVwzVziKf5QoyC9Lacd+8 VRiqtAq6fzSxUUU6ZnhaZIw6ionW2P/jfEkO38YtX/pWm+YMEprHQnFNrYEPrPn3QHtt ln6hgvIVmh/Wzb9H6dTcx4Ut78DpNLzPw9URG+67XxJ6lNTXpThkydzItptQW9xIN1hs djIWt9PW3461UYB4pyPU15Q02PUax15Y+yfDP+3clIzqxxofYepX8Tmy+dicVTgdo10A EBzg== X-Received: by 10.229.174.70 with SMTP id s6mr1503304qcz.7.1422310939844; Mon, 26 Jan 2015 14:22:19 -0800 (PST) Original-Received: by 10.140.131.208 with HTTP; Mon, 26 Jan 2015 14:22:19 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400d:c01::22c X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:181805 Archived-At: --001a1132ecee54682c050d959268 Content-Type: text/plain; charset=UTF-8 > (car #(fubAr quux)) => 'lambda > > would be *very* surprising to most users. That kind of computation is > what functions are for. Taking the car of a function is not valid anyway. Byte compile: (defvar myfunc (lambda ())) Evaluate: (car myfunc) Error: Debugger entered--Lisp error: (wrong-type-argument listp #[nil "\300\207" [nil] 1]) car(#[nil "\300\207" [nil] 1]) eval((car (byte-compile (function (lambda nil)))) nil) eval-last-sexp-1(nil) eval-last-sexp(nil) call-interactively(eval-last-sexp nil nil) command-execute(eval-last-sexp) Or in the *scratch* buffer: (setq lexical-binding t) (car (lambda ())) ; => 'closure --001a1132ecee54682c050d959268 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
> (car #(fubAr quux)) =3D> 'lambda
> =
> would be *very* surprising to most users.=C2=A0 That kind of compu= tation is
> what functions are for.

Taking the car of a functi= on is not valid anyway.

Byte compile:

=C2=A0 (defvar myfunc (= lambda ()))

Evaluate:

=C2=A0 (car myfunc)

Error:
=C2=A0 Debugger entered--Lisp error: (wrong-type-argument listp #[nil &qu= ot;\300\207" [nil] 1])
=C2=A0=C2=A0=C2=A0 car(#[nil "\300\207&= quot; [nil] 1])
=C2=A0=C2=A0=C2=A0 eval((car (byte-compile (function (la= mbda nil)))) nil)
=C2=A0=C2=A0=C2=A0 eval-last-sexp-1(nil)
=C2=A0=C2= =A0=C2=A0 eval-last-sexp(nil)
=C2=A0=C2=A0=C2=A0 call-interactively(eval= -last-sexp nil nil)
=C2=A0=C2=A0=C2=A0 command-execute(eval-last-sexp)
Or in the *scratch* buffer:

=C2=A0 (setq lexical-binding t)=C2=A0 (car (lambda ())) ; =3D> 'closure

--001a1132ecee54682c050d959268--