Quantcast
Channel: Comments on: Continuation kata
Browsing all 10 articles
Browse latest View live

By: jao

Back <a href="http://reddit.com/info?id=1x70" rel="nofollow">at reddit</a>, i've found this Haskell one liner: [(x,y,x) | x <- [2..9], y <- [2..9], z <- [2..9], x^2 + y^2 == z^2]...

View Article



By: Jim

Your original search function doesn't work--here's a working version. <pre> (define (search lst p?) (cond ((null? lst) #f) ((pair? lst) (or (search (car lst) pred?) (search (cdr lst) pred?)))...

View Article

By: jao

Jim, oops, of course you’re right. I’ve corrected it in the post. Thanks for pointing it out.

View Article

By: Jim Ursetto

Here is another solution to search-generator. Below, the call to yield and the outermost call/cc could actually be removed without affecting the result. Let's assume we do so. As in the original...

View Article

By: matthias

1. The Haskell one-liner is also available in PLT Scheme (DrScheme/Full Swindle): <pre> (list-of (list x y z) (x i high) (generate i) (loop (+ i 1)))) (fail))) (define *fail* (list (lambda (_)...

View Article


By: matthias

The Haskell one-liner is <em>not</em> a solution. Why? It is available in PLT Scheme (drscheme) and I bet other Scheme preludes, too. Here is a solution that is different from Marc's but...

View Article

By: Kevin Greer

Below is my solution: <pre> (define fail '()) (call/cc (lambda (k) (set! fail k))) (define (in-range-or-else s e else) (if (> s e) (begin (set! fail else) (else)) (call/cc (lambda (k) (set!...

View Article

By: programming musings » Blog Archive » February’s top ten

[...] Continuation kata [...]

View Article


By: Peter

I apologize in advance for this not formatting correctly, but I have never left a comment before. While working on my solution I noticed that if the solution succeeds then some record of possible...

View Article


By: Peter

apparently the lessthan is an error (define inrange (lambda (low high) (call/cc (lambda (outer) (if (lessthan low high) (begin (call/cc (lambda (inner) (let ((old fail)) (set! fail (lambda (x) (set!...

View Article
Browsing all 10 articles
Browse latest View live




Latest Images