From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Damien Mattei Newsgroups: gmane.lisp.guile.user Subject: Re: GOOPS question Date: Sun, 2 May 2021 12:58:38 +0200 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="16684"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-user To: mikael@djurfeldt.com Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sun May 02 12:59:41 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 1ld9p7-0004GV-Ij for guile-user@m.gmane-mx.org; Sun, 02 May 2021 12:59:41 +0200 Original-Received: from localhost ([::1]:45364 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ld9p6-0003KO-Kk for guile-user@m.gmane-mx.org; Sun, 02 May 2021 06:59:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52482) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ld9oN-0003KI-2j for guile-user@gnu.org; Sun, 02 May 2021 06:58:55 -0400 Original-Received: from mail-io1-xd36.google.com ([2607:f8b0:4864:20::d36]:40457) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ld9oJ-0001WM-8z for guile-user@gnu.org; Sun, 02 May 2021 06:58:54 -0400 Original-Received: by mail-io1-xd36.google.com with SMTP id e186so1894510iof.7 for ; Sun, 02 May 2021 03:58:50 -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=uKrD4qldspqW22QmD7/BP+/Q1iIZofDoZm+iN6WdRGg=; b=sQ21NAE6f5z/Av2BGZo9Tz/tOZZaF3K+ScKhmtuQQZ6FzNT8Xp92OBgr7PcDiOHHQ6 7M9ZBWVrjFYLH3H36CcrbR7FNpgQfKRwAcjpoNgBmYzmDHeBl1dYeKIVzF/c2GbyG2P3 dkvNuDoAhMm3QEuhuURKxOUa9frgYPjOb4AXm/vFJXKNYPloT35BKB1uWq9dLmwX7AGL wJUjcyfmWN9q+0aj4Sl17JdcpwbzQc6qMbWGNBTOM/99Xjtks50cHUNURh05Eq3UDQ7v ZiTh3tECqjenzWYvNfmaMBxKSrFQWfudpGOdk2fQ2vqS1Rf4blvY8w+7tEvYp3ErV9jc CBKA== 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=uKrD4qldspqW22QmD7/BP+/Q1iIZofDoZm+iN6WdRGg=; b=M4q5a34PMqP4Sxu6FJZHFz5SIyLuW5UA5PdooP3TLKQEQMvLJOdhfEwjphJIPMDPmR RNrzfPAJf9N5osLq87K8TRUa6Xj9CDzj3NDf5l6XXmiy/FEuTEmkr2J4bPGSyRb2tJFQ YivlJHy37hUYGodOZ3bV81W0sUY81+lqoCiPJdYrmHoGAF2ilt8m0cfT1MkuPG22NI3q 6wqKVJ+5Fuf/BTC6gz4gPmT7SNZi6qR4czSDDtWNPhjeCP49C26OowQC0ma6KCxFWGQB FaWcBuOKklelijHSNEdc2YLo6/K2GI1bbNg84+cf9HXifOsqQvuRQsK0MFX0fMSYM++U ApUQ== X-Gm-Message-State: AOAM530X8MNjfwB37T1suznAFXI3p7akUPt/lIR2D1HEaHCO5pXnIY1F qgNdb2BWHYEMUhGL/RneLvYYY1hUniwB0jPXQHjvnYvbm8o= X-Google-Smtp-Source: ABdhPJycTP2m9/9llBz0K8VCRr1VslqlBUClWixs5eo0YVCcac43X2VNXNuKteJnwcsSZ7tjX+FpZzcYn3KA+Pj21P8= X-Received: by 2002:a5e:9749:: with SMTP id h9mr3875017ioq.12.1619953129321; Sun, 02 May 2021 03:58:49 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::d36; envelope-from=damien.mattei@gmail.com; helo=mail-io1-xd36.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:17500 Archived-At: hello Mike, thanks you our message crossed i find the same deduction too On Sun, May 2, 2021 at 12:26 PM Mikael Djurfeldt wrote: > make is exported by (oop goops), so yiu always need to do: > > (use-modules (oop goops)) > > to use it. > > Also, you should only use use-modules to load proper modules (starting > with define-module). If it is plain scheme code, use load. > > Den s=C3=B6n 2 maj 2021 12:15Damien Mattei skre= v: > >> i use now the good way to loadmodule: >> >> scheme@(guile-user)> (set! %load-path (reverse (cons "." (reverse >> %load-path)))) >> >> scheme@(guile-user)> %load-path >> >> $1 =3D ("/usr/local/Cellar/guile/2.2.6/share/guile/2.2" >> "/usr/local/Cellar/guile/2.2.6/share/guile/site/2.2" >> "/usr/local/Cellar/guile/2.2.6/share/guile/site" >> "/usr/local/Cellar/guile/2.2.6/share/guile" ".") >> >> scheme@(guile-user)> (use-modules (gvector)) >> >> ;;; note: source file ./gvector.scm >> >> ;;; newer than compiled >> >> /Users/mattei/.cache/guile/ccache/2.2-LE-8-3.A/Volumes/Mojave/Users/matt= ei/Dropbox/git/library-FunctProg/gvector.scm.go >> >> ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=3D0 >> >> ;;; or pass the --no-auto-compile argument to disable. >> >> ;;; compiling ./gvector.scm >> >> ;;; compiled >> >> /Users/mattei/.cache/guile/ccache/2.2-LE-8-3.A/Volumes/Mojave/Users/matt= ei/Dropbox/git/library-FunctProg/gvector.scm.go >> >> scheme@(guile-user)> (define c2 (make )) >> >> ;;; :4:11: warning: possibly unbound variable `make' >> >> :4:0: In procedure module-lookup: Unbound variable: make >> >> >> Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. >> >> scheme@(guile-user) [1]> >> >> module was not in %load-path >> but yet another problem that does not exist outside module when simply >> including files.... >> >> On Sun, May 2, 2021 at 2:07 AM Damien Mattei >> wrote: >> >> > seems your template isn't working: >> > >> > scheme@(guile-user)> (load "gvector.scm") >> > >> > ;;; note: source file >> > /Volumes/Mojave/Users/mattei/Dropbox/git/library-FunctProg/gvector.scm >> > >> > ;;; newer than compiled >> > >> /Users/mattei/.cache/guile/ccache/2.2-LE-8-3.A/Volumes/Mojave/Users/matt= ei/Dropbox/git/library-FunctProg/gvector.scm.go >> > >> > ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=3D0 >> > >> > ;;; or pass the --no-auto-compile argument to disable. >> > >> > ;;; compiling >> > /Volumes/Mojave/Users/mattei/Dropbox/git/library-FunctProg/gvector.scm >> > >> > ;;; compiled >> > >> /Users/mattei/.cache/guile/ccache/2.2-LE-8-3.A/Volumes/Mojave/Users/matt= ei/Dropbox/git/library-FunctProg/gvector.scm.go >> > >> > scheme@(guile-user)> (define c2 (make )) >> > >> > ;;; :2:11: warning: possibly unbound variable `make' >> > >> > ;;; :2:11: warning: possibly unbound variable `' >> > >> > :2:0: In procedure module-lookup: Unbound variable: make >> > >> > >> > Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue= . >> > >> > scheme@(guile-user) [1]> ,bt >> > >> > In current input: >> > >> > 2:0 0 (_) >> > >> > but things go well if i remove module part and add: >> > >> > (use-modules (oop goops) >> > (oop goops describe)) >> > >> > scheme@(guile-user)> (load "gvector.scm") >> > >> > ;;; note: source file >> > /Volumes/Mojave/Users/mattei/Dropbox/git/library-FunctProg/gvector.scm >> > >> > ;;; newer than compiled >> > >> /Users/mattei/.cache/guile/ccache/2.2-LE-8-3.A/Volumes/Mojave/Users/matt= ei/Dropbox/git/library-FunctProg/gvector.scm.go >> > >> > ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=3D0 >> > >> > ;;; or pass the --no-auto-compile argument to disable. >> > >> > ;;; compiling >> > /Volumes/Mojave/Users/mattei/Dropbox/git/library-FunctProg/gvector.scm >> > >> > ;;; >> > >> /Volumes/Mojave/Users/mattei/Dropbox/git/library-FunctProg/gvector.scm:2= 1:2: >> > warning: possibly unbound variable `orig:vector-length' >> > >> > ;;; >> > >> /Volumes/Mojave/Users/mattei/Dropbox/git/library-FunctProg/gvector.scm:2= 6:2: >> > warning: possibly unbound variable `orig:vector-set!' >> > >> > ;;; >> > >> /Volumes/Mojave/Users/mattei/Dropbox/git/library-FunctProg/gvector.scm:3= 1:2: >> > warning: possibly unbound variable `orig:vector-ref' >> > >> > ;;; compiled >> > >> /Users/mattei/.cache/guile/ccache/2.2-LE-8-3.A/Volumes/Mojave/Users/matt= ei/Dropbox/git/library-FunctProg/gvector.scm.go >> > >> > scheme@(guile-user)> (define c2 (make )) >> > >> > scheme@(guile-user)> c2 >> > >> > $1 =3D #< 109e82500> >> > >> > scheme@(guile-user)> (describe c2) >> > >> > #< 109e82500> is an instance of class >> > >> > Slots are: >> > >> > v =3D #(# # # # >> > # # # #) >> > >> > length =3D 0 >> > >> > probably a module issue.... but i never use them with this Scheme >> > otherwise things go well (in other file ....) >> > Damien >> > >> > On Fri, Apr 30, 2021 at 9:55 AM Mikael Djurfeldt >> > wrote: >> > >> >> Hi! >> >> >> >> I attach a template which you could build on. Please post your class >> when >> >> you're done. :) >> >> >> >> Best regards, >> >> Mikael >> >> >> >> On Fri, Apr 30, 2021 at 1:11 AM Damien Mattei > > >> >> wrote: >> >> >> >>> hi, >> >>> i want to create a growable vector class in Guile, >> >>> such as std::vector or python list, >> >>> first i do not know if it exist already? seems not >> >>> >> >>> i want to use GOOPS but i do not understand how the superclass could >> be >> >>> accessed,used, instanciate... >> >>> for example in the doc there is: >> >>> (define-class () r i #:name "Complex") >> >>> >> >>> seems superclass is of no use >> >>> >> >>> for my growable vector i would like to use array as superclass? >> >>> but perhaps should it be just a slot as array are a subset of growab= le >> >>> array ,so a subclass >> >>> >> >>> anyway if i write something ike that: >> >>> (define-class () ..... >> >>> how can i use the object? >> >>> >> >>> i think perhaps i should not define a superclass or as supe= r >> >>> class.... >> >>> any advice welcome... >> >>> >> >>> Damien >> >>> >> >> >> >