Created
April 2, 2011 02:15
-
-
Save saml/899174 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
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
#include "include.dats" | |
(* | |
argc starts with 1 (includes ./prog-name) | |
argv is an array. array elements can be accessed with arr[index] | |
without argc > 1 conditional, argv[1] won't compile!!!!! | |
*) | |
implement main (argc, argv) = begin | |
if argc > 1 then | |
printf ("Hello, %s\n", @(argv[1])) | |
else | |
printf ("Usage: %s your-name\n", @(argv[0])) | |
end |
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
(* including various useful libraries *) | |
#ifndef ATSINCLUDE | |
#define ATSINCLUDE | |
//these are a must for all programs | |
staload _ = "libc/SATS/stdio.sats" | |
staload _ = "prelude/DATS/array.dats" | |
staload _ = "prelude/DATS/array0.dats" | |
staload _ = "prelude/DATS/list.dats" | |
staload _ = "prelude/DATS/list0.dats" | |
staload _ = "prelude/DATS/list_vt.dats" | |
staload _ = "prelude/DATS/matrix.dats" | |
staload _ = "prelude/DATS/matrix0.dats" | |
staload _ = "prelude/DATS/option.dats" | |
staload _ = "prelude/DATS/option0.dats" | |
staload _ = "prelude/DATS/pointer.dats" | |
staload _ = "prelude/DATS/reference.dats" | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment