unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: <janneke@gnu.org>
To: Mikael Djurfeldt <mikael@djurfeldt.com>
Cc: guile-devel <guile-devel@gnu.org>,
	"Ludovic Courtès" <ludo@gnu.org>, guile-user <guile-user@gnu.org>,
	"Andy Wingo" <wingo@pobox.com>
Subject: Re: Keywords in GOOPS methods
Date: Thu, 21 Nov 2024 23:00:45 +0100	[thread overview]
Message-ID: <87iksg2qnm.fsf@gnu.org> (raw)
In-Reply-To: <CAA2XvwK+9s6rzJGZyXVgwdWscO8v9oByjbhoVH5RrCwHWhepCg@mail.gmail.com> (Mikael Djurfeldt's message of "Thu, 21 Nov 2024 21:33:09 +0100")

[-- Attachment #1: Type: text/plain, Size: 334 bytes --]

Mikael Djurfeldt writes:

Hi Mikael,

> Since there are no comments, I'm inclined to apply this patch. I will do
> that on Sunday if there are no comments before that.

Just FYI, have you seen the attached patch by Mark Weaver?  I've been
carrying that for some time now, functionality like this is very
welcome.

Greetings,
Janneke


[-- Attachment #2: 0001-Add-define-method-for-GOOPS.patch --]
[-- Type: text/x-patch, Size: 2787 bytes --]

From f4d73b5590cd2e6ff30341aa824a3f1005b50220 Mon Sep 17 00:00:00 2001
From: Mark H Weaver <mhw@netris.org>
Date: Fri, 15 Apr 2022 11:11:16 +0200
Subject: [PATCH] Add define-method* for GOOPS.
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=UTF-8

* dzn/define-method-star.scm: New file.
* dzn/local.mk (dist_%C%_scm_DATA): Add it.
---
 dzn/define-method-star.scm | 40 ++++++++++++++++++++++++++++++++++++++
 dzn/local.mk               |  1 +
 2 files changed, 41 insertions(+)
 create mode 100644 dzn/define-method-star.scm

diff --git a/dzn/define-method-star.scm b/dzn/define-method-star.scm
new file mode 100644
index 0000000000..a958907e35
--- /dev/null
+++ b/dzn/define-method-star.scm
@@ -0,0 +1,40 @@
+;;; Dezyne --- Dezyne command line tools
+;;;
+;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
+;;;
+;;; This file is part of Dezyne.
+;;;
+;;; Dezyne is free software: you can redistribute it and/or modify it
+;;; under the terms of the GNU Affero General Public License as
+;;; published by the Free Software Foundation, either version 3 of the
+;;; License, or (at your option) any later version.
+;;;
+;;; Dezyne is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;;; Affero General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU Affero General Public
+;;; License along with Dezyne.  If not, see <http://www.gnu.org/licenses/>.
+;;;
+;;; Commentary:
+;;;
+;;; Code:
+
+(define-module (8sync define-method-star)
+  #:use-module (oop goops)
+  #:use-module (srfi srfi-1)
+  #:use-module (srfi srfi-11)
+  #:export (define-method*))
+
+(define-syntax define-method*
+  (lambda (x)
+    (syntax-case x ()
+      ((_ (generic arg-spec ... . tail) body ...)
+       (let-values (((required-arg-specs other-arg-specs)
+                     (break (compose keyword? syntax->datum)
+                            #'(arg-spec ...))))
+         #`(define-method (generic #,@required-arg-specs . rest)
+             (apply (lambda* (#,@other-arg-specs . tail)
+                      body ...)
+                    rest)))))))
diff --git a/dzn/local.mk b/dzn/local.mk
index a6cef16408..99d84ae105 100644
--- a/dzn/local.mk
+++ b/dzn/local.mk
@@ -29,6 +29,7 @@ dist_%C%_scm_DATA =				\
  %D%/code.scm					\
  %D%/code-util.scm				\
  %D%/command-line.scm				\
+ %D%/define-method-star.scm			\
  %D%/display.scm				\
  %D%/explore.scm				\
  %D%/goops.scm					\
-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com


[-- Attachment #3: Type: text/plain, Size: 164 bytes --]


-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com

  parent reply	other threads:[~2024-11-21 22:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-19 16:41 Keywords in GOOPS methods Mikael Djurfeldt
2024-11-21 20:33 ` Mikael Djurfeldt
2024-11-21 20:33   ` Mikael Djurfeldt
2024-11-21 22:00   ` janneke [this message]
2024-11-21 22:51     ` Mikael Djurfeldt
2024-11-22 11:46       ` Tomas Volf
2024-11-22 12:28         ` Mikael Djurfeldt
2024-11-22 12:20       ` janneke
2024-11-22 12:29         ` Mikael Djurfeldt
2024-11-22 23:04           ` Mikael Djurfeldt
2024-11-25 23:51         ` Keywords in define-method Mikael Djurfeldt
2024-11-26  0:13           ` Mikael Djurfeldt
2024-11-26  9:33             ` Mikael Djurfeldt
2024-11-26 18:40               ` Mikael Djurfeldt
2024-11-23 15:31       ` Keywords in GOOPS methods Maxime Devos via General Guile related discussions
2024-11-23 15:41         ` Mikael Djurfeldt
2024-11-23 15:49           ` Maxime Devos via General Guile related discussions
2024-11-24 11:56             ` Mikael Djurfeldt

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=87iksg2qnm.fsf@gnu.org \
    --to=janneke@gnu.org \
    --cc=guile-devel@gnu.org \
    --cc=guile-user@gnu.org \
    --cc=ludo@gnu.org \
    --cc=mikael@djurfeldt.com \
    --cc=wingo@pobox.com \
    /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).