Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Jeff Higgins Newsgroups: comp.lang.java.programmer Subject: Re: Microsoft Word as a Java-IDE Date: Sat, 04 Jul 2015 18:07:46 -0400 Organization: A noiseless patient Spider Lines: 70 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sat, 4 Jul 2015 22:09:33 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="8e164d158183579609bf09837dee5210"; logging-data="21157"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19NtPfLjc5f0Qwy3Ei976g81XYsKhWjCDE=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 In-Reply-To: Cancel-Lock: sha1:as7GaI4Sqi4Ne/FZROFBS3MU3zk= Xref: csiph.com comp.lang.java.programmer:31954 On 07/03/2015 01:49 PM, Stefan Ram wrote: > I usually write my course notes with Microsoft® Word, so > I wrote a small VBA macro to execute the Java programs > from within Microsoft Word. > > For example, I might write: > > .-------------------------------------------------------------------- > | > *| lautet »%n«. Das folgende Programm gibt zwei Zeilen aus > *| und schließt diese ordentlich mit einem Zeilenabschluß ab. > *| > *| Main.java > *| > *| public class Main > *| { public static void main( final java.lang.String[] args ) > *| { java.lang.System.out.printf( "a%nb%n" ); }} > | > | Das voranstehende Programm ist gleichbedeutend zu dem > | folgenden Programm. > | > > Now, I press Ctrl-O with the cursor in any of the lines > marked with an asterisk. It takes about 1 second and the > document then looks as follows: > > .-------------------------------------------------------------------- > | > | lautet »%n«. Das folgende Programm gibt zwei Zeilen aus > | und schließt diese ordentlich mit einem Zeilenabschluß ab. > | > | Main.java > | > | public class Main > | { public static void main( final java.lang.String[] args ) > | { java.lang.System.out.printf( "a%nb%n" ); }} > | > | transcript > | > | a > | b > | > | Das voranstehende Programm ist gleichbedeutend zu dem > | folgenden Programm. > | > > A word document might contain several Java-Sources, Ctrl-O > will use the one that is »next to the cursor« (the next > document after the line of the cursor [= the text caret]). > > Before I had this, I sometimes made changes to the source code > and then forgot to check whether it still compiles with the > intended semantics. Now I can check this more easily and so > I check it more often. > > When the compiler produces an error message, this is also > inserted under »transcript«. If there already is a > »transcript« below a program, the new transcript will > replace the existing one. > > One might extend this in the direction of »literal programming«, > where Word will not only execute »main« methods but there > also is a means to »execute« freestanding parameterless > methods or find and run the unit-tests for a method. > See 6.2 Comparison of Programming Notations, page 34 Unicode Nearly Plain-Text Encoding of Mathematics