(defn add-phone
  "Add a phone number to a given service. There are a few steps we have to take:
    - Validate the service name and token
...

Lisp On Clojure noob code

by Zehua, October 17, 2011 09:28

just updated the def's to l...

D41d8cd98f00b204e9800998ecf8427e Talk
(define (build-list L)
  (define (remove-subnodes e xs)
    (or (member e xs) '()))
...

Lisp On Super Simple Parser in Scheme

by podhmo, January 06, 2011 03:31

this is gauche(one of schem...

4a403f635b1c0f61cf5de98f6a308f51 Talk
(define (compose . fns)
  (define (make-chain fn chain)
...

Lisp On Generalised composition

by Chris Jester-Young, October 17, 2010 16:29

Just for fun, I decided to ...

729442eea8d8548842a6e0947e333c7b Talk
(define (compose . fns)
  (define (make-chain fn chain)
...

Lisp On Generalised composition

by Chris Jester-Young, April 22, 2009 05:07

zbigniew from freenode #sch...

729442eea8d8548842a6e0947e333c7b Talk
(defun next-lex (number-list &optional (rev-tail-list ()))
  "Returns the next lexicographic permutation of number-list."
  (cond ((null rev-tail-list)                       ; initial call
...

Lisp On Lexicographically next perm...

by Harleqin, February 03, 2009 08:25

Here comes the fixed versio...

D41d8cd98f00b204e9800998ecf8427e Talk

Lisp On Lexicographically next perm...

by Harleqin, February 03, 2009 06:56

Sorry, that one has a bug t...

D41d8cd98f00b204e9800998ecf8427e Talk
(defun next-lex (number-list &optional (rev-tail-list ()))
  "Returns the next lexicographic permutation of number-list."
  (cond ((null rev-tail-list)                       ; initial call
...

Lisp On Lexicographically next perm...

by Harleqin, February 03, 2009 06:47

I think that this is somewh...

1127d0098e693682f382758abd9f6c76 Talk
;;; 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

The initial example code ha...

D41d8cd98f00b204e9800998ecf8427e Talk
(define (group-by x n)
  (unfold
...

Lisp On Group-by

by Chris Jester-Young, June 29, 2008 09:33

The function can be made ev...

729442eea8d8548842a6e0947e333c7b Talk
(define (split-at-or-earlier! x i)
  (let 
...

Lisp On Group-by

by Chris Jester-Young, June 25, 2008 17:36

Here is a demonstration of ...

729442eea8d8548842a6e0947e333c7b Talk
;; To activate SRFI 1:
;; MzScheme 372: (require (lib "1.ss" "srfi"))
...

Lisp On Group-by

by Chris Jester-Young, June 23, 2008 10:59

Here's a very cheap answer ...

729442eea8d8548842a6e0947e333c7b Talk
(define (decrypt key rounds)
  (let
...

Lisp On CipherSaber

by Chris Jester-Young, June 22, 2008 11:16

Looking at the code, I just...

729442eea8d8548842a6e0947e333c7b Talk
(defun group-by (lst n)
  (cond ((null lst) nil)
	(t (cons (first-n n lst)
...

Lisp On Group-by

by jsmcgd, May 24, 2008 13:30

It isn't tail recursive and...

D41d8cd98f00b204e9800998ecf8427e Talk

Lisp On matrix transpose

by confused?, May 23, 2008 21:58

that's great! how did you d...

E9558f012a4568bcce3555bbe5573e00 Talk
(defun transpose (m)
  (apply #'mapcar #'list m))

Lisp On matrix transpose

by anonymous, May 23, 2008 19:17 Star_fullStar_fullStar_fullStar_fullStar_full
D41d8cd98f00b204e9800998ecf8427e Talk
;; get the firt n element from a list
;; parameter:
;;     l -> list to split
...

Lisp On Group-by

by Eineki, December 22, 2007 01:38

What do you think of this r...

5a00a3a98dcf6f9cd717440fd2b606e5 Talk
(defun Transpose (m) (Cond ((CAR m) (Cons (MapCAR 'CAR m) (Transpose (MapCAR 'CDR m))))))

Lisp On matrix transpose

by acjr, November 08, 2007 12:01

If the "Cond" returns a val...

Ca569f6c87196fd0a204719c7885370f Talk

Lisp On Lexicographically next perm...

by Sunnan, October 15, 2007 11:51

p.s. your Bind macro is ava...

Fe9b3250264e25222a755215cc8a3dbf Talk
(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 ...

Fe9b3250264e25222a755215cc8a3dbf Talk

Lisp On Lexicographically next perm...

by Kartik Agaram, October 09, 2007 01:43

Nice!

1. How is the 'on' l...

14d99459914c594998d2506db1e868c2 Talk
(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 Star_fullStar_fullStar_fullStar_fullStar_full

rewritten with the "with" m...

D41d8cd98f00b204e9800998ecf8427e Talk
(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 Star_fullStar_fullStar_full

sorry, it's actually for r ...

D41d8cd98f00b204e9800998ecf8427e Talk
(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 Star_fullStar_fullStar_full

if you like (loop), also no...

D41d8cd98f00b204e9800998ecf8427e Talk
(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 Star_fullStar_fullStar_fullStar_full

if you don't care about eff...

D41d8cd98f00b204e9800998ecf8427e Talk
(defun partition-upto (pivot a &optional less more)
      (cond
        ((eql (car a) pivot)
...

Lisp On Lexicographically next perm...

by niv, October 09, 2007 00:26 Star_fullStar_fullStar_full

for starters

D41d8cd98f00b204e9800998ecf8427e Talk