Back to index

plt-scheme  4.2.1
helloprint.c
Go to the documentation of this file.
00001 /* Like hello.c, but prints to the current output port and returns
00002    (void). */
00003 
00004 #include "escheme.h"
00005 
00006 Scheme_Object *scheme_reload(Scheme_Env *env)
00007 {
00008   /* Make the string: */
00009   Scheme_Object *hw;
00010   hw = scheme_make_utf8_string("Hello, World!\n");
00011 
00012   /* Display it: */
00013   scheme_display(hw, scheme_get_param(scheme_current_config(), 
00014                                   MZCONFIG_OUTPUT_PORT));
00015 
00016   /* Why not just
00017         printf("Hello, World!\n");
00018      ? That would write to stdout, which may or may not be the same as
00019      the current output port. But sometimes printf() is what you
00020      want. */
00021 
00022   return scheme_void;
00023 }
00024 
00025 Scheme_Object *scheme_initialize(Scheme_Env *env)
00026 {
00027   /* First load is same as every load: */
00028   return scheme_reload(env);
00029 }
00030 
00031 Scheme_Object *scheme_module_name()
00032 {
00033   /* This extension doesn't define a module: */
00034   return scheme_false;
00035 }