From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Israelsson Tampe Newsgroups: gmane.lisp.guile.user Subject: Re: GOOPS question Date: Fri, 30 Apr 2021 14:19:31 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4459"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-user To: Mikael Djurfeldt Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Fri Apr 30 15:43:24 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 1lcTQR-00014B-NV for guile-user@m.gmane-mx.org; Fri, 30 Apr 2021 15:43:23 +0200 Original-Received: from localhost ([::1]:47048 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lcTQQ-0005gN-P6 for guile-user@m.gmane-mx.org; Fri, 30 Apr 2021 09:43:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52776) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lcS7Y-0007UO-QK for guile-user@gnu.org; Fri, 30 Apr 2021 08:19:49 -0400 Original-Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]:40952) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lcS7W-0008BZ-2b for guile-user@gnu.org; Fri, 30 Apr 2021 08:19:48 -0400 Original-Received: by mail-pf1-x429.google.com with SMTP id a12so6026995pfc.7 for ; Fri, 30 Apr 2021 05:19:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9TYY7MqrZpjA/SE1OlYJ98nHJveWIxvbif91PsiJ5l8=; b=DbUK+4nRC6BiLhtrEjd2/iAyqMEwgb5xDxzep4yWt1lKNv7DKuNcMO089MMDbZ8ZKu ntLMRD+k5uEEy5IMcojz/0AZ+YgcEh2fiG+iJ3ZnZznAIdKTIxj18Dt/3BarynLpk1Tn RZcvqXs6RLkhQH4SHMIAM/a5uukNlLLQwbCXKJnseQuAj/k3DS2AphFqA1f5HbvnGV/p TVCoJbe6G25k3zQ3bIPNnKDJXvpUL0lRy8kg0z6gFDLeWFTZ72k0F6eCgFpcYj5GRikf w4sMWsD7JPNeddynTHZLjsfbRzo3E1BvU7sBnfdtGujptlEjux/sUiGNz9reWhJdYALB eOCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9TYY7MqrZpjA/SE1OlYJ98nHJveWIxvbif91PsiJ5l8=; b=V0m5ZOIwE6KmeIKUTmTq+h3hekdaD/KVozfSlb4xMxcePYwLVstS8QCkRVMDtJsTZQ maK7ZZYt719oI9JesIsEgQpff17rWgJdMrqyW+ZJrfV15lv0soJ8qXsfpnLzZ9yoc8Kc CGyWMitWJA2ZIZm/RHJWiptC4D05PFp6d/n0Xp1h9bE0LJg2J8bSm3KB2ciYz6KGD5SO 8kKGwV5cwHVwIFP3SpqbXY+nwRZ0OJGkZ7MTf08fDRFTxc5ERCvcWe84mnH9A7zIEtpO Iw8NxSyxxvZoyJrOxG+JS2qhu9UtEbP9S60Axnj7xb9M2gDVhHqf9ieD0k0yEbklXsxL mPAw== X-Gm-Message-State: AOAM531ubZZUcXeXTtM7TizztveBKlAWKwxPgs/uUPdFSE3z97HdzX/9 UHi/tfhZ3YTNDu9YbwOSWV95yYOhxJ687znQnC4= X-Google-Smtp-Source: ABdhPJyIn40hFGYqPZweM08hd+5fFR0ub8hct44PjDVEzQj8kWkSZtLK5b5i/OgdnCZ/5RVLD80e+fa18F6nZjjigUI= X-Received: by 2002:a63:e90c:: with SMTP id i12mr4319874pgh.116.1619785182099; Fri, 30 Apr 2021 05:19:42 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=stefan.itampe@gmail.com; helo=mail-pf1-x429.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, HTML_MESSAGE=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-Content-Filtered-By: Mailman/MimeDel 2.1.23 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:17489 Archived-At: If performance is important, a goops solution can be slow in vector-ref and vector-set! operations due to two reasons. (I have pounder an implementation of resizable python lists and here is my tips), 1. slot-ref/slot-set! is slow (I try to fix this using the much more difficult struct-ref/struct-set!) 2. generic-method-dispatch is slow, I try to make a wrapper function in which we short cut for python/sheme internal types and if they do not match use the generic method. On Fri, Apr 30, 2021 at 1:57 PM Mikael Djurfeldt wrote: > On Fri, Apr 30, 2021 at 1:11 AM Damien Mattei > wrote: > > > for example in the doc there is: > > (define-class () r i #:name "Complex") > > > > seems superclass is of no use > > > > Well, it certainly *is* of use in the sense that methods operating on > will immediately start to also accept as an argument. > That might seem worrisome but is not if there is some agreement on which > operations should be implemented for all numbers. So, if you had previously > written an algorithm which operates on numbers, there's now a good chance > that it would also work for objects. >