From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Panicz Maciej Godek Newsgroups: gmane.lisp.guile.user Subject: Re: A couple of questions about goops method parameters Date: Wed, 3 Sep 2014 18:20:49 +0200 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1409761268 11362 80.91.229.3 (3 Sep 2014 16:21:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Sep 2014 16:21:08 +0000 (UTC) Cc: "guile-user@gnu.org" To: Carlos Pita Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Sep 03 18:21:01 2014 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XPDIr-0007Gt-At for guile-user@m.gmane.org; Wed, 03 Sep 2014 18:21:01 +0200 Original-Received: from localhost ([::1]:46534 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPDIq-00038a-R8 for guile-user@m.gmane.org; Wed, 03 Sep 2014 12:21:00 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43161) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPDIi-00037i-0u for guile-user@gnu.org; Wed, 03 Sep 2014 12:20:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPDIg-0005nz-Kr for guile-user@gnu.org; Wed, 03 Sep 2014 12:20:51 -0400 Original-Received: from mail-vc0-x231.google.com ([2607:f8b0:400c:c03::231]:39332) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPDIg-0005ni-Gj for guile-user@gnu.org; Wed, 03 Sep 2014 12:20:50 -0400 Original-Received: by mail-vc0-f177.google.com with SMTP id hq11so8958167vcb.22 for ; Wed, 03 Sep 2014 09:20:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=BQRrNZd2UO87qBd5C88L0eamuERzJErwS873eKONpRA=; b=oQxrIlMVzVGRZB4SDm1MJTNN9q01np4j4/OtzRwdiOa2jpbLs2Sz09EFqhmT+R/s+G WF1Dn00D99Of5EuQQpDUcKNstXrZbpwC8+q5iqQjvP2sKSQALXLjJfGcxJWlDXaJezYt +gNA+DZlB+WA2qfPEo4z5LzVakEQcv+gs5kePhmAuS4HC4btUWQI09m/5cJqBnXzhdEW Rjs4lLdAyD4K9LI/RDKiSQTPfOo2Ex2won525ZNJZIyT1VkL+PlpQ3J/HbT7J8iPNf3J f58zDXsHu9k0sjRGQh5ZLP9fOpqiDc+MMNogZsYpa+zwt50CFOo3Z5FRqCnaz2n3oAf/ 2rBA== X-Received: by 10.220.175.17 with SMTP id v17mr6437605vcz.0.1409761249465; Wed, 03 Sep 2014 09:20:49 -0700 (PDT) Original-Received: by 10.221.66.79 with HTTP; Wed, 3 Sep 2014 09:20:49 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400c:c03::231 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:11451 Archived-At: Howdy, > 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. I'm not sure if I get the question right, but you usually overload the "initialize" method (which calls (next-method)) and use the "let-keywords" form if you want to add additional initialization parameters > 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? This is a good question and I'd like to know the answer myself, but it seems to me that GOOPS methods and keyword arguments are simply incompatible. Obviously you can obtain default arguments in GOOPS quite easily: (define-method (f (x ) (y )) ...) (define-method (f (x )) (f x default-y-value)) (define-method (f) (f default-x-value)) One could also come up easily with a macro that allows to expand (define-method/default (f (x default-x-value) (y default-y-value)) ...) to the above code. But I don't think that the goops dispatcher was anyhow suited for the keyword arguments (I could be wrong, though)