1 2 3 4
;;; LIS is a list of (possibly repeated) elements ;;; COMPARE is a boolean function of two elements, such as > (which is the default) ;;; This returns the next lexicographically larger (via COMPARE) list of those same elements ...
Lisp On Lexicographically next perm...
by M Tyson,
June 29, 2008 09:49
1 2 3 4
(defun group-by (lst n) (cond ((null lst) nil) (t (cons (first-n n lst) ...
1 2
(defun transpose (m) (apply #'mapcar #'list m))
1
(defun Transpose (m) (Cond ((CAR m) (Cons (MapCAR 'CAR m) (Transpose (MapCAR 'CDR m))))))
Lisp On Lexicographically next perm...
by Sunnan,
October 15, 2007 11:51
p.s. your Bind macro is ava...
1 2 3 4
(require-extension miscmacros srfi-1)
(define (next-lex nums)
...
Lisp On Lexicographically next perm...
by Sunnan,
October 15, 2007 11:32
Tried changing the algo to ...
Lisp On Lexicographically next perm...
by akkartik.livejournal.com/,
October 09, 2007 01:43
Nice!
1. How is the 'on' l...
1 2 3 4
(defun next-lex (a) (with var r = (reverse a) var pivor = (first-down r) ...
Lisp On Lexicographically next perm...
by niv,
October 09, 2007 00:45
rewritten with the "with" m...
1 2 3 4
(defun partition-upto (pivot a) (loop for e in a for r on a ...
Lisp On Lexicographically next perm...
by niv,
October 09, 2007 00:41
sorry, it's actually for r ...
1 2 3 4
(defun first-down (a) (loop for fst in a for scd in (cdr a) ...
Lisp On Lexicographically next perm...
by niv,
October 09, 2007 00:39
if you like (loop), also no...
1 2 3
(defun partition-upto (pivot a) (values (remove-if (lambda (x) (> x pivot))) (remove-if (lambda (x) (< x pivot)))))
Lisp On Lexicographically next perm...
by niv,
October 09, 2007 00:29
if you don't care about eff...
1 2 3 4
(defun partition-upto (pivot a &optional less more) (cond ((eql (car a) pivot) ...
1 2 3 4
(defun transpose (m) (unless (null (car m)) (cons (mapcar #'car m) (transpose (mapcar #'cdr m))))) ...
Lisp On folding of non-ascii long h...
by luser.myopenid.com/,
October 03, 2007 09:01
YES! Although "~^~% " seems...
1 2 3 4
(defun header-encode (string) (if (find-if (lambda (c) (> (char-code c) 127)) string) ...
Lisp On folding of non-ascii long h...
by Aaron,
October 02, 2007 12:10
Is this what you want? I h...

The initial example code ha...