Mark Volkmann a écrit :
> Why does this output 1?
>
> (def my-ref (ref {:a 1}))
> (my-ref :a)
>
> I thought I could only access data in a ref by dereferencing it, but
> this shows otherwise.
>
>
Refs (like Vars) implement IFn by delegating to their value but Rich
stated to not rely on this beh
both (my-ref :a) and (@my-ref :a) returns 1. hmmm...
On Jan 6, 11:01 am, "Mark Volkmann" wrote:
> Why does this output 1?
>
> (def my-ref (ref {:a 1}))
> (my-ref :a)
>
> I thought I could only access data in a ref by dereferencing it, but
> this shows otherwise.
>
> --
> R. Mark Volkmann
> Obje
Why does this output 1?
(def my-ref (ref {:a 1}))
(my-ref :a)
I thought I could only access data in a ref by dereferencing it, but
this shows otherwise.
--
R. Mark Volkmann
Object Computing, Inc.
--~--~-~--~~~---~--~~
You received this message because you are s