From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Vivien Kraus Newsgroups: gmane.lisp.guile.user Subject: Re: overload a procedure Date: Sun, 19 Feb 2023 18:52:14 +0100 Message-ID: References: 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="20458"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.46.0 To: Damien Mattei , guile-user Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sun Feb 19 18:53:06 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 1pTns1-00054k-Cq for guile-user@m.gmane-mx.org; Sun, 19 Feb 2023 18:53:05 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pTnrW-0000io-BL; Sun, 19 Feb 2023 12:52:34 -0500 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 1pTnrS-0000ia-8k for guile-user@gnu.org; Sun, 19 Feb 2023 12:52:33 -0500 Original-Received: from planete-kraus.eu ([2a00:5881:4008:2810::309]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1pTnrQ-0007Je-8g for guile-user@gnu.org; Sun, 19 Feb 2023 12:52:29 -0500 Original-Received: from planete-kraus.eu (localhost.lan [127.0.0.1]) by planete-kraus.eu (OpenSMTPD) with ESMTP id 35ce0b96; Sun, 19 Feb 2023 17:52:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=planete-kraus.eu; h= message-id:subject:from:to:date:in-reply-to:references :content-type:content-transfer-encoding:mime-version; s=dkim; bh=dM9ShXHGIrw82UxKdyWw9TyXGBQ=; b=tPIBSpy6cqohlgkxvOvBzZ2CF2Uo PYJth1paM2cU/ZW5u9MbNnptcwGI2AAJFD+ZYJa0EIpfpvLqaC0PRjf+f6vbX3Nu rdHshULqL9vtWl18O+uFhh0t+Q3lZdZ5vy43TR3l6NqabFkTXo5+8hgNYWwtKyVt RK2/dUiSwopPJIk= Original-Received: by planete-kraus.eu (OpenSMTPD) with ESMTPSA id 183597fa (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Sun, 19 Feb 2023 17:52:18 +0000 (UTC) In-Reply-To: Received-SPF: pass client-ip=2a00:5881:4008:2810::309; envelope-from=vivien@planete-kraus.eu; helo=planete-kraus.eu 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, SPF_HELO_PASS=-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:18919 Archived-At: Hi Damien, Le dimanche 19 f=C3=A9vrier 2023 =C3=A0 18:45 +0100, Damien Mattei a =C3=A9= crit=C2=A0: > ok now i come to the scheme problem implementing the two solutions; > in > scheme i can not use types so i use type predicates (number? verctor? > string? list?....)to identify the good function depending of the > parameters > types find with the predicates. > i tried with macro and recursive function with this solution: >=20 > example of use:: > (overload + add-vect-vect vector? vector?) Did you try GOOPS? It provides that kind of functionality. (use-modules (oop goops) (srfi srfi-43)) (define-method (+ (a ) (b )) (vector-append a b)) (+ #(1 2 3) #(4 5)) Vivien