From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Zelphir Kaltstahl Newsgroups: gmane.lisp.guile.user Subject: Re: #:printer filed in language specification. Date: Mon, 20 Sep 2021 08:04:50 +0000 Message-ID: References: <66ede8b9-6e56-cb7a-28d2-825dc93ef8cd@cock.li> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21264"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Guile User To: Maxime Devos Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Mon Sep 20 10:05:33 2021 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 1mSEIv-0005KB-Bo for guile-user@m.gmane-mx.org; Mon, 20 Sep 2021 10:05:33 +0200 Original-Received: from localhost ([::1]:36124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSEIt-0000L1-Bg for guile-user@m.gmane-mx.org; Mon, 20 Sep 2021 04:05:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSEIM-0000Ki-15 for guile-user@gnu.org; Mon, 20 Sep 2021 04:04:58 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:44807) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSEIJ-0008F7-LQ for guile-user@gnu.org; Mon, 20 Sep 2021 04:04:57 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 76424240101 for ; Mon, 20 Sep 2021 10:04:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1632125092; bh=QRq4ydgJz4gXw40R4uxEQB2Bd/vG8nHqaxPHoPsnE+g=; h=Subject:To:Cc:From:Date:From; b=QUcMkT/zsoUEXZefPGzt+R9yFpqftm7SvI3QOfUscFLOQ8wtYEH4blu6SMuAOQnqn 3iVfc0BDnVUAFWA/q6hDxGvFp8u0QeSwLBv1lAfm7MYeTbZIKxsoz4PtCBDDXuPKkd +3F0sFvlqvRg0eWhKHzhkapK7wJHzYq55phAmOrup0xmv/Z+tCL3g0xmKqajxgsxPu d9nfexPUsxYTzT4bc33O4HKytCOg0+ENfLlPG4tMOZPnhGv2EzanH200hWXkT7llsp dgebgFiO+fBjVVrNqxo8t5Vs0vyYzlYrTVBbV6eaJ6FbsCqpmPdJDp6Rym29fxTrW2 Sa2XfPH3vgyMg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4HCcXz4ygtz9rxh; Mon, 20 Sep 2021 10:04:51 +0200 (CEST) In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=185.67.36.66; envelope-from=zelphirkaltstahl@posteo.de; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, 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.23 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" Xref: news.gmane.io gmane.lisp.guile.user:17765 Archived-At: Hi Maxim! Thank you for your reply! I do not know how to create such a vtable, what it means to have a vtalbe which is `` or how to set it for a struct, but I should have a look at the manual and see, what comes up when searching for vtable. Regards, Zelphir On 9/19/21 2:24 PM, Maxime Devos wrote: > Zelphir Kaltstahl schreef op zo 19-09-2021 om 12:11 [+0000]: >> Hi Maxim! >> >> Do you know of any simple example anywhere for applicable structs? I might have >> another use for them. > From NEWS in the Guile source code: > > ** Applicable struct support > > One may now make structs from Scheme that may be applied as procedures. > To do so, make a struct whose vtable is `'. > That struct will be the vtable of your applicable structs; instances of > that new struct are assumed to have the procedure in their first slot. > `' is like Common Lisp's > `funcallable-standard-class'. Likewise there is > `', which looks for the setter in > the second slot. This needs to be better documented. > > For a not-very-simple example, see modules/oop/gooops.scm in Guile's source code. > I don't know any simple examples. > > Greetings, > Maxime. -- repositories: https://notabug.org/ZelphirKaltstahl