Quick actions

cmd+k|ctrl+k

Navigation

Languages

Compare/Print Addresses

Snippet info

Language

Ats

Visibility

public

Author

steinwaywhw

Created

2016-08-11T18:47:42Z

Updated

2016-08-11T18:47:42Z

#include "share/atspre_staload.hats"


extern fun {a:type} gcompare_addr_addr (a, a): int 
implement {a} gcompare_addr_addr (x, y) = gcompare_val_val<uint> ($UNSAFE.cast{uint} x, $UNSAFE.cast{uint} y)

extern fun {a:type} show (a): void
implement {a} show (x) = $extfcall (void, "printf", "%p\n", $UNSAFE.cast{uint} x)


implement main0 () = let 
    val x = "Hello World"
    val y = "Hellos World" 
    val z = "asd"
    
    
    
    val _ = show x
    val _ = show y
    val _ = show z
    val _ = println! (gcompare_addr_addr (x, z))
in 
end
INFO