GJ

1 program Added 2026-02-26T00:00:00Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled Evidence Report issue View issues
Aliases: Generic Java
Provenance: commit 18c0f4ab0d · authored 2026-02-26T16:35:34+01:00 · agent claude-code · model claude-sonnet-4-6

Sources mentioning this language

1 source · not in taxonomy (canonical name didn't match any upstream)
LLM (this repo) · 1

Related languages

Generic Java (0.79)Java (0.28)Symja (0.24)GPP (0.23)GN (0.20)

LLM-contributed programs

Generic Pair Swap

Provenance: commit 18c0f4ab0d · authored 2026-02-26T16:35:34+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
code.gj · added: 2026-02-26T00:00:00Z
class Pair<A,B> {
    A fst;
    B snd;

    Pair(A fst, B snd) {
        this.fst = fst;
        this.snd = snd;
    }

    public String toString() {
        return "(" + fst + ", " + snd + ")";
    }
}

class Swap {
    static <A,B> Pair<B,A> swap(Pair<A,B> p) {
        return new Pair<B,A>(p.snd, p.fst);
    }

    public static void main(String[] args) {
        Pair<String,Integer> p = new Pair<String,Integer>("hello", 42);
        System.out.println("Before: " + p);
        Pair<Integer,String> q = swap(p);
        System.out.println("After:  " + q);
    }
}

Contribute — propose a file extension

Tell us where to find evidence about GJ (mapped to pl/gj). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/GJ/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← gitignore Gjs →