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 How to get the namespace for an unqualified symbol?

Received: by 10.58.209.106 with SMTP id ml10mr6524768vec.31.1352747655069;
        Mon, 12 Nov 2012 11:14:15 -0800 (PST)
X-BeenThere: clojure@googlegroups.com
Received: by 10.220.107.208 with SMTP id c16ls8127944vcp.3.gmail; Mon, 12 Nov
 2012 11:14:03 -0800 (PST)
Received: by 10.52.34.211 with SMTP id b19mr7645993vdj.6.1352747643405;
        Mon, 12 Nov 2012 11:14:03 -0800 (PST)
Received: by 10.52.34.211 with SMTP id b19mr7645992vdj.6.1352747643395;
        Mon, 12 Nov 2012 11:14:03 -0800 (PST)
Return-Path: <t...@gnu.org>
Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com. [66.111.4.29])
        by gmr-mx.google.com with ESMTPS id es5si2640112vdb.2.2012.11.12.11.14.03
        (version=TLSv1/SSLv3 cipher=OTHER);
        Mon, 12 Nov 2012 11:14:03 -0800 (PST)
Received-SPF: softfail (google.com: domain of transitioning t...@gnu.org does not designate 66.111.4.29 as permitted sender) client-ip=66.111.4.29;
Authentication-Results: gmr-mx.google.com; spf=softfail (google.com: domain of transitioning t...@gnu.org does not designate 66.111.4.29 as permitted sender) smtp.mail=t...@gnu.org; dkim=pass header...@messagingengine.com
Received: from compute4.internal (compute4.nyi.mail.srv.osa [10.202.2.44])
	by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 0DB532093C
	for <clojure@googlegroups.com>; Mon, 12 Nov 2012 14:14:03 -0500 (EST)
Received: from frontend2.nyi.mail.srv.osa ([10.202.2.161])
  by compute4.internal (MEProxy); Mon, 12 Nov 2012 14:14:03 -0500
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=
	messagingengine.com; h=from:to:subject:references:date
	:in-reply-to:message-id:mime-version:content-type; s=smtpout;
	 bh=UwkpfhlDYksYXCky8N0RcCjkoJ0=; b=MvZMHqONSSSC59u8vF8x5e++BpiU
	Zk5i3dn/MOJr3ZtRYsVbLkHJIkwZrx70gqH4BcChjmxujJPnqYGKSqtI+viaZ9+b
	m8UE2XmZXKpOiq2C4u20pGoMNlvs28ZL4fvdAsu2SCKQ1DIUTyRP6GLuYcSyu82+
	MwiumPDRBrdvMFE=
X-Sasl-enc: 4fqg+egoi1cS4IjiEKoXnv9TqtQcasnzZYVKsfdccWET 1352747642
Received: from thinkpad.tsdh.de (unknown [91.67.10.84])
	by mail.messagingengine.com (Postfix) with ESMTPA id 8D51A4827C9
	for <clojure@googlegroups.com>; Mon, 12 Nov 2012 14:14:02 -0500 (EST)
From: Tassilo Horn <t...@gnu.org>
To: clojure@googlegroups.com
Subject: Re: How to get the namespace for an unqualified symbol?
References: <cd5d5cb7-0c45-47db-b116-07c382ef6a91@googlegroups.com>
	<CAJCe3hXv+Vyo6-TTavx=9_7uHd3QwMTdHcHcM+H_mVqdyTs...@mail.gmail.com>
Mail-Followup-To: clojure@googlegroups.com
Date: Mon, 12 Nov 2012 20:14:01 +0100
In-Reply-To: <CAJCe3hXv+Vyo6-TTavx=9_7uHd3QwMTdHcHcM+H_mVqdyTs...@mail.gmail.com>
	(Ambrose Bonnaire-Sergeant's message of "Tue, 13 Nov 2012 03:04:38
	+0800")
Message-ID: <87625afxc6....@thinkpad.tsdh.de>
User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain

Ambrose Bonnaire-Sergeant <abonnaireserge...@gmail.com> writes:

> Evil, but this is the solution I use:
>
> (let [v (resolve 'a)]
>   (symbol (str (ns-name (.ns v))) (str (.sym v))))
>
> I'd love to know a better way.

How about backquote?

>> user=> (def x 5)
>> #'user/x

user> `x
user/x

Bye,
Tassilo