Unknown function operation deciphering, exercise in readability by program reasoning

small Pox smallpox911 at gmail.com
Sun Dec 5 12:57:12 EST 2010


On Dec 5, 9:13 am, "rupertlssm... at googlemail.com"
<rupertlssm... at googlemail.com> wrote:
> On Dec 5, 3:34 am, jvt <vincent.to... at gmail.com> wrote:
>

> > I think this is correct:
>
> > (defun unknown-function (sym0)
> >   (let (sym1 sym2)
> >         (while (or sym2 sym0)
> >           (if sym0
> >                   (if (consp sym0)
> >                           (setq sym2 (cons (cdr sym0) sym2) sym0 (car sym0))
> >                         (setq sym3 sym4 (cons sym0 sym1) sym0 nil))
> >                 (setq sym0 (car sym2) sym2 (cdr sym2))))
> >         sym1))
> > Thank emacs, not me.
>
> Lisp? Still can't read it... ;-)- Hide quoted text -
>

This is because madhu did not explain how he reasoned.

Does it appear to you that she broke first two rules.

its a list flattener that also reverses the operation.

it appears that she took the consp predicate and/or flatten and
started googling ... naughty girl.





More information about the Python-list mailing list