From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ian Price Newsgroups: gmane.lisp.guile.devel Subject: Re: Testing Functions Internal to a Module Date: Sat, 17 Dec 2011 15:31:26 +0000 Message-ID: <87y5ubrz8x.fsf@Kagami.home> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1324136160 31126 80.91.229.12 (17 Dec 2011 15:36:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 17 Dec 2011 15:36:00 +0000 (UTC) Cc: guile-devel To: Noah Lavine Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Dec 17 16:35:54 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RbwIj-00025x-Dl for guile-devel@m.gmane.org; Sat, 17 Dec 2011 16:35:53 +0100 Original-Received: from localhost ([::1]:54677 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbwIi-0001FW-NL for guile-devel@m.gmane.org; Sat, 17 Dec 2011 10:35:52 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:55221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbwIg-0001FR-Ft for guile-devel@gnu.org; Sat, 17 Dec 2011 10:35:51 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RbwIf-0007QL-F3 for guile-devel@gnu.org; Sat, 17 Dec 2011 10:35:50 -0500 Original-Received: from mail-ww0-f49.google.com ([74.125.82.49]:44425) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbwIf-0007QH-Ac for guile-devel@gnu.org; Sat, 17 Dec 2011 10:35:49 -0500 Original-Received: by wgbdt11 with SMTP id dt11so6599355wgb.30 for ; Sat, 17 Dec 2011 07:35:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=R9CUhF00GzC/09Y30+epws/DWbiL3m04PmBcapKxpKg=; b=b9KnWFuVxlUfO9VPJ35oxkrFDzJHitQdh0YnxGjs7eqtVsWRdDVjciPCEXKwZnhptP gu00EUiT00gJ2vyBlW8rKcxhHyXBkjAExoWQlnjltEfKP4AcjsUBuyDd1riKCmOwqKnB iNpkzlm77XDIwGU+AEc8d6v/5Ag5SwzCGSYOM= Original-Received: by 10.227.206.76 with SMTP id ft12mr8202378wbb.1.1324136147842; Sat, 17 Dec 2011 07:35:47 -0800 (PST) Original-Received: from Kagami.home (host109-154-207-250.range109-154.btcentralplus.com. [109.154.207.250]) by mx.google.com with ESMTPS id m5sm17806168wie.2.2011.12.17.07.35.44 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 17 Dec 2011 07:35:45 -0800 (PST) In-Reply-To: (Noah Lavine's message of "Sat, 17 Dec 2011 10:07:35 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.82.49 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:13150 Archived-At: Noah Lavine writes: > Is there a standard way of handling this? > > This seems like a place where perhaps a helper procedure would be > useful, because lots of test suites will face this issue. Something > like "import all of this module's private definitions". What does > everyone else do in this situation? When testing at the repl, I've used ,m to great effect, and presumably you could use set-current-module and co. in a similar way. Alternatively, you could use (@@ (module name) procedure-name) to access a private function. Maybe with a helper like (define-syntax-rule (use-privates module proc-name ...) (begin (define proc-name (@@ module proc-name)) ...)) -- Ian Price "Programming is like pinball. The reward for doing it well is the opportunity to do it again" - from "The Wizardy Compiled"