Function prototype: Difference between revisions

m
mNo edit summary
Line 130:
 
<lang Amazing Hopper>
#!/usr/bin/hopper
#proto noargs /* Declare a pseudo-function with no argument */
 
#proto twoargs(_X_,_Y_) /* Declare a pseudo-function with two arguments */
// Archivo Hopper
#include <hopper.h>
 
#protocontext-free noargs /* Declare a pseudo-function with no argument */
#synon noargs no arguments
#context multiargs /* Declare a pseudo-function with multi arguments */
#proto twoargs(_X_,_Y_) /* Declare a pseudo-function with two arguments. #PROTO need arguments */
 
main:
_nono argsarguments
_two args (2,2) // pseudo-function #proto need "_" sufix
printprintln
{1,2,3,"hola mundo!","\n"}, multiargs
exit(0)
 
.locals
 
multiargs:
_PARAMS_={},pushall(_PARAMS_)
[1:3]get(_PARAMS_),stats(SUMMATORY),println
{"Mensaje: "}[4:5]get(_PARAMS_),println
clear(_PARAMS_)
back
 
twoargs(a,b)
{a}mulby(b)
back
 
// This function is as useful asa s an ashtray on a motorcycle:
no args:
{0}minus(0),kill
back
 
{0}return
</lang>
 
543

edits