From: Keith Wright <kwright@free-comp-shop.com>
Cc: guile-user@gnu.org
Subject: Re: Multiple implementations of low-level functions
Date: Fri, 31 Oct 2003 23:45:09 -0500 [thread overview]
Message-ID: <200311010445.hA14j91e026190@fcs10.free-comp-shop.com> (raw)
In-Reply-To: <873cd87tzw.fsf@shadizar.localdomain> (mbarilli@midsouth.rr.com)
> From: "Michael J. Barillier" <mbarilli@midsouth.rr.com>
>
> I've been hacking on a system for which I would like to have multiple
> implementations of low-level functions, which would be called by
> higher-level code. (e.g. A test version with static data, v. a test
> version with data stored in a database, v. a production version
> running against an Oracle database and communicating with other
> processes.)
> ...
> Anyone care to weigh in on either method, or propose a sexier
> solution?
Why not just have a variable and assign it the value you want?
(set! compute
(case version
((test1) (lambda(n) 42))
((test2) (lambda(n) (+ 1 n)))
(else (lambda(n) (call-oracle "select answer from air"))) ))
--
-- Keith Wright <kwright@free-comp-shop.com>
Programmer in Chief, Free Computer Shop <http://www.free-comp-shop.com>
--- Food, Shelter, Source code. ---
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user
next prev parent reply other threads:[~2003-11-01 4:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-01 1:33 Multiple implementations of low-level functions Michael J. Barillier
2003-11-01 4:45 ` Keith Wright [this message]
2003-11-02 13:48 ` Thien-Thi Nguyen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200311010445.hA14j91e026190@fcs10.free-comp-shop.com \
--to=kwright@free-comp-shop.com \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).