From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Maxime Devos Newsgroups: gmane.lisp.guile.user Subject: RE: Advice on ST-Object data-structure setup Date: Wed, 17 Apr 2024 18:34:19 +0200 Message-ID: <20240417183420.CGaK2C00F3BbbgK01GaL5E@laurent.telenet-ops.be> References: <75f99db3-fe74-4f49-bdce-bcf4aefa507a@starynkevitch.net> 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="17724"; mail-complaints-to="usenet@ciao.gmane.io" To: Basile Starynkevitch , "guile-user@gnu.org" Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Wed Apr 17 18:34:57 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 1rx8FM-0004M8-AE for guile-user@m.gmane-mx.org; Wed, 17 Apr 2024 18:34:56 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rx8Ez-0005NG-Bt; Wed, 17 Apr 2024 12:34:33 -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 1rx8Ev-0005LH-IV for guile-user@gnu.org; Wed, 17 Apr 2024 12:34:29 -0400 Original-Received: from laurent.telenet-ops.be ([2a02:1800:110:4::f00:19]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rx8Es-0006J5-O0 for guile-user@gnu.org; Wed, 17 Apr 2024 12:34:28 -0400 Original-Received: from [IPv6:2a02:1808:86:93ea:9c17:e94b:8acf:486b] ([IPv6:2a02:1808:86:93ea:9c17:e94b:8acf:486b]) by laurent.telenet-ops.be with bizsmtp id CGaK2C00F3BbbgK01GaL5E; Wed, 17 Apr 2024 18:34:20 +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=1713371660; bh=lBaiktJxyW7DgiHFLKllIBxipO1NXqcsFfP9GmOrH6Y=; h=To:From:Subject:Date:In-Reply-To:References; b=ZY2epPRz4f5Kl93mmgCjbM7pYPfHpn4oF1ufNSyxboDXaxVJ74/L9BLsxU+BLJ30n QY2j9Y20xsXWD7mO1E7R1VV/pAKxtIqGlPSIRYqQ7nN/XBSFVvZMJ5jnss14EPwSRw 69kh4nQsC3HghouW/nqoldwDVvcz8rNn5Agj9/EiNl71ohJbrAaVv3eF6Rs2pkWx3a Gsf+jxp+tKsHqAHNTpoCLUJ6NN3bJYQJ6zG95mwHtVT439x36Mm9xVF8JSRey1JafO NYkfdBhp3LVh9UB/1Zxn3S4GnfCPXRaaAUf5Lc+hy/6jLIYmXnghCAypOgINiO0n7s 2yMuyEawKwdPQ== Received-SPF: pass client-ip=2a02:1800:110:4::f00:19; envelope-from=maximedevos@telenet.be; helo=laurent.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_NONE=0.001, SPF_PASS=-0.001 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:19529 Archived-At: >is to get the mechanics working.=C2=A0 For this I=20 > need to have an St-Object which is basically a Vector but which=20 > answers #false to vector? and #true to st-object? > > [Note https://github.com/KenDickey/Crosstalk/blob/master/st-kernel.scm ] > > I note that one might change the T7 type-tag from 0x0d (vector) to=20 > 0x6d (currently unused) with a quick bitwise-or, but would like some=20 > advice on the best way to do this or some alternate.=C2=A0 I would prefer= =20 > to work in Scheme, not C, BTW. It would be simplest to define a record type with a single field, let=E2=80= =99s say =E2=80=98=E2=80=99 with a field =E2=80=98actual-vec= tor=E2=80=99(*) (*) plus whatever fields are required to make it satisfy =E2=80=98st-object= ?=E2=80=99 The objects of type are by construction not vectors (so, th= ey don=E2=80=99t satisfy vector?). However, you can easily define ;; st-vector-ref: rename this to the equivalent of vector-ref in Smalltalk, ;; and replace =E2=80=98define=E2=80=99 by what would be the equivalent in = Smalltalk (define (st-vector-ref v n) ;; st-vector-like-actual-vector: field getter ;; vector-ref: standard Scheme procedure (vector-ref (st-vector-like-actual-vector v) n)) and the like. Best regards, Maxime Devos.