[Prev][Next][Index][Thread]

Re: Does my ideal language exist?



In article <B57CEC15.643E%ptw@callitrope.com>, P T Withington 
<ptw@callitrope.com> wrote:

> Bruce Hoult bruce@hoult.org on  2000-06-26 03:00 wrote:
> 
> > What is it that the empty values() is doing?  Surely a bug?
> 
> Perhaps a conscious decision by the compiler writer to optimize 
> single-value
> return because it is the most common, and treat 0 values as just another
> instance of multiple-value return.
 
No, because if I put more than one value in the values() call then it 
generates the good code.  And functions => () work fine in most contexts.

I currently think it's a confusion bwteeen returning exactly zero values 
and returning an unspecified number of values (called a "wild-ctype" 
inside d2c).  Usually this works fine as there is machinery to 
distinguish them, but maybe not in the "apply" transformer in 
optimize/trans.dylan, or possibly in the "merge-clusters" transformer in 
the same place.  It turns out that if I replace the call to values() 
with a call to foo(), where foo() is defined as...

   define method foo() => ();
   end

... then the same thing happens.

-- Bruce



References: