From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Keith Wright Newsgroups: gmane.lisp.guile.user Subject: Re: Multiple implementations of low-level functions Date: Fri, 31 Oct 2003 23:45:09 -0500 Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: <200311010445.hA14j91e026190@fcs10.free-comp-shop.com> References: <873cd87tzw.fsf@shadizar.localdomain> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1067662504 22153 80.91.224.253 (1 Nov 2003 04:55:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 1 Nov 2003 04:55:04 +0000 (UTC) Cc: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Nov 01 05:55:01 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AFnmv-0008QH-00 for ; Sat, 01 Nov 2003 05:55:01 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AFnj6-0004jt-09 for guile-user@m.gmane.org; Fri, 31 Oct 2003 23:51:04 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AFnig-0004jn-6U for guile-user@gnu.org; Fri, 31 Oct 2003 23:50:38 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AFniA-0004TU-Dd for guile-user@gnu.org; Fri, 31 Oct 2003 23:50:37 -0500 Original-Received: from [216.254.0.205] (helo=mail.speakeasy.net) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1AFniA-0004TQ-0h for guile-user@gnu.org; Fri, 31 Oct 2003 23:50:06 -0500 Original-Received: (qmail 17301 invoked from network); 1 Nov 2003 04:43:22 -0000 Original-Received: from unknown (HELO free-comp-shop.com) ([66.92.74.188]) (envelope-sender ) by mail5.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 1 Nov 2003 04:43:22 -0000 Original-Received: from fcs10.free-comp-shop.com (localhost.localdomain [127.0.0.1]) by free-comp-shop.com (8.12.8/8.12.8) with ESMTP id hA14j9nI026192; Fri, 31 Oct 2003 23:45:10 -0500 Original-Received: (from kwright@localhost) by fcs10.free-comp-shop.com (8.12.8/8.12.8/Submit) id hA14j91e026190; Fri, 31 Oct 2003 23:45:09 -0500 Original-To: mbarilli@midsouth.rr.com In-reply-to: <873cd87tzw.fsf@shadizar.localdomain> (mbarilli@midsouth.rr.com) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.user:2364 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:2364 > From: "Michael J. Barillier" > > 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 Programmer in Chief, Free Computer Shop --- Food, Shelter, Source code. --- _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user