emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] 23/255: more complex but more intuitive and useful `range'


From: Eric Schulte
Subject: [elpa] 23/255: more complex but more intuitive and useful `range'
Date: Sun, 16 Mar 2014 01:02:12 +0000

eschulte pushed a commit to branch go
in repository elpa.

commit 47a39c1be1d035f2ce75bf32aa97c1040aa6b66f
Author: Eric Schulte <address@hidden>
Date:   Tue May 15 19:50:30 2012 -0400

    more complex but more intuitive and useful `range'
---
 sgf.el |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/sgf.el b/sgf.el
index ed6d0fe..712b6fb 100644
--- a/sgf.el
+++ b/sgf.el
@@ -208,7 +208,17 @@
 
 (defun board-size (board) (round (sqrt (length board))))
 
-(defun range (size) (number-sequence 0 (- size 1)))
+(defun range (a &optional b)
+  (block nil
+    (let (tmp)
+      (unless b
+        (cond ((> a 0) (decf a))
+              ((= a 0) (return nil))
+              ((> 0 a) (incf a)))
+        (setq b a a 0))
+      (if (> a b) (setq tmp a a b b tmp))
+      (let ((res (number-sequence a b)))
+        (if tmp (nreverse res) res)))))
 
 (defvar black-piece "X")
 



reply via email to

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