And I would have trouble playing with a DM who wouldn't allow a whimsical paladin. To my mind, alignment is about your ultimate intent, not personality traits.
And the idea that following a code is enough to make one lawful is an idea I find rather silly. What if your code is "Visit bloody vengenance on all landed aristocrats so that the peasantry will rise up and overthrow them." Or your code is a list of personal taboos like "I must paint every cow I see purple the day following a rainstorm". Doesn't matter how resolutely you follow that list, you're still chaotic to me.
I would disagree, if you follow a code like that you are pretty Lawful. Even if your code is always break the local laws there really is nothing chaotic, random, arbitrary, or (insert any other synonym for chaotic here). You really are not free, you just created a very loose (and strange lol) code to follow that nobody else agrees or even understands.
The only example I know of is current computer AI's, while it appears to be learning and may have no pattern we can follow, its still just a pattern thats coded in.