emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Clojure-like syntactic sugar for an anonymous function liter


From: Barry OReilly
Subject: Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal
Date: Mon, 26 Jan 2015 14:22:19 -0800

> (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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]