all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
To: Artur Malabarba <bruce.connor.am@gmail.com>
Cc: Nicolas Richard <theonewiththeevillook@yahoo.fr>,
	"Stephen J. Turnbull" <stephen@xemacs.org>,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	emacs-devel@gnu.org
Subject: Re: [elpa] master 68bcf86 2/4: package/names: :group can be given a list
Date: Mon, 12 Jan 2015 22:41:25 +0100	[thread overview]
Message-ID: <87iogbismy.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <CAAdUY-J7C_a99_bOQovye=OVELZxRdFiT1pPauzQjvfpDgz8hA@mail.gmail.com> (Artur Malabarba's message of "Mon, 12 Jan 2015 18:30:42 -0200")

Artur Malabarba <bruce.connor.am@gmail.com> writes:

> I'll use the backquoted version. But I'm at a place of spotty internet
> at the moment, so it may take me a few days.

Many versions of quoted lambda functions may these days be _so_ much
better written using lexical binding instead that I think XEmacs should
really try catching up here.  Otherwise the amount of code that cannot
be easily brought to run on XEmacs will likely become much larger.

I'm currently writing some package, and there are things like

(defun lily-pitch-insert-for (note)
  "Calculate a pitch insertion routine for Midi note NOTE.

This takes a look at `lily-midi-keysig' and determines the proper
enharmonic variant to insert."
  (lambda () (interactive)
    (lily-note-insert
     (apply #'lily-notename (lily-midi-to-note note)))))

or

(defun midikbd-filter-create ()
  "Create one Midi process filter keeping state across calls."
  (let ((state (make-vector 9 nil)))
    (lambda (_process string)
      (setq unread-command-events
	    (append unread-command-events
		    (mapcar (lambda (x) (aref midikbd-keys x))
			    (ccl-execute-on-string 'midikbd-decoder
						   state string t t)))))))

and other stuff.  That's quite nicer and more efficient than the awkward

(defun midikbd-filter-create ()
  "Create one Midi process filter keeping state across calls."
  (let ((state (make-vector 9 nil)))
    `(lambda (_process string)
      (setq unread-command-events
	    (append unread-command-events
		    (mapcar (lambda (x) (aref midikbd-keys x))
			    (ccl-execute-on-string 'midikbd-decoder
						   ,state string t t)))))))

or similar.

-- 
David Kastrup



  reply	other threads:[~2015-01-12 21:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20150112112953.11913.47601@vcs.savannah.gnu.org>
     [not found] ` <E1YAdBy-00037L-O2@vcs.savannah.gnu.org>
2015-01-12 15:21   ` [elpa] master 68bcf86 2/4: package/names: :group can be given a list Stefan Monnier
2015-01-12 16:11     ` Stephen J. Turnbull
2015-01-12 16:25       ` Nicolas Richard
2015-01-12 17:29         ` Stephen J. Turnbull
2015-01-12 18:13           ` David Kastrup
2015-01-12 20:30             ` Artur Malabarba
2015-01-12 21:41               ` David Kastrup [this message]
2015-01-13  5:53                 ` Stephen J. Turnbull
2015-01-13  9:48                   ` David Kastrup
2015-01-14 11:51                 ` Artur Malabarba
2015-01-14 12:03                   ` David Kastrup
2015-01-13 18:46               ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87iogbismy.fsf@fencepost.gnu.org \
    --to=dak@gnu.org \
    --cc=bruce.connor.am@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=stephen@xemacs.org \
    --cc=theonewiththeevillook@yahoo.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.