Skip to content

LOLCODE spec: smaller semantic gaps (items 7-14) #159

Open

Description

@Sir-NoChill

Found while marking the LOLCODE assignment (Fall 2026, 36 submissions). The quoted text is from lolcode/ and info/ on master.

Each item can be fixed and ticked off separately.

  • 7. Negative literals contradict

    spec/variables.rst: "Integer literals are allowed to have a leading hyphen". impl/assertions.rst (nonnegative-literals): "All integer literals will be >= 0". Several lexers have no sign.

    Proposed fix: keep one; if negatives are allowed, add -5 to an example.

  • 8. Integer width is permissive

    "Integers can be represented using the host's 32-bit implementation." Some used 64-bit (one student noticed the "can").

    Proposed fix: "NUMBR is a signed 32-bit integer."

  • 9. Division and modulo of negatives are unspecified

    QUOSHUNT truncation and MOD sign (C++ % truncates toward zero; one student used floored mod, another abs).

    Proposed fix: "QUOSHUNT truncates toward zero; MOD takes the sign of the dividend, as in C++".

  • 10. BIGGR OF/SMALLR OF on YARNs

    The math section says YARN operands are converted to NUMBR, but BIGGR OF/SMALLR OF are introduced only in the If-then section. Some compared YARNs lexicographically.

    Proposed fix: list them with the math operators.

  • 11. WTF? matching and conversion

    OMG literals "must be unique" but the spec does not say whether matching follows BOTH SAEM (no implicit conversion) or converts. Is OMG 1 distinct from OMG "1"?

    Proposed fix: "a case matches when BOTH SAEM <selector> AN <literal> is WIN".

  • 12. Redeclaration

    Nothing says what I HAS A x does when x exists, which happens on the second pass of a loop body. Students threw, overwrote, or kept the old value.

    Proposed fix: say it re-initialises (or is invalid input).

  • 13. Scope of a loop-body declaration

    "All variable scope is local to the main program block", but the iterated loop variable is "temporary, and local to the loop". One student built a scope stack.

    Proposed fix: one sentence: declarations inside any block are visible after it.

  • 14. GIMMEH reads what?

    "takes YARN for input". Word or line? Leading whitespace kept? Several used std::cin >>.

    Proposed fix: "reads one line, without its newline".

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions