Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Clojure Scoping Rules

X-BeenThere: clojure@googlegroups.com
Received: by 10.142.151.29 with SMTP id y29ls13959wfd.1.p; Mon, 23 Nov 2009 
	22:43:07 -0800 (PST)
Received: by 10.143.26.6 with SMTP id d6mr1328213wfj.5.1259044987609;
        Mon, 23 Nov 2009 22:43:07 -0800 (PST)
Received: by 10.143.26.6 with SMTP id d6mr1328212wfj.5.1259044987583;
        Mon, 23 Nov 2009 22:43:07 -0800 (PST)
Return-Path: <mark.engelb...@gmail.com>
Received: from mail-px0-f190.google.com (mail-px0-f190.google.com [209.85.216.190])
        by gmr-mx.google.com with ESMTP id 18si661298pzk.5.2009.11.23.22.43.06;
        Mon, 23 Nov 2009 22:43:06 -0800 (PST)
Received-SPF: pass (google.com: domain of mark.engelb...@gmail.com designates 209.85.216.190 as permitted sender) client-ip=209.85.216.190;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of mark.engelb...@gmail.com designates 209.85.216.190 as permitted sender) smtp.mail=mark.engelb...@gmail.com; dkim=pass (test mode) header...@gmail.com
Received: by mail-px0-f190.google.com with SMTP id 28so4322786pxi.7
        for <clojure@googlegroups.com>; Mon, 23 Nov 2009 22:43:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:mime-version:received:in-reply-to:references
         :date:message-id:subject:from:to:content-type;
        bh=J3VLtJQzMYYVF3XwfMWpIG8iXXcU1OQf9rLxuZdsrng=;
        b=I1pglsGa9dc5WmiSchVp9S2gsKIYx7RUvu6Zw7aeZ2/+eWL36qJeNo/zdJN2xnm0CP
         tyroqsCjacnvOL6Fcotb1+3Y3YWe0nJA5PZYvdnAdC/tPUZzWvtALbum45gPA8xuVNIu
         aFyI35x/Mtl3KzEE+Ioyk4fdZJpYogwcgAWHo=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :content-type;
        b=KvYBGlitcfzmWl8Zrr2MMqGrJztrirYjcC7ptBgqR5fNaQOOUdGzwZ0C/6i5b8iAst
         c/vvHUxIOF5Fe1aJUMI5TwIzSaNXRpgsTSO8/sb6DCiiEMI2/trTfXzgk0NqQcHPSH5l
         fJFNPN12tc3W3sj3pqJcbAhGRotdTq0+oVE5Y=
MIME-Version: 1.0
Received: by 10.142.195.4 with SMTP id s4mr652392wff.51.1259044986496; Mon, 23 
	Nov 2009 22:43:06 -0800 (PST)
In-Reply-To: <86AED927-BF75-44A0-83FF-A2E664CF3...@kotka.de>
References: <fe132832-7d75-4e8d-8f96-4f5901f11...@e23g2000yqd.googlegroups.com>
	 <c9518a4d0911202002m3c956447xd016249d03b5f...@mail.gmail.com>
	 <c9518a4d0911202022n6ac33e0et95a8397aebe0a...@mail.gmail.com>
	 <2883A997-850F-4850-AD59-28E1A8452...@kotka.de>
	 <ae59b7ff0911231221jaabf19dg92fcd6e7b0b4f...@mail.gmail.com>
	 <86AED927-BF75-44A0-83FF-A2E664CF3...@kotka.de>
Date: Mon, 23 Nov 2009 22:43:06 -0800
Message-ID: <c9518a4d0911232243n33f9735cge8b36ab357bdf...@mail.gmail.com>
Subject: Re: Clojure Scoping Rules
From: Mark Engelberg <mark.engelb...@gmail.com>
To: clojure@googlegroups.com
Content-Type: text/plain; charset=ISO-8859-1

Meikel's blog post quotes:
"running into a lot of such trouble is a sign, that you misuse dynamic
variables. Use them wisely."

I'd like to see examples of what you think is a good, clean,
compelling use of dynamic variables that are properly used wisely.

My own experience is that if the code is simple enough for you to
analyze the use of binding and be sure it is correct, then the code is
also simple enough to have easily written in another way (perhaps
using explicit parameter passing).  On the other hand, if the use of
binding is complex enough to really matter, it is also sufficiently
complex you can't be 100% sure binding will do what you expect.

I even somewhat question the places where Clojure internally uses
bindings.  For example, if you use with-precision to try to control
floating point behavior within a structure that potentially has some
deep laziness (like a tree) that can't easily be forced with a doall,
you're in for a surprise.

I would like to be proven wrong, so I'm serious about wanting to see
good examples of dynamic binding.