Unknown function operation deciphering, exercise in readability byprogram reasoning

S

small Pox

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))
 
B

Barb Knox

small Pox said:

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 |
-----------------------------
 
J

jvt

No need to add any additional hurdles -- the code as presented is
thoroughly unreadable by humans.


What about "desk checking" (a lost art from the oldene dayes)?



Maybe if you had done that yourself before posting it then I would have
tried to understand it.  As it is, no way.










--
---------------------------
|  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

rupertlssmith

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... ;-)
 
S

small Pox

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.
 
S

small Pox

* jvt <5e1f79ab-5432-4f18-b896-362b7406c...@i18g2000yqn.googlegroups.com> :
Wrote on Sat, 4 Dec 2010 19:34:53 -0800 (PST):

|
| 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.

Not quite. You didn't account for the original poster's go-
ogle masters mangling his message.   But your function appears to be a
list flattener:
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))

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top