guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Testing Functions Internal to a Module


From: Ian Price
Subject: Re: Testing Functions Internal to a Module
Date: Sat, 17 Dec 2011 15:31:26 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

Noah Lavine <address@hidden> 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"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]