On Thursday, November 24, 2016 at 12:06:43 AM UTC+8, Jan Mercl wrote:
>
> On Wed, Nov 23, 2016 at 4:55 PM T L <tapi...@gmail.com <javascript:>> 
> wrote:
>
> > But we can't take addresses of formally declared functions and function 
> literals.
>
> Yes, so if you cannot have the function pointer (like in func foo() {}; fp 
> := foo) then there is nothing to compare so I don't understand what's the 
> connection to comparing of function pointers.
>

We cannot tabke addresses of constants too, but we can compare constants.
 

>
> > We can only take addresses of function variables.
>
> Addresses of function variables can be compared freely without any 
> limitation. Note: There's a distinction between the value of a function 
> variable (that's the function pointer) and the address of the variable, 
> that's not the function address and so it can be compared normally. To be 
> explicit. Address of a function variable is a pointer to a pointer. Maybe 
> that's making this thread confusing.
>
>
> -- 
>
> -j
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to