Skip to content

Instantly share code, notes, and snippets.

@tinybike
Created August 8, 2015 06:16
Show Gist options
  • Select an option

  • Save tinybike/6201be7ae1fd5a121f82 to your computer and use it in GitHub Desktop.

Select an option

Save tinybike/6201be7ae1fd5a121f82 to your computer and use it in GitHub Desktop.
Print to stdout in Serpent
event stdout(data)
# prints an array to stdout
# $a: array
# $n: array length
macro log_array($a, $n):
with $i = 0:
while $i < $n:
log(type=stdout, $a[$i])
$i += 1
# print to stdout
macro print($x):
log(type=stdout, $x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment