0

this code has been floating around on forums and i'm having a hard time understanding it. i'm not even sure if the name is correct, butit compiles just fine:

    protected final @SafeVarargs synchronized static strictfp boolean $validJava(boolean φ, Class[]... wheee) throws Throwable
    {
        do do do do break; while (false); while (false); while (false); while (false);
        return φ |= φ &= φ |= !/**/false;
    }{}{}{}{}{}{}{}{}{}{}{}{}{}{}

the main part i'm interested in is why the phi symbol (φ) is interpreted in java just fine, it appears to be recognized as a boolean. i could't find any information about this sadly. the only information i could find was wikipedia articles regarding pushdown automotons.

EDIT: I've found out what the phi symbol is, thanks for the link @Sotirios Delimanolis. however, i'm still interested in the logic behind this method and whether or not its just nonsense. i've seen a few questions asking whether or not a system like this works like a turing machine, but I have no clue

user207421
  • 305,947
  • 44
  • 307
  • 483
  • 1
    `φ` is recognized as a boolean because it is declared as such in the parameter list. As the linked question hints, this symbol is allowed in a variable name. – Code-Apprentice Aug 10 '16 at 00:53
  • Your edit sounds like a whole different question from your original post. You should probably just start a new question and clarify what part of the code you are asking about. – Code-Apprentice Aug 10 '16 at 00:54
  • @Code-Apprentice i never specifically asked about the phi symbol, i just said that it was a main part i was interested in. the title asks what a two-stack deterministic pushdown automata means, not what foreign characters in java mean – Shortninja Aug 10 '16 at 01:05
  • The title and text of your question are mismatched then. There are certainly two separate questions here which should be posted as such. – Code-Apprentice Aug 10 '16 at 01:07
  • i'm not sure why this is even necessary, considering that an edit of a duplicate question would be 10x faster than me having to wait an hour and thirty minutes to post a new question. it's not like this question is actually going to answer other people's questions, considering the description provided. – Shortninja Aug 10 '16 at 01:19
  • That's actually my point. This question has been marked as a duplicate because you were originally asking about the phi symbol in variable names. (At least that's how reader's and potential answers interpreted it.) The meaning of the code on the other hand is a completely different question and should be posted separately. – Code-Apprentice Aug 10 '16 at 19:46
  • so you'd rather have a duplicate question continue to float around, instead of me fixing it (thus it being able to help others)? no logic behind that what so ever – Shortninja Aug 11 '16 at 03:58
  • This duplicate question will eventually be deleted by the system since there are no answers. You have two options as far as your other question about how the code works is concerned: 1) Post a new question. 2) Edit this question and vote to reopen. You will get an answer sooner by just posting a new question as there is no guarantee that you will get this one reopened. – Code-Apprentice Aug 11 '16 at 17:15
  • thank you. i've gotten the answer from a friend – Shortninja Aug 13 '16 at 00:19

0 Answers0