From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Walter Lewis via General Guile related discussions Newsgroups: gmane.lisp.guile.user Subject: Re: Breaking hygiene with syntax-rules? Date: Fri, 11 Aug 2023 18:50:45 -0400 Message-ID: <1f5c2e6b-5c04-7d56-18c1-276bc7b36a01@mailbox.org> References: <4d1a63061435cc0cd5f357cc2795d17844510b52.camel@abou-samra.fr> <44a09148-a6a9-475a-c24c-656202c9cbed@mailbox.org> Reply-To: Walter Lewis Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32643"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sat Aug 12 00:51:27 2023 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qUayc-0008Cr-GX for guile-user@m.gmane-mx.org; Sat, 12 Aug 2023 00:51:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qUayA-00078x-3i; Fri, 11 Aug 2023 18:50:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qUay8-00077u-5z for guile-user@gnu.org; Fri, 11 Aug 2023 18:50:56 -0400 Original-Received: from mout-p-101.mailbox.org ([2001:67c:2050:0:465::101]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1qUay5-0006PH-Ty for guile-user@gnu.org; Fri, 11 Aug 2023 18:50:55 -0400 Original-Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4RMzXl6bsGz9sZk for ; Sat, 12 Aug 2023 00:50:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1691794247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=TIoNu1L+OYLbu3hFPKK0nZ1rdaRR0Cqs2e8Y3m0fmFg=; b=ClrLpPz3Zt1WOoHeRK3CIrRiMeJzAa1U38AlPvcWn+nH7S78DUawzmfOYHB6qsoCyoiE5i rIqkuTVn9zVFbR0mwldX7hd1FRJlsEKhU/6T+nrsmMuiQdWH+fvt+n5L+C26xeij1zC5YF hjoK/Wb1BZtQ1zoBis/PW7W4ZtwiFMi9q4NjROnpPXDYhj3jbkQfKNUExqgX0Fhm9U9oSz 7ySHlGc+kBqdXIdCV144XBd9606UiIHASDbmquJV6jiFFI1KGGbpOp1jraJmsePgy1UP04 yqTBK9JEB4J6fH60SpLSg9FfKbZHCxNndWM1jzenNzuB1s7P/zeDEktdQGndYw== Content-Language: en-US In-Reply-To: <44a09148-a6a9-475a-c24c-656202c9cbed@mailbox.org> X-MBO-RS-ID: 02897589c5894ca1860 X-MBO-RS-META: ztsmyyg8j8i9rrm8oryx7bd68ogdqyi7 Received-SPF: pass client-ip=2001:67c:2050:0:465::101; envelope-from=wklew@mailbox.org; helo=mout-p-101.mailbox.org X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.user:19152 Archived-At: Sorry I typed that code offhand and it had some mistakes; should be: (use-modules (srfi srfi-9) (system foreign)) (define-syntax define-ffi-wrapper (syntax-rules () ((_ size name wrap unwrap predicate to-pointer from-pointer) (begin (define-record-type name (wrap bv pointer) predicate (bv unwrap) (pointer pointer-ref pointer-set!)) (define (to-pointer x) (or (pointer-ref x) (let ((pointer (bytevector->pointer x))) (pointer-set! x pointer) pointer))) (define (from-pointer pointer) (wrap (pointer->bytevector pointer size) pointer))))))