logoalt Hacker News

tostiyesterday at 5:44 PM2 repliesview on HN

There's so much repetition in there. E.g.: (adi-json.adb)

    if not W.After_Key (W.Depth) then
        -- things
    else
        W.After_Key (W.Depth) := False;
    end if;
    -- ...more things...
    W.After_Key (W.Depth) := False;
And what's the deal with those filenames? If you replace adi- with TIMMEH, you'll see what I mean.

Code should be more DRY (don't repeat yourself).


Replies

OneWingedSharkyesterday at 7:53 PM

GNAT (not Ada) has an implementation restriction that you cannot have multiple compilation-units in a single file; I believe that the dot-replacement is a holdover from when GNAT/GCC was dealing with DOS.

ovenpastayesterday at 5:50 PM

I agree on the repetitions those need cleanup. Regarding filenames, it is a GNAT convention (the GCC's ada compiler) where we need to have the package name on it separated by -

show 1 reply