关于" yin-yang puzzle"的任何历史背景详细?

时间:2015-05-23 06:46:14

标签: scheme continuations

关于" yin-yang puzzle"有很多问题。已经在Stackoverflow中:

我想知道什么时候和谁找到这个美丽的编程珍珠。所以我深入研究它。这是我的发现:

  • 第一个问题是在2010年发布的,并引用了wikipedia page
  • 本页的当前版本提到了Yin Wang的网络博客。
  • 不幸的是,他关闭了他的博客,但它在Web Archive中可用,截至2012/07/27。
  • 此网络博客引用了第一个堆栈溢出问题。
  • 这意味着在提出第一个问题后维基百科文章已更新。
  • 维基百科的文章历史显示原始的阴阳拼图是在2009年由注册用户添加的,没有任何引用。

现在我失去了追踪2009年之前历史的所有线索。似乎这个谜题在2009年至少在某些社会中是众所周知的。由于最初的谜题在Scheme中,我认为它是一个Scheme用户组。

任何人都可以在此展示更多历史细节吗?

1 个答案:

答案 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.)