Newsgroups: comp.lang.dylan
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!fas-news.harvard.edu!newspump.wustl.edu!news.ecn.bgu.edu!vixen.cso.uiuc.edu!howland.reston.ans.net!ix.netcom.com!netcom.com!netcom9.netcom.com!haahr
From: haahr@netcom.com (Paul Haahr)
Subject: Re: Questions
In-Reply-To: Wolfgang Ziller's message of 26 Oct 1995 00:42:28 GMT
To: Wolfgang Ziller <wziller@math.upenn.edu>
Message-ID: <HAAHR.95Oct27125805@netcom9.netcom.com>
Sender: haahr@netcom9.netcom.com
Organization: NETCOM On-line services
References: <46mlhk$huh@netnews.upenn.edu>
Date: Fri, 27 Oct 1995 12:58:04 GMT
Lines: 52

Wolfgang Ziller <wziller@math.upenn.edu> wrote:

> 1)  Since dylan allows multiple return values, why can't 
> these values returned be assigned to variables already 
> declared?

Because the ``multiple value assignment'' proposal was never accepted.
It could certainly be added to the language at some later date.

> 2)  How do I pass values to a function by reference (so 
> that the variable passed in can change value).  Dylan seems 
> to use pass by value...I want the equivalent of Pascal's 
> var statement (or c's & operator).

You can't.  Use multiple values or (when they are available) macros.

> 3)  How can dylan be considered object oriented if 
> functions are separated from class definitions?  How is 
> this any different from C, substituting the word struct for 
> class?

Because method dispatch is based on dynamic information.  Explain to me
the C equivalent of:

  define method double (x :: <number>)
    x + x
  end method double;

  define method double (x :: <sequence>)
    concatenate(x, x)
  end method double;

This is a religious issue, and if you don't believe my answer, I'm not
going to try to convince you again.  Generic functions present a
different view of the world from ``objects as record,'' but I think it's
still firmly object-oriented.

> 4)  When declaring classes no semicolon is allowed after 
> the define line but it is allowed for method declarations
>   define class <my-class> (<object>);  // error
>   ..
>   end class;
>   define method m ();  // no error
> Can the semicolon be used as a terminator (as opposed to a 
> separator) in all cases?

It's not legal to put a semicolon in between the superclass list and the
slots.  It's allowed after the parameter list in a method declaration
because there's an ambiguity (in some cases) with result values if
there's no semicolon present.

Paul
