Discussion:
Unknown function operation deciphering, exercise in readability by program reasoning
(too old to reply)
small Pox
2010-12-04 06:57:59 UTC
Permalink
Rules :

@1@ No execution of the function, only checking syntax

@2@ No profiling using a debugger or profiler

@3@ Editing allowed to make simpler variables


(defun unknown-function (nano-thermite-911-FBI-fat-per-diem-bustards-
kept-their-odious-mouth-shut-on-anthrax-and-911-lie)
(let (BERNARD-MADOFF-PHILIP-MARKOFF-MIKHAIL-KHODORKOVSKY-NEOCONS-
PAUL-WOLFOWITZ-LEWIS-SCOOTER-LIBBY-MOSHE-KATSEV-MOSSAD-DUBAI-MURDERERS
I-AM-THE-WITNESS-DOT-COM-has-MR-BENJAMIN-FREEDMAN-SPEECH-ON-KHAZARS)
(while (or I-AM-THE-WITNESS-DOT-COM-has-MR-BENJAMIN-FREEDMAN-
SPEECH-ON-KHAZARS nano-thermite-911-FBI-fat-per-diem-bustards-kept-
their-odious-mouth-shut-on-anthrax-and-911-lie)
(if nano-thermite-911-FBI-fat-per-diem-bustards-kept-their-
odious-mouth-shut-on-anthrax-and-911-lie
(if (consp nano-thermite-911-FBI-fat-per-diem-bustards-kept-
their-odious-mouth-shut-on-anthrax-and-911-lie)
(setq I-AM-THE-WITNESS-DOT-COM-has-MR-BENJAMIN-FREEDMAN-
SPEECH-ON-KHAZARS (cons (cdr nano-thermite-911-FBI-fat-per-diem-
bustards-kept-their-odious-mouth-shut-on-anthrax-and-911-lie)
I-AM-THE-WITNESS-DOT-COM-has-MR-
BENJAMIN-FREEDMAN-SPEECH-ON-KHAZARS)
nano-thermite-911-FBI-fat-per-diem-bustards-kept-
their-odious-mouth-shut-on-anthrax-and-911-lie (car nano-thermite-911-
FBI-fat-per-diem-bustards-kept-their-odious-mouth-shut-on-anthrax-
and-911-lie))
(setq BERNARD-MADOFF-PHILIP-MARKOFF-MIKHAIL-KHODORKOVSKY-
NEOCONS-PAUL-WOLFOWITZ-LEWIS-SCOOTER-LIBBY-MOSHE-KATSEV-MOSSAD-DUBAI-
MURDERERS (cons nano-thermite-911-FBI-fat-per-diem-bustards-kept-their-
odious-mouth-shut-on-anthrax-and-911-lie BERNARD-MADOFF-PHILIP-MARKOFF-
MIKHAIL-KHODORKOVSKY-NEOCONS-PAUL-WOLFOWITZ-LEWIS-SCOOTER-LIBBY-MOSHE-
KATSEV-MOSSAD-DUBAI-MURDERERS)
nano-thermite-911-FBI-fat-per-diem-bustards-kept-
their-odious-mouth-shut-on-anthrax-and-911-lie nil))
(setq nano-thermite-911-FBI-fat-per-diem-bustards-kept-their-
odious-mouth-shut-on-anthrax-and-911-lie (car I-AM-THE-WITNESS-DOT-COM-
has-MR-BENJAMIN-FREEDMAN-SPEECH-ON-KHAZARS)
I-AM-THE-WITNESS-DOT-COM-has-MR-BENJAMIN-FREEDMAN-SPEECH-
ON-KHAZARS (cdr I-AM-THE-WITNESS-DOT-COM-has-MR-BENJAMIN-FREEDMAN-
SPEECH-ON-KHAZARS))))
BERNARD-MADOFF-PHILIP-MARKOFF-MIKHAIL-KHODORKOVSKY-NEOCONS-PAUL-
WOLFOWITZ-LEWIS-SCOOTER-LIBBY-MOSHE-KATSEV-MOSSAD-DUBAI-MURDERERS))
Barb Knox
2010-12-04 21:49:20 UTC
Permalink
In article
No need to add any additional hurdles -- the code as presented is
thoroughly unreadable by humans.
Post by small Pox
@1@ No execution of the function, only checking syntax
What about "desk checking" (a lost art from the oldene dayes)?
Post by small Pox
@2@ No profiling using a debugger or profiler
@3@ Editing allowed to make simpler variables
Maybe if you had done that yourself before posting it then I would have
tried to understand it. As it is, no way.
Post by small Pox
(defun unknown-function (nano-thermite-911-FBI-fat-per-diem-bustards-
kept-their-odious-mouth-shut-on-anthrax-and-911-lie)
(let (BERNARD-MADOFF-PHILIP-MARKOFF-MIKHAIL-KHODORKOVSKY-NEOCONS-
PAUL-WOLFOWITZ-LEWIS-SCOOTER-LIBBY-MOSHE-KATSEV-MOSSAD-DUBAI-MURDERERS
I-AM-THE-WITNESS-DOT-COM-has-MR-BENJAMIN-FREEDMAN-SPEECH-ON-KHAZARS)
(while (or I-AM-THE-WITNESS-DOT-COM-has-MR-BENJAMIN-FREEDMAN-
SPEECH-ON-KHAZARS nano-thermite-911-FBI-fat-per-diem-bustards-kept-
their-odious-mouth-shut-on-anthrax-and-911-lie)
(if nano-thermite-911-FBI-fat-per-diem-bustards-kept-their-
odious-mouth-shut-on-anthrax-and-911-lie
(if (consp nano-thermite-911-FBI-fat-per-diem-bustards-kept-
their-odious-mouth-shut-on-anthrax-and-911-lie)
(setq I-AM-THE-WITNESS-DOT-COM-has-MR-BENJAMIN-FREEDMAN-
SPEECH-ON-KHAZARS (cons (cdr nano-thermite-911-FBI-fat-per-diem-
bustards-kept-their-odious-mouth-shut-on-anthrax-and-911-lie)
I-AM-THE-WITNESS-DOT-COM-has-MR-
BENJAMIN-FREEDMAN-SPEECH-ON-KHAZARS)
nano-thermite-911-FBI-fat-per-diem-bustards-kept-
their-odious-mouth-shut-on-anthrax-and-911-lie (car nano-thermite-911-
FBI-fat-per-diem-bustards-kept-their-odious-mouth-shut-on-anthrax-
and-911-lie))
(setq BERNARD-MADOFF-PHILIP-MARKOFF-MIKHAIL-KHODORKOVSKY-
NEOCONS-PAUL-WOLFOWITZ-LEWIS-SCOOTER-LIBBY-MOSHE-KATSEV-MOSSAD-DUBAI-
MURDERERS (cons nano-thermite-911-FBI-fat-per-diem-bustards-kept-their-
odious-mouth-shut-on-anthrax-and-911-lie BERNARD-MADOFF-PHILIP-MARKOFF-
MIKHAIL-KHODORKOVSKY-NEOCONS-PAUL-WOLFOWITZ-LEWIS-SCOOTER-LIBBY-MOSHE-
KATSEV-MOSSAD-DUBAI-MURDERERS)
nano-thermite-911-FBI-fat-per-diem-bustards-kept-
their-odious-mouth-shut-on-anthrax-and-911-lie nil))
(setq nano-thermite-911-FBI-fat-per-diem-bustards-kept-their-
odious-mouth-shut-on-anthrax-and-911-lie (car I-AM-THE-WITNESS-DOT-COM-
has-MR-BENJAMIN-FREEDMAN-SPEECH-ON-KHAZARS)
I-AM-THE-WITNESS-DOT-COM-has-MR-BENJAMIN-FREEDMAN-SPEECH-
ON-KHAZARS (cdr I-AM-THE-WITNESS-DOT-COM-has-MR-BENJAMIN-FREEDMAN-
SPEECH-ON-KHAZARS))))
BERNARD-MADOFF-PHILIP-MARKOFF-MIKHAIL-KHODORKOVSKY-NEOCONS-PAUL-
WOLFOWITZ-LEWIS-SCOOTER-LIBBY-MOSHE-KATSEV-MOSSAD-DUBAI-MURDERERS))
--
---------------------------
| BBB b \ Barbara at LivingHistory stop co stop uk
| B B aa rrr b |
| BBB a a r bbb | Quidquid latine dictum sit,
| B B a a r b b | altum videtur.
| BBB aa a r bbb |
-----------------------------
jvt
2010-12-05 03:34:53 UTC
Permalink
Post by Barb Knox
In article
No need to add any additional hurdles -- the code as presented is
thoroughly unreadable by humans.
@1@  No execution of the function, only checking syntax
What about "desk checking" (a lost art from the oldene dayes)?
@2@  No profiling using a debugger or profiler
@3@  Editing allowed to make simpler variables
Maybe if you had done that yourself before posting it then I would have
tried to understand it.  As it is, no way.
(defun unknown-function (nano-thermite-911-FBI-fat-per-diem-bustards-
kept-their-odious-mouth-shut-on-anthrax-and-911-lie)
  (let (BERNARD-MADOFF-PHILIP-MARKOFF-MIKHAIL-KHODORKOVSKY-NEOCONS-
PAUL-WOLFOWITZ-LEWIS-SCOOTER-LIBBY-MOSHE-KATSEV-MOSSAD-DUBAI-MURDERERS
I-AM-THE-WITNESS-DOT-COM-has-MR-BENJAMIN-FREEDMAN-SPEECH-ON-KHAZARS)
    (while (or I-AM-THE-WITNESS-DOT-COM-has-MR-BENJAMIN-FREEDMAN-
SPEECH-ON-KHAZARS nano-thermite-911-FBI-fat-per-diem-bustards-kept-
their-odious-mouth-shut-on-anthrax-and-911-lie)
      (if nano-thermite-911-FBI-fat-per-diem-bustards-kept-their-
odious-mouth-shut-on-anthrax-and-911-lie
          (if (consp nano-thermite-911-FBI-fat-per-diem-bustards-kept-
their-odious-mouth-shut-on-anthrax-and-911-lie)
              (setq I-AM-THE-WITNESS-DOT-COM-has-MR-BENJAMIN-FREEDMAN-
SPEECH-ON-KHAZARS (cons (cdr nano-thermite-911-FBI-fat-per-diem-
bustards-kept-their-odious-mouth-shut-on-anthrax-and-911-lie)
                                I-AM-THE-WITNESS-DOT-COM-has-MR-
BENJAMIN-FREEDMAN-SPEECH-ON-KHAZARS)
                    nano-thermite-911-FBI-fat-per-diem-bustards-kept-
their-odious-mouth-shut-on-anthrax-and-911-lie (car nano-thermite-911-
FBI-fat-per-diem-bustards-kept-their-odious-mouth-shut-on-anthrax-
and-911-lie))
            (setq BERNARD-MADOFF-PHILIP-MARKOFF-MIKHAIL-KHODORKOVSKY-
NEOCONS-PAUL-WOLFOWITZ-LEWIS-SCOOTER-LIBBY-MOSHE-KATSEV-MOSSAD-DUBAI-
MURDERERS (cons nano-thermite-911-FBI-fat-per-diem-bustards-kept-their-
odious-mouth-shut-on-anthrax-and-911-lie BERNARD-MADOFF-PHILIP-MARKOFF-
MIKHAIL-KHODORKOVSKY-NEOCONS-PAUL-WOLFOWITZ-LEWIS-SCOOTER-LIBBY-MOSHE-
KATSEV-MOSSAD-DUBAI-MURDERERS)
                  nano-thermite-911-FBI-fat-per-diem-bustards-kept-
their-odious-mouth-shut-on-anthrax-and-911-lie nil))
        (setq nano-thermite-911-FBI-fat-per-diem-bustards-kept-their-
odious-mouth-shut-on-anthrax-and-911-lie (car I-AM-THE-WITNESS-DOT-COM-
has-MR-BENJAMIN-FREEDMAN-SPEECH-ON-KHAZARS)
              I-AM-THE-WITNESS-DOT-COM-has-MR-BENJAMIN-FREEDMAN-SPEECH-
ON-KHAZARS (cdr I-AM-THE-WITNESS-DOT-COM-has-MR-BENJAMIN-FREEDMAN-
SPEECH-ON-KHAZARS))))
    BERNARD-MADOFF-PHILIP-MARKOFF-MIKHAIL-KHODORKOVSKY-NEOCONS-PAUL-
WOLFOWITZ-LEWIS-SCOOTER-LIBBY-MOSHE-KATSEV-MOSSAD-DUBAI-MURDERERS))
--
---------------------------
|  BBB                b    \     Barbara at LivingHistory stop co stop uk
|  B  B   aa     rrr  b     |
|  BBB   a  a   r     bbb   |    Quidquid latine dictum sit,
|  B  B  a  a   r     b  b  |    altum videtur.
|  BBB    aa a  r     bbb   |  
-----------------------------
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.
r***@googlemail.com
2010-12-05 17:13:22 UTC
Permalink
Post by jvt
Post by Barb Knox
In article
No need to add any additional hurdles -- the code as presented is
thoroughly unreadable by humans.
@1@  No execution of the function, only checking syntax
What about "desk checking" (a lost art from the oldene dayes)?
@2@  No profiling using a debugger or profiler
@3@  Editing allowed to make simpler variables
Maybe if you had done that yourself before posting it then I would have
tried to understand it.  As it is, no way.
(defun unknown-function (nano-thermite-911-FBI-fat-per-diem-bustards-
kept-their-odious-mouth-shut-on-anthrax-and-911-lie)
  (let (BERNARD-MADOFF-PHILIP-MARKOFF-MIKHAIL-KHODORKOVSKY-NEOCONS-
PAUL-WOLFOWITZ-LEWIS-SCOOTER-LIBBY-MOSHE-KATSEV-MOSSAD-DUBAI-MURDERERS
I-AM-THE-WITNESS-DOT-COM-has-MR-BENJAMIN-FREEDMAN-SPEECH-ON-KHAZARS)
    (while (or I-AM-THE-WITNESS-DOT-COM-has-MR-BENJAMIN-FREEDMAN-
SPEECH-ON-KHAZARS nano-thermite-911-FBI-fat-per-diem-bustards-kept-
their-odious-mouth-shut-on-anthrax-and-911-lie)
      (if nano-thermite-911-FBI-fat-per-diem-bustards-kept-their-
odious-mouth-shut-on-anthrax-and-911-lie
          (if (consp nano-thermite-911-FBI-fat-per-diem-bustards-kept-
their-odious-mouth-shut-on-anthrax-and-911-lie)
              (setq I-AM-THE-WITNESS-DOT-COM-has-MR-BENJAMIN-FREEDMAN-
SPEECH-ON-KHAZARS (cons (cdr nano-thermite-911-FBI-fat-per-diem-
bustards-kept-their-odious-mouth-shut-on-anthrax-and-911-lie)
                                I-AM-THE-WITNESS-DOT-COM-has-MR-
BENJAMIN-FREEDMAN-SPEECH-ON-KHAZARS)
                    nano-thermite-911-FBI-fat-per-diem-bustards-kept-
their-odious-mouth-shut-on-anthrax-and-911-lie (car nano-thermite-911-
FBI-fat-per-diem-bustards-kept-their-odious-mouth-shut-on-anthrax-
and-911-lie))
            (setq BERNARD-MADOFF-PHILIP-MARKOFF-MIKHAIL-KHODORKOVSKY-
NEOCONS-PAUL-WOLFOWITZ-LEWIS-SCOOTER-LIBBY-MOSHE-KATSEV-MOSSAD-DUBAI-
MURDERERS (cons nano-thermite-911-FBI-fat-per-diem-bustards-kept-their-
odious-mouth-shut-on-anthrax-and-911-lie BERNARD-MADOFF-PHILIP-MARKOFF-
MIKHAIL-KHODORKOVSKY-NEOCONS-PAUL-WOLFOWITZ-LEWIS-SCOOTER-LIBBY-MOSHE-
KATSEV-MOSSAD-DUBAI-MURDERERS)
                  nano-thermite-911-FBI-fat-per-diem-bustards-kept-
their-odious-mouth-shut-on-anthrax-and-911-lie nil))
        (setq nano-thermite-911-FBI-fat-per-diem-bustards-kept-their-
odious-mouth-shut-on-anthrax-and-911-lie (car I-AM-THE-WITNESS-DOT-COM-
has-MR-BENJAMIN-FREEDMAN-SPEECH-ON-KHAZARS)
              I-AM-THE-WITNESS-DOT-COM-has-MR-BENJAMIN-FREEDMAN-SPEECH-
ON-KHAZARS (cdr I-AM-THE-WITNESS-DOT-COM-has-MR-BENJAMIN-FREEDMAN-
SPEECH-ON-KHAZARS))))
    BERNARD-MADOFF-PHILIP-MARKOFF-MIKHAIL-KHODORKOVSKY-NEOCONS-PAUL-
WOLFOWITZ-LEWIS-SCOOTER-LIBBY-MOSHE-KATSEV-MOSSAD-DUBAI-MURDERERS))
--
---------------------------
|  BBB                b    \     Barbara at LivingHistory stop co stop uk
|  B  B   aa     rrr  b     |
|  BBB   a  a   r     bbb   |    Quidquid latine dictum sit,
|  B  B  a  a   r     b  b  |    altum videtur.
|  BBB    aa a  r     bbb   |  
-----------------------------
(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... ;-)
small Pox
2010-12-05 17:57:12 UTC
Permalink
Post by jvt
(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.
small Pox
2010-12-05 18:03:33 UTC
Permalink
|
|
|
| (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.
Not quite. You didn't account for the original poster's go-
ogle masters mangling his message.   But your function appears to be a
explanation
(defun unknown-function (list)
  (let (stack ret)
    (while (or ret list)
      (if list
          (if (consp list)
              (setq ret (cons (cdr list) ret) ;; hint: this is a push followed by
list (car list)) ;; pop
            (setq stack (cons list stack) ;; and so is this
list nil))
        (setq list (car ret) ret (cdr ret))))
    stack))
---
Madhu
I will post an explanation in a few days if no one does this before
since its not urgent for anyone and i have some job assignments to
finish.

Loading...