[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 209/255: adding curry, rcurry and compose helpers
From: |
Eric Schulte |
Subject: |
[elpa] 209/255: adding curry, rcurry and compose helpers |
Date: |
Sun, 16 Mar 2014 01:02:50 +0000 |
eschulte pushed a commit to branch go
in repository elpa.
commit cdaf1a77bc87a10dc12baa795679adc8b4adb6bc
Author: Eric Schulte <address@hidden>
Date: Tue Aug 6 12:13:55 2013 -0600
adding curry, rcurry and compose helpers
---
go-util.el | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/go-util.el b/go-util.el
index 4483369..45b7049 100644
--- a/go-util.el
+++ b/go-util.el
@@ -28,6 +28,24 @@
;;; Code:
(eval-when-compile (require 'cl))
+(defun curry (function &rest arguments)
+ (lexical-let ((function function)
+ (arguments arguments))
+ (lambda (&rest more) (apply function (append arguments more)))))
+
+(defun rcurry (function &rest arguments)
+ (lexical-let ((function function)
+ (arguments arguments))
+ (lambda (&rest more) (apply function (append more arguments)))))
+
+(defun compose (function &rest more-functions)
+ (cl-reduce (lambda (f g)
+ (lexical-let ((f f) (g g))
+ (lambda (&rest arguments)
+ (funcall f (apply g arguments)))))
+ more-functions
+ :initial-value function))
+
(defun rcons (x lst)
(append lst (list x)))
- [elpa] 201/255: print score after marking territory, (continued)
- [elpa] 201/255: print score after marking territory, Eric Schulte, 2014/03/15
- [elpa] 189/255: replace flet with cl-flet, Eric Schulte, 2014/03/15
- [elpa] 190/255: set level (mainly for playing GNUGO), Eric Schulte, 2014/03/15
- [elpa] 204/255: prefix external names with package name, Eric Schulte, 2014/03/15
- [elpa] 165/255: working on placing backgrounds behind pieces, Eric Schulte, 2014/03/15
- [elpa] 202/255: added interface function to view an SGF file, Eric Schulte, 2014/03/15
- [elpa] 205/255: update the README, Eric Schulte, 2014/03/15
- [elpa] 206/255: ensure prisoners are 0 at the start of a new game, Eric Schulte, 2014/03/15
- [elpa] 208/255: support for viewing lists in a buffer, Eric Schulte, 2014/03/15
- [elpa] 207/255: robustly handle prematurely quitting process, Eric Schulte, 2014/03/15
- [elpa] 209/255: adding curry, rcurry and compose helpers,
Eric Schulte <=
- [elpa] 213/255: include headers in width calculation, Eric Schulte, 2014/03/15
- [elpa] 215/255: smaller ldots, Eric Schulte, 2014/03/15
- [elpa] 200/255: refresh the go board, Eric Schulte, 2014/03/15
- [elpa] 214/255: refresh list every time the buffer changes size, Eric Schulte, 2014/03/15
- [elpa] 212/255: bug fix, wrong function name, Eric Schulte, 2014/03/15
- [elpa] 225/255: quit observing IGS game w/o closing connection, Eric Schulte, 2014/03/15
- [elpa] 171/255: bigger stones, Eric Schulte, 2014/03/15
- [elpa] 219/255: updated igs backend, Eric Schulte, 2014/03/15
- [elpa] 222/255: asynchronous IGS game listing, Eric Schulte, 2014/03/15
- [elpa] 220/255: list buffer navigation, Eric Schulte, 2014/03/15