TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

ambit-0.9.1 -- a Gem for choose/fail (amb) non-deterministic programming

2 pointsby jimwiseabout 14 years ago

1 comment

wizard_2about 14 years ago
Looks like this is a direct port of pg's version. I have to admit, I haven't seen callcc before and the concept while similar to closures scares me a bit. Storing a complete environment in a variable is a new concept to wrap my head around.<p><pre><code> This is an all-ruby implementation of choose/fail nondeterministic programming with branch cut, as described in Chapter 22 of Paul Graham’s On Lisp[1], or Section 4.3 of SICP[2]. Due to Ruby containing a true call/cc, this is a much straighter port of Paul Graham’s scheme version of this code than his Common Lisp or my C versions are. :-)</code></pre>