unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* A couple of questions about goops method parameters
@ 2014-09-03  2:05 Carlos Pita
  2014-09-03 15:49 ` Carlos Pita
                   ` (2 more replies)
  0 siblings, 3 replies; 36+ messages in thread
From: Carlos Pita @ 2014-09-03  2:05 UTC (permalink / raw)
  To: guile-user

Hi all,

I've some questions about parameter handling in goops methods:

1) initialize takes the initargs argument as a list, because of the
way make-instance is defined. But the documentation states:

    In theory, initarg … can have any structure that is understood by
whatever methods get applied when the initialize generic function is
applied to the newly allocated instance.

One could think this implies that initargs won't necessarily be packed
as a list. Indeed, that would be very convenient and sensible for
custom initialization methods. But make-instance is implemented as:

    (define-method (make-instance (class <class>) . initargs)
      (let ((instance (allocate-instance class initargs)))
        (initialize instance initargs)
        instance))

So one would need to rewrite it in order to apply initargs, or
something like that, in order to "unpack" the list.

How do you typically implement a custom initialization method, then?
Using pattern matching? Maybe ice-9 optargs? Maybe apply? Maybe you
directly call initialize? In any case, why is this so? Wouldn't it be
better for initialize to just get the "unpacked" argument list? This
perplexes me.

2) What is the relationship between the lambda* family and methods?
Are methods restricted in the sense that they can't aspire to get the
greater flexibility of lambda* parameter handling? Maybe because of
the way dispatching is done?

Thank you very much in advance for any help.

Best regards
--
Carlos



^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2014-09-07 23:13 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-03  2:05 A couple of questions about goops method parameters Carlos Pita
2014-09-03 15:49 ` Carlos Pita
2014-09-03 16:47   ` Marko Rauhamaa
2014-09-03 18:05     ` Carlos Pita
2014-09-03 16:20 ` Panicz Maciej Godek
2014-09-05  8:32 ` Nala Ginrut
2014-09-05 12:47   ` Carlos Pita
2014-09-05 19:03   ` Panicz Maciej Godek
2014-09-05 19:12     ` David Thompson
2014-09-05 19:35       ` Panicz Maciej Godek
2014-09-05 19:55         ` David Thompson
2014-09-05 20:10         ` Taylan Ulrich Bayirli/Kammer
2014-09-05 20:50           ` David Thompson
2014-09-07 10:33           ` Neil Jerram
2014-09-07 15:27             ` Taylan Ulrich Bayirli/Kammer
2014-09-05 20:10         ` Panicz Maciej Godek
2014-09-05 20:18           ` Taylan Ulrich Bayirli/Kammer
2014-09-05 20:37             ` Panicz Maciej Godek
2014-09-05 20:51               ` Marko Rauhamaa
2014-09-05 21:53                 ` Taylan Ulrich Bayirli/Kammer
2014-09-05 22:26                   ` Marko Rauhamaa
2014-09-05 20:44           ` Marko Rauhamaa
2014-09-05 21:08             ` Panicz Maciej Godek
2014-09-05 22:14               ` Marko Rauhamaa
2014-09-06  8:53                 ` Panicz Maciej Godek
2014-09-06 10:44                   ` Taylan Ulrich Bayirli/Kammer
2014-09-06 11:27                   ` Marko Rauhamaa
2014-09-06 11:54                     ` Taylan Ulrich Bayirli/Kammer
2014-09-06 23:46                     ` Panicz Maciej Godek
2014-09-07  0:20                       ` Marko Rauhamaa
2014-09-07 12:57                         ` Taylan Ulrich Bayirli/Kammer
2014-09-07 13:58                           ` Marko Rauhamaa
2014-09-07 16:46                             ` Taylan Ulrich Bayirli/Kammer
2014-09-07 19:49                               ` Marko Rauhamaa
2014-09-07 23:13                                 ` Taylan Ulrich Bayirli/Kammer
     [not found]           ` <CAPjoZoc7X7s+keog6avP62yvgJyQ3Ma_jomhw6xQq_rK9jnhVw@mail.gmail.com>
2014-09-06 16:57             ` Nala Ginrut

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).