From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Damien Mattei Newsgroups: gmane.lisp.guile.user Subject: write simpler a syntax form ? Date: Thu, 16 May 2024 01:00:58 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8061"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-user Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Thu May 16 01:02:19 2024 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 1s7Nda-0001xU-Ef for guile-user@m.gmane-mx.org; Thu, 16 May 2024 01:02:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s7NdF-00084d-JQ; Wed, 15 May 2024 19:01:57 -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 1s7Ncl-000822-CA for guile-user@gnu.org; Wed, 15 May 2024 19:01:32 -0400 Original-Received: from mail-qk1-x733.google.com ([2607:f8b0:4864:20::733]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s7NcX-0000vV-Fh for guile-user@gnu.org; Wed, 15 May 2024 19:01:19 -0400 Original-Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-792b8c9046bso627294085a.3 for ; Wed, 15 May 2024 16:01:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715814069; x=1716418869; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=e5vZ2Hb3jWU07PljjepboeiagapxbhzZ59Swt/EzAvg=; b=UQ8ZBIPK3ylRc4DZW3ps48FBYTVikD4zuDqB1tcMHCUWyaNfgREwmQqwnQfmCUXdRI pqTLNFMeEh6BdtJWsvdsnbtWIvbZ84Xmgyy4o1EPq/AqCjXvxBV8qH3D6U/non+CpOfk GyWFHFeOIMuB1bEFWXEkJ/AuiahW55CZxJ7vYYBJe7mfUmw3dDASafmL2x7AHI3kSOZK e+Dmi7pjb1z0XG14W+R5Vo5J62jcK/FWYeym2AK6v3PFTXpOL0jsdXgyB85zZLH0fwlc 3cV0G8D/hTWhNbR7la4TkEn3NuRomUID2iG+acF7+m1eNEkTraoau+DKnvDxHb6PCaRk Z8fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715814069; x=1716418869; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=e5vZ2Hb3jWU07PljjepboeiagapxbhzZ59Swt/EzAvg=; b=ZMOlYFdo9cxJwyqqXTcvWomh9I0BUILDhJt93K/+bdF+cwW2CVmguba4qMOtql61mu hUb4HFj+1/4CbqCfKxhKBQMX1gy7piNF/KpmQ9WLUe34wnDdMCNqTHBNvoR0cvE4MVA7 2ZBiJHgL8xzsbwYyM6JtSSHZ8Yb9aTMQB7nNhaOYYi0Ri8ccOQ/Uw1UOkjnS/lmx6IwK 2O0qXAK8Ub+4pO1Uc4to1kKKbukQY4l7HNd1Gp026iHIOfscWlt/LW7R5y7t0BymYGhf SExWFEtt4DZ0VhII9UXaT+sXrN+jmKRoc4QTmamqUnm3Ih/UHhnspg3IVWXiIvtEYTHq k3JA== X-Gm-Message-State: AOJu0Yzu6wT2xN4qWcxzHBgx46P3vggg99PhIcxmfDZxD14wHTrZdNZo cY7A4S6oLEt6fUTpIap6SkCgmjDnkFCeMhAd8JVhmfGCz9Sk8XbCwRMETrnKjaEqlYRZP1o5Fqg RvLzJOsmgEtxVWnF1f1tXt4pfBMunH++NXoA= X-Google-Smtp-Source: AGHT+IGDDwuSeLO00bquwb0wlf+Z7IZuA/5ZdidxGcQJNRkMy9+kXTEeXjre3KWkUXn6l7gUog36iduwWXy5sjLM0po= X-Received: by 2002:a05:6214:5e8a:b0:6a0:7de0:a28c with SMTP id 6a1803df08f44-6a168259719mr145208896d6.65.1715814069333; Wed, 15 May 2024 16:01:09 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::733; envelope-from=damien.mattei@gmail.com; helo=mail-qk1-x733.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, HTML_FONT_LOW_CONTRAST=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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:19653 Archived-At: do you think this can be written simpler? #`(list #,@(optimizer-parse-square-brackets-arguments-lister-syntax #`(#,@#'args-brackets))) i'm quite afraid the look the 'syntax' get.... it is part of this macro: (define-syntax $bracket-apply$ (lambda (stx) (syntax-case stx () ;; a version that pre-compil the infix expression, should be faster ;; scheme@(guile-user)> {#(1 2 3 4 5 6 7 8 9)[6 - 4 : 5 + 2]} ;; optimizer-parse-square-brackets-arguments-lister-syntax : args-brackets=(# # # # # # #) ;; $bracket-apply$ : #'parsed-args=(# (# # #) # (# # #)) ;; $1 = #(3 4 5 6 7) ;; scheme@(guile-user)> (define i 5) ;; scheme@(guile-user)> {#(1 2 3 4 5 6 7 8 9)[6 - 4 : i + 2]} ;; optimizer-parse-square-brackets-arguments-lister-syntax : args-brackets=(# # # # # # #) ;; $bracket-apply$ : #'parsed-args=(# (# # #) # (# # #)) ;; $2 = #(3 4 5 6 7) (($bracket-apply$ container . args-brackets) (with-syntax ((parsed-args #`(list #,@(optimizer-parse-square-brackets-arguments-lister-syntax #`(#,@#'args-brackets))))) (display "$bracket-apply$ : #'parsed-args=") (display #'parsed-args) (newline) #'($bracket-apply$next4list-args container parsed-args))))))