Beginners problem with Harlequin Dylan 
Author Message
 Beginners problem with Harlequin Dylan

    Hello,

I found Dylan as language, download Harlequin
Dylan 1.2 Personal, apply Service Patch 2.

Now I wrote simple program and found a problem.
If I uncomment the if statement in display-
architecture method the I obtain this warning

Serious warning in method display-
architecture:systeminfo:systeminfo () at
SystemInfo:20:

Reference to undefined binding {$architecture-
little-endian in SystemInfo}.

All other works well. I can compile and run.

----- begin code -------

define method main () => ()
  // Your program starts here...
  format-out("SystemInfo\n");
  format-out("Your computer name is: %s\n",
$machine-name);
  display-architecture();
  format-out("OS name: %s\n", $os-name);
  format-out("OS variant: %s\n", $os-variant);
end method main;

begin
  main();
end;

define method display-architecture () => ()
  //if ( $architecture-little-endian )
  //  format-out("Architecture is little
endian\n")
  //else
  //  format-out("Architecture is big endian\n")
  //end;
end method display-architecture;

----- end code -----

Can anyone tell me what I'm doing wrong?

Radek Hnilica

Sent via Deja.com http://www.*-*-*.com/
Share what you know. Learn what you don't.



Sun, 03 Feb 2002 03:00:00 GMT  
 Beginners problem with Harlequin Dylan

Quote:

> Can anyone tell me what I'm doing wrong?

Nothing that I can see according to the online help. Unfortunately the
help is wrong. It should not be $architecture-little-endian, it is
$architecture-little-endian?. Note the '?' at the end of the
name. Changing your function to the below will let your code compile
(in HD 2.0 beta 2 anyway):

  define method display-architecture () => ()
    if ( $architecture-little-endian? )
      format-out("Architecture is little endian\n")
    else
      format-out("Architecture is big endian\n")
    end;
  end method display-architecture;

Chris.



Sun, 03 Feb 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. Beginers problem with Harlequin Dylan

4. Problem with false-or in Harlequin Dylan

5. Problem with false-or in Harlequin Dylan

6. HARLEQUIN DYLAN and C FFI

7. Small d2c and Harlequin Dylan incompatibility

8. first attempt at Harlequin-Dylan

9. Functional Objects to take over Harlequin Dylan

10. Harlequin Dylan 2.0 beta 2 is now available

11. Future of Harlequin Dylan

12. ODBC database with Harlequin Dylan

 

 
Powered by phpBB® Forum Software