first attempt at Harlequin-Dylan 
Author Message
 first attempt at Harlequin-Dylan

This is my first attempt at using Dylan (specifically Harlequin-Dylan)...
and I'm having some troubles.

I managed to build a simple "Hello World" from scratch.  The next step was
to define a class, instantiate it, get and set some values.  I can define
the class and it compiles without error, but when I try instantiating it, it
still compiles without error, but I get the run-time error
'attempt to make an instance of an incompletely initialized class:
"<my-object>".'

The class is defined as:

define class <my-object> (<object>)
  slot first-item :: <integer>, init-keyword: first-value:, init-value: 1;
  slot second-item :: <integer>, init-keyword: second-value:, init-value: 2;
end class <my-object>;

and i instantiate it in the programs entry method like:
let instance = make(<my-object>, first-value: 3, second-value: 4);

same result if i instantiate using:
let instance = make(<my-object>);

same result if i define the class to be:

define class <my-object> (<object>)
  slot first-item :: <integer> = 1, init-keyword: first-value:;
  slot second-item :: <integer> = 2, init-keyword: second-value:;
end class <my-object>;

even tried forcing initialization with
'required-init-keyword'

same runtime error in all cases...
hope i've done something obviously wrong?

is there a Harlequin-Dylan tutorial?
i'm also looking for info on console IO, file IO, and interfacing with C
libraries...
thanks in advance.
____________
Maxwell Sayles



Mon, 13 May 2002 03:00:00 GMT  
 first attempt at Harlequin-Dylan
Maxwell,

Quote:
> I managed to build a simple "Hello World" from scratch.  The next step was
> to define a class, instantiate it, get and set some values.  I can define
> the class and it compiles without error, but when I try instantiating it, it
> still compiles without error, but I get the run-time error
> 'attempt to make an instance of an incompletely initialized class:
> "<my-object>".'

> [...]

Your class definitions look fine. If this error crops up, it's usually
because an attempt has been made to instantiate a class before the code
implementing the class definition has been run. To avoid the problem,
just make sure the top-level call to main() (or whatever your entry point
function is called) is the last form in the last file in your project. The
definition of main() can still be anywhere in relation to the class
definition, it just shouldn't be called until after the class definition
it relies on has had a chance to do its thing.

Quote:
> is there a Harlequin-Dylan tutorial?
> i'm also looking for info on console IO, file IO, and interfacing with C
> libraries...

As well as the reference sections, there is some tutorial material in the
online documentation ("Getting Started with Harlequin Dylan" and "Building
Applications Using DUIM") along with example code. The DUIM task-list example
includes code for saving and loading task lists.

I can't remember whether it comes with all editions, but source for the
win32 library interfaces is provided along with examples of a couple of
simple applications with a UI written in Dylan but against the raw, imported
C API (under Examples\Win32 in the installation).

-- Keith



Mon, 13 May 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. (fwd) harlequin's dylan-corba mailing list switching to MIT's info-dylan

2. Dylan and Java [was: Harlequin Dylan - Update]

3. HARLEQUIN DYLAN and C FFI

4. Small d2c and Harlequin Dylan incompatibility

5. Functional Objects to take over Harlequin Dylan

6. Harlequin Dylan 2.0 beta 2 is now available

7. Future of Harlequin Dylan

8. ODBC database with Harlequin Dylan

9. Harlequin Dylan Update

10. using winInet with harlequin dylan

11. Beginners problem with Harlequin Dylan

12. Beginers problem with Harlequin Dylan

 

 
Powered by phpBB® Forum Software