From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: Guile API for foreign languages: proposing SCM scm_list_0(void) Date: Thu, 31 Jan 2013 12:45:42 +0100 Message-ID: <87sj5htw2h.fsf@pobox.com> References: <87txqmwhwq.fsf@pobox.com> <87y5flwkpq.fsf@pobox.com> <871ud1vbgo.fsf@pobox.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1359632873 27494 80.91.229.3 (31 Jan 2013 11:47:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 31 Jan 2013 11:47:53 +0000 (UTC) Cc: guile-devel To: Alexei Matveev Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Jan 31 12:48:13 2013 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U0scm-0000vA-1B for guile-devel@m.gmane.org; Thu, 31 Jan 2013 12:48:12 +0100 Original-Received: from localhost ([::1]:37931 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0scU-0001ks-1p for guile-devel@m.gmane.org; Thu, 31 Jan 2013 06:47:54 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:51041) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0saR-0001fz-Up for guile-devel@gnu.org; Thu, 31 Jan 2013 06:45:48 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U0saQ-0002t6-CE for guile-devel@gnu.org; Thu, 31 Jan 2013 06:45:47 -0500 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:50376 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0saQ-0002t0-28 for guile-devel@gnu.org; Thu, 31 Jan 2013 06:45:46 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 7172A9A8E; Thu, 31 Jan 2013 06:45:45 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=JLe+v1KQf+e8PE5nfiD2KjXyhR4=; b=Yp3XWe YKU7nrA+tU1QMuH84AF1TI9AeXbdtWieo/YfAy+hDQ9S1KDKAQy9azIUi3hSyNkU Zr21QcBVem8hmriNU3CvdtilNDpuor/yb9tFqa+bFdLm7rfknjoKw43Q/6LD/g2Y C7G4oCv16fgDfXWKX0A5CWlxUbcmR20UGlJoU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=hWdQs13BoaLNyM8G4k0/aiQUxVxppLCE ch9ImItTba4DY81ypNqg8WIveClmze2VffTaPXtyspjXu/xUvgnYW/kKUTOQXQZs CQi8KWjZUf3xBIBhDKXJhMXtBm6sTtepCgweGnMQ5fiJUAoipHPGwovml6aJi91l PInmMCtjBYM= Original-Received: from a-pb-sasl-quonix.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 6A66A9A8D; Thu, 31 Jan 2013 06:45:45 -0500 (EST) Original-Received: from badger (unknown [88.160.190.192]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id ED9A89A8C; Thu, 31 Jan 2013 06:45:44 -0500 (EST) In-Reply-To: <871ud1vbgo.fsf@pobox.com> (Andy Wingo's message of "Thu, 31 Jan 2013 12:27:51 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) X-Pobox-Relay-ID: BF78D714-6B9B-11E2-B32D-0A4F0E5B5709-02397024!a-pb-sasl-quonix.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 208.72.237.25 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:15647 Archived-At: On Thu 31 Jan 2013 12:27, Andy Wingo writes: > On Tue 22 Jan 2013 11:55, Andy Wingo writes: > >> SCM_BOOL_F >> SCM_BOOL_T >> SCM_ELISP_NIL >> SCM_EOF_VAL >> SCM_EOL >> SCM_UNBOUND >> SCM_UNDEFINED >> SCM_UNSPECIFIED >> > Instead, users should just keep a table of what the values of these > constants are for a given Guile major series. Defining them as > enumerated values doesn't help e.g. an Ada compiler. The particular > language should make this list in their own source code format, perhaps > generated by a small C program linked to libguile. Or by Scheme: (for-each (lambda (pair) (format #t "static const scm_t_bits my_~A = 0x~X;\n" (car pair) (object-address (cdr pair)))) `(("false" . #f) ("true" . #t) ("nil" . #nil) ("eof" . ,the-eof-object) ("eol" . ()) ("unspecified" . ,*unspecified*))) static const scm_t_bits my_false = 0x4; static const scm_t_bits my_true = 0x404; static const scm_t_bits my_nil = 0x104; static const scm_t_bits my_eof = 0xa04; static const scm_t_bits my_eol = 0x304; static const scm_t_bits my_unspecified = 0x804; Unbound and undefined are a little trickier. Andy -- http://wingolog.org/