Skip to content

Instantly share code, notes, and snippets.

@waywardmonkeys
Created September 29, 2014 03:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save waywardmonkeys/8415fedcbf68cd4292cf to your computer and use it in GitHub Desktop.
Save waywardmonkeys/8415fedcbf68cd4292cf to your computer and use it in GitHub Desktop.
inliner bug
Module: int
Synopsis:
Author:
Copyright:
define inline function exit(#key s :: one-of(#"a", #"b") = #"a")
let status =
if (s = #"a")
0
elseif (s == #"b")
1
end if;
%call-c-function ("exit")
(status :: <raw-c-signed-long>) => (nothing :: <raw-c-void>)
(integer-as-raw(status))
end;
end;
define function main
(name :: <string>, arguments :: <vector>)
format-out("Hello, world!\n");
exit();
end function main;
main(application-name(), application-arguments());
Library: int
Files: library
int
Module: dylan-user
define library int
use dylan;
use common-dylan;
use io;
end library int;
define module int
use common-dylan;
use format-out;
use dylan-direct-c-ffi;
export exit, main;
end module int;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment