关于" yin-yang puzzle"有很多问题。已经在Stackoverflow中:
我想知道什么时候和谁找到这个美丽的编程珍珠。所以我深入研究它。这是我的发现:
现在我失去了追踪2009年之前历史的所有线索。似乎这个谜题在2009年至少在某些社会中是众所周知的。由于最初的谜题在Scheme中,我认为它是一个Scheme用户组。
任何人都可以在此展示更多历史细节吗?
答案 0 :(得分:1)
来自1999年的comp.lang.scheme:
https://groups.google.com/d/msg/comp.lang.scheme/Fysq_Wplxsw/awxEZ_uxW20J
From: mad...@news.ens.fr (David Madore)
Subject: call/cc mind-boggler
Date: 1999/06/24
Message-ID: <7ktbid$a29$1@nef.ens.fr>#1/1
X-Deja-AN: 493362808
Organization: Ecole normale superieure
Newsgroups: comp.lang.scheme
I sumbled (accidentally as it were) upon the following Scheme program:
(let* ((yin ((lambda (foo) (newline) foo)
(call/cc (lambda (bar) bar))))
(yang ((lambda (foo) (write-char #\*) foo)
(call/cc (lambda (bar) bar)))))
(yin yang))
(If you want the full story, I was inventing a language (called
``Unlambda'', essentially, an implementation of the lambda calculus
without the lambda operation) that is specially designed for
obfuscation, and whose interpreter is written in Scheme; I had written
a single program in it that was over 600 characters long to write the
integers consecutively (writing each integer by a line of asterisks).
Then I added the call/cc operation to the language, and while
experimenting with it I found that a 12-character program performed
exactly the same task as my longer program, namely ``r`ci`.*`ci (where
` means apply, c means call/cc and i is the identity, r and .* are
essentially newline and write *). Converting this program back to
Scheme gives the thing I have printed above. Well, that's the whole
story, I didn't claim it was interesting.)