Created
June 1, 2013 15:39
-
-
Save arnsholt/5690787 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Expects to be live in .../zavolaj/ | |
use lib '.'; | |
use t::CompileTestLib; | |
use NativeCall; | |
compile_test_lib('08-callbacks'); | |
sub TakeACallback(&cb()) is native('./08-callbacks') { * } | |
sub simple_callback() { | |
say 'simple callback'; | |
} | |
TakeACallback(&simple_callback); | |
pir::sweep__vi(1); | |
# vim:ft=perl6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
And for reference, the pointer value changes a bit on each run (it could be a counter getting overridden a pointer) but it is consistently a very low hexadecimal number that is not a valid memory address.