Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Oberon subtyping (was: JWlinkD updated) (Developers)

posted by Rugxulo(R) Homepage E-mail, USA, 20.02.2012, 20:14

> I made a small update to http://www.japheth.de/Download/JWlink/JWlinkbd.zip
> , which has the following changes:
>...
> After these fixes your sample did run, linked with jwlink.

Cool, thanks. Yes, it seems to work.

BTW, here's another silly example just to demonstrate the subtyping of Oberon:


MODULE blah;
IMPORT O := Out;

TYPE object = RECORD END;
     Tchar   = RECORD (object) c: CHAR END;
     Tstring = RECORD (object) str: ARRAY 255 OF CHAR END;
     Tinteger= RECORD (object) i: LONGINT END;

VAR name: Tstring; number: Tinteger; grade: Tchar;

PROCEDURE write(VAR o: object);
BEGIN
  IF o IS Tchar THEN O.Char(27X); O.Char(o(Tchar).c); O.Char(27X)
  ELSIF o IS Tstring THEN O.Char(22X); O.String(o(Tstring).str); O.Char(22X);
  ELSIF o IS Tinteger THEN O.Int(o(Tinteger).i,1)
  ELSE O.Ln; O.String("dunno")
  END;
  O.Ln
END write;

BEGIN (* blah *)
  grade.c := "B"; number.i := 5150H; COPY("dosuser",name.str);

  write(name); write(number); write(grade);
END blah.

 

Complete thread:

Back to the forum
Board view  Mix view
13749 Postings in 1216 Threads, 206 registered users, 17 users online (0 registered, 17 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum