[plt-scheme] question from a newbie regarding the import of a library

From: Marek Kubica (marek at xivilization.net)
Date: Sat Apr 4 20:13:00 EDT 2009

On Sun, 5 Apr 2009 01:55:08 +0200
Jon Loldrup <loldrup at gmail.com> wrote:

> #lang scheme
> (require (planet dfriedman/miniKanren:1:1/minikanren))
> (run #f (q) fail)
> 
> the first two lines succeeded, but the third failed with this error:
> 
> expand: unbound identifier in module in: fail
> 
> the third line was taken from the file
> mktests.scm<http://kanren.cvs.sourceforge.net/viewvc/kanren/kanren/mini/mktests.scm?revision=1.6&view=markup>which
> I think is designed to test a minikanren implementation. Therefor I
> think that that third line is valid minikanren-syntax and should run
> without errors.

True, but ``fail`` is most likely not a term from miniKANREN but rather
something that is provided by the Scheme implementation (in that
example code I think it is MIT Scheme). PLT doesn't have ``fail``
built-in.

As I don't know what ``fail`` is supposed to do anyway (I don't want to
look up MIT Scheme or KANREN) here's a dumb implementation of ``fail``:

#lang scheme
(require (planet dfriedman/miniKanren:1:1/minikanren))

(define (fail arg)
  #f)

(run #f (q) fail)

regards,
Marek


Posted on the users mailing list.