Newsgroups: comp.lang.dylan
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!pipex!sunic!news.lth.se!news.lu.se!fastpath-8.ling.lu.se!user
From: Johan.Dahl@ling.lu.se (Johan Dahl)
Subject: Bug in MacMarlais 0.5d22
Message-ID: <Johan.Dahl-0401951554180001@fastpath-8.ling.lu.se>
Sender: news@nomina.lu.se (USENET News System)
Nntp-Posting-Host: fastpath-8.ling.lu.se
Organization: Dept. of Lingvistics & Phonetics, Univ of Lund, Sweden
Date: Wed, 4 Jan 1995 14:54:18 GMT
Lines: 24

I have found a possible bug in MacMarlais 0.5d22
I don't know if anyone else is aware of this.
Am I doing something wrong or is it a bug?

First I define a class <foo> with 1 slot a::<real> which have 0 (zero) as
it's initial value:

define class <foo> (<object>)
   slot a :: <real>,
      init-value: 0,
      init-keyword: a:;
end class;

But then I use this definition to make objects of type <foo> this happens:
? make(<foo>);
{instance of class <foo>, a = 0}  <-- This is fine
? make(<foo>, a: 3);
{instance of class <foo>, a = 3}  <-- This too
? make(<foo>);
{instance of class <foo>, a = 3}  <-- But?! Isn't the default value for a zero?

This happens all the time, not just with a simple class like this. It
seems that MacMarlais always copies the values from the previous make to
slots with default values.
