From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Maxime Devos via General Guile related discussions Newsgroups: gmane.lisp.guile.user Subject: RE: define-typed: checking values on proc entry and exit Date: Thu, 20 Jun 2024 00:29:27 +0200 Message-ID: <20240620002926.daVS2C00E0K6dk401aVSn6@andre.telenet-ops.be> References: <871q6axg4s.fsf@web.de> Reply-To: Maxime Devos 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="26326"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "guile-user@gnu.org" To: Damien Mattei , "Dr. Arne Babenhauserheide" Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Thu Jun 20 00:29:59 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 1sK3oV-0006eF-3E for guile-user@m.gmane-mx.org; Thu, 20 Jun 2024 00:29:59 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sK3o6-0001UC-Fn; Wed, 19 Jun 2024 18:29:34 -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 1sK3o4-0001U2-RB for guile-user@gnu.org; Wed, 19 Jun 2024 18:29:32 -0400 Original-Received: from andre.telenet-ops.be ([2a02:1800:120:4::f00:15]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sK3o2-000822-4z for guile-user@gnu.org; Wed, 19 Jun 2024 18:29:32 -0400 Original-Received: from [IPv6:2a02:1811:8c0e:ef00:ad11:ee0:137f:2aa4] ([IPv6:2a02:1811:8c0e:ef00:ad11:ee0:137f:2aa4]) by andre.telenet-ops.be with bizsmtp id daVS2C00E0K6dk401aVSn6; Thu, 20 Jun 2024 00:29:26 +0200 Importance: normal X-Priority: 3 In-Reply-To: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=telenet.be; s=r24; t=1718836166; bh=aNCehMLcFOBWc2qVu/KWMIoXoyx4SwDXqX7uEwk1T0Q=; h=To:Cc:From:Subject:Date:In-Reply-To:References; b=UW2JyZiHJg7S1ta/bN6E3NcgSnReELS5WBk7LDx6hl0IIpz911vBdCRhgSXBSlVpA qdpqhza8KBiLYsdUaoxIWhIhERAxKd3+LTFdruswEHfIBIyZSv/2izNHWEkfL3XKj8 pGgv7IMbhnU9zWvxzWYtW5fbShWWkB+xOyVf5Sx/D0uozrn75Tbi01uBXORbtd8h5M TJT8riULjatVreVRPGlicp2fgFTvciIT6lFLx1KdCPgRFb0V3MFwdwDkjytikCrGrl VCruXBxjSUuEq7s1tarpVs/hL+wPLvzggg/cvrAH6x6LDSykS6VWYHv2tK880Yheyn EiyBJZbCqPr6w== Received-SPF: pass client-ip=2a02:1800:120:4::f00:15; envelope-from=maximedevos@telenet.be; helo=andre.telenet-ops.be X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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:19721 Archived-At: >Hello, > >not sure to understand but does GOOPS (Guile object model) allow some sort of check to the argument but perhaps it is only inherent to the procedures of a 'class' in the object model? I don=E2=80=99t know what =E2=80=98procedures of a class=E2=80=99 means, bu= t otherwise yes, with the caveat that the check must be a type-check, in th= e sense that it checks whether the argument is of a certain class.=20 The documentation https://www.gnu.org/software/guile/manual/html_node/Metho= ds-and-Generic-Functions.html has a bunch of examples. I recommend reading = it. (Also note that is a class.) Now, that the check must be a type-check isn=E2=80=99t actually much of a l= imitation, since you can just check other conditions in the body and call n= ext-method when it doesn=E2=80=99t match. (I=E2=80=99m not entirely sure t= hough, I wonder what happens if you define a method of a generic with the s= ame type signature as an another method of the generic). Best regards, Maxime Devos.