On Mon, Dec 14, 2009 at 8:18 AM, Stuart Halloway
wrote:
>> I see now that the simpler expression:
>>
>> #'clojure.core/spread
>>
>> equivalent to
>>
>> (var clojure.core/spread)
>>
>> also works:
>>
>> user=> (#'clojure.core/spread [:a [:b :c]])
>> (:a :b :c)
>
> This works
Hi,
Am 14.12.2009 um 07:16 schrieb Chouser:
> I'd like a ruling on this as well. It solves a real problem of
> macros getting access to helper functions, so if we shouldn't be
> relying on it, a reliable solution would be desirable.
>
> This technique is actually used in the "new" branch in
> c
On Mon, Dec 14, 2009 at 1:16 AM, Chouser wrote:
> On Sun, Dec 13, 2009 at 7:55 PM, Stephen C. Gilardi wrote:
>>
>> On Dec 13, 2009, at 6:54 PM, Stuart Halloway wrote:
>>
>>> That's great. I wouldn't have expected it to work. Do you think this is by
>>> design or coincidental/subject to change?
>
> I see now that the simpler expression:
>
> #'clojure.core/spread
>
> equivalent to
>
> (var clojure.core/spread)
>
> also works:
>
> user=> (#'clojure.core/spread [:a [:b :c]])
> (:a :b :c)
This works for refs but not for atoms. :-/
Stu
--
You received this message bec
On Sun, Dec 13, 2009 at 7:55 PM, Stephen C. Gilardi wrote:
>
> On Dec 13, 2009, at 6:54 PM, Stuart Halloway wrote:
>
>> That's great. I wouldn't have expected it to work. Do you think this is by
>> design or coincidental/subject to change?
>
> The expression I gave was:
>
> �...@#'clojure.c
On Dec 13, 2009, at 6:54 PM, Stuart Halloway wrote:
> That's great. I wouldn't have expected it to work. Do you think this is by
> design or coincidental/subject to change?
The expression I gave was:
@#'clojure.core/spread
equivalent to:
(deref (var clojure.core/spread))
I s
Steve,
That's great. I wouldn't have expected it to work. Do you think this
is by design or coincidental/subject to change?
Stu
>
> On Dec 13, 2009, at 3:19 PM, Stuart Halloway wrote:
>
>> (1) Is there already a form that does this?
>
> Hi Stuart,
>
> I think the trick is resolving manually:
>
On Dec 13, 2009, at 3:19 PM, Stuart Halloway wrote:
> (1) Is there already a form that does this?
Hi Stuart,
I think the trick is resolving manually:
user=> @#'clojure.core/spread
#
user=> (@#'clojure.core/spread [:a :b [:c :d]])
(:a :b :c :d)
user=>
I
(1) Is there already a form that does this?
or
(2) If not, how can the following be better/simpler:
(use 'clojure.contrib.with-ns)
(defmacro wall-hack-var
"Return the value of a var in a namespace, even
if it is private. Intended for test automation."
[ns v]
`(with-ns '~ns
(if