Interpreting error messages in Functional Developer 
Author Message
 Interpreting error messages in Functional Developer

Anyone know if Functional Developer has a document that describes
error messages in greater detail?  I am getting the following from
FunDev when I try a very simple program:

Dylan error: attempt to call subclass? on an incompletely initialized
 class <my-sample>.

Below is a little bit of the code for context.  I am sure that it
is something simple but the error doesn't tell me much in this case.

// -- Start example --

// The following is defined in dylansample.dylan:
Module: dylansample

define method main() => ()
  let sample-instance = make(<my-sample>)
  sample-instance.value := 7
  format-out("value is %d\n", sample-instance.value);
end method main;

begin
  main();
end

// The following is defined in datamodel.dylan
Module: dylansample

define class <my-sample> ( <object> )
  slot value :: <integer>, init-value: 0;
end class <my-sample>;

// -- End example --

I suspect it has something to do with these definitions being
in two different files.  If I combine them into one file, making
the instance seems to work but the "format-out" call fails to
run with an access violation.

I am using FunDev 2.0 (service pack 1) on Windows NT 4.0 (I
think service pack 6).

                        David S. Harrison



Tue, 02 Dec 2003 07:11:33 GMT  
 Interpreting error messages in Functional Developer
David,

Quote:
> Anyone know if Functional Developer has a document that describes
> error messages in greater detail?  I am getting the following from
> FunDev when I try a very simple program:

> Dylan error: attempt to call subclass? on an incompletely initialized
>  class <my-sample>.

Top-level forms within a library are initialized in file order and
top to bottom within a file. If an error refers to an "incompletely
initialized class" it typically means you've tried to do something
with that class that requires knowledge of its slots or superclasses,
and have done so before the class's definition has been "run".

In the case of your example, it looks like there's a top-level call
to main() before the definition of <my-sample> gets a chance to run
(assuming datamodel.dylan is listed after dylansample.dylan in
the project), so an error results when you attempt to make(<my-sample>).

Try moving the kick-off call to main() such that it's the
last expression in the last file of the project.

FWIW, I'm a little surprised main() compiles if, as presented,
it's missing terminating semicolons after the let and the assignment!

-- Keith

Quote:
> Below is a little bit of the code for context.  I am sure that it
> is something simple but the error doesn't tell me much in this case.

> // -- Start example --

> // The following is defined in dylansample.dylan:
> Module: dylansample

> define method main() => ()
>   let sample-instance = make(<my-sample>)
>   sample-instance.value := 7
>   format-out("value is %d\n", sample-instance.value);
> end method main;

> begin
>   main();
> end

> // The following is defined in datamodel.dylan
> Module: dylansample

> define class <my-sample> ( <object> )
>   slot value :: <integer>, init-value: 0;
> end class <my-sample>;

> // -- End example --

> I suspect it has something to do with these definitions being
> in two different files.  If I combine them into one file, making
> the instance seems to work but the "format-out" call fails to
> run with an access violation.



Tue, 02 Dec 2003 08:00:23 GMT  
 Interpreting error messages in Functional Developer
The problem was indeed that the files were not ordered correctly
in the project.  The access violation problem went away when
I rebooted NT.  There were indeed some typos in the example that
I posted (serves me right for trying to type in the code rather
than import it directly into the message).

                        David S. Harrison



Tue, 02 Dec 2003 08:51:42 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. HLEP: I have a problem about interpreting Error Message

2. Error Messages - developer Defined

3. Sigma, an interpreted functional programming language implemented in C++

4. sigma, an interpreted, functional extension language for C++

5. sigma, an interpreted, functional extension language for C++

6. ERROR MESSAGE: Internal Error: tpsbt.cpp line 2172

7. Network error Message Error 50

8. Error message dbcommital internal error 19

9. Error message Ordlistadd (0) Internal error 1010

10. Error message Internal error 1010

11. How to catch all interpret() errors

12. Garnet 3.0 under Redhat/CMUCL: Error in function C::BYTE-INTERPRET-BYTE: Unbound variable: OPAL::AGGRELIST

 

 
Powered by phpBB® Forum Software