I only know lisp, so I'll use it as an example, but there are other homoiconic languages out there.
In lisp i can do this:
(eval (cons '+ '(1 2 3)))
What i did was that i added the symbol + to the front of the list (1 2 3) to get (+ 1 2 3) which is a valid lisp expression, and i eval-ed it resulting in 6.i can do other such things:
(eval (reverse '(3 2 1 +)))
I take the list (3 2 1 +) which is an invalid lisp expression, and i reverse it, giving me (+ 1 2 3).See what we did here? We took a datastructure and we transformed it into something the lisp compiler can recognize as a valid form. We can do this because lisp code is expressed as lisp datastructures(thats what homoiconic means).