Lately, when I have a lot of C-like indirection, I use a `pua` template:
    
    
    template pua(T: typedesc): untyped = ptr UncheckedArray[T]
    
    
    Run

which makes `pua` like `ptr` but stays within the `UncheckedArray` family 
(meaning things like `[]` are already defined). It generalizes to double 
indirection:
    
    
    let x = cast[pua pua int](0)
    echo x[1][2] # Just show syntax; SEGV otherwise
    
    
    Run

Maybe not worth mentioning, but I find it slightly more ergonomic and perhaps 
someone else will also. Looks & sounds just different enough from "ptr" to not 
be confusing (like in C), but that is obviously a bit subjective.

Reply via email to