From: Walter Lewis via General Guile related discussions <guile-user@gnu.org>
To: guile-user@gnu.org
Subject: Re: Breaking hygiene with syntax-rules?
Date: Fri, 11 Aug 2023 18:50:45 -0400 [thread overview]
Message-ID: <1f5c2e6b-5c04-7d56-18c1-276bc7b36a01@mailbox.org> (raw)
In-Reply-To: <44a09148-a6a9-475a-c24c-656202c9cbed@mailbox.org>
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))))))
next prev parent reply other threads:[~2023-08-11 22:50 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-11 2:35 Breaking hygiene with syntax-rules? Walter Lewis via General Guile related discussions
2023-08-11 5:07 ` Dr. Arne Babenhauserheide
2023-08-11 8:00 ` Jean Abou Samra
2023-08-11 8:33 ` Dr. Arne Babenhauserheide
2023-08-11 23:57 ` Jean Abou Samra
2023-08-12 5:57 ` Dr. Arne Babenhauserheide
2023-08-11 13:34 ` Walter Lewis via General Guile related discussions
2023-08-11 22:50 ` Walter Lewis via General Guile related discussions [this message]
2023-08-11 23:55 ` Jean Abou Samra
2023-08-11 23:57 ` Jean Abou Samra
2023-08-12 0:19 ` Walter Lewis
2023-08-12 0:58 ` Jean Abou Samra
2023-08-12 5:59 ` Dr. Arne Babenhauserheide
2023-08-14 19:26 ` Thompson, David
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1f5c2e6b-5c04-7d56-18c1-276bc7b36a01@mailbox.org \
--to=guile-user@gnu.org \
--cc=wklew@mailbox.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).