;Given a variable of any type, check if it is a single valid pointer, and if ;so, keep dereferencing it until it's not a single valid pointer anymore. ;Safe to use on any variable of any type. This will only return something ;different if the input variable is a single valid pointer. ; ;example: ; IDL> h=ptr_new(4) ; IDL> print,dereference_single(h) ;same as print,*h ; 4 ; IDL> h=ptr_new(ptr_new(ptr_new(h))) ; IDL> print,dereference_single(h) ;same as print,*(*(*(*h)))) ; 4 ;Note that the input parameter is not modified in any way. function dereference_single,a return,snap(a) end