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: Re: overloading an existing operator in Guile Date: Tue, 3 Oct 2023 20:24:34 +0200 Message-ID: References: <3D3D44C6-4FF2-49E2-A976-5D7EB39628F6@abou-samra.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38267"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-user Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Tue Oct 03 20:25:23 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 1qnk5C-0009Wh-Gz for guile-user@m.gmane-mx.org; Tue, 03 Oct 2023 20:25:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qnk4s-0005C9-0J; Tue, 03 Oct 2023 14:25:02 -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 1qnk4i-00059T-5v for guile-user@gnu.org; Tue, 03 Oct 2023 14:24:55 -0400 Original-Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qnk4e-0000Fo-J1 for guile-user@gnu.org; Tue, 03 Oct 2023 14:24:51 -0400 Original-Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5363227cc80so2072677a12.3 for ; Tue, 03 Oct 2023 11:24:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696357485; x=1696962285; darn=gnu.org; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=3Jv4bkAWia7kQeiVRH68elk8vC8kL0O7Ww2ce+kbWEg=; b=IxVghv0Q+RWW1KZjgiWXnRegEV57ly4zKTTuxAX4Zc/RilPttYTaa5lfUUIrJCmU0K pPJeuYuHkdG/8FQsUtLqTuvaPvrgPtjO7G4qE+H2dbA8lurxDuMOAh+hColZkmN22Pr2 T45/iQhXo+VIODwLVBI1et3+xd2lfaKRuQvNdR6+lsODUn4R58ZcBJJR44o58zxJ9aJj Mn3D4EQmUwthCPpFpOuTTuv8V2PKymdLUYSWVXsriu2Zxe/7jMJfXQHvoPahqqHDKWTm XFvSWWLQkfW2Vk72+bxj+rXB69JWON0m7QdzNbm1lZZ5ZTpKEUI+BXCpdWhNwodRN1o/ kpng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696357485; x=1696962285; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3Jv4bkAWia7kQeiVRH68elk8vC8kL0O7Ww2ce+kbWEg=; b=HS8iXrUBCSS4WcpqRYqAS/kIhNxYa7OwvMmCfCf32zQECkM0QCXoVniF3wDYQGrcaP M4/sdzD8Rx6DR25nhG3GfgdV+Gabf5Jid63M/WD5YSuKGCnmf77bcph08GEh5SqOyvG/ U6QAMD/bc2PAuE0ib3DlHH/G/iE9R5ep54VXSsApCBCN+sOEKY1wsO6mEJt2amJX9hPY U5noC5NA6LQbdSYQKYhSBV/F9wTvETbLF6TgS3+v/RNNkeIpkIWeccmrJM5uoF/0g85N tUPYNFnrTceOzMUnx8ivliwIqFCz2wkmPXyckDT2HbyU4DsLlwd78nCG5mA9Aj4U5ddd 8R6g== X-Gm-Message-State: AOJu0YzZh03J6N/SWSf5rrPTogjcV6UITPKubchwCHZUa+KqhF8qc0hD XZujpUeekst80zQy6ClAknN+lXL2wGCq9T8DmVu0FyIjZfA= X-Google-Smtp-Source: AGHT+IGBME1fzVwZVNlmNJkCrmlDf3P08vDVZwkRwHpT0gTvNojUbRbmcAsdTVBzcqsZ8f4Ru7lhmzaLvxK3055t11w= X-Received: by 2002:aa7:d58d:0:b0:52a:943:9abd with SMTP id r13-20020aa7d58d000000b0052a09439abdmr14349365edq.30.1696357485509; Tue, 03 Oct 2023 11:24:45 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=damien.mattei@gmail.com; helo=mail-ed1-x532.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, 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-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:19216 Archived-At: solution: scheme@(guile-user)> (define-method (+ (x ) (y )) (vector-append x y)) ;;; :11:46: warning: possibly unbound variable `vector-append' scheme@(guile-user)> (use-modules (srfi srfi-43)) scheme@(guile-user)> (+ 2 3) $3 =3D 5 scheme@(guile-user)> (+ #(1 2 3) #(4 5)) $4 =3D #(1 2 3 4 5) scheme@(guile-user)> {#(1 2 3) + #(4 5)} $5 =3D #(1 2 3 4 5) On Tue, Oct 3, 2023 at 12:33=E2=80=AFPM Damien Mattei wrote: > > thank you > i understand i must overload + the usual way in class > scheme@(guile-user)> > $2 =3D #< 104a6e380> > > about the described problem this should not be a problem because - > as no sense in term of concatanate > > On Tue, Oct 3, 2023 at 11:19=E2=80=AFAM Jean Abou Samra wrote: > > > > > > > > Le 3 oct. 2023 =C3=A0 11:14, Damien Mattei a = =C3=A9crit : > > > > is it possible to overload an existing operator in Guile? > > > > > > > > Yes, but it's a bit buggy. See https://debbugs.gnu.org/cgi/bugreport.cg= i?bug=3D64508