[ooc-compiler] Oberon-2 standard
Brought to you by:
mva
|
From: August <fus...@sp...> - 2004-05-27 01:22:15
|
Concerning the posting from Gregory Gelfond and the answer from Michael van Acken > ... > In general, the resemblance between the libraries of oo2c and the > original documentation of the Oberon System is superficial. > ... Wouldn't it be (very) desirable to make OOC conform to the Oakwood guidelines at least when it comes to the basic libraries? As stated in the report: "The intention is that all implementors should offer support for Oberon-2 to at least the ETH specification standard and also offer an implementation of the basic library modules." I must say that even if the OOC version of the IO functionality etc. is more efficient, I find the idea of redefining the interface of some of those standard modules a bit strange (I don't think anyone would ship a C-compiler with a library header named `stdio.h' that differs from the standard ansi `stdio.h' specification). Why not call the non-compatible modules OOCFiles, OOCIn etc or something completely different? One risk with the current modules is also that users may think they are using standard libraries since the names coincide. Another solution would be to make the OOC version of each of these modules a true superset of the corresponding standard module and then require a special compiler option to allow the extra functionality. -- August ----- Original Message ----- From: "Michael van Acken" <Mic...@de...> To: "Gregory Gelfond" <gre...@tt...> Cc: "OOC Compiler List" <ooc...@li...> Sent: Wednesday, May 26, 2004 9:47 PM Subject: Re: [ooc-compiler] Help With I/O > Gregory Gelfond <gre...@tt...> writes: > > > Hello All, > > > > I am completely new to Oberon, and am attempting to learn the language. I > > understand the basics of the language as described in Wirth's book, but am > > having some difficulty in learning the oo2c library. I have the following > > program: > > > > MODULE DisplayFile; > > [...] > > > > I have several difficulties running this program. The program displays the > > contents of the file "HelloWorld.Mod", with the exception of the last line. > > How can I specify the termination condition of the loop to read "While not > > end of file do"? > > Using your program (plus fix), I see all the lines from the input file > duplicated to stdout -- as expected. "WHILE res=done DO" should > definitely work. > > > Also, can someone explain the meaning of the third parameter 'res' of the > > Files.Old function call? > > Opening the file may file. A "res#done" indicates an error. This > should be checked. For example, when I started your program without > providing the input file, I got a seg fault because `file' was NIL. > `res' would indicate a "file not found" error. > > > Furthermore, in Wirth's book, the I/O functions that are described differ > > from those present in the oo2c library. Am I correct in understanding that > > these are the ones defined in the Oakwood modules? If so, what are the > > benefits/drawbacks of one over the other? > > In general, the resemblance between the libraries of oo2c and the > original documentation of the Oberon System is superficial. By > necessity, any I/O library put on top of the standard C/POSIX library > needs to decide whether to implement its own view of the world, or to > provide a faithful representation of the low-level functions of the > operating system (or C library). In a way, the Wirth I/O functions > _are_ the operating system. OOC leans more in the direction of the > operating system it is using, which is represented by the I/O > functions of C. For example, the v2 compiler comes with a set of > low-level IO modules (like IO:FileChannel and IO:SocketChannel) that > are essentially one-to-one interfaces to C's open(), read(), write(), > etc. > > As for Oakwood: The v1 compiler distribution has a set of Oak* modules > that are closer to the original Oberon System modules. > > -- mva > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click > _______________________________________________ > ooc-compiler mailing list > ooc...@li... > https://lists.sourceforge.net/lists/listinfo/ooc-compiler > > |