Re: Would like a preprocessor.

From: Paul Lutus (nospam_at_nosite.zzz)
Date: 08/30/04


Date: Sun, 29 Aug 2004 22:58:04 -0700

Glen wrote:

>
> OK--- I understand the compiler can inline too. I am interested in
> other features too and want to see what is out there.
>
> I have a method that is over 400 lines long. Huge switch statements.
> The centerpiece is a data structor called a bitboard that represents a
> chess position in 96 bytes.
>
> I've reviewed the JVM op codes and taken that into account.
>
> This will probably blown your mind but I would kill for a GOTO
> statement.

I hate to tell you this, but Java actually does have a GOTO (not under that
name). It's a special form of "break" that can go to a defined label. See
below.

The reason I hate to tell you this is because it is always a bad programming
idea.

> Actually if anyone knows of any way to add a goto please
> tell me. Goto would help me reduce overall code size without using
> method calls.

Come on! If you are willing to consider this desperate measure to increase
execution speed, whay are you writing in Java in the first place?

>
> I considered writing this class in JASMINE the bytecode assembler but
> decided to try straight java first. After working on this a few days
> the thing I want most is a goto statement :P

So why not read about Java?

http://java.sun.com/docs/books/tutorial/java/nutsandbolts/branch.html

-- 
Paul Lutus
http://www.arachnoid.com


Relevant Pages

  • Re: Would like a preprocessor.
    ... >> This will probably blown your mind but I would kill for a GOTO ... > I hate to tell you this, but Java actually does have a GOTO (not under ... >> I considered writing this class in JASMINE the bytecode assembler but ... >> decided to try straight java first. ...
    (comp.lang.java.programmer)
  • Re: Using "break" to Break Out of Multiple Loops in One Call
    ... The main difference I see is that the syntax of the Java labeled break reinforces the idea of a structured flow. ... It's true that you can add braces to force an equivalence to a goto, but when you do so the language is giving you very loud clues about whether ... I prefer to believe that I never misuse a "goto" statement, but whether I do or not, it's my belief that the Java syntax would make it a lot more obvious to me if I'd abused the statement. ... Granted, I don't know what the Java designers were actually thinking, but I like to think that's at least part of why it's the way it is. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Shall I move from C to Java?
    ... You have to analyze what it means to use Java ... another question is how to disable "goto", ... Need to learn how to apply control theory in your embedded system? ... "Applied Control Theory for Embedded Systems" by Tim Wescott ...
    (comp.arch.embedded)
  • Re: Compile with goto
    ... > I have a problem that you may be able with java and since there is no ... > java catergory I have to post it here, when I try to compile java ... There is no such thing as a goto syntax in Java. ... ultimate goal is to use goto, then you need some language besides Java. ...
    (comp.lang.java.help)
  • Re: Structured Coding
    ... Standard Pascal does include goto, but it's deprecated, and labels ... I like this quote from _Learning Java_: ... Has a surprising amount of good stuff. ...
    (comp.lang.cobol)