Newsgroups: comp.lang.dylan
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!udel!gatech!howland.reston.ans.net!pipex!uunet!sytex!smcl
From: smcl@sytex.com (Scott McLoughlin)
Subject: Re: optional parameter test
Message-ID: <DaZFZc1w165w@sytex.com>
Sender: bbs@sytex.com
Organization: Sytex Access Ltd.
References: <3g20ok$gnu@cantaloupe.srv.cs.cmu.edu>
Date: Tue, 24 Jan 1995 16:50:12 GMT
Lines: 41

sef@CS.CMU.EDU (Scott Fahlman) writes:

> 
> In article <199501240018.AA14408@world.std.com> jbk@world.std.com (Jeffrey B 
> 
>    Has anyone looked into adding a boolean operator to dylan to let methods k
>    if optional parmameters have been used (vs their default values).  In CL t
>    is usually done as:
> 
>    (defmethod My-Method (&optional (y default-value y-defined-p))
> 
> Some of us at Carnegie Mellon and at Harlequin have come to the
> conclusion that something like this is needed, or at least very
> useful, in Dylan.  There are several possible ways of accomplsihing
> this, so some discussion is required.  There is no chance that this
> will be added to the Dylan spec for the current go-round, but at some
> point the language will be open for improvements based on initial
> experience, and this will be on the agenda.
> 

Howdy,
        If supplied-p bindings are added to DYLAN, I'd suggest that
such bindings be made functional (not updatable). This would give
interpreters/simple compilers more freedom for representing these
bindings (like bit fields, a microcoded predicate, etc.) and 
discourage folks from writing hairy stupid code (like, let's pretend
the argument was passed, etc.).
        Minus such compiler cleverness, what's wrong with

(defvar *opt-dftl* (gensym))
...
(defun foo (x y &optional (end *opt-dflt*))
    (if (eq end *opt-dflt*) ; <- not much more verbose
       ...blah...

Just my two bits.

=============================================
Scott McLoughlin
Conscious Computing
=============================================
