From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: HiPhish Newsgroups: gmane.lisp.guile.user Subject: Re: A macro containing a mini-macro? Date: Sun, 16 Sep 2018 00:21:48 +0200 Message-ID: <2851503.udm261mnLh@aleksandar-ixtreme-m5740> References: <2093628.1NtSHukUaa@aleksandar-ixtreme-m5740> <75b134ef995e81bb55db8e583f602a02@airmail.cc> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit X-Trace: blaine.gmane.org 1537050371 6960 195.159.176.226 (15 Sep 2018 22:26:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 15 Sep 2018 22:26:11 +0000 (UTC) Cc: guile-user@gnu.org To: rain1@airmail.cc Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Sep 16 00:26:07 2018 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g1J0w-0001eh-F4 for guile-user@m.gmane.org; Sun, 16 Sep 2018 00:26:06 +0200 Original-Received: from localhost ([::1]:56928 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g1J32-0001Bq-Rn for guile-user@m.gmane.org; Sat, 15 Sep 2018 18:28:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42023) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g1J2K-00011o-Tv for guile-user@gnu.org; Sat, 15 Sep 2018 18:27:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g1Iwr-0007bu-R5 for guile-user@gnu.org; Sat, 15 Sep 2018 18:21:57 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:40631) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g1Iwr-0007Zj-Be for guile-user@gnu.org; Sat, 15 Sep 2018 18:21:53 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id BBE7420FB5 for ; Sun, 16 Sep 2018 00:21:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1537050110; bh=VMIwjUb2xoV64b0SZslRueeZ93XBMx5K6s2zHje2GLM=; h=From:To:Cc:Subject:Date:From; b=iS0J9EUJbgwm4AnM71V6qVzOkZ+QU0nmV3Hyf99grkZwIM54lWBPoLPwn5OhMTkZG rfMnGIZr+uFPJTbVS9+aF9k0zrtoWWbyrNm/zXC/t/hOUHLFG+bF5q9S2IwdaZ4ksI nEHQVluNEcjPs+Rz27C0owlyA0PC8J28sILd0XYv+2GhAZO1yWHmbxQPCGjrAOwabD As9G3WSteQnD61KcijhCi8qz8VSGzkNzXd7Cae+ZBYHdkZTBExR9ZMOMp/Z2kz3Acr ofkpWuu5BFVTvm4l2eMfvnXSWyEtXZUqZl6Q1i8PfpKbxh8/8o3pudSCc9tU4bttSk icX2DptMjcEtA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 42CRgx4FJ4z9rxD; Sun, 16 Sep 2018 00:21:49 +0200 (CEST) In-Reply-To: <75b134ef995e81bb55db8e583f602a02@airmail.cc> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 185.67.36.66 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:14881 Archived-At: I don't quite follow; having a macro for the byte DSL is simple: (define-syntax byte-dsl (syntax-rules () ((_ byte) (list byte)) ((_ count byte) (make-list count byte byte)))) But this requires every byte specification to be written as `(byte-dsl 0x00)`, which I want to avoid in my test-case DSL. I want to be able to write (test-case 13 (#x01 #x02 (4 #xAB) #xFF)) This requires being able to match either `byte` or `(amount byte)` inside the test-case pattern. rain1@airmail.cc wrote: > You can implement the DSL that transforms bytevector descriptions like > (#xDC (16 #x00)) into a bytevector as a procedure, suppose we call it > byte-dsl. Then you only need to change u8-list->bytevector with > byte-dsl. This lets you do what you wanted without the difficult task of > macros inside macros.