From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.devel Subject: When to use SCM_DEFINE vs SCM_GPROC vs SCM_PRIMITIVE_GENERIC? Date: Thu, 27 Jan 2011 19:47:28 -0500 Message-ID: NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1296205994 8835 80.91.229.12 (28 Jan 2011 09:13:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 28 Jan 2011 09:13:14 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Jan 28 10:13:06 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PikO9-0007HD-Bp for guile-devel@m.gmane.org; Fri, 28 Jan 2011 10:13:05 +0100 Original-Received: from localhost ([127.0.0.1]:40423 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PikO8-00068Z-Ko for guile-devel@m.gmane.org; Fri, 28 Jan 2011 04:13:04 -0500 Original-Received: from [140.186.70.92] (port=46383 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pijpt-00061r-FQ for guile-devel@gnu.org; Fri, 28 Jan 2011 03:37:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pijps-0003Kd-BW for guile-devel@gnu.org; Fri, 28 Jan 2011 03:37:41 -0500 Original-Received: from world.peace.net ([216.204.32.208]:33546) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pijps-0003KH-8a for guile-devel@gnu.org; Fri, 28 Jan 2011 03:37:40 -0500 Original-Received: from ip68-9-118-38.ri.ri.cox.net ([68.9.118.38] helo=freedomincluded) by world.peace.net with esmtpa (Exim 4.69) (envelope-from ) id 1PicUr-0000N2-CA; Thu, 27 Jan 2011 19:47:29 -0500 Original-Received: from mhw by freedomincluded with local (Exim 4.69) (envelope-from ) id 1PicUq-0006Em-5Q; Thu, 27 Jan 2011 19:47:28 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 216.204.32.208 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:11371 Archived-At: I am writing C versions of R6RS div/mod/div0/mod0, as well as div-and-mod and div0-and-mod0, for numbers.c. I notice that numbers.c uses three different macros to define public procedures: SCM_DEFINE, SCM_GPROC, and SCM_PRIMITIVE_GENERIC. I don't see an obvious logic to the choices of which macro to use. For example, `exact->inexact' uses SCM_GPROC whereas `inexact->exact' uses SCM_DEFINE. One obvious disadvantage to SCM_GPROC is that it doesn't accept a documentation string. Can someone please enlighten me about the relevant factors to decide? What macro do you think I should use for the functions I'm writing? Note that `div-and-mod' and `div0-and-mod0' will return two values. One more question: do you think I should give div/mod/div0/mod0 their short R6RS names by default? Thanks, Mark