Skip to content

Instantly share code, notes, and snippets.

@akoskovacs
Created December 3, 2012 00:31
Show Gist options
  • Select an option

  • Save akoskovacs/4191793 to your computer and use it in GitHub Desktop.

Select an option

Save akoskovacs/4191793 to your computer and use it in GitHub Desktop.
AkLisp hello, world module
#include <aklisp.h>
#include <stdio.h>
AKL_CFUN_DEFINE(hello, in, args)
{
printf("Hello, world from 'hello' module!\n");
/* Every function must return something,
the type of 'akl_value' */
return &NIL_VALUE;
}
static int hello_load(struct akl_state *in)
{
AKL_ADD_CFUN(in, hello, "HELLO", "Hey hello!");
return AKL_LOAD_OK;
}
static int hello_unload(struct akl_state *in)
{
AKL_REMOVE_CFUN(in, hello);
return AKL_LOAD_OK;
}
AKL_MODULE_DEFINE(hello_load, hello_unload, "hello"
, "A simple demo module", "Akos Kovacs");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment