Confusing error report
Bruno Carton
bc at cetic.be
Wed May 19 16:31:15 CEST 2004
Dear All,
The following program
declare
S = {New Open.socket init}
P = {S bind(takePort:12345)}
{Show {S receive(list:$)}}
raises the following error report :
%*************************** type error *************************
%**
%** wrong arity in application of S
%**
%** Procedure type: procedure/2
%** Application arity: 1
%** Application (names): {S _}
%** Application (values): {S receive(list:_<optimized>)}
%** in file "Oz", line 4, column 6
%** ------------------ rejected (1 error)
I guess that the compiler deduces from line 3 that S is a 2-ary
procedure. However, when the developper reads the error report , he has
in mind that S is a socket object (roughly a 1-ary porcedure) and he is
confused with this error report.
I guess that this confusion could be avoided by adding more information
in the error report. For instance something like
%*************************** type error *************************
%**
%** wrong arity in application of S
%**
%** Procedure type (deduced from line 3) : procedure/2
%** Application arity: 1
%** Application (names): {S _}
%** Application (values): {S receive(list:_<optimized>)}
%** in file "Oz", line 4, column 6
%** ------------------ rejected (1 error)
is less confusing.
What do you think?
Bruno
More information about the mozart-hackers
mailing list