#include static SCM g_skip_block_comment(SCM ch, SCM port) { int bang_seen = 0; while (1) { int c; c = scm_getc(port); if (c == EOF) { fprintf(stderr, "unterminated `#| ... |#' comment"); return(SCM_BOOL_F); } if (c == '|') bang_seen = 1; else { if ((c == '#') && (bang_seen)) return(SCM_BOOL_F); else bang_seen = 0; } } return(SCM_BOOL_F); } void inner_main (void *closure, int argc, char **argv) { scm_read_hash_extend (scm_integer_to_char (scm_from_char ('|')), scm_c_make_subr ("skip-comment", scm_tc7_subr_2, g_skip_block_comment)); scm_shell (argc, argv); } int main (int argc, char **argv) { scm_boot_guile (argc, argv, inner_main, NULL); } /* Local variables: compile-command: "gcc bill.c -o bill" End: */