:: Re: [DNG] Conspiracy theories Was R…
トップ ページ
このメッセージを削除
このメッセージに返信
著者: Rainer Weikusat
日付:  
To: Dng
題目: Re: [DNG] Conspiracy theories Was Re: Don't feed the troll
Mitt Green <mitt_green@???> writes:
>>BTW, what's "Cons-piracy"‎?
>
> https://en.wiktionary.org/wiki/conspiracy


There are plenty of free dictionaries available on the web. OTOH, a cons
(cell) is a basic data type of list, namely, a pair. The first element
is usually referred to as "the car" and the second as "the cdr" (terms
dating back to IBM 704 machine language). Lists are constructed from
cons-cells by putting a data element in the car and the tail of the list
in the cdr, eg, the Lisp list

(1 2 3)

can also be written in explicit cons-notations as

(1. (2. (3. NIL))

The following Lisp function,

(defun pirate-cons (l)
       (let
        ((x (cdr l)))
        (setf (cdr l) (cddr l))
        (setf (cdr x) nil)
        x))


removes the second cons from the passed list which is extracted and
returned, eg (using clisp for execution),

,----
| [1]> (setq l '(1 2 3 4))
| (1 2 3 4)
| [2]> (defun pirate-cons (l)
|        (let
|         ((x (cdr l)))
|         (setf (cdr l) (cddr l))
|         (setf (cdr x) nil)
|         x))
| PIRATE-CONS
| [3]> (setq loot (pirate-cons l))
| (2)
| [4]> l
| (1 3 4)
| [5]> loot 
| (2)
| [6]> (bye)
| Bye.

`----

Hence, thats cons-piracy and it's much more tangible than conjecture
about shady, nameless agents of sinister powers ....