From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Hans Aberg Newsgroups: gmane.lisp.guile.devel Subject: Difference letrec & environment binding Date: Wed, 13 Apr 2011 12:38:07 +0200 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1302691112 9161 80.91.229.12 (13 Apr 2011 10:38:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 13 Apr 2011 10:38:32 +0000 (UTC) To: guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Apr 13 12:38:27 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q9xSr-0003Wj-SZ for guile-devel@m.gmane.org; Wed, 13 Apr 2011 12:38:26 +0200 Original-Received: from localhost ([::1]:53160 helo=lists2.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q9xSr-0006B6-38 for guile-devel@m.gmane.org; Wed, 13 Apr 2011 06:38:25 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:60859) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q9xSk-0006Aq-AE for guile-devel@gnu.org; Wed, 13 Apr 2011 06:38:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q9xSf-0005AM-QH for guile-devel@gnu.org; Wed, 13 Apr 2011 06:38:18 -0400 Original-Received: from smtp-out21.han.skanova.net ([195.67.226.208]:54691) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q9xSf-00059g-JV for guile-devel@gnu.org; Wed, 13 Apr 2011 06:38:13 -0400 Original-Received: from [10.0.1.2] (217.210.127.13) by smtp-out21.han.skanova.net (8.5.133) (authenticated as u26619196) id 4D6517A10133CC10 for guile-devel@gnu.org; Wed, 13 Apr 2011 12:38:08 +0200 X-Mailer: Apple Mail (2.1084) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 195.67.226.208 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:12228 Archived-At: What is the practical difference between the two ways of doing the same = thing (letrec or an environment). Is letrec more efficient in the = implementation of Guile? Hans (letrec ( (even? (lambda (n) (if (zero? n) #t (odd? (- n 1))))) (odd? (lambda (n) (if (zero? n) #f (even? (- n 1)))))) (even? 1000)) ((lambda () (define even? (lambda (n) (if (zero? n) #t (odd? (- n 1))))) (define odd? (lambda (n) (if (zero? n) #f (even? (- n 1))))) (even? 1000)))