public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Damien Mattei <damien.mattei@gmail.com>
To: "Ἀλκείδης FP" <alcides.fp@gmail.com>
Cc: kawa mailing list <kawa@sourceware.org>
Subject: Re: accessor, getter setter for kawa class
Date: Mon, 16 Oct 2023 15:30:55 +0200	[thread overview]
Message-ID: <CADEOadcPpzSKAW5t=ZOUMJ7RyrJHToa5nXbQvfSwKiPt4SJRyA@mail.gmail.com> (raw)
In-Reply-To: <CAKWd2AgXFQsbZo=DgLnG-628AH9i3MBGXgSbf6n0UCQP3sJcMQ@mail.gmail.com>

hello Ἀλκείδης

in fact, as written in the manual , a lot of Guile GOOPS procedure are
ported to Kawa, like slot-ref and this give this code:

(define (matrix-v M)
  (slot-ref M 'v))

to have the same getter than in Guile or Racket for a matrix class:

(define-simple-class matrix ()

  (v::vector)

  ((*init* (vParam::vector))
   (set! v vParam))

  )

(matrix-v M)
#(#(0 1 2) #(1 2 3))


On Mon, Oct 16, 2023 at 1:41 PM Ἀλκείδης FP <alcides.fp@gmail.com> wrote:
>
> Hi Damien.
>
> AFAIK, there aren't such predefinded accesors in Kawa classes.
>
> To achieve the same goal I usually do one of the following:
>
> a) Leave the field as public and use it directly.
>
> b) Define a parent class (abstract or not) in Java and use Lombok annotations (@Getter, @Setter, @Data, etc)
>
> Greetings.
>
> El lun., 16 de octubre de 2023 6:19, Damien Mattei via Kawa <kawa@sourceware.org> escribió:
>>
>> are there predefined getter or setter for a field of a kawa class?

  reply	other threads:[~2023-10-16 13:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-16 11:18 Damien Mattei
2023-10-16 11:41 ` Ἀλκείδης FP
2023-10-16 13:30   ` Damien Mattei [this message]
2023-10-16 16:43     ` Alcides Flores

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADEOadcPpzSKAW5t=ZOUMJ7RyrJHToa5nXbQvfSwKiPt4SJRyA@mail.gmail.com' \
    --to=damien.mattei@gmail.com \
    --cc=alcides.fp@gmail.com \
    --cc=kawa@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).