exercism / clojure-representer

GNU Affero General Public License v3.0
1 stars 5 forks source link

Normalize placeholder names #33

Closed bobbicodes closed 1 year ago

bobbicodes commented 1 year ago

This PR sorts the variable placeholders to normalize the order of them.

bobbicodes commented 1 year ago

A couple of issues with this:

  1. It didn't actually reduce the number of unique solutions for armstrong-numbers, which made me kind of sad, but at the time I figured that it would potentially work for other exercises.

However, when I thought about it more carefully, I don't think my logic is even valid, and here's why: I'm 90% sure that everything the code is doing is deterministic. Therefore, any duplicate representations should indeed end up with the same placeholder names! It wasn't a bad idea (and still might improve the output aesthetically, however...

  1. I forgot to update the mapping.json! Ouch! But to be fair, there really ought to be a test for this, that performs the placholder-switch and back again to verify that the code is the same.
bobbicodes commented 1 year ago

Closing this as this is unnecessary, as mentioned in the above comment.