Thursday, December 19, 2013

Echo like a echo

Thanks to my eyes on the ground at the Tech Squares 2013 challenge weekend, I got to hear about some cool specialty tips that were called. The same caller who came up with the Pavlovian tip shared several new ideas in sequences or tips, one of which I wanted to write about here.

This idea was a new metaconcept that took as arguments a <concept> and a <call> and said to do the call, do the call with the concept applied, and then do the call again. It was described to me as "kind of a play on echo." I agreed and thought it was so nicely symmetric that there had to be a nice existing way to define it succinctly. After a bunch of half-baked attempts (including one vastly more complicated but I believe still correct*), I came up with: echo [like a] [echo <concept> <call>].

(Note - very different from: echo [like a echo <concept>] <call>, if that's even legal syntax, which would just be: twice <call>. I'd probably want to pronounce that one "echo like an echo..." and the fact that this confusion is possible means I don't want to say "like an" for the correct parse.)

Let's go through the parsing of this definition.
echo [like a] [foo] means do the last part of foo, then do foo.
echo <concept> <call> means do <call> with <concept> applied, then do <call>
So expanding our "foo", echo [like a] [echo <concept> <call>] means do the last part of echo <concept> <call>, then do echo <concept> <call>.
And simplifying this: do <call>, then do <call> with <concept> applied and then do <call>, which is just what we wanted.

This does not, however, preserve the three-part structure of the original metaconcept... it instead has two parts, the second of which has two parts (how everyone wishes they could do swing and mix, right?). I thought of an alternative definition that DOES preserve the three parts: sandwich [twice <call>] around <concept> <call>. However I still find this a wordier definition because it includes <call> two times, and it uses "twice" which is a bit silly.

*reverse echo [like a reverse order] [reverse echo <concept> <call>] ... maybe?